diff --git a/CMakeLists.txt b/CMakeLists.txt index 0933a88035ac..5d4c44804f22 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -197,7 +197,6 @@ set(ZIG_CPP_SOURCES # These are planned to stay even when we are self-hosted. src/zig_llvm.cpp src/zig_llvm-ar.cpp - src/zig_clang.cpp src/zig_clang_driver.cpp src/zig_clang_cc1_main.cpp src/zig_clang_cc1as_main.cpp @@ -502,7 +501,6 @@ set(ZIG_STAGE2_SOURCES lib/std/zig/Server.zig lib/std/zig/WindowsSdk.zig lib/std/zig/Zir.zig - lib/std/zig/c_builtins.zig lib/std/zig/string_literal.zig lib/std/zig/system.zig lib/std/zig/system/NativePaths.zig @@ -537,7 +535,6 @@ set(ZIG_STAGE2_SOURCES src/Value.zig src/Zcu.zig src/Zcu/PerThread.zig - src/clang.zig src/clang_options.zig src/clang_options_data.zig src/codegen.zig @@ -639,7 +636,6 @@ set(ZIG_STAGE2_SOURCES src/register_manager.zig src/target.zig src/tracy.zig - src/translate_c.zig src/libs/wasi_libc.zig ) diff --git a/build.zig b/build.zig index 5696dd44f364..74542efb7fa9 100644 --- a/build.zig +++ b/build.zig @@ -90,8 +90,6 @@ pub fn build(b: *std.Build) !void { const skip_libc = b.option(bool, "skip-libc", "Main test suite skips tests that link libc") orelse false; const skip_single_threaded = b.option(bool, "skip-single-threaded", "Main test suite skips tests that are single-threaded") orelse false; const skip_compile_errors = b.option(bool, "skip-compile-errors", "Main test suite skips compile error tests") orelse false; - const skip_translate_c = b.option(bool, "skip-translate-c", "Main test suite skips translate-c tests") orelse false; - const skip_run_translated_c = b.option(bool, "skip-run-translated-c", "Main test suite skips run-translated-c tests") orelse false; const skip_freebsd = b.option(bool, "skip-freebsd", "Main test suite skips targets with freebsd OS") orelse false; const skip_netbsd = b.option(bool, "skip-netbsd", "Main test suite skips targets with netbsd OS") orelse false; const skip_windows = b.option(bool, "skip-windows", "Main test suite skips targets with windows OS") orelse false; @@ -415,7 +413,7 @@ pub fn build(b: *std.Build) !void { test_step.dependOn(check_fmt); const test_cases_step = b.step("test-cases", "Run the main compiler test cases"); - try tests.addCases(b, test_cases_step, target, .{ + try tests.addCases(b, test_cases_step, .{ .test_filters = test_filters, .test_target_filters = test_target_filters, .skip_compile_errors = skip_compile_errors, @@ -427,9 +425,6 @@ pub fn build(b: *std.Build) !void { .skip_linux = skip_linux, .skip_llvm = skip_llvm, .skip_libc = skip_libc, - }, .{ - .skip_translate_c = skip_translate_c, - .skip_run_translated_c = skip_run_translated_c, }, .{ .enable_llvm = enable_llvm, .llvm_has_m68k = llvm_has_m68k, @@ -464,26 +459,6 @@ pub fn build(b: *std.Build) !void { .max_rss = 4000000000, })); - test_modules_step.dependOn(tests.addModuleTests(b, .{ - .test_filters = test_filters, - .test_target_filters = test_target_filters, - .test_extra_targets = test_extra_targets, - .root_src = "test/c_import.zig", - .name = "c-import", - .desc = "Run the @cImport tests", - .optimize_modes = optimization_modes, - .include_paths = &.{"test/c_import"}, - .skip_single_threaded = true, - .skip_non_native = skip_non_native, - .skip_freebsd = skip_freebsd, - .skip_netbsd = skip_netbsd, - .skip_windows = skip_windows, - .skip_macos = skip_macos, - .skip_linux = skip_linux, - .skip_llvm = skip_llvm, - .skip_libc = skip_libc, - })); - test_modules_step.dependOn(tests.addModuleTests(b, .{ .test_filters = test_filters, .test_target_filters = test_target_filters, @@ -724,13 +699,7 @@ fn addCompilerMod(b: *std.Build, options: AddCompilerModOptions) *std.Build.Modu .root_source_file = b.path("lib/compiler/aro/aro.zig"), }); - const aro_translate_c_mod = b.createModule(.{ - .root_source_file = b.path("lib/compiler/aro_translate_c.zig"), - }); - - aro_translate_c_mod.addImport("aro", aro_mod); compiler_mod.addImport("aro", aro_mod); - compiler_mod.addImport("aro_translate_c", aro_translate_c_mod); return compiler_mod; } @@ -1150,7 +1119,6 @@ fn toNativePathSep(b: *std.Build, s: []const u8) []u8 { const zig_cpp_sources = [_][]const u8{ // These are planned to stay even when we are self-hosted. "src/zig_llvm.cpp", - "src/zig_clang.cpp", "src/zig_llvm-ar.cpp", "src/zig_clang_driver.cpp", "src/zig_clang_cc1_main.cpp", diff --git a/lib/compiler/aro/README.md b/lib/compiler/aro/README.md deleted file mode 100644 index bb8a28020a7c..000000000000 --- a/lib/compiler/aro/README.md +++ /dev/null @@ -1,26 +0,0 @@ -Aro - -# Aro - -A C compiler with the goal of providing fast compilation and low memory usage with good diagnostics. - -Aro is included as an alternative C frontend in the [Zig compiler](https://github.com/ziglang/zig) -for `translate-c` and eventually compiling C files by translating them to Zig first. -Aro is developed in https://github.com/Vexu/arocc and the Zig dependency is -updated from there when needed. - -Currently most of standard C is supported up to C23 and as are many of the common -extensions from GNU, MSVC, and Clang - -Basic code generation is supported for x86-64 linux and can produce a valid hello world: -```sh-session -$ cat hello.c -extern int printf(const char *restrict fmt, ...); -int main(void) { - printf("Hello, world!\n"); - return 0; -} -$ zig build && ./zig-out/bin/arocc hello.c -o hello -$ ./hello -Hello, world! -``` diff --git a/lib/compiler/aro/aro.zig b/lib/compiler/aro/aro.zig index 8e3da2aa9763..82c67e55133f 100644 --- a/lib/compiler/aro/aro.zig +++ b/lib/compiler/aro/aro.zig @@ -5,12 +5,14 @@ pub const Driver = @import("aro/Driver.zig"); pub const Parser = @import("aro/Parser.zig"); pub const Preprocessor = @import("aro/Preprocessor.zig"); pub const Source = @import("aro/Source.zig"); +pub const StringInterner = @import("aro/StringInterner.zig"); +pub const target_util = @import("aro/target.zig"); pub const Tokenizer = @import("aro/Tokenizer.zig"); pub const Toolchain = @import("aro/Toolchain.zig"); pub const Tree = @import("aro/Tree.zig"); -pub const Type = @import("aro/Type.zig"); -pub const TypeMapper = @import("aro/StringInterner.zig").TypeMapper; -pub const target_util = @import("aro/target.zig"); +pub const TypeStore = @import("aro/TypeStore.zig"); +pub const QualType = TypeStore.QualType; +pub const Type = TypeStore.Type; pub const Value = @import("aro/Value.zig"); const backend = @import("backend.zig"); @@ -18,6 +20,7 @@ pub const Interner = backend.Interner; pub const Ir = backend.Ir; pub const Object = backend.Object; pub const CallingConvention = backend.CallingConvention; +pub const Assembly = backend.Assembly; pub const version_str = backend.version_str; pub const version = backend.version; @@ -34,6 +37,5 @@ test { _ = @import("aro/Preprocessor.zig"); _ = @import("aro/target.zig"); _ = @import("aro/Tokenizer.zig"); - _ = @import("aro/toolchains/Linux.zig"); _ = @import("aro/Value.zig"); } diff --git a/lib/compiler/aro/aro/Attribute.zig b/lib/compiler/aro/aro/Attribute.zig index 4db287b65cc9..f32cad67c7be 100644 --- a/lib/compiler/aro/aro/Attribute.zig +++ b/lib/compiler/aro/aro/Attribute.zig @@ -6,9 +6,8 @@ const Compilation = @import("Compilation.zig"); const Diagnostics = @import("Diagnostics.zig"); const Parser = @import("Parser.zig"); const Tree = @import("Tree.zig"); -const NodeIndex = Tree.NodeIndex; const TokenIndex = Tree.TokenIndex; -const Type = @import("Type.zig"); +const QualType = @import("TypeStore.zig").QualType; const Value = @import("Value.zig"); const Attribute = @This(); @@ -39,79 +38,53 @@ pub const Kind = enum { }; pub const Iterator = struct { - source: union(enum) { - ty: Type, - slice: []const Attribute, + source: ?struct { + qt: QualType, + comp: *const Compilation, }, + slice: []const Attribute, index: usize, - pub fn initSlice(slice: ?[]const Attribute) Iterator { - return .{ .source = .{ .slice = slice orelse &.{} }, .index = 0 }; + pub fn initSlice(slice: []const Attribute) Iterator { + return .{ .source = null, .slice = slice, .index = 0 }; } - pub fn initType(ty: Type) Iterator { - return .{ .source = .{ .ty = ty }, .index = 0 }; + pub fn initType(qt: QualType, comp: *const Compilation) Iterator { + return .{ .source = .{ .qt = qt, .comp = comp }, .slice = &.{}, .index = 0 }; } /// returns the next attribute as well as its index within the slice or current type /// The index can be used to determine when a nested type has been recursed into pub fn next(self: *Iterator) ?struct { Attribute, usize } { - switch (self.source) { - .slice => |slice| { - if (self.index < slice.len) { - defer self.index += 1; - return .{ slice[self.index], self.index }; - } - }, - .ty => |ty| { - switch (ty.specifier) { - .typeof_type => { - self.* = .{ .source = .{ .ty = ty.data.sub_type.* }, .index = 0 }; - return self.next(); - }, - .typeof_expr => { - self.* = .{ .source = .{ .ty = ty.data.expr.ty }, .index = 0 }; - return self.next(); - }, - .attributed => { - if (self.index < ty.data.attributed.attributes.len) { - defer self.index += 1; - return .{ ty.data.attributed.attributes[self.index], self.index }; - } - self.* = .{ .source = .{ .ty = ty.data.attributed.base }, .index = 0 }; - return self.next(); - }, - else => {}, - } - }, + if (self.index < self.slice.len) { + defer self.index += 1; + return .{ self.slice[self.index], self.index }; + } + if (self.source) |*source| { + var cur = source.qt; + if (cur.isInvalid()) { + self.source = null; + return null; + } + while (true) switch (cur.type(source.comp)) { + .typeof => |typeof| cur = typeof.base, + .attributed => |attributed| { + self.slice = attributed.attributes; + self.index = 1; + source.qt = attributed.base; + return .{ self.slice[0], 0 }; + }, + .typedef => |typedef| cur = typedef.base, + else => { + self.source = null; + break; + }, + }; } return null; } }; -pub const ArgumentType = enum { - string, - identifier, - int, - alignment, - float, - complex_float, - expression, - nullptr_t, - - pub fn toString(self: ArgumentType) []const u8 { - return switch (self) { - .string => "a string", - .identifier => "an identifier", - .int, .alignment => "an integer constant", - .nullptr_t => "nullptr", - .float => "a floating point number", - .complex_float => "a complex floating point number", - .expression => "an expression", - }; - } -}; - /// number of required arguments pub fn requiredArgCount(attr: Tag) u32 { switch (attr) { @@ -211,21 +184,20 @@ pub fn wantsIdentEnum(attr: Tag) bool { } } -pub fn diagnoseIdent(attr: Tag, arguments: *Arguments, ident: []const u8) ?Diagnostics.Message { +pub fn diagnoseIdent(attr: Tag, arguments: *Arguments, ident: TokenIndex, p: *Parser) !bool { switch (attr) { inline else => |tag| { const fields = @typeInfo(@field(attributes, @tagName(tag))).@"struct".fields; if (fields.len == 0) unreachable; const Unwrapped = UnwrapOptional(fields[0].type); if (@typeInfo(Unwrapped) != .@"enum") unreachable; - if (std.meta.stringToEnum(Unwrapped, normalize(ident))) |enum_val| { + if (std.meta.stringToEnum(Unwrapped, normalize(p.tokSlice(ident)))) |enum_val| { @field(@field(arguments, @tagName(tag)), fields[0].name) = enum_val; - return null; + return false; } - return Diagnostics.Message{ - .tag = .unknown_attr_enum, - .extra = .{ .attr_enum = .{ .tag = attr } }, - }; + + try p.err(ident, .unknown_attr_enum, .{ @tagName(attr), Formatting.choices(attr) }); + return true; }, } } @@ -244,7 +216,7 @@ pub fn wantsAlignment(attr: Tag, idx: usize) bool { } } -pub fn diagnoseAlignment(attr: Tag, arguments: *Arguments, arg_idx: u32, res: Parser.Result, p: *Parser) !?Diagnostics.Message { +pub fn diagnoseAlignment(attr: Tag, arguments: *Arguments, arg_idx: u32, res: Parser.Result, arg_start: TokenIndex, p: *Parser) !bool { switch (attr) { inline else => |tag| { const arg_fields = @typeInfo(@field(attributes, @tagName(tag))).@"struct".fields; @@ -254,17 +226,25 @@ pub fn diagnoseAlignment(attr: Tag, arguments: *Arguments, arg_idx: u32, res: Pa inline 0...arg_fields.len - 1 => |arg_i| { if (UnwrapOptional(arg_fields[arg_i].type) != Alignment) unreachable; - if (!res.val.is(.int, p.comp)) return Diagnostics.Message{ .tag = .alignas_unavailable }; + if (!res.val.is(.int, p.comp)) { + try p.err(arg_start, .alignas_unavailable, .{}); + return true; + } if (res.val.compare(.lt, Value.zero, p.comp)) { - return Diagnostics.Message{ .tag = .negative_alignment, .extra = .{ .str = try res.str(p) } }; + try p.err(arg_start, .negative_alignment, .{res}); + return true; } const requested = res.val.toInt(u29, p.comp) orelse { - return Diagnostics.Message{ .tag = .maximum_alignment, .extra = .{ .str = try res.str(p) } }; + try p.err(arg_start, .maximum_alignment, .{res}); + return true; }; - if (!std.mem.isValidAlign(requested)) return Diagnostics.Message{ .tag = .non_pow2_align }; + if (!std.mem.isValidAlign(requested)) { + try p.err(arg_start, .non_pow2_align, .{}); + return true; + } - @field(@field(arguments, @tagName(tag)), arg_fields[arg_i].name) = Alignment{ .requested = requested }; - return null; + @field(@field(arguments, @tagName(tag)), arg_fields[arg_i].name) = .{ .requested = requested }; + return false; }, else => unreachable, } @@ -278,102 +258,106 @@ fn diagnoseField( comptime Wanted: type, arguments: *Arguments, res: Parser.Result, + arg_start: TokenIndex, node: Tree.Node, p: *Parser, -) !?Diagnostics.Message { +) !bool { + const string = "a string"; + const identifier = "an identifier"; + const int = "an integer constant"; + const alignment = "an integer constant"; + const nullptr_t = "nullptr"; + const float = "a floating point number"; + const complex_float = "a complex floating point number"; + const expression = "an expression"; + + const expected: []const u8 = switch (Wanted) { + Value => string, + Identifier => identifier, + u32 => int, + Alignment => alignment, + CallingConvention => identifier, + else => switch (@typeInfo(Wanted)) { + .@"enum" => if (Wanted.opts.enum_kind == .string) string else identifier, + else => unreachable, + }, + }; + if (res.val.opt_ref == .none) { - if (Wanted == Identifier and node.tag == .decl_ref_expr) { - @field(@field(arguments, decl.name), field.name) = Identifier{ .tok = node.data.decl_ref }; - return null; + if (Wanted == Identifier and node == .decl_ref_expr) { + @field(@field(arguments, decl.name), field.name) = .{ .tok = node.decl_ref_expr.name_tok }; + return false; } - return invalidArgMsg(Wanted, .expression); + + try p.err(arg_start, .attribute_arg_invalid, .{ expected, expression }); + return true; } const key = p.comp.interner.get(res.val.ref()); switch (key) { .int => { if (@typeInfo(Wanted) == .int) { - @field(@field(arguments, decl.name), field.name) = res.val.toInt(Wanted, p.comp) orelse return .{ - .tag = .attribute_int_out_of_range, - .extra = .{ .str = try res.str(p) }, + @field(@field(arguments, decl.name), field.name) = res.val.toInt(Wanted, p.comp) orelse { + try p.err(arg_start, .attribute_int_out_of_range, .{res}); + return true; }; - return null; + + return false; } }, .bytes => |bytes| { if (Wanted == Value) { - if (node.tag != .string_literal_expr or (!node.ty.elemType().is(.char) and !node.ty.elemType().is(.uchar))) { - return .{ - .tag = .attribute_requires_string, - .extra = .{ .str = decl.name }, - }; + validate: { + if (node != .string_literal_expr) break :validate; + switch (node.string_literal_expr.qt.childType(p.comp).get(p.comp, .int).?) { + .char, .uchar, .schar => {}, + else => break :validate, + } + @field(@field(arguments, decl.name), field.name) = try p.removeNull(res.val); + return false; } - @field(@field(arguments, decl.name), field.name) = try p.removeNull(res.val); - return null; + + try p.err(arg_start, .attribute_requires_string, .{decl.name}); + return true; } else if (@typeInfo(Wanted) == .@"enum" and @hasDecl(Wanted, "opts") and Wanted.opts.enum_kind == .string) { const str = bytes[0 .. bytes.len - 1]; if (std.meta.stringToEnum(Wanted, str)) |enum_val| { @field(@field(arguments, decl.name), field.name) = enum_val; - return null; - } else { - return .{ - .tag = .unknown_attr_enum, - .extra = .{ .attr_enum = .{ .tag = std.meta.stringToEnum(Tag, decl.name).? } }, - }; + return false; } + + try p.err(arg_start, .unknown_attr_enum, .{ decl.name, Formatting.choices(@field(Tag, decl.name)) }); + return true; } }, else => {}, } - return invalidArgMsg(Wanted, switch (key) { - .int => .int, - .bytes => .string, - .float => .float, - .complex => .complex_float, - .null => .nullptr_t, - .int_ty, - .float_ty, - .complex_ty, - .ptr_ty, - .noreturn_ty, - .void_ty, - .func_ty, - .array_ty, - .vector_ty, - .record_ty, - => unreachable, - }); -} -fn invalidArgMsg(comptime Expected: type, actual: ArgumentType) Diagnostics.Message { - return .{ - .tag = .attribute_arg_invalid, - .extra = .{ .attr_arg_type = .{ .expected = switch (Expected) { - Value => .string, - Identifier => .identifier, - u32 => .int, - Alignment => .alignment, - CallingConvention => .identifier, - else => switch (@typeInfo(Expected)) { - .@"enum" => if (Expected.opts.enum_kind == .string) .string else .identifier, - else => unreachable, - }, - }, .actual = actual } }, - }; + try p.err(arg_start, .attribute_arg_invalid, .{ expected, switch (key) { + .int => int, + .bytes => string, + .float => float, + .complex => complex_float, + .null => nullptr_t, + else => unreachable, + } }); + return true; } -pub fn diagnose(attr: Tag, arguments: *Arguments, arg_idx: u32, res: Parser.Result, node: Tree.Node, p: *Parser) !?Diagnostics.Message { +pub fn diagnose(attr: Tag, arguments: *Arguments, arg_idx: u32, res: Parser.Result, arg_start: TokenIndex, node: Tree.Node, p: *Parser) !bool { switch (attr) { + .nonnull => return false, inline else => |tag| { const decl = @typeInfo(attributes).@"struct".decls[@intFromEnum(tag)]; const max_arg_count = comptime maxArgCount(tag); - if (arg_idx >= max_arg_count) return Diagnostics.Message{ - .tag = .attribute_too_many_args, - .extra = .{ .attr_arg_count = .{ .attribute = attr, .expected = max_arg_count } }, - }; + if (arg_idx >= max_arg_count) { + try p.err(arg_start, .attribute_too_many_args, .{ @tagName(attr), max_arg_count }); + return true; + } + const arg_fields = @typeInfo(@field(attributes, decl.name)).@"struct".fields; switch (arg_idx) { inline 0...arg_fields.len - 1 => |arg_i| { - return diagnoseField(decl, arg_fields[arg_i], UnwrapOptional(arg_fields[arg_i].type), arguments, res, node, p); + return diagnoseField(decl, arg_fields[arg_i], UnwrapOptional(arg_fields[arg_i].type), arguments, res, arg_start, node, p); }, else => unreachable, } @@ -386,8 +370,8 @@ const EnumTypes = enum { identifier, }; pub const Alignment = struct { - node: NodeIndex = .none, - requested: u29, + node: Tree.Node.OptIndex = .null, + requested: u32, }; pub const Identifier = struct { tok: TokenIndex = 0, @@ -549,13 +533,11 @@ const attributes = struct { pub const @"noinline" = struct {}; pub const noipa = struct {}; // TODO: arbitrary number of arguments - // const nonnull = struct { - // // arg_index: []const u32, - // }; - // }; + pub const nonnull = struct {}; pub const nonstring = struct {}; pub const noplt = struct {}; pub const @"noreturn" = struct {}; + pub const nothrow = struct {}; // TODO: union args ? // const optimize = struct { // // optimize, // u32 | []const u8 -- optimize? @@ -697,6 +679,39 @@ const attributes = struct { pub const calling_convention = struct { cc: CallingConvention, }; + pub const nullability = struct { + kind: enum { + nonnull, + nullable, + nullable_result, + unspecified, + + const opts = struct { + const enum_kind = .identifier; + }; + }, + }; + pub const unaligned = struct {}; + pub const pcs = struct { + kind: enum { + aapcs, + @"aapcs-vfp", + + const opts = struct { + const enum_kind = .string; + }; + }, + }; + pub const riscv_vector_cc = struct {}; + pub const aarch64_sve_pcs = struct {}; + pub const aarch64_vector_pcs = struct {}; + pub const fastcall = struct {}; + pub const stdcall = struct {}; + pub const vectorcall = struct {}; + pub const cdecl = struct {}; + pub const thiscall = struct {}; + pub const sysv_abi = struct {}; + pub const ms_abi = struct {}; }; pub const Tag = std.meta.DeclEnum(attributes); @@ -777,117 +792,140 @@ pub fn normalize(name: []const u8) []const u8 { } fn ignoredAttrErr(p: *Parser, tok: TokenIndex, attr: Attribute.Tag, context: []const u8) !void { - const strings_top = p.strings.items.len; - defer p.strings.items.len = strings_top; + try p.err(tok, .ignored_attribute, .{ @tagName(attr), context }); +} - try p.strings.writer().print("attribute '{s}' ignored on {s}", .{ @tagName(attr), context }); - const str = try p.comp.diagnostics.arena.allocator().dupe(u8, p.strings.items[strings_top..]); - try p.errStr(.ignored_attribute, tok, str); +pub fn applyParameterAttributes(p: *Parser, qt: QualType, attr_buf_start: usize, diagnostic: ?Parser.Diagnostic) !QualType { + return applyVariableOrParameterAttributes(p, qt, attr_buf_start, diagnostic, .parameter); } -pub const applyParameterAttributes = applyVariableAttributes; -pub fn applyVariableAttributes(p: *Parser, ty: Type, attr_buf_start: usize, tag: ?Diagnostics.Tag) !Type { +pub fn applyVariableAttributes(p: *Parser, qt: QualType, attr_buf_start: usize, diagnostic: ?Parser.Diagnostic) !QualType { + return applyVariableOrParameterAttributes(p, qt, attr_buf_start, diagnostic, .variable); +} + +fn applyVariableOrParameterAttributes(p: *Parser, qt: QualType, attr_buf_start: usize, diagnostic: ?Parser.Diagnostic, context: enum { parameter, variable }) !QualType { + const gpa = p.comp.gpa; const attrs = p.attr_buf.items(.attr)[attr_buf_start..]; const toks = p.attr_buf.items(.tok)[attr_buf_start..]; p.attr_application_buf.items.len = 0; - var base_ty = ty; + var base_qt = qt; var common = false; var nocommon = false; for (attrs, toks) |attr, tok| switch (attr.tag) { // zig fmt: off .alias, .may_alias, .deprecated, .unavailable, .unused, .warn_if_not_aligned, .weak, .used, - .noinit, .retain, .persistent, .section, .mode, .asm_label, - => try p.attr_application_buf.append(p.gpa, attr), + .noinit, .retain, .persistent, .section, .mode, .asm_label, .nullability, .unaligned, + => try p.attr_application_buf.append(gpa, attr), // zig fmt: on .common => if (nocommon) { - try p.errTok(.ignore_common, tok); + try p.err(tok, .ignore_common, .{}); } else { - try p.attr_application_buf.append(p.gpa, attr); + try p.attr_application_buf.append(gpa, attr); common = true; }, .nocommon => if (common) { - try p.errTok(.ignore_nocommon, tok); + try p.err(tok, .ignore_nocommon, .{}); } else { - try p.attr_application_buf.append(p.gpa, attr); + try p.attr_application_buf.append(gpa, attr); nocommon = true; }, - .vector_size => try attr.applyVectorSize(p, tok, &base_ty), - .aligned => try attr.applyAligned(p, base_ty, tag), - .nonstring => if (!base_ty.isArray() or !(base_ty.is(.char) or base_ty.is(.uchar) or base_ty.is(.schar))) { - try p.errStr(.non_string_ignored, tok, try p.typeStr(ty)); - } else { - try p.attr_application_buf.append(p.gpa, attr); + .vector_size => try attr.applyVectorSize(p, tok, &base_qt), + .aligned => try attr.applyAligned(p, base_qt, diagnostic), + .nonnull => { + switch (context) { + .parameter => try p.err(tok, .attribute_todo, .{ "nonnull", "parameters" }), + .variable => try p.err(tok, .nonnull_not_applicable, .{}), + } }, - .uninitialized => if (p.func.ty == null) { - try p.errStr(.local_variable_attribute, tok, "uninitialized"); + .nonstring => { + if (base_qt.get(p.comp, .array)) |array_ty| { + if (array_ty.elem.get(p.comp, .int)) |int_ty| switch (int_ty) { + .char, .uchar, .schar => { + try p.attr_application_buf.append(gpa, attr); + continue; + }, + else => {}, + }; + } + try p.err(tok, .non_string_ignored, .{qt}); + }, + .uninitialized => if (p.func.qt == null) { + try p.err(tok, .local_variable_attribute, .{"uninitialized"}); } else { - try p.attr_application_buf.append(p.gpa, attr); + try p.attr_application_buf.append(gpa, attr); }, - .cleanup => if (p.func.ty == null) { - try p.errStr(.local_variable_attribute, tok, "cleanup"); + .cleanup => if (p.func.qt == null) { + try p.err(tok, .local_variable_attribute, .{"cleanup"}); } else { - try p.attr_application_buf.append(p.gpa, attr); + try p.attr_application_buf.append(gpa, attr); }, + .calling_convention => try applyCallingConvention(attr, p, tok, base_qt), .alloc_size, .copy, .tls_model, .visibility, - => |t| try p.errExtra(.attribute_todo, tok, .{ .attribute_todo = .{ .tag = t, .kind = .variables } }), + => |t| try p.err(tok, .attribute_todo, .{ @tagName(t), "variables" }), + // There is already an error in Parser for _Noreturn keyword + .noreturn => if (attr.syntax != .keyword) try ignoredAttrErr(p, tok, attr.tag, "variables"), else => try ignoredAttrErr(p, tok, attr.tag, "variables"), }; - return base_ty.withAttributes(p.arena, p.attr_application_buf.items); + return applySelected(base_qt, p); } -pub fn applyFieldAttributes(p: *Parser, field_ty: *Type, attr_buf_start: usize) ![]const Attribute { +pub fn applyFieldAttributes(p: *Parser, field_qt: *QualType, attr_buf_start: usize) ![]const Attribute { const attrs = p.attr_buf.items(.attr)[attr_buf_start..]; const toks = p.attr_buf.items(.tok)[attr_buf_start..]; p.attr_application_buf.items.len = 0; for (attrs, toks) |attr, tok| switch (attr.tag) { // zig fmt: off - .@"packed", .may_alias, .deprecated, .unavailable, .unused, .warn_if_not_aligned, .mode, .warn_unused_result, .nodiscard, - => try p.attr_application_buf.append(p.gpa, attr), + .@"packed", .may_alias, .deprecated, .unavailable, .unused, .warn_if_not_aligned, + .mode, .warn_unused_result, .nodiscard, .nullability, .unaligned, + => try p.attr_application_buf.append(p.comp.gpa, attr), // zig fmt: on - .vector_size => try attr.applyVectorSize(p, tok, field_ty), - .aligned => try attr.applyAligned(p, field_ty.*, null), + .vector_size => try attr.applyVectorSize(p, tok, field_qt), + .aligned => try attr.applyAligned(p, field_qt.*, null), + .calling_convention => try applyCallingConvention(attr, p, tok, field_qt.*), else => try ignoredAttrErr(p, tok, attr.tag, "fields"), }; - if (p.attr_application_buf.items.len == 0) return &[0]Attribute{}; - return p.arena.dupe(Attribute, p.attr_application_buf.items); + return p.attr_application_buf.items; } -pub fn applyTypeAttributes(p: *Parser, ty: Type, attr_buf_start: usize, tag: ?Diagnostics.Tag) !Type { +pub fn applyTypeAttributes(p: *Parser, qt: QualType, attr_buf_start: usize, diagnostic: ?Parser.Diagnostic) !QualType { + const gpa = p.comp.gpa; const attrs = p.attr_buf.items(.attr)[attr_buf_start..]; const toks = p.attr_buf.items(.tok)[attr_buf_start..]; p.attr_application_buf.items.len = 0; - var base_ty = ty; + var base_qt = qt; for (attrs, toks) |attr, tok| switch (attr.tag) { // zig fmt: off - .@"packed", .may_alias, .deprecated, .unavailable, .unused, .warn_if_not_aligned, .mode, - => try p.attr_application_buf.append(p.gpa, attr), + .@"packed", .may_alias, .deprecated, .unavailable, .unused, .warn_if_not_aligned, .mode, .nullability, .unaligned, + => try p.attr_application_buf.append(gpa, attr), // zig fmt: on - .transparent_union => try attr.applyTransparentUnion(p, tok, base_ty), - .vector_size => try attr.applyVectorSize(p, tok, &base_ty), - .aligned => try attr.applyAligned(p, base_ty, tag), - .designated_init => if (base_ty.is(.@"struct")) { - try p.attr_application_buf.append(p.gpa, attr); + .transparent_union => try attr.applyTransparentUnion(p, tok, base_qt), + .vector_size => try attr.applyVectorSize(p, tok, &base_qt), + .aligned => try attr.applyAligned(p, base_qt, diagnostic), + .designated_init => if (base_qt.is(p.comp, .@"struct")) { + try p.attr_application_buf.append(gpa, attr); } else { - try p.errTok(.designated_init_invalid, tok); + try p.err(tok, .designated_init_invalid, .{}); }, + .calling_convention => try applyCallingConvention(attr, p, tok, base_qt), .alloc_size, .copy, .scalar_storage_order, .nonstring, - => |t| try p.errExtra(.attribute_todo, tok, .{ .attribute_todo = .{ .tag = t, .kind = .types } }), + => |t| try p.err(tok, .attribute_todo, .{ @tagName(t), "types" }), else => try ignoredAttrErr(p, tok, attr.tag, "types"), }; - return base_ty.withAttributes(p.arena, p.attr_application_buf.items); + return applySelected(base_qt, p); } -pub fn applyFunctionAttributes(p: *Parser, ty: Type, attr_buf_start: usize) !Type { +pub fn applyFunctionAttributes(p: *Parser, qt: QualType, attr_buf_start: usize) !QualType { + const gpa = p.comp.gpa; const attrs = p.attr_buf.items(.attr)[attr_buf_start..]; const toks = p.attr_buf.items(.tok)[attr_buf_start..]; p.attr_application_buf.items.len = 0; - var base_ty = ty; + var base_qt = qt; var hot = false; var cold = false; var @"noinline" = false; @@ -897,55 +935,153 @@ pub fn applyFunctionAttributes(p: *Parser, ty: Type, attr_buf_start: usize) !Typ .noreturn, .unused, .used, .warning, .deprecated, .unavailable, .weak, .pure, .leaf, .@"const", .warn_unused_result, .section, .returns_nonnull, .returns_twice, .@"error", .externally_visible, .retain, .flatten, .gnu_inline, .alias, .asm_label, .nodiscard, - .reproducible, .unsequenced, - => try p.attr_application_buf.append(p.gpa, attr), + .reproducible, .unsequenced, .nothrow, .nullability, .unaligned, + => try p.attr_application_buf.append(gpa, attr), // zig fmt: on .hot => if (cold) { - try p.errTok(.ignore_hot, tok); + try p.err(tok, .ignore_hot, .{}); } else { - try p.attr_application_buf.append(p.gpa, attr); + try p.attr_application_buf.append(gpa, attr); hot = true; }, .cold => if (hot) { - try p.errTok(.ignore_cold, tok); + try p.err(tok, .ignore_cold, .{}); } else { - try p.attr_application_buf.append(p.gpa, attr); + try p.attr_application_buf.append(gpa, attr); cold = true; }, .always_inline => if (@"noinline") { - try p.errTok(.ignore_always_inline, tok); + try p.err(tok, .ignore_always_inline, .{}); } else { - try p.attr_application_buf.append(p.gpa, attr); + try p.attr_application_buf.append(gpa, attr); always_inline = true; }, .@"noinline" => if (always_inline) { - try p.errTok(.ignore_noinline, tok); + try p.err(tok, .ignore_noinline, .{}); } else { - try p.attr_application_buf.append(p.gpa, attr); + try p.attr_application_buf.append(gpa, attr); @"noinline" = true; }, - .aligned => try attr.applyAligned(p, base_ty, null), - .format => try attr.applyFormat(p, base_ty), - .calling_convention => switch (attr.args.calling_convention.cc) { - .C => continue, - .stdcall, .thiscall => switch (p.comp.target.cpu.arch) { - .x86 => try p.attr_application_buf.append(p.gpa, attr), - else => try p.errStr(.callconv_not_supported, tok, p.tok_ids[tok].lexeme().?), - }, - .vectorcall => switch (p.comp.target.cpu.arch) { - .x86, .aarch64, .aarch64_be => try p.attr_application_buf.append(p.gpa, attr), - else => try p.errStr(.callconv_not_supported, tok, p.tok_ids[tok].lexeme().?), - }, + .aligned => try attr.applyAligned(p, base_qt, null), + .format => try attr.applyFormat(p, base_qt), + .calling_convention => try applyCallingConvention(attr, p, tok, base_qt), + .fastcall => if (p.comp.target.cpu.arch == .x86) { + try p.attr_application_buf.append(gpa, .{ + .tag = .calling_convention, + .args = .{ .calling_convention = .{ .cc = .fastcall } }, + .syntax = attr.syntax, + }); + } else { + try p.err(tok, .callconv_not_supported, .{"fastcall"}); + }, + .stdcall => if (p.comp.target.cpu.arch == .x86) { + try p.attr_application_buf.append(gpa, .{ + .tag = .calling_convention, + .args = .{ .calling_convention = .{ .cc = .stdcall } }, + .syntax = attr.syntax, + }); + } else { + try p.err(tok, .callconv_not_supported, .{"stdcall"}); + }, + .thiscall => if (p.comp.target.cpu.arch == .x86) { + try p.attr_application_buf.append(gpa, .{ + .tag = .calling_convention, + .args = .{ .calling_convention = .{ .cc = .thiscall } }, + .syntax = attr.syntax, + }); + } else { + try p.err(tok, .callconv_not_supported, .{"thiscall"}); + }, + .vectorcall => if (p.comp.target.cpu.arch == .x86 or p.comp.target.cpu.arch.isAARCH64()) { + try p.attr_application_buf.append(gpa, .{ + .tag = .calling_convention, + .args = .{ .calling_convention = .{ .cc = .vectorcall } }, + .syntax = attr.syntax, + }); + } else { + try p.err(tok, .callconv_not_supported, .{"vectorcall"}); + }, + .cdecl => {}, + .pcs => if (p.comp.target.cpu.arch.isArm()) { + try p.attr_application_buf.append(gpa, .{ + .tag = .calling_convention, + .args = .{ .calling_convention = .{ .cc = switch (attr.args.pcs.kind) { + .aapcs => .arm_aapcs, + .@"aapcs-vfp" => .arm_aapcs_vfp, + } } }, + .syntax = attr.syntax, + }); + } else { + try p.err(tok, .callconv_not_supported, .{"pcs"}); + }, + .riscv_vector_cc => if (p.comp.target.cpu.arch.isRISCV()) { + try p.attr_application_buf.append(gpa, .{ + .tag = .calling_convention, + .args = .{ .calling_convention = .{ .cc = .riscv_vector } }, + .syntax = attr.syntax, + }); + } else { + try p.err(tok, .callconv_not_supported, .{"pcs"}); + }, + .aarch64_sve_pcs => if (p.comp.target.cpu.arch.isAARCH64()) { + try p.attr_application_buf.append(gpa, .{ + .tag = .calling_convention, + .args = .{ .calling_convention = .{ .cc = .aarch64_sve_pcs } }, + .syntax = attr.syntax, + }); + } else { + try p.err(tok, .callconv_not_supported, .{"pcs"}); + }, + .aarch64_vector_pcs => if (p.comp.target.cpu.arch.isAARCH64()) { + try p.attr_application_buf.append(gpa, .{ + .tag = .calling_convention, + .args = .{ .calling_convention = .{ .cc = .aarch64_vector_pcs } }, + .syntax = attr.syntax, + }); + } else { + try p.err(tok, .callconv_not_supported, .{"pcs"}); + }, + .sysv_abi => if (p.comp.target.cpu.arch == .x86_64 and p.comp.target.os.tag == .windows) { + try p.attr_application_buf.append(gpa, .{ + .tag = .calling_convention, + .args = .{ .calling_convention = .{ .cc = .x86_64_sysv } }, + .syntax = attr.syntax, + }); + }, + .ms_abi => if (p.comp.target.cpu.arch == .x86_64 and p.comp.target.os.tag != .windows) { + try p.attr_application_buf.append(gpa, .{ + .tag = .calling_convention, + .args = .{ .calling_convention = .{ .cc = .x86_64_win } }, + .syntax = attr.syntax, + }); }, .malloc => { - if (base_ty.returnType().isPtr()) { - try p.attr_application_buf.append(p.gpa, attr); + if (base_qt.get(p.comp, .func).?.return_type.isPointer(p.comp)) { + try p.attr_application_buf.append(gpa, attr); } else { try ignoredAttrErr(p, tok, attr.tag, "functions that do not return pointers"); } }, + .alloc_align => { + const func_ty = base_qt.get(p.comp, .func).?; + if (func_ty.return_type.isPointer(p.comp)) { + if (attr.args.alloc_align.position == 0 or attr.args.alloc_align.position > func_ty.params.len) { + try p.err(tok, .attribute_param_out_of_bounds, .{ "alloc_align", 1 }); + } else { + const arg_qt = func_ty.params[attr.args.alloc_align.position - 1].qt; + if (arg_qt.isInvalid()) continue; + const arg_sk = arg_qt.scalarKind(p.comp); + if (!arg_sk.isInt() or !arg_sk.isReal()) { + try p.err(tok, .alloc_align_required_int_param, .{}); + } else { + try p.attr_application_buf.append(gpa, attr); + } + } + } else { + try p.err(tok, .alloc_align_requires_ptr_return, .{}); + } + }, .access, - .alloc_align, .alloc_size, .artificial, .assume_aligned, @@ -971,7 +1107,7 @@ pub fn applyFunctionAttributes(p: *Parser, ty: Type, attr_buf_start: usize) !Typ .no_stack_protector, .noclone, .noipa, - // .nonnull, + .nonnull, .noplt, // .optimize, .patchable_function_entry, @@ -984,137 +1120,183 @@ pub fn applyFunctionAttributes(p: *Parser, ty: Type, attr_buf_start: usize) !Typ .visibility, .weakref, .zero_call_used_regs, - => |t| try p.errExtra(.attribute_todo, tok, .{ .attribute_todo = .{ .tag = t, .kind = .functions } }), + => |t| try p.err(tok, .attribute_todo, .{ @tagName(t), "functions" }), else => try ignoredAttrErr(p, tok, attr.tag, "functions"), }; - return ty.withAttributes(p.arena, p.attr_application_buf.items); + return applySelected(qt, p); } -pub fn applyLabelAttributes(p: *Parser, ty: Type, attr_buf_start: usize) !Type { +pub fn applyLabelAttributes(p: *Parser, attr_buf_start: usize) !QualType { + const gpa = p.comp.gpa; const attrs = p.attr_buf.items(.attr)[attr_buf_start..]; const toks = p.attr_buf.items(.tok)[attr_buf_start..]; p.attr_application_buf.items.len = 0; var hot = false; var cold = false; for (attrs, toks) |attr, tok| switch (attr.tag) { - .unused => try p.attr_application_buf.append(p.gpa, attr), + .unused => try p.attr_application_buf.append(gpa, attr), .hot => if (cold) { - try p.errTok(.ignore_hot, tok); + try p.err(tok, .ignore_hot, .{}); } else { - try p.attr_application_buf.append(p.gpa, attr); + try p.attr_application_buf.append(gpa, attr); hot = true; }, .cold => if (hot) { - try p.errTok(.ignore_cold, tok); + try p.err(tok, .ignore_cold, .{}); } else { - try p.attr_application_buf.append(p.gpa, attr); + try p.attr_application_buf.append(gpa, attr); cold = true; }, else => try ignoredAttrErr(p, tok, attr.tag, "labels"), }; - return ty.withAttributes(p.arena, p.attr_application_buf.items); + return applySelected(.void, p); } -pub fn applyStatementAttributes(p: *Parser, ty: Type, expr_start: TokenIndex, attr_buf_start: usize) !Type { +pub fn applyStatementAttributes(p: *Parser, expr_start: TokenIndex, attr_buf_start: usize) !QualType { const attrs = p.attr_buf.items(.attr)[attr_buf_start..]; const toks = p.attr_buf.items(.tok)[attr_buf_start..]; p.attr_application_buf.items.len = 0; for (attrs, toks) |attr, tok| switch (attr.tag) { - .fallthrough => if (p.tok_ids[p.tok_i] != .keyword_case and p.tok_ids[p.tok_i] != .keyword_default) { - // TODO: this condition is not completely correct; the last statement of a compound - // statement is also valid if it precedes a switch label (so intervening '}' are ok, - // but only if they close a compound statement) - try p.errTok(.invalid_fallthrough, expr_start); - } else { - try p.attr_application_buf.append(p.gpa, attr); + .fallthrough => { + for (p.tok_ids[p.tok_i..]) |tok_id| { + switch (tok_id) { + .keyword_case, .keyword_default, .eof => { + try p.attr_application_buf.append(p.comp.gpa, attr); + break; + }, + .r_brace => {}, + else => { + try p.err(expr_start, .invalid_fallthrough, .{}); + break; + }, + } + } }, - else => try p.errStr(.cannot_apply_attribute_to_statement, tok, @tagName(attr.tag)), + else => try p.err(tok, .cannot_apply_attribute_to_statement, .{@tagName(attr.tag)}), }; - return ty.withAttributes(p.arena, p.attr_application_buf.items); + return applySelected(.void, p); } -pub fn applyEnumeratorAttributes(p: *Parser, ty: Type, attr_buf_start: usize) !Type { +pub fn applyEnumeratorAttributes(p: *Parser, qt: QualType, attr_buf_start: usize) !QualType { const attrs = p.attr_buf.items(.attr)[attr_buf_start..]; const toks = p.attr_buf.items(.tok)[attr_buf_start..]; p.attr_application_buf.items.len = 0; for (attrs, toks) |attr, tok| switch (attr.tag) { - .deprecated, .unavailable => try p.attr_application_buf.append(p.gpa, attr), + .deprecated, .unavailable => try p.attr_application_buf.append(p.comp.gpa, attr), else => try ignoredAttrErr(p, tok, attr.tag, "enums"), }; - return ty.withAttributes(p.arena, p.attr_application_buf.items); + return applySelected(qt, p); } -fn applyAligned(attr: Attribute, p: *Parser, ty: Type, tag: ?Diagnostics.Tag) !void { - const base = ty.canonicalize(.standard); +fn applyAligned(attr: Attribute, p: *Parser, qt: QualType, diagnostic: ?Parser.Diagnostic) !void { if (attr.args.aligned.alignment) |alignment| alignas: { if (attr.syntax != .keyword) break :alignas; const align_tok = attr.args.aligned.__name_tok; - if (tag) |t| try p.errTok(t, align_tok); + if (diagnostic) |d| try p.err(align_tok, d, .{}); - const default_align = base.alignof(p.comp); - if (ty.isFunc()) { - try p.errTok(.alignas_on_func, align_tok); + if (qt.isInvalid()) return; + const default_align = qt.base(p.comp).qt.alignof(p.comp); + if (qt.is(p.comp, .func)) { + try p.err(align_tok, .alignas_on_func, .{}); } else if (alignment.requested < default_align) { - try p.errExtra(.minimum_alignment, align_tok, .{ .unsigned = default_align }); + try p.err(align_tok, .minimum_alignment, .{default_align}); } } - try p.attr_application_buf.append(p.gpa, attr); + try p.attr_application_buf.append(p.comp.gpa, attr); } -fn applyTransparentUnion(attr: Attribute, p: *Parser, tok: TokenIndex, ty: Type) !void { - const union_ty = ty.get(.@"union") orelse { - return p.errTok(.transparent_union_wrong_type, tok); +fn applyTransparentUnion(attr: Attribute, p: *Parser, tok: TokenIndex, qt: QualType) !void { + const union_ty = qt.get(p.comp, .@"union") orelse { + return p.err(tok, .transparent_union_wrong_type, .{}); }; // TODO validate union defined at end - if (union_ty.data.record.isIncomplete()) return; - const fields = union_ty.data.record.fields; - if (fields.len == 0) { - return p.errTok(.transparent_union_one_field, tok); + if (union_ty.layout == null) return; + if (union_ty.fields.len == 0) { + return p.err(tok, .transparent_union_one_field, .{}); } - const first_field_size = fields[0].ty.bitSizeof(p.comp).?; - for (fields[1..]) |field| { - const field_size = field.ty.bitSizeof(p.comp).?; + const first_field_size = union_ty.fields[0].qt.bitSizeof(p.comp); + for (union_ty.fields[1..]) |field| { + const field_size = field.qt.bitSizeof(p.comp); if (field_size == first_field_size) continue; - const mapper = p.comp.string_interner.getSlowTypeMapper(); - const str = try std.fmt.allocPrint( - p.comp.diagnostics.arena.allocator(), - "'{s}' ({d}", - .{ mapper.lookup(field.name), field_size }, - ); - try p.errStr(.transparent_union_size, field.name_tok, str); - return p.errExtra(.transparent_union_size_note, fields[0].name_tok, .{ .unsigned = first_field_size }); + + try p.err(field.name_tok, .transparent_union_size, .{ field.name.lookup(p.comp), field_size }); + return p.err(union_ty.fields[0].name_tok, .transparent_union_size_note, .{first_field_size}); } - try p.attr_application_buf.append(p.gpa, attr); + try p.attr_application_buf.append(p.comp.gpa, attr); } -fn applyVectorSize(attr: Attribute, p: *Parser, tok: TokenIndex, ty: *Type) !void { - const base = ty.base(); - const is_enum = ty.is(.@"enum"); - if (!(ty.isInt() or ty.isFloat()) or !ty.isReal() or (is_enum and p.comp.langopts.emulate == .gcc)) { - try p.errStr(.invalid_vec_elem_ty, tok, try p.typeStr(ty.*)); +fn applyVectorSize(attr: Attribute, p: *Parser, tok: TokenIndex, qt: *QualType) !void { + if (qt.isInvalid()) return; + const scalar_kind = qt.scalarKind(p.comp); + if (scalar_kind != .int and scalar_kind != .float) { + if (qt.get(p.comp, .@"enum")) |enum_ty| { + if (p.comp.langopts.emulate == .clang and enum_ty.incomplete) { + return; // Clang silently ignores vector_size on incomplete enums. + } + } + try p.err(tok, .invalid_vec_elem_ty, .{qt.*}); return error.ParsingFailed; } - if (is_enum) return; + if (qt.get(p.comp, .bit_int)) |bit_int| { + if (bit_int.bits < 8) { + try p.err(tok, .bit_int_vec_too_small, .{}); + return error.ParsingFailed; + } else if (!std.math.isPowerOfTwo(bit_int.bits)) { + try p.err(tok, .bit_int_vec_not_pow2, .{}); + return error.ParsingFailed; + } + } const vec_bytes = attr.args.vector_size.bytes; - const ty_size = ty.sizeof(p.comp).?; - if (vec_bytes % ty_size != 0) { - return p.errTok(.vec_size_not_multiple, tok); + const elem_size = qt.sizeof(p.comp); + if (vec_bytes % elem_size != 0) { + return p.err(tok, .vec_size_not_multiple, .{}); } - const vec_size = vec_bytes / ty_size; - const arr_ty = try p.arena.create(Type.Array); - arr_ty.* = .{ .elem = ty.*, .len = vec_size }; - base.* = .{ - .specifier = .vector, - .data = .{ .array = arr_ty }, - }; + qt.* = try p.comp.type_store.put(p.comp.gpa, .{ .vector = .{ + .elem = qt.*, + .len = @intCast(vec_bytes / elem_size), + } }); } -fn applyFormat(attr: Attribute, p: *Parser, ty: Type) !void { +fn applyFormat(attr: Attribute, p: *Parser, qt: QualType) !void { // TODO validate - _ = ty; - try p.attr_application_buf.append(p.gpa, attr); + _ = qt; + try p.attr_application_buf.append(p.comp.gpa, attr); +} + +fn applyCallingConvention(attr: Attribute, p: *Parser, tok: TokenIndex, qt: QualType) !void { + if (!qt.is(p.comp, .func)) { + return p.err(tok, .callconv_non_func, .{ p.tok_ids[tok].symbol(), qt }); + } + switch (attr.args.calling_convention.cc) { + .c => {}, + .stdcall, .thiscall, .fastcall, .regcall => switch (p.comp.target.cpu.arch) { + .x86 => try p.attr_application_buf.append(p.comp.gpa, attr), + else => try p.err(tok, .callconv_not_supported, .{p.tok_ids[tok].symbol()}), + }, + .vectorcall => switch (p.comp.target.cpu.arch) { + .x86, .aarch64, .aarch64_be => try p.attr_application_buf.append(p.comp.gpa, attr), + else => try p.err(tok, .callconv_not_supported, .{p.tok_ids[tok].symbol()}), + }, + .riscv_vector, + .aarch64_sve_pcs, + .aarch64_vector_pcs, + .arm_aapcs, + .arm_aapcs_vfp, + .x86_64_sysv, + .x86_64_win, + => unreachable, // These can't come from keyword syntax + } +} + +fn applySelected(qt: QualType, p: *Parser) !QualType { + if (p.attr_application_buf.items.len == 0) return qt; + if (qt.isInvalid()) return qt; + return (try p.comp.type_store.put(p.comp.gpa, .{ .attributed = .{ + .base = qt, + .attributes = p.attr_application_buf.items, + } })).withQualifiers(qt); } diff --git a/lib/compiler/aro/aro/Attribute/names.zig b/lib/compiler/aro/aro/Attribute/names.zig index c0732b6118be..eeb6934a940c 100644 --- a/lib/compiler/aro/aro/Attribute/names.zig +++ b/lib/compiler/aro/aro/Attribute/names.zig @@ -11,7 +11,123 @@ properties: Properties, /// Integer starting at 0 derived from the unique index, /// corresponds with the data array index. -pub const Tag = enum(u16) { _ }; +pub const Tag = enum(u16) { aarch64_sve_pcs, + aarch64_vector_pcs, + access, + alias, + @"align", + aligned, + alloc_align, + alloc_size, + allocate, + allocator, + always_inline, + appdomain, + artificial, + assume_aligned, + cdecl, + cleanup, + code_seg, + cold, + common, + @"const", + constructor, + copy, + deprecated, + designated_init, + destructor, + dllexport, + dllimport, + @"error", + externally_visible, + fallthrough, + fastcall, + flatten, + format, + format_arg, + gnu_inline, + hot, + ifunc, + interrupt, + interrupt_handler, + jitintrinsic, + leaf, + malloc, + may_alias, + maybe_unused, + mode, + ms_abi, + naked, + no_address_safety_analysis, + no_icf, + no_instrument_function, + no_profile_instrument_function, + no_reorder, + no_sanitize, + no_sanitize_address, + no_sanitize_coverage, + no_sanitize_thread, + no_sanitize_undefined, + no_split_stack, + no_stack_limit, + no_stack_protector, + @"noalias", + noclone, + nocommon, + nodiscard, + noinit, + @"noinline", + noipa, + nonnull, + nonstring, + noplt, + @"noreturn", + nothrow, + @"packed", + patchable_function_entry, + pcs, + persistent, + process, + pure, + reproducible, + restrict, + retain, + returns_nonnull, + returns_twice, + riscv_vector_cc, + safebuffers, + scalar_storage_order, + section, + selectany, + sentinel, + simd, + spectre, + stack_protect, + stdcall, + symver, + sysv_abi, + target, + target_clones, + thiscall, + thread, + tls_model, + transparent_union, + unavailable, + uninitialized, + unsequenced, + unused, + used, + uuid, + vector_size, + vectorcall, + visibility, + warn_if_not_aligned, + warn_unused_result, + warning, + weak, + weakref, + zero_call_used_regs, +}; const Self = @This(); @@ -69,7 +185,7 @@ pub const longest_name = 30; /// If found, returns the index of the node within the `dafsa` array. /// Otherwise, returns `null`. pub fn findInList(first_child_index: u16, char: u8) ?u16 { - @setEvalBranchQuota(206); + @setEvalBranchQuota(232); var index = first_child_index; while (true) { if (dafsa[index].char == char) return index; @@ -117,8 +233,7 @@ pub fn nameFromUniqueIndex(index: u16, buf: []u8) []u8 { var node_index: u16 = 0; var count: u16 = index; - var fbs = std.io.fixedBufferStream(buf); - const w = fbs.writer(); + var w = std.Io.Writer.fixed(buf); while (true) { var sibling_index = dafsa[node_index].child_index; @@ -140,7 +255,7 @@ pub fn nameFromUniqueIndex(index: u16, buf: []u8) []u8 { if (count == 0) break; } - return fbs.getWritten(); + return w.buffered(); } const Node = packed struct(u32) { @@ -165,837 +280,805 @@ const Node = packed struct(u32) { const dafsa = [_]Node{ .{ .char = 0, .end_of_word = false, .end_of_list = true, .number = 0, .child_index = 1 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 21 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 26 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 28 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 30 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 32 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 35 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 36 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 37 }, - .{ .char = 'j', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 39 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 40 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 41 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 43 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 45 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 49 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 50 }, - .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 57 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 61 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 64 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 66 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 68 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 69 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 70 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 73 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 74 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 75 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 76 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 77 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 82 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 84 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 85 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 86 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 87 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 88 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 89 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 90 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 91 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 92 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 93 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 94 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 95 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 96 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 98 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 99 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 23, .child_index = 100 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 108 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 110 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 111 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 112 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 113 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 116 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 117 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 118 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 121 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 122 }, - .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 123 }, - .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 124 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 125 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 126 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 127 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 128 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 129 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 133 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 134 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 135 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 136 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 137 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 138 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 139 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 140 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 141 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 143 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 144 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 145 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 146 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 147 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 148 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 149 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 150 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 151 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 152 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 153 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 154 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 155 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 157 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 159 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 160 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 161 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 162 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 163 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 164 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 14, .child_index = 21 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 27 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 30 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 32 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 34 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 37 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 38 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 39 }, + .{ .char = 'j', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 41 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 42 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 43 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 26, .child_index = 46 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 48 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 53 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 11, .child_index = 55 }, + .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 62 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 66 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 69 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 71 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 73 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 74 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 75 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 76 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 79 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 80 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 81 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 82 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 83 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 84 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 89 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 91 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 92 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 93 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 94 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 96 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 97 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 98 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 99 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 100 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 101 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 102 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 103 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 104 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 106 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 107 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 108 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 109 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 118 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 120 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 121 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 122 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 123 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 124 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 127 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 128 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 129 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 130 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 133 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 134 }, + .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 135 }, + .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 137 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 139 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 140 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 142 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 143 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 144 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 148 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 149 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 150 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 151 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 152 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 153 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 154 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 155 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 156 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 157 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 159 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 160 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 161 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 162 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 163 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 164 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 165 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 166 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 167 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 168 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 169 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 170 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 171 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 172 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 174 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 176 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 177 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 178 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 179 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 180 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 181 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 182 }, .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 165 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 166 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 167 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 168 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 169 }, - .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 170 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 172 }, - .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 133 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 13, .child_index = 173 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 178 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 179 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 181 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 182 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 184 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 185 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 186 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 99 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 187 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 188 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 69 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 172 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 189 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 190 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 191 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 193 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 194 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 195 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 196 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 197 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 150 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 198 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 199 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 200 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 201 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 202 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 203 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 204 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 205 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 206 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 207 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 208 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 150 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 150 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 209 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 210 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 211 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 212 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 213 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 214 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 215 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 216 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 217 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 218 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 219 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 220 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 221 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 222 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 223 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 183 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 184 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 185 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 186 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 187 }, + .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 188 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 190 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 191 }, + .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 148 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 13, .child_index = 192 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 197 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 198 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 200 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 201 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 203 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 205 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 206 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 207 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 108 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 208 }, + .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 209 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 75 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 190 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 210 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 211 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 212 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 214 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 215 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 216 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 217 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 218 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 219 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 167 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 220 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 221 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 222 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 223 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 224 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 225 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 226 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 227 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 228 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 229 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 230 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 231 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 232 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 233 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 167 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 167 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 234 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 235 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 236 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 237 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 238 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 239 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 240 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 120 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 241 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 242 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 243 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 244 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 245 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 246 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 247 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 248 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 249 }, .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 224 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 225 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 250 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 251 }, .{ .char = 'y', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 226 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 227 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 228 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 229 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 230 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 231 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 232 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 233 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 234 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 235 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 236 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 237 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 238 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 239 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 252 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 253 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 254 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 255 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 256 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 257 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 258 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 259 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 222 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 260 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 261 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 262 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 263 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 264 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 265 }, .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 240 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 241 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 242 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 266 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 267 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 268 }, .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 243 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 244 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 246 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 247 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 248 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 251 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 252 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 253 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 254 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 255 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 257 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 258 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 91 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 259 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 260 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 261 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 262 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 263 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 264 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 265 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 266 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 267 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 268 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 269 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 270 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 271 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 272 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 273 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 274 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 275 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 276 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 277 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 278 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 279 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 280 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 133 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 281 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 282 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 283 }, - .{ .char = 'k', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 285 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 286 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 215 }, - .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 287 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 288 }, - .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 290 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 291 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 292 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 293 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 294 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 295 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 296 }, - .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 297 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 298 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 299 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 300 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 301 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 301 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 269 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 270 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 271 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 273 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 274 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 275 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 278 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 279 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 280 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 281 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 282 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 284 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 285 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 286 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 99 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 287 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 288 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 289 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 290 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 291 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 292 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 293 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 294 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 295 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 296 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 297 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 298 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 299 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 300 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 301 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 302 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 303 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 304 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 107 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 305 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 222 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 306 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 307 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 308 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 309 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 310 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 311 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 148 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 312 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 313 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 314 }, + .{ .char = 'k', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 316 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 317 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 318 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 120 }, + .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 319 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 320 }, + .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 322 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 323 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 324 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 325 }, + .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 326 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 327 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 328 }, + .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 329 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 330 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 331 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 332 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 333 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 333 }, .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 302 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 303 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 304 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 305 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 306 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 334 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 335 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 336 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 337 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 338 }, .{ .char = 'c', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 307 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 308 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 237 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 178 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 309 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 310 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 168 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 311 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 312 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 313 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 314 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 315 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 316 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 317 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 318 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 151 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 319 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 91 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 320 }, - .{ .char = 'a', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 321 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 322 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 323 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 324 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 325 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 326 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 296 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 327 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 328 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 329 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 224 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 330 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 331 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 112 }, - .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 332 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 231 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 333 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 150 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 334 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 335 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 336 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 337 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 338 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 339 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 340 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 341 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 343 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 344 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 345 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 150 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 346 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 348 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 164 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 349 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 339 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 340 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 263 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 197 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 341 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 342 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 343 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 186 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 344 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 345 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 346 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 347 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 348 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 349 }, .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 350 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 351 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 352 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 353 }, - .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 300 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 354 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 355 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 356 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 357 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 358 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 359 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 296 }, - .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 360 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 361 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 351 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 168 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 352 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 99 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 353 }, + .{ .char = 'a', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 354 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 355 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 356 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 357 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 358 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 359 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 360 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 361 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 328 }, .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 362 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 363 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 364 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 365 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 366 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 367 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 368 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 369 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 370 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 371 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 215 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 172 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 372 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 318 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 373 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 374 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 375 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 376 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 377 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 378 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 379 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 380 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 381 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 382 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 383 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 384 }, - .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 385 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 386 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 387 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 388 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 389 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 390 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 391 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 392 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 393 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 394 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 363 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 364 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 365 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 250 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 366 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 367 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 123 }, + .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 368 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 354 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 257 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 369 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 167 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 370 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 371 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 372 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 373 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 374 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 375 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 376 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 377 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 379 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 380 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 381 }, + .{ .char = '6', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 382 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 167 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 383 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 385 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 182 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 386 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 387 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 388 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 389 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 390 }, + .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 332 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 391 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 392 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 393 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 394 }, .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 395 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 168 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 396 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 397 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 398 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 399 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 264 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 401 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 402 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 396 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 328 }, + .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 397 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 398 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 399 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 400 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 401 }, + .{ .char = 'i', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 402 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 403 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 404 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 405 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 406 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 407 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 408 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 120 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 190 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 409 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 351 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 247 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 410 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 411 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 412 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 413 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 414 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 415 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 416 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 417 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 418 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 419 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 420 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 421 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 422 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 423 }, + .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 424 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 425 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 426 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 427 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 428 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 429 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 430 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 432 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 433 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 434 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 435 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 186 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 436 }, + .{ .char = '4', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 437 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 438 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 439 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 440 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 293 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 442 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 443 }, .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 395 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 403 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 404 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 405 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 406 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 407 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 408 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 409 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 320 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 410 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 411 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 412 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 413 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 414 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 415 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 416 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 417 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 418 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 419 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 420 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 343 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 296 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 421 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 422 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 423 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 91 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 424 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 425 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 426 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 427 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 428 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 429 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 430 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 383 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 431 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 432 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 433 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 434 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 435 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 436 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 437 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 438 }, - .{ .char = 'g', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 439 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 440 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 441 }, - .{ .char = 'e', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 231 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 442 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 443 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 133 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 444 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 159 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 91 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 445 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 446 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 447 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 448 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 449 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 450 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 451 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 435 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 444 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 445 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 446 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 447 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 448 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 449 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 450 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 353 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 451 }, .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 452 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 453 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 273 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 454 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 453 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 454 }, .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 455 }, - .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 456 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 150 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 457 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 458 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 459 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 460 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 462 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 463 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 153 }, - .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 464 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 465 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 466 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 467 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 468 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 469 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 398 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 470 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 456 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 457 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 458 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 459 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 460 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 461 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 379 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 328 }, + .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 462 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 463 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 464 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 99 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 465 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 466 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 467 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 468 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 469 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 247 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 470 }, .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 471 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 472 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 422 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 472 }, .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 473 }, .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 474 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 172 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 428 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 475 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 476 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 475 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 476 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 303 }, .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 477 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 478 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 395 }, - .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 479 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 480 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 208 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 481 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 482 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 478 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 479 }, + .{ .char = 'g', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 480 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 481 }, .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 483 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 484 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 485 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 486 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 488 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 91 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 467 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 489 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 490 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 491 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 492 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 493 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 494 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 495 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 496 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 497 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 133 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 153 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 498 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 499 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 484 }, + .{ .char = 'e', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 257 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 485 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 486 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 148 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 487 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 176 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 99 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 488 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 489 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 490 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 491 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 492 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 493 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 494 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 495 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 496 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 304 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 497 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 498 }, + .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 499 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 167 }, .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 500 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 296 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 501 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 502 }, - .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 503 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 504 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 505 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 506 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 501 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 502 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 503 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 505 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 506 }, .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 507 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 508 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 509 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 510 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 511 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 512 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 513 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 514 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 515 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 516 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 215 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 517 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 518 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 519 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 520 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 172 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 521 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 522 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 523 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 524 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 525 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 526 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 527 }, - .{ .char = 'h', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 528 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 237 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 529 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 530 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 170 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 508 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 509 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 510 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 511 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 512 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 513 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 439 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 514 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 515 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 516 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 517 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 518 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 519 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 520 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 190 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 247 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 521 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 522 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 523 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 524 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 435 }, + .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 525 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 526 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 233 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 527 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 528 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 529 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 530 }, .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 531 }, - .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 532 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 533 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 534 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 535 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 536 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 537 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 538 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 539 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 378 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 540 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 541 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 133 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 351 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 542 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 543 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 133 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 544 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 545 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 546 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 547 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 548 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 549 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 550 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 554 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 555 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 556 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 557 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 558 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 172 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 559 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 215 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 560 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 561 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 562 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 555 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 563 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 564 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 565 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 532 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 534 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 99 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 511 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 535 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 536 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 537 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 538 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 539 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 540 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 541 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 542 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 543 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 544 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 148 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 170 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 545 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 546 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 547 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 548 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 549 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 328 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 550 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 551 }, + .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 552 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 553 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 554 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 555 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 556 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 557 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 558 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 559 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 560 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 561 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 562 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 563 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 564 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 565 }, .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 566 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 311 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 567 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 568 }, - .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 569 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 570 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 571 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 91 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 572 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 573 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 574 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 575 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 576 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 577 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 578 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 459 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 579 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 580 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 120 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 567 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 568 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 569 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 570 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 190 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 571 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 572 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 573 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 574 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 575 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 576 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 577 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 578 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 579 }, + .{ .char = 'h', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 580 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 263 }, .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 581 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 582 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 583 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 126 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 584 }, - .{ .char = 'k', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 356 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 585 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 428 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 586 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 268 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 587 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 588 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 273 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 589 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 590 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 591 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 592 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 593 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 582 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 583 }, + .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 584 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 585 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 586 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 587 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 588 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 589 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 590 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 591 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 592 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 416 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 593 }, .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 594 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 313 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 595 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 596 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 597 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 598 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 140 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 599 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 600 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 601 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 185 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 602 }, - .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 603 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 604 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 605 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 606 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 607 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 608 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 609 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 195 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 610 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 525 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 611 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 215 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 612 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 172 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 613 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 614 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 615 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 616 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 617 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 618 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 619 }, - .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 620 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 153 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 621 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 215 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 148 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 388 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 595 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 596 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 597 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 598 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 148 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 599 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 600 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 601 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 602 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 603 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 604 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 605 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 609 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 610 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 611 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 612 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 285 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 190 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 613 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 614 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 120 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 615 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 616 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 617 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 618 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 619 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 610 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 620 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 621 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 622 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 623 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 344 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 624 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 625 }, + .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 626 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 627 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 628 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 99 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 629 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 630 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 631 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 632 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 633 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 634 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 635 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 120 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 575 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 502 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 636 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 637 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 638 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 639 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 640 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 641 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 642 }, + .{ .char = 'k', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 393 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 643 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 263 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 644 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 298 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 645 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 646 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 304 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 647 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 648 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 649 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 650 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 227 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 651 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 652 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 346 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 653 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 654 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 655 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 656 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 156 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 657 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 658 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 659 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 205 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 660 }, + .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 661 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 662 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 663 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 664 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 665 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 666 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 667 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 217 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 668 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 577 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 669 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 120 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 670 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 190 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 671 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 672 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 673 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 674 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 675 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 676 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 677 }, + .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 678 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 170 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 679 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 120 }, }; pub const data = blk: { - @setEvalBranchQuota(721); + @setEvalBranchQuota(812); break :blk [_]@This(){ - // access - .{ .tag = @enumFromInt(0), .properties = .{ .tag = .access, .gnu = true } }, - // alias - .{ .tag = @enumFromInt(1), .properties = .{ .tag = .alias, .gnu = true } }, - // align - .{ .tag = @enumFromInt(2), .properties = .{ .tag = .aligned, .declspec = true } }, - // aligned - .{ .tag = @enumFromInt(3), .properties = .{ .tag = .aligned, .gnu = true } }, - // alloc_align - .{ .tag = @enumFromInt(4), .properties = .{ .tag = .alloc_align, .gnu = true } }, - // alloc_size - .{ .tag = @enumFromInt(5), .properties = .{ .tag = .alloc_size, .gnu = true } }, - // allocate - .{ .tag = @enumFromInt(6), .properties = .{ .tag = .allocate, .declspec = true } }, - // allocator - .{ .tag = @enumFromInt(7), .properties = .{ .tag = .allocator, .declspec = true } }, - // always_inline - .{ .tag = @enumFromInt(8), .properties = .{ .tag = .always_inline, .gnu = true } }, - // appdomain - .{ .tag = @enumFromInt(9), .properties = .{ .tag = .appdomain, .declspec = true } }, - // artificial - .{ .tag = @enumFromInt(10), .properties = .{ .tag = .artificial, .gnu = true } }, - // assume_aligned - .{ .tag = @enumFromInt(11), .properties = .{ .tag = .assume_aligned, .gnu = true } }, - // cleanup - .{ .tag = @enumFromInt(12), .properties = .{ .tag = .cleanup, .gnu = true } }, - // code_seg - .{ .tag = @enumFromInt(13), .properties = .{ .tag = .code_seg, .declspec = true } }, - // cold - .{ .tag = @enumFromInt(14), .properties = .{ .tag = .cold, .gnu = true } }, - // common - .{ .tag = @enumFromInt(15), .properties = .{ .tag = .common, .gnu = true } }, - // const - .{ .tag = @enumFromInt(16), .properties = .{ .tag = .@"const", .gnu = true } }, - // constructor - .{ .tag = @enumFromInt(17), .properties = .{ .tag = .constructor, .gnu = true } }, - // copy - .{ .tag = @enumFromInt(18), .properties = .{ .tag = .copy, .gnu = true } }, - // deprecated - .{ .tag = @enumFromInt(19), .properties = .{ .tag = .deprecated, .c23 = true, .gnu = true, .declspec = true } }, - // designated_init - .{ .tag = @enumFromInt(20), .properties = .{ .tag = .designated_init, .gnu = true } }, - // destructor - .{ .tag = @enumFromInt(21), .properties = .{ .tag = .destructor, .gnu = true } }, - // dllexport - .{ .tag = @enumFromInt(22), .properties = .{ .tag = .dllexport, .declspec = true } }, - // dllimport - .{ .tag = @enumFromInt(23), .properties = .{ .tag = .dllimport, .declspec = true } }, - // error - .{ .tag = @enumFromInt(24), .properties = .{ .tag = .@"error", .gnu = true } }, - // externally_visible - .{ .tag = @enumFromInt(25), .properties = .{ .tag = .externally_visible, .gnu = true } }, - // fallthrough - .{ .tag = @enumFromInt(26), .properties = .{ .tag = .fallthrough, .c23 = true, .gnu = true } }, - // flatten - .{ .tag = @enumFromInt(27), .properties = .{ .tag = .flatten, .gnu = true } }, - // format - .{ .tag = @enumFromInt(28), .properties = .{ .tag = .format, .gnu = true } }, - // format_arg - .{ .tag = @enumFromInt(29), .properties = .{ .tag = .format_arg, .gnu = true } }, - // gnu_inline - .{ .tag = @enumFromInt(30), .properties = .{ .tag = .gnu_inline, .gnu = true } }, - // hot - .{ .tag = @enumFromInt(31), .properties = .{ .tag = .hot, .gnu = true } }, - // ifunc - .{ .tag = @enumFromInt(32), .properties = .{ .tag = .ifunc, .gnu = true } }, - // interrupt - .{ .tag = @enumFromInt(33), .properties = .{ .tag = .interrupt, .gnu = true } }, - // interrupt_handler - .{ .tag = @enumFromInt(34), .properties = .{ .tag = .interrupt_handler, .gnu = true } }, - // jitintrinsic - .{ .tag = @enumFromInt(35), .properties = .{ .tag = .jitintrinsic, .declspec = true } }, - // leaf - .{ .tag = @enumFromInt(36), .properties = .{ .tag = .leaf, .gnu = true } }, - // malloc - .{ .tag = @enumFromInt(37), .properties = .{ .tag = .malloc, .gnu = true } }, - // may_alias - .{ .tag = @enumFromInt(38), .properties = .{ .tag = .may_alias, .gnu = true } }, - // maybe_unused - .{ .tag = @enumFromInt(39), .properties = .{ .tag = .unused, .c23 = true } }, - // mode - .{ .tag = @enumFromInt(40), .properties = .{ .tag = .mode, .gnu = true } }, - // naked - .{ .tag = @enumFromInt(41), .properties = .{ .tag = .naked, .declspec = true } }, - // no_address_safety_analysis - .{ .tag = @enumFromInt(42), .properties = .{ .tag = .no_address_safety_analysis, .gnu = true } }, - // no_icf - .{ .tag = @enumFromInt(43), .properties = .{ .tag = .no_icf, .gnu = true } }, - // no_instrument_function - .{ .tag = @enumFromInt(44), .properties = .{ .tag = .no_instrument_function, .gnu = true } }, - // no_profile_instrument_function - .{ .tag = @enumFromInt(45), .properties = .{ .tag = .no_profile_instrument_function, .gnu = true } }, - // no_reorder - .{ .tag = @enumFromInt(46), .properties = .{ .tag = .no_reorder, .gnu = true } }, - // no_sanitize - .{ .tag = @enumFromInt(47), .properties = .{ .tag = .no_sanitize, .gnu = true } }, - // no_sanitize_address - .{ .tag = @enumFromInt(48), .properties = .{ .tag = .no_sanitize_address, .gnu = true, .declspec = true } }, - // no_sanitize_coverage - .{ .tag = @enumFromInt(49), .properties = .{ .tag = .no_sanitize_coverage, .gnu = true } }, - // no_sanitize_thread - .{ .tag = @enumFromInt(50), .properties = .{ .tag = .no_sanitize_thread, .gnu = true } }, - // no_sanitize_undefined - .{ .tag = @enumFromInt(51), .properties = .{ .tag = .no_sanitize_undefined, .gnu = true } }, - // no_split_stack - .{ .tag = @enumFromInt(52), .properties = .{ .tag = .no_split_stack, .gnu = true } }, - // no_stack_limit - .{ .tag = @enumFromInt(53), .properties = .{ .tag = .no_stack_limit, .gnu = true } }, - // no_stack_protector - .{ .tag = @enumFromInt(54), .properties = .{ .tag = .no_stack_protector, .gnu = true } }, - // noalias - .{ .tag = @enumFromInt(55), .properties = .{ .tag = .@"noalias", .declspec = true } }, - // noclone - .{ .tag = @enumFromInt(56), .properties = .{ .tag = .noclone, .gnu = true } }, - // nocommon - .{ .tag = @enumFromInt(57), .properties = .{ .tag = .nocommon, .gnu = true } }, - // nodiscard - .{ .tag = @enumFromInt(58), .properties = .{ .tag = .nodiscard, .c23 = true } }, - // noinit - .{ .tag = @enumFromInt(59), .properties = .{ .tag = .noinit, .gnu = true } }, - // noinline - .{ .tag = @enumFromInt(60), .properties = .{ .tag = .@"noinline", .gnu = true, .declspec = true } }, - // noipa - .{ .tag = @enumFromInt(61), .properties = .{ .tag = .noipa, .gnu = true } }, - // nonstring - .{ .tag = @enumFromInt(62), .properties = .{ .tag = .nonstring, .gnu = true } }, - // noplt - .{ .tag = @enumFromInt(63), .properties = .{ .tag = .noplt, .gnu = true } }, - // noreturn - .{ .tag = @enumFromInt(64), .properties = .{ .tag = .@"noreturn", .c23 = true, .gnu = true, .declspec = true } }, - // packed - .{ .tag = @enumFromInt(65), .properties = .{ .tag = .@"packed", .gnu = true } }, - // patchable_function_entry - .{ .tag = @enumFromInt(66), .properties = .{ .tag = .patchable_function_entry, .gnu = true } }, - // persistent - .{ .tag = @enumFromInt(67), .properties = .{ .tag = .persistent, .gnu = true } }, - // process - .{ .tag = @enumFromInt(68), .properties = .{ .tag = .process, .declspec = true } }, - // pure - .{ .tag = @enumFromInt(69), .properties = .{ .tag = .pure, .gnu = true } }, - // reproducible - .{ .tag = @enumFromInt(70), .properties = .{ .tag = .reproducible, .c23 = true } }, - // restrict - .{ .tag = @enumFromInt(71), .properties = .{ .tag = .restrict, .declspec = true } }, - // retain - .{ .tag = @enumFromInt(72), .properties = .{ .tag = .retain, .gnu = true } }, - // returns_nonnull - .{ .tag = @enumFromInt(73), .properties = .{ .tag = .returns_nonnull, .gnu = true } }, - // returns_twice - .{ .tag = @enumFromInt(74), .properties = .{ .tag = .returns_twice, .gnu = true } }, - // safebuffers - .{ .tag = @enumFromInt(75), .properties = .{ .tag = .safebuffers, .declspec = true } }, - // scalar_storage_order - .{ .tag = @enumFromInt(76), .properties = .{ .tag = .scalar_storage_order, .gnu = true } }, - // section - .{ .tag = @enumFromInt(77), .properties = .{ .tag = .section, .gnu = true } }, - // selectany - .{ .tag = @enumFromInt(78), .properties = .{ .tag = .selectany, .declspec = true } }, - // sentinel - .{ .tag = @enumFromInt(79), .properties = .{ .tag = .sentinel, .gnu = true } }, - // simd - .{ .tag = @enumFromInt(80), .properties = .{ .tag = .simd, .gnu = true } }, - // spectre - .{ .tag = @enumFromInt(81), .properties = .{ .tag = .spectre, .declspec = true } }, - // stack_protect - .{ .tag = @enumFromInt(82), .properties = .{ .tag = .stack_protect, .gnu = true } }, - // symver - .{ .tag = @enumFromInt(83), .properties = .{ .tag = .symver, .gnu = true } }, - // target - .{ .tag = @enumFromInt(84), .properties = .{ .tag = .target, .gnu = true } }, - // target_clones - .{ .tag = @enumFromInt(85), .properties = .{ .tag = .target_clones, .gnu = true } }, - // thread - .{ .tag = @enumFromInt(86), .properties = .{ .tag = .thread, .declspec = true } }, - // tls_model - .{ .tag = @enumFromInt(87), .properties = .{ .tag = .tls_model, .gnu = true } }, - // transparent_union - .{ .tag = @enumFromInt(88), .properties = .{ .tag = .transparent_union, .gnu = true } }, - // unavailable - .{ .tag = @enumFromInt(89), .properties = .{ .tag = .unavailable, .gnu = true } }, - // uninitialized - .{ .tag = @enumFromInt(90), .properties = .{ .tag = .uninitialized, .gnu = true } }, - // unsequenced - .{ .tag = @enumFromInt(91), .properties = .{ .tag = .unsequenced, .c23 = true } }, - // unused - .{ .tag = @enumFromInt(92), .properties = .{ .tag = .unused, .gnu = true } }, - // used - .{ .tag = @enumFromInt(93), .properties = .{ .tag = .used, .gnu = true } }, - // uuid - .{ .tag = @enumFromInt(94), .properties = .{ .tag = .uuid, .declspec = true } }, - // vector_size - .{ .tag = @enumFromInt(95), .properties = .{ .tag = .vector_size, .gnu = true } }, - // visibility - .{ .tag = @enumFromInt(96), .properties = .{ .tag = .visibility, .gnu = true } }, - // warn_if_not_aligned - .{ .tag = @enumFromInt(97), .properties = .{ .tag = .warn_if_not_aligned, .gnu = true } }, - // warn_unused_result - .{ .tag = @enumFromInt(98), .properties = .{ .tag = .warn_unused_result, .gnu = true } }, - // warning - .{ .tag = @enumFromInt(99), .properties = .{ .tag = .warning, .gnu = true } }, - // weak - .{ .tag = @enumFromInt(100), .properties = .{ .tag = .weak, .gnu = true } }, - // weakref - .{ .tag = @enumFromInt(101), .properties = .{ .tag = .weakref, .gnu = true } }, - // zero_call_used_regs - .{ .tag = @enumFromInt(102), .properties = .{ .tag = .zero_call_used_regs, .gnu = true } }, + .{ .tag = .aarch64_sve_pcs, .properties = .{ .tag = .aarch64_sve_pcs, .gnu = true } }, + .{ .tag = .aarch64_vector_pcs, .properties = .{ .tag = .aarch64_vector_pcs, .gnu = true } }, + .{ .tag = .access, .properties = .{ .tag = .access, .gnu = true } }, + .{ .tag = .alias, .properties = .{ .tag = .alias, .gnu = true } }, + .{ .tag = .@"align", .properties = .{ .tag = .aligned, .declspec = true } }, + .{ .tag = .aligned, .properties = .{ .tag = .aligned, .gnu = true } }, + .{ .tag = .alloc_align, .properties = .{ .tag = .alloc_align, .gnu = true } }, + .{ .tag = .alloc_size, .properties = .{ .tag = .alloc_size, .gnu = true } }, + .{ .tag = .allocate, .properties = .{ .tag = .allocate, .declspec = true } }, + .{ .tag = .allocator, .properties = .{ .tag = .allocator, .declspec = true } }, + .{ .tag = .always_inline, .properties = .{ .tag = .always_inline, .gnu = true } }, + .{ .tag = .appdomain, .properties = .{ .tag = .appdomain, .declspec = true } }, + .{ .tag = .artificial, .properties = .{ .tag = .artificial, .gnu = true } }, + .{ .tag = .assume_aligned, .properties = .{ .tag = .assume_aligned, .gnu = true } }, + .{ .tag = .cdecl, .properties = .{ .tag = .cdecl, .gnu = true } }, + .{ .tag = .cleanup, .properties = .{ .tag = .cleanup, .gnu = true } }, + .{ .tag = .code_seg, .properties = .{ .tag = .code_seg, .declspec = true } }, + .{ .tag = .cold, .properties = .{ .tag = .cold, .gnu = true } }, + .{ .tag = .common, .properties = .{ .tag = .common, .gnu = true } }, + .{ .tag = .@"const", .properties = .{ .tag = .@"const", .gnu = true } }, + .{ .tag = .constructor, .properties = .{ .tag = .constructor, .gnu = true } }, + .{ .tag = .copy, .properties = .{ .tag = .copy, .gnu = true } }, + .{ .tag = .deprecated, .properties = .{ .tag = .deprecated, .c23 = true, .gnu = true, .declspec = true } }, + .{ .tag = .designated_init, .properties = .{ .tag = .designated_init, .gnu = true } }, + .{ .tag = .destructor, .properties = .{ .tag = .destructor, .gnu = true } }, + .{ .tag = .dllexport, .properties = .{ .tag = .dllexport, .declspec = true } }, + .{ .tag = .dllimport, .properties = .{ .tag = .dllimport, .declspec = true } }, + .{ .tag = .@"error", .properties = .{ .tag = .@"error", .gnu = true } }, + .{ .tag = .externally_visible, .properties = .{ .tag = .externally_visible, .gnu = true } }, + .{ .tag = .fallthrough, .properties = .{ .tag = .fallthrough, .c23 = true, .gnu = true } }, + .{ .tag = .fastcall, .properties = .{ .tag = .fastcall, .gnu = true } }, + .{ .tag = .flatten, .properties = .{ .tag = .flatten, .gnu = true } }, + .{ .tag = .format, .properties = .{ .tag = .format, .gnu = true } }, + .{ .tag = .format_arg, .properties = .{ .tag = .format_arg, .gnu = true } }, + .{ .tag = .gnu_inline, .properties = .{ .tag = .gnu_inline, .gnu = true } }, + .{ .tag = .hot, .properties = .{ .tag = .hot, .gnu = true } }, + .{ .tag = .ifunc, .properties = .{ .tag = .ifunc, .gnu = true } }, + .{ .tag = .interrupt, .properties = .{ .tag = .interrupt, .gnu = true } }, + .{ .tag = .interrupt_handler, .properties = .{ .tag = .interrupt_handler, .gnu = true } }, + .{ .tag = .jitintrinsic, .properties = .{ .tag = .jitintrinsic, .declspec = true } }, + .{ .tag = .leaf, .properties = .{ .tag = .leaf, .gnu = true } }, + .{ .tag = .malloc, .properties = .{ .tag = .malloc, .gnu = true } }, + .{ .tag = .may_alias, .properties = .{ .tag = .may_alias, .gnu = true } }, + .{ .tag = .maybe_unused, .properties = .{ .tag = .unused, .c23 = true } }, + .{ .tag = .mode, .properties = .{ .tag = .mode, .gnu = true } }, + .{ .tag = .ms_abi, .properties = .{ .tag = .ms_abi, .gnu = true } }, + .{ .tag = .naked, .properties = .{ .tag = .naked, .declspec = true } }, + .{ .tag = .no_address_safety_analysis, .properties = .{ .tag = .no_address_safety_analysis, .gnu = true } }, + .{ .tag = .no_icf, .properties = .{ .tag = .no_icf, .gnu = true } }, + .{ .tag = .no_instrument_function, .properties = .{ .tag = .no_instrument_function, .gnu = true } }, + .{ .tag = .no_profile_instrument_function, .properties = .{ .tag = .no_profile_instrument_function, .gnu = true } }, + .{ .tag = .no_reorder, .properties = .{ .tag = .no_reorder, .gnu = true } }, + .{ .tag = .no_sanitize, .properties = .{ .tag = .no_sanitize, .gnu = true } }, + .{ .tag = .no_sanitize_address, .properties = .{ .tag = .no_sanitize_address, .gnu = true, .declspec = true } }, + .{ .tag = .no_sanitize_coverage, .properties = .{ .tag = .no_sanitize_coverage, .gnu = true } }, + .{ .tag = .no_sanitize_thread, .properties = .{ .tag = .no_sanitize_thread, .gnu = true } }, + .{ .tag = .no_sanitize_undefined, .properties = .{ .tag = .no_sanitize_undefined, .gnu = true } }, + .{ .tag = .no_split_stack, .properties = .{ .tag = .no_split_stack, .gnu = true } }, + .{ .tag = .no_stack_limit, .properties = .{ .tag = .no_stack_limit, .gnu = true } }, + .{ .tag = .no_stack_protector, .properties = .{ .tag = .no_stack_protector, .gnu = true } }, + .{ .tag = .@"noalias", .properties = .{ .tag = .@"noalias", .declspec = true } }, + .{ .tag = .noclone, .properties = .{ .tag = .noclone, .gnu = true } }, + .{ .tag = .nocommon, .properties = .{ .tag = .nocommon, .gnu = true } }, + .{ .tag = .nodiscard, .properties = .{ .tag = .nodiscard, .c23 = true } }, + .{ .tag = .noinit, .properties = .{ .tag = .noinit, .gnu = true } }, + .{ .tag = .@"noinline", .properties = .{ .tag = .@"noinline", .gnu = true, .declspec = true } }, + .{ .tag = .noipa, .properties = .{ .tag = .noipa, .gnu = true } }, + .{ .tag = .nonnull, .properties = .{ .tag = .nonnull, .gnu = true } }, + .{ .tag = .nonstring, .properties = .{ .tag = .nonstring, .gnu = true } }, + .{ .tag = .noplt, .properties = .{ .tag = .noplt, .gnu = true } }, + .{ .tag = .@"noreturn", .properties = .{ .tag = .@"noreturn", .c23 = true, .gnu = true, .declspec = true } }, + .{ .tag = .nothrow, .properties = .{ .tag = .nothrow, .gnu = true } }, + .{ .tag = .@"packed", .properties = .{ .tag = .@"packed", .gnu = true } }, + .{ .tag = .patchable_function_entry, .properties = .{ .tag = .patchable_function_entry, .gnu = true } }, + .{ .tag = .pcs, .properties = .{ .tag = .pcs, .gnu = true } }, + .{ .tag = .persistent, .properties = .{ .tag = .persistent, .gnu = true } }, + .{ .tag = .process, .properties = .{ .tag = .process, .declspec = true } }, + .{ .tag = .pure, .properties = .{ .tag = .pure, .gnu = true } }, + .{ .tag = .reproducible, .properties = .{ .tag = .reproducible, .c23 = true } }, + .{ .tag = .restrict, .properties = .{ .tag = .restrict, .declspec = true } }, + .{ .tag = .retain, .properties = .{ .tag = .retain, .gnu = true } }, + .{ .tag = .returns_nonnull, .properties = .{ .tag = .returns_nonnull, .gnu = true } }, + .{ .tag = .returns_twice, .properties = .{ .tag = .returns_twice, .gnu = true } }, + .{ .tag = .riscv_vector_cc, .properties = .{ .tag = .riscv_vector_cc, .gnu = true } }, + .{ .tag = .safebuffers, .properties = .{ .tag = .safebuffers, .declspec = true } }, + .{ .tag = .scalar_storage_order, .properties = .{ .tag = .scalar_storage_order, .gnu = true } }, + .{ .tag = .section, .properties = .{ .tag = .section, .gnu = true } }, + .{ .tag = .selectany, .properties = .{ .tag = .selectany, .declspec = true } }, + .{ .tag = .sentinel, .properties = .{ .tag = .sentinel, .gnu = true } }, + .{ .tag = .simd, .properties = .{ .tag = .simd, .gnu = true } }, + .{ .tag = .spectre, .properties = .{ .tag = .spectre, .declspec = true } }, + .{ .tag = .stack_protect, .properties = .{ .tag = .stack_protect, .gnu = true } }, + .{ .tag = .stdcall, .properties = .{ .tag = .stdcall, .gnu = true } }, + .{ .tag = .symver, .properties = .{ .tag = .symver, .gnu = true } }, + .{ .tag = .sysv_abi, .properties = .{ .tag = .sysv_abi, .gnu = true } }, + .{ .tag = .target, .properties = .{ .tag = .target, .gnu = true } }, + .{ .tag = .target_clones, .properties = .{ .tag = .target_clones, .gnu = true } }, + .{ .tag = .thiscall, .properties = .{ .tag = .thiscall, .gnu = true } }, + .{ .tag = .thread, .properties = .{ .tag = .thread, .declspec = true } }, + .{ .tag = .tls_model, .properties = .{ .tag = .tls_model, .gnu = true } }, + .{ .tag = .transparent_union, .properties = .{ .tag = .transparent_union, .gnu = true } }, + .{ .tag = .unavailable, .properties = .{ .tag = .unavailable, .gnu = true } }, + .{ .tag = .uninitialized, .properties = .{ .tag = .uninitialized, .gnu = true } }, + .{ .tag = .unsequenced, .properties = .{ .tag = .unsequenced, .c23 = true } }, + .{ .tag = .unused, .properties = .{ .tag = .unused, .gnu = true } }, + .{ .tag = .used, .properties = .{ .tag = .used, .gnu = true } }, + .{ .tag = .uuid, .properties = .{ .tag = .uuid, .declspec = true } }, + .{ .tag = .vector_size, .properties = .{ .tag = .vector_size, .gnu = true } }, + .{ .tag = .vectorcall, .properties = .{ .tag = .vectorcall, .gnu = true } }, + .{ .tag = .visibility, .properties = .{ .tag = .visibility, .gnu = true } }, + .{ .tag = .warn_if_not_aligned, .properties = .{ .tag = .warn_if_not_aligned, .gnu = true } }, + .{ .tag = .warn_unused_result, .properties = .{ .tag = .warn_unused_result, .gnu = true } }, + .{ .tag = .warning, .properties = .{ .tag = .warning, .gnu = true } }, + .{ .tag = .weak, .properties = .{ .tag = .weak, .gnu = true } }, + .{ .tag = .weakref, .properties = .{ .tag = .weakref, .gnu = true } }, + .{ .tag = .zero_call_used_regs, .properties = .{ .tag = .zero_call_used_regs, .gnu = true } }, }; }; }; diff --git a/lib/compiler/aro/aro/Builtins.zig b/lib/compiler/aro/aro/Builtins.zig index 6443a6b6d494..b8d3084fefc8 100644 --- a/lib/compiler/aro/aro/Builtins.zig +++ b/lib/compiler/aro/aro/Builtins.zig @@ -1,21 +1,23 @@ const std = @import("std"); + const Compilation = @import("Compilation.zig"); -const Type = @import("Type.zig"); -const TypeDescription = @import("Builtins/TypeDescription.zig"); -const target_util = @import("target.zig"); -const StringId = @import("StringInterner.zig").StringId; const LangOpts = @import("LangOpts.zig"); const Parser = @import("Parser.zig"); +const target_util = @import("target.zig"); +const TypeStore = @import("TypeStore.zig"); +const QualType = TypeStore.QualType; +const Builder = TypeStore.Builder; +const TypeDescription = @import("Builtins/TypeDescription.zig"); const Properties = @import("Builtins/Properties.zig"); pub const Builtin = @import("Builtins/Builtin.zig").with(Properties); const Expanded = struct { - ty: Type, + qt: QualType, builtin: Builtin, }; -const NameToTypeMap = std.StringHashMapUnmanaged(Type); +const NameToTypeMap = std.StringHashMapUnmanaged(QualType); const Builtins = @This(); @@ -25,38 +27,38 @@ pub fn deinit(b: *Builtins, gpa: std.mem.Allocator) void { b._name_to_type_map.deinit(gpa); } -fn specForSize(comp: *const Compilation, size_bits: u32) Type.Builder.Specifier { - var ty = Type{ .specifier = .short }; - if (ty.sizeof(comp).? * 8 == size_bits) return .short; +fn specForSize(comp: *const Compilation, size_bits: u32) TypeStore.Builder.Specifier { + var qt: QualType = .short; + if (qt.bitSizeof(comp) == size_bits) return .short; - ty.specifier = .int; - if (ty.sizeof(comp).? * 8 == size_bits) return .int; + qt = .int; + if (qt.bitSizeof(comp) == size_bits) return .int; - ty.specifier = .long; - if (ty.sizeof(comp).? * 8 == size_bits) return .long; + qt = .long; + if (qt.bitSizeof(comp) == size_bits) return .long; - ty.specifier = .long_long; - if (ty.sizeof(comp).? * 8 == size_bits) return .long_long; + qt = .long_long; + if (qt.bitSizeof(comp) == size_bits) return .long_long; unreachable; } -fn createType(desc: TypeDescription, it: *TypeDescription.TypeIterator, comp: *const Compilation, allocator: std.mem.Allocator) !Type { - var builder: Type.Builder = .{ .error_on_invalid = true }; +fn createType(desc: TypeDescription, it: *TypeDescription.TypeIterator, comp: *Compilation) !QualType { + var parser: Parser = undefined; + parser.comp = comp; + var builder: TypeStore.Builder = .{ .parser = &parser, .error_on_invalid = true }; + var require_native_int32 = false; var require_native_int64 = false; for (desc.prefix) |prefix| { switch (prefix) { - .L => builder.combine(undefined, .long, 0) catch unreachable, - .LL => { - builder.combine(undefined, .long, 0) catch unreachable; - builder.combine(undefined, .long, 0) catch unreachable; - }, + .L => builder.combine(.long, 0) catch unreachable, + .LL => builder.combine(.long_long, 0) catch unreachable, .LLL => { - switch (builder.specifier) { - .none => builder.specifier = .int128, - .signed => builder.specifier = .sint128, - .unsigned => builder.specifier = .uint128, + switch (builder.type) { + .none => builder.type = .int128, + .signed => builder.type = .sint128, + .unsigned => builder.type = .uint128, else => unreachable, } }, @@ -65,239 +67,226 @@ fn createType(desc: TypeDescription, it: *TypeDescription.TypeIterator, comp: *c .N => { std.debug.assert(desc.spec == .i); if (!target_util.isLP64(comp.target)) { - builder.combine(undefined, .long, 0) catch unreachable; + builder.combine(.long, 0) catch unreachable; } }, .O => { - builder.combine(undefined, .long, 0) catch unreachable; + builder.combine(.long, 0) catch unreachable; if (comp.target.os.tag != .opencl) { - builder.combine(undefined, .long, 0) catch unreachable; + builder.combine(.long, 0) catch unreachable; } }, - .S => builder.combine(undefined, .signed, 0) catch unreachable, - .U => builder.combine(undefined, .unsigned, 0) catch unreachable, + .S => builder.combine(.signed, 0) catch unreachable, + .U => builder.combine(.unsigned, 0) catch unreachable, .I => { // Todo: compile-time constant integer }, } } switch (desc.spec) { - .v => builder.combine(undefined, .void, 0) catch unreachable, - .b => builder.combine(undefined, .bool, 0) catch unreachable, - .c => builder.combine(undefined, .char, 0) catch unreachable, - .s => builder.combine(undefined, .short, 0) catch unreachable, + .v => builder.combine(.void, 0) catch unreachable, + .b => builder.combine(.bool, 0) catch unreachable, + .c => builder.combine(.char, 0) catch unreachable, + .s => builder.combine(.short, 0) catch unreachable, .i => { if (require_native_int32) { - builder.specifier = specForSize(comp, 32); + builder.type = specForSize(comp, 32); } else if (require_native_int64) { - builder.specifier = specForSize(comp, 64); + builder.type = specForSize(comp, 64); } else { - switch (builder.specifier) { + switch (builder.type) { .int128, .sint128, .uint128 => {}, - else => builder.combine(undefined, .int, 0) catch unreachable, + else => builder.combine(.int, 0) catch unreachable, } } }, - .h => builder.combine(undefined, .fp16, 0) catch unreachable, - .x => builder.combine(undefined, .float16, 0) catch unreachable, + .h => builder.combine(.fp16, 0) catch unreachable, + .x => builder.combine(.float16, 0) catch unreachable, .y => { // Todo: __bf16 - return .{ .specifier = .invalid }; + return .invalid; }, - .f => builder.combine(undefined, .float, 0) catch unreachable, + .f => builder.combine(.float, 0) catch unreachable, .d => { - if (builder.specifier == .long_long) { - builder.specifier = .float128; + if (builder.type == .long_long) { + builder.type = .float128; } else { - builder.combine(undefined, .double, 0) catch unreachable; + builder.combine(.double, 0) catch unreachable; } }, .z => { - std.debug.assert(builder.specifier == .none); - builder.specifier = Type.Builder.fromType(comp.types.size); + std.debug.assert(builder.type == .none); + builder.type = Builder.fromType(comp, comp.type_store.size); }, .w => { - std.debug.assert(builder.specifier == .none); - builder.specifier = Type.Builder.fromType(comp.types.wchar); + std.debug.assert(builder.type == .none); + builder.type = Builder.fromType(comp, comp.type_store.wchar); }, .F => { - std.debug.assert(builder.specifier == .none); - builder.specifier = Type.Builder.fromType(comp.types.ns_constant_string.ty); + std.debug.assert(builder.type == .none); + builder.type = Builder.fromType(comp, comp.type_store.ns_constant_string); }, .G => { // Todo: id - return .{ .specifier = .invalid }; + return .invalid; }, .H => { // Todo: SEL - return .{ .specifier = .invalid }; + return .invalid; }, .M => { // Todo: struct objc_super - return .{ .specifier = .invalid }; + return .invalid; }, .a => { - std.debug.assert(builder.specifier == .none); + std.debug.assert(builder.type == .none); std.debug.assert(desc.suffix.len == 0); - builder.specifier = Type.Builder.fromType(comp.types.va_list); + builder.type = Builder.fromType(comp, comp.type_store.va_list); }, .A => { - std.debug.assert(builder.specifier == .none); + std.debug.assert(builder.type == .none); std.debug.assert(desc.suffix.len == 0); - var va_list = comp.types.va_list; - if (va_list.isArray()) va_list.decayArray(); - builder.specifier = Type.Builder.fromType(va_list); + var va_list = comp.type_store.va_list; + std.debug.assert(!va_list.is(comp, .array)); + builder.type = Builder.fromType(comp, va_list); }, .V => |element_count| { std.debug.assert(desc.suffix.len == 0); const child_desc = it.next().?; - const child_ty = try createType(child_desc, undefined, comp, allocator); - const arr_ty = try allocator.create(Type.Array); - arr_ty.* = .{ + const elem_qt = try createType(child_desc, undefined, comp); + const vector_qt = try comp.type_store.put(comp.gpa, .{ .vector = .{ + .elem = elem_qt, .len = element_count, - .elem = child_ty, - }; - const vector_ty: Type = .{ .specifier = .vector, .data = .{ .array = arr_ty } }; - builder.specifier = Type.Builder.fromType(vector_ty); + } }); + builder.type = .{ .other = vector_qt }; }, .q => { // Todo: scalable vector - return .{ .specifier = .invalid }; + return .invalid; }, .E => { // Todo: ext_vector (OpenCL vector) - return .{ .specifier = .invalid }; + return .invalid; }, .X => |child| { - builder.combine(undefined, .complex, 0) catch unreachable; + builder.combine(.complex, 0) catch unreachable; switch (child) { - .float => builder.combine(undefined, .float, 0) catch unreachable, - .double => builder.combine(undefined, .double, 0) catch unreachable, + .float => builder.combine(.float, 0) catch unreachable, + .double => builder.combine(.double, 0) catch unreachable, .longdouble => { - builder.combine(undefined, .long, 0) catch unreachable; - builder.combine(undefined, .double, 0) catch unreachable; + builder.combine(.long, 0) catch unreachable; + builder.combine(.double, 0) catch unreachable; }, } }, .Y => { - std.debug.assert(builder.specifier == .none); + std.debug.assert(builder.type == .none); std.debug.assert(desc.suffix.len == 0); - builder.specifier = Type.Builder.fromType(comp.types.ptrdiff); + builder.type = Builder.fromType(comp, comp.type_store.ptrdiff); }, .P => { - std.debug.assert(builder.specifier == .none); - if (comp.types.file.specifier == .invalid) { - return comp.types.file; + std.debug.assert(builder.type == .none); + if (comp.type_store.file.isInvalid()) { + return comp.type_store.file; } - builder.specifier = Type.Builder.fromType(comp.types.file); + builder.type = Builder.fromType(comp, comp.type_store.file); }, .J => { - std.debug.assert(builder.specifier == .none); + std.debug.assert(builder.type == .none); std.debug.assert(desc.suffix.len == 0); - if (comp.types.jmp_buf.specifier == .invalid) { - return comp.types.jmp_buf; + if (comp.type_store.jmp_buf.isInvalid()) { + return comp.type_store.jmp_buf; } - builder.specifier = Type.Builder.fromType(comp.types.jmp_buf); + builder.type = Builder.fromType(comp, comp.type_store.jmp_buf); }, .SJ => { - std.debug.assert(builder.specifier == .none); + std.debug.assert(builder.type == .none); std.debug.assert(desc.suffix.len == 0); - if (comp.types.sigjmp_buf.specifier == .invalid) { - return comp.types.sigjmp_buf; + if (comp.type_store.sigjmp_buf.isInvalid()) { + return comp.type_store.sigjmp_buf; } - builder.specifier = Type.Builder.fromType(comp.types.sigjmp_buf); + builder.type = Builder.fromType(comp, comp.type_store.sigjmp_buf); }, .K => { - std.debug.assert(builder.specifier == .none); - if (comp.types.ucontext_t.specifier == .invalid) { - return comp.types.ucontext_t; + std.debug.assert(builder.type == .none); + if (comp.type_store.ucontext_t.isInvalid()) { + return comp.type_store.ucontext_t; } - builder.specifier = Type.Builder.fromType(comp.types.ucontext_t); + builder.type = Builder.fromType(comp, comp.type_store.ucontext_t); }, .p => { - std.debug.assert(builder.specifier == .none); + std.debug.assert(builder.type == .none); std.debug.assert(desc.suffix.len == 0); - builder.specifier = Type.Builder.fromType(comp.types.pid_t); + builder.type = Builder.fromType(comp, comp.type_store.pid_t); }, - .@"!" => return .{ .specifier = .invalid }, + .@"!" => return .invalid, } for (desc.suffix) |suffix| { switch (suffix) { .@"*" => |address_space| { _ = address_space; // TODO: handle address space - const elem_ty = try allocator.create(Type); - elem_ty.* = builder.finish(undefined) catch unreachable; - const ty = Type{ - .specifier = .pointer, - .data = .{ .sub_type = elem_ty }, - }; - builder.qual = .{}; - builder.specifier = Type.Builder.fromType(ty); + const pointer_qt = try comp.type_store.put(comp.gpa, .{ .pointer = .{ + .child = builder.finish() catch unreachable, + .decayed = null, + } }); + + builder.@"const" = null; + builder.@"volatile" = null; + builder.restrict = null; + builder.type = .{ .other = pointer_qt }; }, - .C => builder.qual.@"const" = 0, - .D => builder.qual.@"volatile" = 0, - .R => builder.qual.restrict = 0, + .C => builder.@"const" = 0, + .D => builder.@"volatile" = 0, + .R => builder.restrict = 0, } } - return builder.finish(undefined) catch unreachable; + return builder.finish() catch unreachable; } -fn createBuiltin(comp: *const Compilation, builtin: Builtin, type_arena: std.mem.Allocator) !Type { +fn createBuiltin(comp: *Compilation, builtin: Builtin) !QualType { var it = TypeDescription.TypeIterator.init(builtin.properties.param_str); const ret_ty_desc = it.next().?; if (ret_ty_desc.spec == .@"!") { // Todo: handle target-dependent definition } - const ret_ty = try createType(ret_ty_desc, &it, comp, type_arena); + const ret_ty = try createType(ret_ty_desc, &it, comp); var param_count: usize = 0; - var params: [Builtin.max_param_count]Type.Func.Param = undefined; + var params: [Builtin.max_param_count]TypeStore.Type.Func.Param = undefined; while (it.next()) |desc| : (param_count += 1) { - params[param_count] = .{ .name_tok = 0, .ty = try createType(desc, &it, comp, type_arena), .name = .empty }; + params[param_count] = .{ .name_tok = 0, .qt = try createType(desc, &it, comp), .name = .empty, .node = .null }; } - const duped_params = try type_arena.dupe(Type.Func.Param, params[0..param_count]); - const func = try type_arena.create(Type.Func); - - func.* = .{ + return comp.type_store.put(comp.gpa, .{ .func = .{ .return_type = ret_ty, - .params = duped_params, - }; - return .{ - .specifier = if (builtin.properties.isVarArgs()) .var_args_func else .func, - .data = .{ .func = func }, - }; + .kind = if (builtin.properties.isVarArgs()) .variadic else .normal, + .params = params[0..param_count], + } }); } /// Asserts that the builtin has already been created pub fn lookup(b: *const Builtins, name: []const u8) Expanded { const builtin = Builtin.fromName(name).?; - const ty = b._name_to_type_map.get(name).?; - return .{ - .builtin = builtin, - .ty = ty, - }; + const qt = b._name_to_type_map.get(name).?; + return .{ .builtin = builtin, .qt = qt }; } -pub fn getOrCreate(b: *Builtins, comp: *Compilation, name: []const u8, type_arena: std.mem.Allocator) !?Expanded { - const ty = b._name_to_type_map.get(name) orelse { +pub fn getOrCreate(b: *Builtins, comp: *Compilation, name: []const u8) !?Expanded { + const qt = b._name_to_type_map.get(name) orelse { const builtin = Builtin.fromName(name) orelse return null; if (!comp.hasBuiltinFunction(builtin)) return null; try b._name_to_type_map.ensureUnusedCapacity(comp.gpa, 1); - const ty = try createBuiltin(comp, builtin, type_arena); - b._name_to_type_map.putAssumeCapacity(name, ty); + const qt = try createBuiltin(comp, builtin); + b._name_to_type_map.putAssumeCapacity(name, qt); return .{ .builtin = builtin, - .ty = ty, + .qt = qt, }; }; const builtin = Builtin.fromName(name).?; - return .{ - .builtin = builtin, - .ty = ty, - }; + return .{ .builtin = builtin, .qt = qt }; } pub const Iterator = struct { @@ -323,12 +312,13 @@ pub const Iterator = struct { }; test Iterator { + const gpa = std.testing.allocator; var it = Iterator{}; - var seen = std.StringHashMap(Builtin).init(std.testing.allocator); - defer seen.deinit(); + var seen: std.StringHashMapUnmanaged(Builtin) = .empty; + defer seen.deinit(gpa); - var arena_state = std.heap.ArenaAllocator.init(std.testing.allocator); + var arena_state = std.heap.ArenaAllocator.init(gpa); defer arena_state.deinit(); const arena = arena_state.allocator(); @@ -344,25 +334,27 @@ test Iterator { std.debug.print("previous data: {}\n", .{seen.get(entry.name).?}); return error.TestExpectedUniqueEntries; } - try seen.put(try arena.dupe(u8, entry.name), entry.builtin); + try seen.put(gpa, try arena.dupe(u8, entry.name), entry.builtin); } try std.testing.expectEqual(@as(usize, Builtin.data.len), seen.count()); } test "All builtins" { - var comp = Compilation.init(std.testing.allocator, std.fs.cwd()); + var arena_state: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena_state.deinit(); + const arena = arena_state.allocator(); + + var comp = Compilation.init(std.testing.allocator, arena, undefined, std.fs.cwd()); defer comp.deinit(); - _ = try comp.generateBuiltinMacros(.include_system_defines); - var arena = std.heap.ArenaAllocator.init(std.testing.allocator); - defer arena.deinit(); - const type_arena = arena.allocator(); + try comp.type_store.initNamedTypes(&comp); + comp.type_store.va_list = try comp.type_store.va_list.decay(&comp); var builtin_it = Iterator{}; while (builtin_it.next()) |entry| { - const name = try type_arena.dupe(u8, entry.name); - if (try comp.builtins.getOrCreate(&comp, name, type_arena)) |func_ty| { - const get_again = (try comp.builtins.getOrCreate(&comp, name, std.testing.failing_allocator)).?; + const name = try arena.dupe(u8, entry.name); + if (try comp.builtins.getOrCreate(&comp, name)) |func_ty| { + const get_again = (try comp.builtins.getOrCreate(&comp, name)).?; const found_by_lookup = comp.builtins.lookup(name); try std.testing.expectEqual(func_ty.builtin.tag, get_again.builtin.tag); try std.testing.expectEqual(func_ty.builtin.tag, found_by_lookup.builtin.tag); @@ -373,19 +365,19 @@ test "All builtins" { test "Allocation failures" { const Test = struct { fn testOne(allocator: std.mem.Allocator) !void { - var comp = Compilation.init(allocator, std.fs.cwd()); + var arena_state: std.heap.ArenaAllocator = .init(allocator); + defer arena_state.deinit(); + const arena = arena_state.allocator(); + + var comp = Compilation.init(allocator, arena, undefined, std.fs.cwd()); defer comp.deinit(); _ = try comp.generateBuiltinMacros(.include_system_defines); - var arena = std.heap.ArenaAllocator.init(comp.gpa); - defer arena.deinit(); - - const type_arena = arena.allocator(); const num_builtins = 40; var builtin_it = Iterator{}; for (0..num_builtins) |_| { const entry = builtin_it.next().?; - _ = try comp.builtins.getOrCreate(&comp, entry.name, type_arena); + _ = try comp.builtins.getOrCreate(&comp, entry.name); } } }; diff --git a/lib/compiler/aro/aro/Builtins/Builtin.zig b/lib/compiler/aro/aro/Builtins/Builtin.zig index 6e5217b4da32..b74eaf192c40 100644 --- a/lib/compiler/aro/aro/Builtins/Builtin.zig +++ b/lib/compiler/aro/aro/Builtins/Builtin.zig @@ -13,7 +13,3998 @@ properties: Properties, /// Integer starting at 0 derived from the unique index, /// corresponds with the data array index. -pub const Tag = enum(u16) { _ }; +pub const Tag = enum(u16) { _Block_object_assign, + _Block_object_dispose, + _Exit, + _InterlockedAnd, + _InterlockedAnd16, + _InterlockedAnd8, + _InterlockedCompareExchange, + _InterlockedCompareExchange16, + _InterlockedCompareExchange64, + _InterlockedCompareExchange8, + _InterlockedCompareExchangePointer, + _InterlockedCompareExchangePointer_nf, + _InterlockedDecrement, + _InterlockedDecrement16, + _InterlockedExchange, + _InterlockedExchange16, + _InterlockedExchange8, + _InterlockedExchangeAdd, + _InterlockedExchangeAdd16, + _InterlockedExchangeAdd8, + _InterlockedExchangePointer, + _InterlockedExchangeSub, + _InterlockedExchangeSub16, + _InterlockedExchangeSub8, + _InterlockedIncrement, + _InterlockedIncrement16, + _InterlockedOr, + _InterlockedOr16, + _InterlockedOr8, + _InterlockedXor, + _InterlockedXor16, + _InterlockedXor8, + _MoveFromCoprocessor, + _MoveFromCoprocessor2, + _MoveToCoprocessor, + _MoveToCoprocessor2, + _ReturnAddress, + __GetExceptionInfo, + __abnormal_termination, + __annotation, + __arithmetic_fence, + __assume, + __atomic_add_fetch, + __atomic_always_lock_free, + __atomic_and_fetch, + __atomic_clear, + __atomic_compare_exchange, + __atomic_compare_exchange_n, + __atomic_exchange, + __atomic_exchange_n, + __atomic_fetch_add, + __atomic_fetch_and, + __atomic_fetch_max, + __atomic_fetch_min, + __atomic_fetch_nand, + __atomic_fetch_or, + __atomic_fetch_sub, + __atomic_fetch_xor, + __atomic_is_lock_free, + __atomic_load, + __atomic_load_n, + __atomic_max_fetch, + __atomic_min_fetch, + __atomic_nand_fetch, + __atomic_or_fetch, + __atomic_signal_fence, + __atomic_store, + __atomic_store_n, + __atomic_sub_fetch, + __atomic_test_and_set, + __atomic_thread_fence, + __atomic_xor_fetch, + __builtin___CFStringMakeConstantString, + __builtin___NSStringMakeConstantString, + __builtin___clear_cache, + __builtin___fprintf_chk, + __builtin___get_unsafe_stack_bottom, + __builtin___get_unsafe_stack_ptr, + __builtin___get_unsafe_stack_start, + __builtin___get_unsafe_stack_top, + __builtin___memccpy_chk, + __builtin___memcpy_chk, + __builtin___memmove_chk, + __builtin___mempcpy_chk, + __builtin___memset_chk, + __builtin___printf_chk, + __builtin___snprintf_chk, + __builtin___sprintf_chk, + __builtin___stpcpy_chk, + __builtin___stpncpy_chk, + __builtin___strcat_chk, + __builtin___strcpy_chk, + __builtin___strlcat_chk, + __builtin___strlcpy_chk, + __builtin___strncat_chk, + __builtin___strncpy_chk, + __builtin___vfprintf_chk, + __builtin___vprintf_chk, + __builtin___vsnprintf_chk, + __builtin___vsprintf_chk, + __builtin_abort, + __builtin_abs, + __builtin_acos, + __builtin_acosf, + __builtin_acosf128, + __builtin_acosh, + __builtin_acoshf, + __builtin_acoshf128, + __builtin_acoshl, + __builtin_acosl, + __builtin_add_overflow, + __builtin_addc, + __builtin_addcb, + __builtin_addcl, + __builtin_addcll, + __builtin_addcs, + __builtin_align_down, + __builtin_align_up, + __builtin_alloca, + __builtin_alloca_uninitialized, + __builtin_alloca_with_align, + __builtin_alloca_with_align_uninitialized, + __builtin_amdgcn_alignbit, + __builtin_amdgcn_alignbyte, + __builtin_amdgcn_atomic_dec32, + __builtin_amdgcn_atomic_dec64, + __builtin_amdgcn_atomic_inc32, + __builtin_amdgcn_atomic_inc64, + __builtin_amdgcn_buffer_wbinvl1, + __builtin_amdgcn_class, + __builtin_amdgcn_classf, + __builtin_amdgcn_cosf, + __builtin_amdgcn_cubeid, + __builtin_amdgcn_cubema, + __builtin_amdgcn_cubesc, + __builtin_amdgcn_cubetc, + __builtin_amdgcn_cvt_pk_i16, + __builtin_amdgcn_cvt_pk_u16, + __builtin_amdgcn_cvt_pk_u8_f32, + __builtin_amdgcn_cvt_pknorm_i16, + __builtin_amdgcn_cvt_pknorm_u16, + __builtin_amdgcn_cvt_pkrtz, + __builtin_amdgcn_dispatch_ptr, + __builtin_amdgcn_div_fixup, + __builtin_amdgcn_div_fixupf, + __builtin_amdgcn_div_fmas, + __builtin_amdgcn_div_fmasf, + __builtin_amdgcn_div_scale, + __builtin_amdgcn_div_scalef, + __builtin_amdgcn_ds_append, + __builtin_amdgcn_ds_bpermute, + __builtin_amdgcn_ds_consume, + __builtin_amdgcn_ds_faddf, + __builtin_amdgcn_ds_fmaxf, + __builtin_amdgcn_ds_fminf, + __builtin_amdgcn_ds_permute, + __builtin_amdgcn_ds_swizzle, + __builtin_amdgcn_endpgm, + __builtin_amdgcn_exp2f, + __builtin_amdgcn_fcmp, + __builtin_amdgcn_fcmpf, + __builtin_amdgcn_fence, + __builtin_amdgcn_fmed3f, + __builtin_amdgcn_fract, + __builtin_amdgcn_fractf, + __builtin_amdgcn_frexp_exp, + __builtin_amdgcn_frexp_expf, + __builtin_amdgcn_frexp_mant, + __builtin_amdgcn_frexp_mantf, + __builtin_amdgcn_grid_size_x, + __builtin_amdgcn_grid_size_y, + __builtin_amdgcn_grid_size_z, + __builtin_amdgcn_groupstaticsize, + __builtin_amdgcn_iglp_opt, + __builtin_amdgcn_implicitarg_ptr, + __builtin_amdgcn_interp_mov, + __builtin_amdgcn_interp_p1, + __builtin_amdgcn_interp_p1_f16, + __builtin_amdgcn_interp_p2, + __builtin_amdgcn_interp_p2_f16, + __builtin_amdgcn_is_private, + __builtin_amdgcn_is_shared, + __builtin_amdgcn_kernarg_segment_ptr, + __builtin_amdgcn_ldexp, + __builtin_amdgcn_ldexpf, + __builtin_amdgcn_lerp, + __builtin_amdgcn_log_clampf, + __builtin_amdgcn_logf, + __builtin_amdgcn_mbcnt_hi, + __builtin_amdgcn_mbcnt_lo, + __builtin_amdgcn_mqsad_pk_u16_u8, + __builtin_amdgcn_mqsad_u32_u8, + __builtin_amdgcn_msad_u8, + __builtin_amdgcn_qsad_pk_u16_u8, + __builtin_amdgcn_queue_ptr, + __builtin_amdgcn_rcp, + __builtin_amdgcn_rcpf, + __builtin_amdgcn_read_exec, + __builtin_amdgcn_read_exec_hi, + __builtin_amdgcn_read_exec_lo, + __builtin_amdgcn_readfirstlane, + __builtin_amdgcn_readlane, + __builtin_amdgcn_rsq, + __builtin_amdgcn_rsq_clamp, + __builtin_amdgcn_rsq_clampf, + __builtin_amdgcn_rsqf, + __builtin_amdgcn_s_barrier, + __builtin_amdgcn_s_dcache_inv, + __builtin_amdgcn_s_decperflevel, + __builtin_amdgcn_s_getpc, + __builtin_amdgcn_s_getreg, + __builtin_amdgcn_s_incperflevel, + __builtin_amdgcn_s_sendmsg, + __builtin_amdgcn_s_sendmsghalt, + __builtin_amdgcn_s_setprio, + __builtin_amdgcn_s_setreg, + __builtin_amdgcn_s_sleep, + __builtin_amdgcn_s_waitcnt, + __builtin_amdgcn_sad_hi_u8, + __builtin_amdgcn_sad_u16, + __builtin_amdgcn_sad_u8, + __builtin_amdgcn_sbfe, + __builtin_amdgcn_sched_barrier, + __builtin_amdgcn_sched_group_barrier, + __builtin_amdgcn_sicmp, + __builtin_amdgcn_sicmpl, + __builtin_amdgcn_sinf, + __builtin_amdgcn_sqrt, + __builtin_amdgcn_sqrtf, + __builtin_amdgcn_trig_preop, + __builtin_amdgcn_trig_preopf, + __builtin_amdgcn_ubfe, + __builtin_amdgcn_uicmp, + __builtin_amdgcn_uicmpl, + __builtin_amdgcn_wave_barrier, + __builtin_amdgcn_workgroup_id_x, + __builtin_amdgcn_workgroup_id_y, + __builtin_amdgcn_workgroup_id_z, + __builtin_amdgcn_workgroup_size_x, + __builtin_amdgcn_workgroup_size_y, + __builtin_amdgcn_workgroup_size_z, + __builtin_amdgcn_workitem_id_x, + __builtin_amdgcn_workitem_id_y, + __builtin_amdgcn_workitem_id_z, + __builtin_annotation, + __builtin_arm_cdp, + __builtin_arm_cdp2, + __builtin_arm_clrex, + __builtin_arm_cls, + __builtin_arm_cls64, + __builtin_arm_clz, + __builtin_arm_clz64, + __builtin_arm_cmse_TT, + __builtin_arm_cmse_TTA, + __builtin_arm_cmse_TTAT, + __builtin_arm_cmse_TTT, + __builtin_arm_dbg, + __builtin_arm_dmb, + __builtin_arm_dsb, + __builtin_arm_get_fpscr, + __builtin_arm_isb, + __builtin_arm_ldaex, + __builtin_arm_ldc, + __builtin_arm_ldc2, + __builtin_arm_ldc2l, + __builtin_arm_ldcl, + __builtin_arm_ldrex, + __builtin_arm_ldrexd, + __builtin_arm_mcr, + __builtin_arm_mcr2, + __builtin_arm_mcrr, + __builtin_arm_mcrr2, + __builtin_arm_mrc, + __builtin_arm_mrc2, + __builtin_arm_mrrc, + __builtin_arm_mrrc2, + __builtin_arm_nop, + __builtin_arm_prefetch, + __builtin_arm_qadd, + __builtin_arm_qadd16, + __builtin_arm_qadd8, + __builtin_arm_qasx, + __builtin_arm_qdbl, + __builtin_arm_qsax, + __builtin_arm_qsub, + __builtin_arm_qsub16, + __builtin_arm_qsub8, + __builtin_arm_rbit, + __builtin_arm_rbit64, + __builtin_arm_rsr, + __builtin_arm_rsr64, + __builtin_arm_rsrp, + __builtin_arm_sadd16, + __builtin_arm_sadd8, + __builtin_arm_sasx, + __builtin_arm_sel, + __builtin_arm_set_fpscr, + __builtin_arm_sev, + __builtin_arm_sevl, + __builtin_arm_shadd16, + __builtin_arm_shadd8, + __builtin_arm_shasx, + __builtin_arm_shsax, + __builtin_arm_shsub16, + __builtin_arm_shsub8, + __builtin_arm_smlabb, + __builtin_arm_smlabt, + __builtin_arm_smlad, + __builtin_arm_smladx, + __builtin_arm_smlald, + __builtin_arm_smlaldx, + __builtin_arm_smlatb, + __builtin_arm_smlatt, + __builtin_arm_smlawb, + __builtin_arm_smlawt, + __builtin_arm_smlsd, + __builtin_arm_smlsdx, + __builtin_arm_smlsld, + __builtin_arm_smlsldx, + __builtin_arm_smuad, + __builtin_arm_smuadx, + __builtin_arm_smulbb, + __builtin_arm_smulbt, + __builtin_arm_smultb, + __builtin_arm_smultt, + __builtin_arm_smulwb, + __builtin_arm_smulwt, + __builtin_arm_smusd, + __builtin_arm_smusdx, + __builtin_arm_ssat, + __builtin_arm_ssat16, + __builtin_arm_ssax, + __builtin_arm_ssub16, + __builtin_arm_ssub8, + __builtin_arm_stc, + __builtin_arm_stc2, + __builtin_arm_stc2l, + __builtin_arm_stcl, + __builtin_arm_stlex, + __builtin_arm_strex, + __builtin_arm_strexd, + __builtin_arm_sxtab16, + __builtin_arm_sxtb16, + __builtin_arm_tcancel, + __builtin_arm_tcommit, + __builtin_arm_tstart, + __builtin_arm_ttest, + __builtin_arm_uadd16, + __builtin_arm_uadd8, + __builtin_arm_uasx, + __builtin_arm_uhadd16, + __builtin_arm_uhadd8, + __builtin_arm_uhasx, + __builtin_arm_uhsax, + __builtin_arm_uhsub16, + __builtin_arm_uhsub8, + __builtin_arm_uqadd16, + __builtin_arm_uqadd8, + __builtin_arm_uqasx, + __builtin_arm_uqsax, + __builtin_arm_uqsub16, + __builtin_arm_uqsub8, + __builtin_arm_usad8, + __builtin_arm_usada8, + __builtin_arm_usat, + __builtin_arm_usat16, + __builtin_arm_usax, + __builtin_arm_usub16, + __builtin_arm_usub8, + __builtin_arm_uxtab16, + __builtin_arm_uxtb16, + __builtin_arm_vcvtr_d, + __builtin_arm_vcvtr_f, + __builtin_arm_wfe, + __builtin_arm_wfi, + __builtin_arm_wsr, + __builtin_arm_wsr64, + __builtin_arm_wsrp, + __builtin_arm_yield, + __builtin_asin, + __builtin_asinf, + __builtin_asinf128, + __builtin_asinh, + __builtin_asinhf, + __builtin_asinhf128, + __builtin_asinhl, + __builtin_asinl, + __builtin_assume, + __builtin_assume_aligned, + __builtin_assume_separate_storage, + __builtin_atan, + __builtin_atan2, + __builtin_atan2f, + __builtin_atan2f128, + __builtin_atan2l, + __builtin_atanf, + __builtin_atanf128, + __builtin_atanh, + __builtin_atanhf, + __builtin_atanhf128, + __builtin_atanhl, + __builtin_atanl, + __builtin_bcmp, + __builtin_bcopy, + __builtin_bitoffsetof, + __builtin_bitrev, + __builtin_bitreverse16, + __builtin_bitreverse32, + __builtin_bitreverse64, + __builtin_bitreverse8, + __builtin_bswap16, + __builtin_bswap32, + __builtin_bswap64, + __builtin_bzero, + __builtin_cabs, + __builtin_cabsf, + __builtin_cabsl, + __builtin_cacos, + __builtin_cacosf, + __builtin_cacosh, + __builtin_cacoshf, + __builtin_cacoshl, + __builtin_cacosl, + __builtin_call_with_static_chain, + __builtin_calloc, + __builtin_canonicalize, + __builtin_canonicalizef, + __builtin_canonicalizef16, + __builtin_canonicalizel, + __builtin_carg, + __builtin_cargf, + __builtin_cargl, + __builtin_casin, + __builtin_casinf, + __builtin_casinh, + __builtin_casinhf, + __builtin_casinhl, + __builtin_casinl, + __builtin_catan, + __builtin_catanf, + __builtin_catanh, + __builtin_catanhf, + __builtin_catanhl, + __builtin_catanl, + __builtin_cbrt, + __builtin_cbrtf, + __builtin_cbrtf128, + __builtin_cbrtl, + __builtin_ccos, + __builtin_ccosf, + __builtin_ccosh, + __builtin_ccoshf, + __builtin_ccoshl, + __builtin_ccosl, + __builtin_ceil, + __builtin_ceilf, + __builtin_ceilf128, + __builtin_ceilf16, + __builtin_ceill, + __builtin_cexp, + __builtin_cexpf, + __builtin_cexpl, + __builtin_char_memchr, + __builtin_choose_expr, + __builtin_cimag, + __builtin_cimagf, + __builtin_cimagl, + __builtin_classify_type, + __builtin_clog, + __builtin_clogf, + __builtin_clogl, + __builtin_clrsb, + __builtin_clrsbl, + __builtin_clrsbll, + __builtin_clz, + __builtin_clzl, + __builtin_clzll, + __builtin_clzs, + __builtin_complex, + __builtin_conj, + __builtin_conjf, + __builtin_conjl, + __builtin_constant_p, + __builtin_convertvector, + __builtin_copysign, + __builtin_copysignf, + __builtin_copysignf128, + __builtin_copysignf16, + __builtin_copysignl, + __builtin_cos, + __builtin_cosf, + __builtin_cosf128, + __builtin_cosf16, + __builtin_cosh, + __builtin_coshf, + __builtin_coshf128, + __builtin_coshl, + __builtin_cosl, + __builtin_cpow, + __builtin_cpowf, + __builtin_cpowl, + __builtin_cproj, + __builtin_cprojf, + __builtin_cprojl, + __builtin_cpu_init, + __builtin_cpu_is, + __builtin_cpu_supports, + __builtin_creal, + __builtin_crealf, + __builtin_creall, + __builtin_csin, + __builtin_csinf, + __builtin_csinh, + __builtin_csinhf, + __builtin_csinhl, + __builtin_csinl, + __builtin_csqrt, + __builtin_csqrtf, + __builtin_csqrtl, + __builtin_ctan, + __builtin_ctanf, + __builtin_ctanh, + __builtin_ctanhf, + __builtin_ctanhl, + __builtin_ctanl, + __builtin_ctz, + __builtin_ctzl, + __builtin_ctzll, + __builtin_ctzs, + __builtin_dcbf, + __builtin_debugtrap, + __builtin_dump_struct, + __builtin_dwarf_cfa, + __builtin_dwarf_sp_column, + __builtin_dynamic_object_size, + __builtin_eh_return, + __builtin_eh_return_data_regno, + __builtin_elementwise_abs, + __builtin_elementwise_add_sat, + __builtin_elementwise_bitreverse, + __builtin_elementwise_canonicalize, + __builtin_elementwise_ceil, + __builtin_elementwise_copysign, + __builtin_elementwise_cos, + __builtin_elementwise_exp, + __builtin_elementwise_exp2, + __builtin_elementwise_floor, + __builtin_elementwise_fma, + __builtin_elementwise_log, + __builtin_elementwise_log10, + __builtin_elementwise_log2, + __builtin_elementwise_max, + __builtin_elementwise_min, + __builtin_elementwise_nearbyint, + __builtin_elementwise_pow, + __builtin_elementwise_rint, + __builtin_elementwise_round, + __builtin_elementwise_roundeven, + __builtin_elementwise_sin, + __builtin_elementwise_sqrt, + __builtin_elementwise_sub_sat, + __builtin_elementwise_trunc, + __builtin_erf, + __builtin_erfc, + __builtin_erfcf, + __builtin_erfcf128, + __builtin_erfcl, + __builtin_erff, + __builtin_erff128, + __builtin_erfl, + __builtin_exp, + __builtin_exp10, + __builtin_exp10f, + __builtin_exp10f128, + __builtin_exp10f16, + __builtin_exp10l, + __builtin_exp2, + __builtin_exp2f, + __builtin_exp2f128, + __builtin_exp2f16, + __builtin_exp2l, + __builtin_expect, + __builtin_expect_with_probability, + __builtin_expf, + __builtin_expf128, + __builtin_expf16, + __builtin_expl, + __builtin_expm1, + __builtin_expm1f, + __builtin_expm1f128, + __builtin_expm1l, + __builtin_extend_pointer, + __builtin_extract_return_addr, + __builtin_fabs, + __builtin_fabsf, + __builtin_fabsf128, + __builtin_fabsf16, + __builtin_fabsl, + __builtin_fdim, + __builtin_fdimf, + __builtin_fdimf128, + __builtin_fdiml, + __builtin_ffs, + __builtin_ffsl, + __builtin_ffsll, + __builtin_floor, + __builtin_floorf, + __builtin_floorf128, + __builtin_floorf16, + __builtin_floorl, + __builtin_flt_rounds, + __builtin_fma, + __builtin_fmaf, + __builtin_fmaf128, + __builtin_fmaf16, + __builtin_fmal, + __builtin_fmax, + __builtin_fmaxf, + __builtin_fmaxf128, + __builtin_fmaxf16, + __builtin_fmaxl, + __builtin_fmin, + __builtin_fminf, + __builtin_fminf128, + __builtin_fminf16, + __builtin_fminl, + __builtin_fmod, + __builtin_fmodf, + __builtin_fmodf128, + __builtin_fmodf16, + __builtin_fmodl, + __builtin_fpclassify, + __builtin_fprintf, + __builtin_frame_address, + __builtin_free, + __builtin_frexp, + __builtin_frexpf, + __builtin_frexpf128, + __builtin_frexpf16, + __builtin_frexpl, + __builtin_frob_return_addr, + __builtin_fscanf, + __builtin_getid, + __builtin_getps, + __builtin_huge_val, + __builtin_huge_valf, + __builtin_huge_valf128, + __builtin_huge_valf16, + __builtin_huge_vall, + __builtin_hypot, + __builtin_hypotf, + __builtin_hypotf128, + __builtin_hypotl, + __builtin_ia32_rdpmc, + __builtin_ia32_rdtsc, + __builtin_ia32_rdtscp, + __builtin_ilogb, + __builtin_ilogbf, + __builtin_ilogbf128, + __builtin_ilogbl, + __builtin_index, + __builtin_inf, + __builtin_inff, + __builtin_inff128, + __builtin_inff16, + __builtin_infl, + __builtin_init_dwarf_reg_size_table, + __builtin_is_aligned, + __builtin_isfinite, + __builtin_isfpclass, + __builtin_isgreater, + __builtin_isgreaterequal, + __builtin_isinf, + __builtin_isinf_sign, + __builtin_isless, + __builtin_islessequal, + __builtin_islessgreater, + __builtin_isnan, + __builtin_isnormal, + __builtin_isunordered, + __builtin_labs, + __builtin_launder, + __builtin_ldexp, + __builtin_ldexpf, + __builtin_ldexpf128, + __builtin_ldexpf16, + __builtin_ldexpl, + __builtin_lgamma, + __builtin_lgammaf, + __builtin_lgammaf128, + __builtin_lgammal, + __builtin_llabs, + __builtin_llrint, + __builtin_llrintf, + __builtin_llrintf128, + __builtin_llrintl, + __builtin_llround, + __builtin_llroundf, + __builtin_llroundf128, + __builtin_llroundl, + __builtin_log, + __builtin_log10, + __builtin_log10f, + __builtin_log10f128, + __builtin_log10f16, + __builtin_log10l, + __builtin_log1p, + __builtin_log1pf, + __builtin_log1pf128, + __builtin_log1pl, + __builtin_log2, + __builtin_log2f, + __builtin_log2f128, + __builtin_log2f16, + __builtin_log2l, + __builtin_logb, + __builtin_logbf, + __builtin_logbf128, + __builtin_logbl, + __builtin_logf, + __builtin_logf128, + __builtin_logf16, + __builtin_logl, + __builtin_longjmp, + __builtin_lrint, + __builtin_lrintf, + __builtin_lrintf128, + __builtin_lrintl, + __builtin_lround, + __builtin_lroundf, + __builtin_lroundf128, + __builtin_lroundl, + __builtin_malloc, + __builtin_matrix_column_major_load, + __builtin_matrix_column_major_store, + __builtin_matrix_transpose, + __builtin_memchr, + __builtin_memcmp, + __builtin_memcpy, + __builtin_memcpy_inline, + __builtin_memmove, + __builtin_mempcpy, + __builtin_memset, + __builtin_memset_inline, + __builtin_mips_absq_s_ph, + __builtin_mips_absq_s_qb, + __builtin_mips_absq_s_w, + __builtin_mips_addq_ph, + __builtin_mips_addq_s_ph, + __builtin_mips_addq_s_w, + __builtin_mips_addqh_ph, + __builtin_mips_addqh_r_ph, + __builtin_mips_addqh_r_w, + __builtin_mips_addqh_w, + __builtin_mips_addsc, + __builtin_mips_addu_ph, + __builtin_mips_addu_qb, + __builtin_mips_addu_s_ph, + __builtin_mips_addu_s_qb, + __builtin_mips_adduh_qb, + __builtin_mips_adduh_r_qb, + __builtin_mips_addwc, + __builtin_mips_append, + __builtin_mips_balign, + __builtin_mips_bitrev, + __builtin_mips_bposge32, + __builtin_mips_cmp_eq_ph, + __builtin_mips_cmp_le_ph, + __builtin_mips_cmp_lt_ph, + __builtin_mips_cmpgdu_eq_qb, + __builtin_mips_cmpgdu_le_qb, + __builtin_mips_cmpgdu_lt_qb, + __builtin_mips_cmpgu_eq_qb, + __builtin_mips_cmpgu_le_qb, + __builtin_mips_cmpgu_lt_qb, + __builtin_mips_cmpu_eq_qb, + __builtin_mips_cmpu_le_qb, + __builtin_mips_cmpu_lt_qb, + __builtin_mips_dpa_w_ph, + __builtin_mips_dpaq_s_w_ph, + __builtin_mips_dpaq_sa_l_w, + __builtin_mips_dpaqx_s_w_ph, + __builtin_mips_dpaqx_sa_w_ph, + __builtin_mips_dpau_h_qbl, + __builtin_mips_dpau_h_qbr, + __builtin_mips_dpax_w_ph, + __builtin_mips_dps_w_ph, + __builtin_mips_dpsq_s_w_ph, + __builtin_mips_dpsq_sa_l_w, + __builtin_mips_dpsqx_s_w_ph, + __builtin_mips_dpsqx_sa_w_ph, + __builtin_mips_dpsu_h_qbl, + __builtin_mips_dpsu_h_qbr, + __builtin_mips_dpsx_w_ph, + __builtin_mips_extp, + __builtin_mips_extpdp, + __builtin_mips_extr_r_w, + __builtin_mips_extr_rs_w, + __builtin_mips_extr_s_h, + __builtin_mips_extr_w, + __builtin_mips_insv, + __builtin_mips_lbux, + __builtin_mips_lhx, + __builtin_mips_lwx, + __builtin_mips_madd, + __builtin_mips_maddu, + __builtin_mips_maq_s_w_phl, + __builtin_mips_maq_s_w_phr, + __builtin_mips_maq_sa_w_phl, + __builtin_mips_maq_sa_w_phr, + __builtin_mips_modsub, + __builtin_mips_msub, + __builtin_mips_msubu, + __builtin_mips_mthlip, + __builtin_mips_mul_ph, + __builtin_mips_mul_s_ph, + __builtin_mips_muleq_s_w_phl, + __builtin_mips_muleq_s_w_phr, + __builtin_mips_muleu_s_ph_qbl, + __builtin_mips_muleu_s_ph_qbr, + __builtin_mips_mulq_rs_ph, + __builtin_mips_mulq_rs_w, + __builtin_mips_mulq_s_ph, + __builtin_mips_mulq_s_w, + __builtin_mips_mulsa_w_ph, + __builtin_mips_mulsaq_s_w_ph, + __builtin_mips_mult, + __builtin_mips_multu, + __builtin_mips_packrl_ph, + __builtin_mips_pick_ph, + __builtin_mips_pick_qb, + __builtin_mips_preceq_w_phl, + __builtin_mips_preceq_w_phr, + __builtin_mips_precequ_ph_qbl, + __builtin_mips_precequ_ph_qbla, + __builtin_mips_precequ_ph_qbr, + __builtin_mips_precequ_ph_qbra, + __builtin_mips_preceu_ph_qbl, + __builtin_mips_preceu_ph_qbla, + __builtin_mips_preceu_ph_qbr, + __builtin_mips_preceu_ph_qbra, + __builtin_mips_precr_qb_ph, + __builtin_mips_precr_sra_ph_w, + __builtin_mips_precr_sra_r_ph_w, + __builtin_mips_precrq_ph_w, + __builtin_mips_precrq_qb_ph, + __builtin_mips_precrq_rs_ph_w, + __builtin_mips_precrqu_s_qb_ph, + __builtin_mips_prepend, + __builtin_mips_raddu_w_qb, + __builtin_mips_rddsp, + __builtin_mips_repl_ph, + __builtin_mips_repl_qb, + __builtin_mips_shilo, + __builtin_mips_shll_ph, + __builtin_mips_shll_qb, + __builtin_mips_shll_s_ph, + __builtin_mips_shll_s_w, + __builtin_mips_shra_ph, + __builtin_mips_shra_qb, + __builtin_mips_shra_r_ph, + __builtin_mips_shra_r_qb, + __builtin_mips_shra_r_w, + __builtin_mips_shrl_ph, + __builtin_mips_shrl_qb, + __builtin_mips_subq_ph, + __builtin_mips_subq_s_ph, + __builtin_mips_subq_s_w, + __builtin_mips_subqh_ph, + __builtin_mips_subqh_r_ph, + __builtin_mips_subqh_r_w, + __builtin_mips_subqh_w, + __builtin_mips_subu_ph, + __builtin_mips_subu_qb, + __builtin_mips_subu_s_ph, + __builtin_mips_subu_s_qb, + __builtin_mips_subuh_qb, + __builtin_mips_subuh_r_qb, + __builtin_mips_wrdsp, + __builtin_modf, + __builtin_modff, + __builtin_modff128, + __builtin_modfl, + __builtin_msa_add_a_b, + __builtin_msa_add_a_d, + __builtin_msa_add_a_h, + __builtin_msa_add_a_w, + __builtin_msa_adds_a_b, + __builtin_msa_adds_a_d, + __builtin_msa_adds_a_h, + __builtin_msa_adds_a_w, + __builtin_msa_adds_s_b, + __builtin_msa_adds_s_d, + __builtin_msa_adds_s_h, + __builtin_msa_adds_s_w, + __builtin_msa_adds_u_b, + __builtin_msa_adds_u_d, + __builtin_msa_adds_u_h, + __builtin_msa_adds_u_w, + __builtin_msa_addv_b, + __builtin_msa_addv_d, + __builtin_msa_addv_h, + __builtin_msa_addv_w, + __builtin_msa_addvi_b, + __builtin_msa_addvi_d, + __builtin_msa_addvi_h, + __builtin_msa_addvi_w, + __builtin_msa_and_v, + __builtin_msa_andi_b, + __builtin_msa_asub_s_b, + __builtin_msa_asub_s_d, + __builtin_msa_asub_s_h, + __builtin_msa_asub_s_w, + __builtin_msa_asub_u_b, + __builtin_msa_asub_u_d, + __builtin_msa_asub_u_h, + __builtin_msa_asub_u_w, + __builtin_msa_ave_s_b, + __builtin_msa_ave_s_d, + __builtin_msa_ave_s_h, + __builtin_msa_ave_s_w, + __builtin_msa_ave_u_b, + __builtin_msa_ave_u_d, + __builtin_msa_ave_u_h, + __builtin_msa_ave_u_w, + __builtin_msa_aver_s_b, + __builtin_msa_aver_s_d, + __builtin_msa_aver_s_h, + __builtin_msa_aver_s_w, + __builtin_msa_aver_u_b, + __builtin_msa_aver_u_d, + __builtin_msa_aver_u_h, + __builtin_msa_aver_u_w, + __builtin_msa_bclr_b, + __builtin_msa_bclr_d, + __builtin_msa_bclr_h, + __builtin_msa_bclr_w, + __builtin_msa_bclri_b, + __builtin_msa_bclri_d, + __builtin_msa_bclri_h, + __builtin_msa_bclri_w, + __builtin_msa_binsl_b, + __builtin_msa_binsl_d, + __builtin_msa_binsl_h, + __builtin_msa_binsl_w, + __builtin_msa_binsli_b, + __builtin_msa_binsli_d, + __builtin_msa_binsli_h, + __builtin_msa_binsli_w, + __builtin_msa_binsr_b, + __builtin_msa_binsr_d, + __builtin_msa_binsr_h, + __builtin_msa_binsr_w, + __builtin_msa_binsri_b, + __builtin_msa_binsri_d, + __builtin_msa_binsri_h, + __builtin_msa_binsri_w, + __builtin_msa_bmnz_v, + __builtin_msa_bmnzi_b, + __builtin_msa_bmz_v, + __builtin_msa_bmzi_b, + __builtin_msa_bneg_b, + __builtin_msa_bneg_d, + __builtin_msa_bneg_h, + __builtin_msa_bneg_w, + __builtin_msa_bnegi_b, + __builtin_msa_bnegi_d, + __builtin_msa_bnegi_h, + __builtin_msa_bnegi_w, + __builtin_msa_bnz_b, + __builtin_msa_bnz_d, + __builtin_msa_bnz_h, + __builtin_msa_bnz_v, + __builtin_msa_bnz_w, + __builtin_msa_bsel_v, + __builtin_msa_bseli_b, + __builtin_msa_bset_b, + __builtin_msa_bset_d, + __builtin_msa_bset_h, + __builtin_msa_bset_w, + __builtin_msa_bseti_b, + __builtin_msa_bseti_d, + __builtin_msa_bseti_h, + __builtin_msa_bseti_w, + __builtin_msa_bz_b, + __builtin_msa_bz_d, + __builtin_msa_bz_h, + __builtin_msa_bz_v, + __builtin_msa_bz_w, + __builtin_msa_ceq_b, + __builtin_msa_ceq_d, + __builtin_msa_ceq_h, + __builtin_msa_ceq_w, + __builtin_msa_ceqi_b, + __builtin_msa_ceqi_d, + __builtin_msa_ceqi_h, + __builtin_msa_ceqi_w, + __builtin_msa_cfcmsa, + __builtin_msa_cle_s_b, + __builtin_msa_cle_s_d, + __builtin_msa_cle_s_h, + __builtin_msa_cle_s_w, + __builtin_msa_cle_u_b, + __builtin_msa_cle_u_d, + __builtin_msa_cle_u_h, + __builtin_msa_cle_u_w, + __builtin_msa_clei_s_b, + __builtin_msa_clei_s_d, + __builtin_msa_clei_s_h, + __builtin_msa_clei_s_w, + __builtin_msa_clei_u_b, + __builtin_msa_clei_u_d, + __builtin_msa_clei_u_h, + __builtin_msa_clei_u_w, + __builtin_msa_clt_s_b, + __builtin_msa_clt_s_d, + __builtin_msa_clt_s_h, + __builtin_msa_clt_s_w, + __builtin_msa_clt_u_b, + __builtin_msa_clt_u_d, + __builtin_msa_clt_u_h, + __builtin_msa_clt_u_w, + __builtin_msa_clti_s_b, + __builtin_msa_clti_s_d, + __builtin_msa_clti_s_h, + __builtin_msa_clti_s_w, + __builtin_msa_clti_u_b, + __builtin_msa_clti_u_d, + __builtin_msa_clti_u_h, + __builtin_msa_clti_u_w, + __builtin_msa_copy_s_b, + __builtin_msa_copy_s_d, + __builtin_msa_copy_s_h, + __builtin_msa_copy_s_w, + __builtin_msa_copy_u_b, + __builtin_msa_copy_u_d, + __builtin_msa_copy_u_h, + __builtin_msa_copy_u_w, + __builtin_msa_ctcmsa, + __builtin_msa_div_s_b, + __builtin_msa_div_s_d, + __builtin_msa_div_s_h, + __builtin_msa_div_s_w, + __builtin_msa_div_u_b, + __builtin_msa_div_u_d, + __builtin_msa_div_u_h, + __builtin_msa_div_u_w, + __builtin_msa_dotp_s_d, + __builtin_msa_dotp_s_h, + __builtin_msa_dotp_s_w, + __builtin_msa_dotp_u_d, + __builtin_msa_dotp_u_h, + __builtin_msa_dotp_u_w, + __builtin_msa_dpadd_s_d, + __builtin_msa_dpadd_s_h, + __builtin_msa_dpadd_s_w, + __builtin_msa_dpadd_u_d, + __builtin_msa_dpadd_u_h, + __builtin_msa_dpadd_u_w, + __builtin_msa_dpsub_s_d, + __builtin_msa_dpsub_s_h, + __builtin_msa_dpsub_s_w, + __builtin_msa_dpsub_u_d, + __builtin_msa_dpsub_u_h, + __builtin_msa_dpsub_u_w, + __builtin_msa_fadd_d, + __builtin_msa_fadd_w, + __builtin_msa_fcaf_d, + __builtin_msa_fcaf_w, + __builtin_msa_fceq_d, + __builtin_msa_fceq_w, + __builtin_msa_fclass_d, + __builtin_msa_fclass_w, + __builtin_msa_fcle_d, + __builtin_msa_fcle_w, + __builtin_msa_fclt_d, + __builtin_msa_fclt_w, + __builtin_msa_fcne_d, + __builtin_msa_fcne_w, + __builtin_msa_fcor_d, + __builtin_msa_fcor_w, + __builtin_msa_fcueq_d, + __builtin_msa_fcueq_w, + __builtin_msa_fcule_d, + __builtin_msa_fcule_w, + __builtin_msa_fcult_d, + __builtin_msa_fcult_w, + __builtin_msa_fcun_d, + __builtin_msa_fcun_w, + __builtin_msa_fcune_d, + __builtin_msa_fcune_w, + __builtin_msa_fdiv_d, + __builtin_msa_fdiv_w, + __builtin_msa_fexdo_h, + __builtin_msa_fexdo_w, + __builtin_msa_fexp2_d, + __builtin_msa_fexp2_w, + __builtin_msa_fexupl_d, + __builtin_msa_fexupl_w, + __builtin_msa_fexupr_d, + __builtin_msa_fexupr_w, + __builtin_msa_ffint_s_d, + __builtin_msa_ffint_s_w, + __builtin_msa_ffint_u_d, + __builtin_msa_ffint_u_w, + __builtin_msa_ffql_d, + __builtin_msa_ffql_w, + __builtin_msa_ffqr_d, + __builtin_msa_ffqr_w, + __builtin_msa_fill_b, + __builtin_msa_fill_d, + __builtin_msa_fill_h, + __builtin_msa_fill_w, + __builtin_msa_flog2_d, + __builtin_msa_flog2_w, + __builtin_msa_fmadd_d, + __builtin_msa_fmadd_w, + __builtin_msa_fmax_a_d, + __builtin_msa_fmax_a_w, + __builtin_msa_fmax_d, + __builtin_msa_fmax_w, + __builtin_msa_fmin_a_d, + __builtin_msa_fmin_a_w, + __builtin_msa_fmin_d, + __builtin_msa_fmin_w, + __builtin_msa_fmsub_d, + __builtin_msa_fmsub_w, + __builtin_msa_fmul_d, + __builtin_msa_fmul_w, + __builtin_msa_frcp_d, + __builtin_msa_frcp_w, + __builtin_msa_frint_d, + __builtin_msa_frint_w, + __builtin_msa_frsqrt_d, + __builtin_msa_frsqrt_w, + __builtin_msa_fsaf_d, + __builtin_msa_fsaf_w, + __builtin_msa_fseq_d, + __builtin_msa_fseq_w, + __builtin_msa_fsle_d, + __builtin_msa_fsle_w, + __builtin_msa_fslt_d, + __builtin_msa_fslt_w, + __builtin_msa_fsne_d, + __builtin_msa_fsne_w, + __builtin_msa_fsor_d, + __builtin_msa_fsor_w, + __builtin_msa_fsqrt_d, + __builtin_msa_fsqrt_w, + __builtin_msa_fsub_d, + __builtin_msa_fsub_w, + __builtin_msa_fsueq_d, + __builtin_msa_fsueq_w, + __builtin_msa_fsule_d, + __builtin_msa_fsule_w, + __builtin_msa_fsult_d, + __builtin_msa_fsult_w, + __builtin_msa_fsun_d, + __builtin_msa_fsun_w, + __builtin_msa_fsune_d, + __builtin_msa_fsune_w, + __builtin_msa_ftint_s_d, + __builtin_msa_ftint_s_w, + __builtin_msa_ftint_u_d, + __builtin_msa_ftint_u_w, + __builtin_msa_ftq_h, + __builtin_msa_ftq_w, + __builtin_msa_ftrunc_s_d, + __builtin_msa_ftrunc_s_w, + __builtin_msa_ftrunc_u_d, + __builtin_msa_ftrunc_u_w, + __builtin_msa_hadd_s_d, + __builtin_msa_hadd_s_h, + __builtin_msa_hadd_s_w, + __builtin_msa_hadd_u_d, + __builtin_msa_hadd_u_h, + __builtin_msa_hadd_u_w, + __builtin_msa_hsub_s_d, + __builtin_msa_hsub_s_h, + __builtin_msa_hsub_s_w, + __builtin_msa_hsub_u_d, + __builtin_msa_hsub_u_h, + __builtin_msa_hsub_u_w, + __builtin_msa_ilvev_b, + __builtin_msa_ilvev_d, + __builtin_msa_ilvev_h, + __builtin_msa_ilvev_w, + __builtin_msa_ilvl_b, + __builtin_msa_ilvl_d, + __builtin_msa_ilvl_h, + __builtin_msa_ilvl_w, + __builtin_msa_ilvod_b, + __builtin_msa_ilvod_d, + __builtin_msa_ilvod_h, + __builtin_msa_ilvod_w, + __builtin_msa_ilvr_b, + __builtin_msa_ilvr_d, + __builtin_msa_ilvr_h, + __builtin_msa_ilvr_w, + __builtin_msa_insert_b, + __builtin_msa_insert_d, + __builtin_msa_insert_h, + __builtin_msa_insert_w, + __builtin_msa_insve_b, + __builtin_msa_insve_d, + __builtin_msa_insve_h, + __builtin_msa_insve_w, + __builtin_msa_ld_b, + __builtin_msa_ld_d, + __builtin_msa_ld_h, + __builtin_msa_ld_w, + __builtin_msa_ldi_b, + __builtin_msa_ldi_d, + __builtin_msa_ldi_h, + __builtin_msa_ldi_w, + __builtin_msa_ldr_d, + __builtin_msa_ldr_w, + __builtin_msa_madd_q_h, + __builtin_msa_madd_q_w, + __builtin_msa_maddr_q_h, + __builtin_msa_maddr_q_w, + __builtin_msa_maddv_b, + __builtin_msa_maddv_d, + __builtin_msa_maddv_h, + __builtin_msa_maddv_w, + __builtin_msa_max_a_b, + __builtin_msa_max_a_d, + __builtin_msa_max_a_h, + __builtin_msa_max_a_w, + __builtin_msa_max_s_b, + __builtin_msa_max_s_d, + __builtin_msa_max_s_h, + __builtin_msa_max_s_w, + __builtin_msa_max_u_b, + __builtin_msa_max_u_d, + __builtin_msa_max_u_h, + __builtin_msa_max_u_w, + __builtin_msa_maxi_s_b, + __builtin_msa_maxi_s_d, + __builtin_msa_maxi_s_h, + __builtin_msa_maxi_s_w, + __builtin_msa_maxi_u_b, + __builtin_msa_maxi_u_d, + __builtin_msa_maxi_u_h, + __builtin_msa_maxi_u_w, + __builtin_msa_min_a_b, + __builtin_msa_min_a_d, + __builtin_msa_min_a_h, + __builtin_msa_min_a_w, + __builtin_msa_min_s_b, + __builtin_msa_min_s_d, + __builtin_msa_min_s_h, + __builtin_msa_min_s_w, + __builtin_msa_min_u_b, + __builtin_msa_min_u_d, + __builtin_msa_min_u_h, + __builtin_msa_min_u_w, + __builtin_msa_mini_s_b, + __builtin_msa_mini_s_d, + __builtin_msa_mini_s_h, + __builtin_msa_mini_s_w, + __builtin_msa_mini_u_b, + __builtin_msa_mini_u_d, + __builtin_msa_mini_u_h, + __builtin_msa_mini_u_w, + __builtin_msa_mod_s_b, + __builtin_msa_mod_s_d, + __builtin_msa_mod_s_h, + __builtin_msa_mod_s_w, + __builtin_msa_mod_u_b, + __builtin_msa_mod_u_d, + __builtin_msa_mod_u_h, + __builtin_msa_mod_u_w, + __builtin_msa_move_v, + __builtin_msa_msub_q_h, + __builtin_msa_msub_q_w, + __builtin_msa_msubr_q_h, + __builtin_msa_msubr_q_w, + __builtin_msa_msubv_b, + __builtin_msa_msubv_d, + __builtin_msa_msubv_h, + __builtin_msa_msubv_w, + __builtin_msa_mul_q_h, + __builtin_msa_mul_q_w, + __builtin_msa_mulr_q_h, + __builtin_msa_mulr_q_w, + __builtin_msa_mulv_b, + __builtin_msa_mulv_d, + __builtin_msa_mulv_h, + __builtin_msa_mulv_w, + __builtin_msa_nloc_b, + __builtin_msa_nloc_d, + __builtin_msa_nloc_h, + __builtin_msa_nloc_w, + __builtin_msa_nlzc_b, + __builtin_msa_nlzc_d, + __builtin_msa_nlzc_h, + __builtin_msa_nlzc_w, + __builtin_msa_nor_v, + __builtin_msa_nori_b, + __builtin_msa_or_v, + __builtin_msa_ori_b, + __builtin_msa_pckev_b, + __builtin_msa_pckev_d, + __builtin_msa_pckev_h, + __builtin_msa_pckev_w, + __builtin_msa_pckod_b, + __builtin_msa_pckod_d, + __builtin_msa_pckod_h, + __builtin_msa_pckod_w, + __builtin_msa_pcnt_b, + __builtin_msa_pcnt_d, + __builtin_msa_pcnt_h, + __builtin_msa_pcnt_w, + __builtin_msa_sat_s_b, + __builtin_msa_sat_s_d, + __builtin_msa_sat_s_h, + __builtin_msa_sat_s_w, + __builtin_msa_sat_u_b, + __builtin_msa_sat_u_d, + __builtin_msa_sat_u_h, + __builtin_msa_sat_u_w, + __builtin_msa_shf_b, + __builtin_msa_shf_h, + __builtin_msa_shf_w, + __builtin_msa_sld_b, + __builtin_msa_sld_d, + __builtin_msa_sld_h, + __builtin_msa_sld_w, + __builtin_msa_sldi_b, + __builtin_msa_sldi_d, + __builtin_msa_sldi_h, + __builtin_msa_sldi_w, + __builtin_msa_sll_b, + __builtin_msa_sll_d, + __builtin_msa_sll_h, + __builtin_msa_sll_w, + __builtin_msa_slli_b, + __builtin_msa_slli_d, + __builtin_msa_slli_h, + __builtin_msa_slli_w, + __builtin_msa_splat_b, + __builtin_msa_splat_d, + __builtin_msa_splat_h, + __builtin_msa_splat_w, + __builtin_msa_splati_b, + __builtin_msa_splati_d, + __builtin_msa_splati_h, + __builtin_msa_splati_w, + __builtin_msa_sra_b, + __builtin_msa_sra_d, + __builtin_msa_sra_h, + __builtin_msa_sra_w, + __builtin_msa_srai_b, + __builtin_msa_srai_d, + __builtin_msa_srai_h, + __builtin_msa_srai_w, + __builtin_msa_srar_b, + __builtin_msa_srar_d, + __builtin_msa_srar_h, + __builtin_msa_srar_w, + __builtin_msa_srari_b, + __builtin_msa_srari_d, + __builtin_msa_srari_h, + __builtin_msa_srari_w, + __builtin_msa_srl_b, + __builtin_msa_srl_d, + __builtin_msa_srl_h, + __builtin_msa_srl_w, + __builtin_msa_srli_b, + __builtin_msa_srli_d, + __builtin_msa_srli_h, + __builtin_msa_srli_w, + __builtin_msa_srlr_b, + __builtin_msa_srlr_d, + __builtin_msa_srlr_h, + __builtin_msa_srlr_w, + __builtin_msa_srlri_b, + __builtin_msa_srlri_d, + __builtin_msa_srlri_h, + __builtin_msa_srlri_w, + __builtin_msa_st_b, + __builtin_msa_st_d, + __builtin_msa_st_h, + __builtin_msa_st_w, + __builtin_msa_str_d, + __builtin_msa_str_w, + __builtin_msa_subs_s_b, + __builtin_msa_subs_s_d, + __builtin_msa_subs_s_h, + __builtin_msa_subs_s_w, + __builtin_msa_subs_u_b, + __builtin_msa_subs_u_d, + __builtin_msa_subs_u_h, + __builtin_msa_subs_u_w, + __builtin_msa_subsus_u_b, + __builtin_msa_subsus_u_d, + __builtin_msa_subsus_u_h, + __builtin_msa_subsus_u_w, + __builtin_msa_subsuu_s_b, + __builtin_msa_subsuu_s_d, + __builtin_msa_subsuu_s_h, + __builtin_msa_subsuu_s_w, + __builtin_msa_subv_b, + __builtin_msa_subv_d, + __builtin_msa_subv_h, + __builtin_msa_subv_w, + __builtin_msa_subvi_b, + __builtin_msa_subvi_d, + __builtin_msa_subvi_h, + __builtin_msa_subvi_w, + __builtin_msa_vshf_b, + __builtin_msa_vshf_d, + __builtin_msa_vshf_h, + __builtin_msa_vshf_w, + __builtin_msa_xor_v, + __builtin_msa_xori_b, + __builtin_mul_overflow, + __builtin_nan, + __builtin_nanf, + __builtin_nanf128, + __builtin_nanf16, + __builtin_nanl, + __builtin_nans, + __builtin_nansf, + __builtin_nansf128, + __builtin_nansf16, + __builtin_nansl, + __builtin_nearbyint, + __builtin_nearbyintf, + __builtin_nearbyintf128, + __builtin_nearbyintl, + __builtin_nextafter, + __builtin_nextafterf, + __builtin_nextafterf128, + __builtin_nextafterl, + __builtin_nexttoward, + __builtin_nexttowardf, + __builtin_nexttowardf128, + __builtin_nexttowardl, + __builtin_nondeterministic_value, + __builtin_nontemporal_load, + __builtin_nontemporal_store, + __builtin_objc_memmove_collectable, + __builtin_object_size, + __builtin_offsetof, + __builtin_operator_delete, + __builtin_operator_new, + __builtin_os_log_format, + __builtin_os_log_format_buffer_size, + __builtin_pack_longdouble, + __builtin_parity, + __builtin_parityl, + __builtin_parityll, + __builtin_popcount, + __builtin_popcountl, + __builtin_popcountll, + __builtin_pow, + __builtin_powf, + __builtin_powf128, + __builtin_powf16, + __builtin_powi, + __builtin_powif, + __builtin_powil, + __builtin_powl, + __builtin_ppc_alignx, + __builtin_ppc_cmpb, + __builtin_ppc_compare_and_swap, + __builtin_ppc_compare_and_swaplp, + __builtin_ppc_dcbfl, + __builtin_ppc_dcbflp, + __builtin_ppc_dcbst, + __builtin_ppc_dcbt, + __builtin_ppc_dcbtst, + __builtin_ppc_dcbtstt, + __builtin_ppc_dcbtt, + __builtin_ppc_dcbz, + __builtin_ppc_eieio, + __builtin_ppc_fcfid, + __builtin_ppc_fcfud, + __builtin_ppc_fctid, + __builtin_ppc_fctidz, + __builtin_ppc_fctiw, + __builtin_ppc_fctiwz, + __builtin_ppc_fctudz, + __builtin_ppc_fctuwz, + __builtin_ppc_fetch_and_add, + __builtin_ppc_fetch_and_addlp, + __builtin_ppc_fetch_and_and, + __builtin_ppc_fetch_and_andlp, + __builtin_ppc_fetch_and_or, + __builtin_ppc_fetch_and_orlp, + __builtin_ppc_fetch_and_swap, + __builtin_ppc_fetch_and_swaplp, + __builtin_ppc_fmsub, + __builtin_ppc_fmsubs, + __builtin_ppc_fnabs, + __builtin_ppc_fnabss, + __builtin_ppc_fnmadd, + __builtin_ppc_fnmadds, + __builtin_ppc_fnmsub, + __builtin_ppc_fnmsubs, + __builtin_ppc_fre, + __builtin_ppc_fres, + __builtin_ppc_fric, + __builtin_ppc_frim, + __builtin_ppc_frims, + __builtin_ppc_frin, + __builtin_ppc_frins, + __builtin_ppc_frip, + __builtin_ppc_frips, + __builtin_ppc_friz, + __builtin_ppc_frizs, + __builtin_ppc_frsqrte, + __builtin_ppc_frsqrtes, + __builtin_ppc_fsel, + __builtin_ppc_fsels, + __builtin_ppc_fsqrt, + __builtin_ppc_fsqrts, + __builtin_ppc_get_timebase, + __builtin_ppc_iospace_eieio, + __builtin_ppc_iospace_lwsync, + __builtin_ppc_iospace_sync, + __builtin_ppc_isync, + __builtin_ppc_ldarx, + __builtin_ppc_load2r, + __builtin_ppc_load4r, + __builtin_ppc_lwarx, + __builtin_ppc_lwsync, + __builtin_ppc_maxfe, + __builtin_ppc_maxfl, + __builtin_ppc_maxfs, + __builtin_ppc_mfmsr, + __builtin_ppc_mfspr, + __builtin_ppc_mftbu, + __builtin_ppc_minfe, + __builtin_ppc_minfl, + __builtin_ppc_minfs, + __builtin_ppc_mtfsb0, + __builtin_ppc_mtfsb1, + __builtin_ppc_mtfsf, + __builtin_ppc_mtfsfi, + __builtin_ppc_mtmsr, + __builtin_ppc_mtspr, + __builtin_ppc_mulhd, + __builtin_ppc_mulhdu, + __builtin_ppc_mulhw, + __builtin_ppc_mulhwu, + __builtin_ppc_popcntb, + __builtin_ppc_poppar4, + __builtin_ppc_poppar8, + __builtin_ppc_rdlam, + __builtin_ppc_recipdivd, + __builtin_ppc_recipdivf, + __builtin_ppc_rldimi, + __builtin_ppc_rlwimi, + __builtin_ppc_rlwnm, + __builtin_ppc_rsqrtd, + __builtin_ppc_rsqrtf, + __builtin_ppc_stdcx, + __builtin_ppc_stfiw, + __builtin_ppc_store2r, + __builtin_ppc_store4r, + __builtin_ppc_stwcx, + __builtin_ppc_swdiv, + __builtin_ppc_swdiv_nochk, + __builtin_ppc_swdivs, + __builtin_ppc_swdivs_nochk, + __builtin_ppc_sync, + __builtin_ppc_tdw, + __builtin_ppc_trap, + __builtin_ppc_trapd, + __builtin_ppc_tw, + __builtin_prefetch, + __builtin_preserve_access_index, + __builtin_printf, + __builtin_ptx_get_image_channel_data_typei_, + __builtin_ptx_get_image_channel_orderi_, + __builtin_ptx_get_image_depthi_, + __builtin_ptx_get_image_heighti_, + __builtin_ptx_get_image_widthi_, + __builtin_ptx_read_image2Dff_, + __builtin_ptx_read_image2Dfi_, + __builtin_ptx_read_image2Dif_, + __builtin_ptx_read_image2Dii_, + __builtin_ptx_read_image3Dff_, + __builtin_ptx_read_image3Dfi_, + __builtin_ptx_read_image3Dif_, + __builtin_ptx_read_image3Dii_, + __builtin_ptx_write_image2Df_, + __builtin_ptx_write_image2Di_, + __builtin_ptx_write_image2Dui_, + __builtin_r600_implicitarg_ptr, + __builtin_r600_read_tgid_x, + __builtin_r600_read_tgid_y, + __builtin_r600_read_tgid_z, + __builtin_r600_read_tidig_x, + __builtin_r600_read_tidig_y, + __builtin_r600_read_tidig_z, + __builtin_r600_recipsqrt_ieee, + __builtin_r600_recipsqrt_ieeef, + __builtin_readcyclecounter, + __builtin_readflm, + __builtin_realloc, + __builtin_reduce_add, + __builtin_reduce_and, + __builtin_reduce_max, + __builtin_reduce_min, + __builtin_reduce_mul, + __builtin_reduce_or, + __builtin_reduce_xor, + __builtin_remainder, + __builtin_remainderf, + __builtin_remainderf128, + __builtin_remainderl, + __builtin_remquo, + __builtin_remquof, + __builtin_remquof128, + __builtin_remquol, + __builtin_return_address, + __builtin_rindex, + __builtin_rint, + __builtin_rintf, + __builtin_rintf128, + __builtin_rintf16, + __builtin_rintl, + __builtin_rotateleft16, + __builtin_rotateleft32, + __builtin_rotateleft64, + __builtin_rotateleft8, + __builtin_rotateright16, + __builtin_rotateright32, + __builtin_rotateright64, + __builtin_rotateright8, + __builtin_round, + __builtin_roundeven, + __builtin_roundevenf, + __builtin_roundevenf128, + __builtin_roundevenf16, + __builtin_roundevenl, + __builtin_roundf, + __builtin_roundf128, + __builtin_roundf16, + __builtin_roundl, + __builtin_sadd_overflow, + __builtin_saddl_overflow, + __builtin_saddll_overflow, + __builtin_scalbln, + __builtin_scalblnf, + __builtin_scalblnf128, + __builtin_scalblnl, + __builtin_scalbn, + __builtin_scalbnf, + __builtin_scalbnf128, + __builtin_scalbnl, + __builtin_scanf, + __builtin_set_flt_rounds, + __builtin_setflm, + __builtin_setjmp, + __builtin_setps, + __builtin_setrnd, + __builtin_shufflevector, + __builtin_signbit, + __builtin_signbitf, + __builtin_signbitl, + __builtin_sin, + __builtin_sinf, + __builtin_sinf128, + __builtin_sinf16, + __builtin_sinh, + __builtin_sinhf, + __builtin_sinhf128, + __builtin_sinhl, + __builtin_sinl, + __builtin_smul_overflow, + __builtin_smull_overflow, + __builtin_smulll_overflow, + __builtin_snprintf, + __builtin_sponentry, + __builtin_sprintf, + __builtin_sqrt, + __builtin_sqrtf, + __builtin_sqrtf128, + __builtin_sqrtf16, + __builtin_sqrtl, + __builtin_sscanf, + __builtin_ssub_overflow, + __builtin_ssubl_overflow, + __builtin_ssubll_overflow, + __builtin_stdarg_start, + __builtin_stpcpy, + __builtin_stpncpy, + __builtin_strcasecmp, + __builtin_strcat, + __builtin_strchr, + __builtin_strcmp, + __builtin_strcpy, + __builtin_strcspn, + __builtin_strdup, + __builtin_strlen, + __builtin_strncasecmp, + __builtin_strncat, + __builtin_strncmp, + __builtin_strncpy, + __builtin_strndup, + __builtin_strpbrk, + __builtin_strrchr, + __builtin_strspn, + __builtin_strstr, + __builtin_sub_overflow, + __builtin_subc, + __builtin_subcb, + __builtin_subcl, + __builtin_subcll, + __builtin_subcs, + __builtin_tan, + __builtin_tanf, + __builtin_tanf128, + __builtin_tanh, + __builtin_tanhf, + __builtin_tanhf128, + __builtin_tanhl, + __builtin_tanl, + __builtin_tgamma, + __builtin_tgammaf, + __builtin_tgammaf128, + __builtin_tgammal, + __builtin_thread_pointer, + __builtin_trap, + __builtin_trunc, + __builtin_truncf, + __builtin_truncf128, + __builtin_truncf16, + __builtin_truncl, + __builtin_types_compatible_p, + __builtin_uadd_overflow, + __builtin_uaddl_overflow, + __builtin_uaddll_overflow, + __builtin_umul_overflow, + __builtin_umull_overflow, + __builtin_umulll_overflow, + __builtin_unpack_longdouble, + __builtin_unpredictable, + __builtin_unreachable, + __builtin_unwind_init, + __builtin_usub_overflow, + __builtin_usubl_overflow, + __builtin_usubll_overflow, + __builtin_va_arg, + __builtin_va_copy, + __builtin_va_end, + __builtin_va_start, + __builtin_ve_vl_andm_MMM, + __builtin_ve_vl_andm_mmm, + __builtin_ve_vl_eqvm_MMM, + __builtin_ve_vl_eqvm_mmm, + __builtin_ve_vl_extract_vm512l, + __builtin_ve_vl_extract_vm512u, + __builtin_ve_vl_fencec_s, + __builtin_ve_vl_fencei, + __builtin_ve_vl_fencem_s, + __builtin_ve_vl_fidcr_sss, + __builtin_ve_vl_insert_vm512l, + __builtin_ve_vl_insert_vm512u, + __builtin_ve_vl_lcr_sss, + __builtin_ve_vl_lsv_vvss, + __builtin_ve_vl_lvm_MMss, + __builtin_ve_vl_lvm_mmss, + __builtin_ve_vl_lvsd_svs, + __builtin_ve_vl_lvsl_svs, + __builtin_ve_vl_lvss_svs, + __builtin_ve_vl_lzvm_sml, + __builtin_ve_vl_negm_MM, + __builtin_ve_vl_negm_mm, + __builtin_ve_vl_nndm_MMM, + __builtin_ve_vl_nndm_mmm, + __builtin_ve_vl_orm_MMM, + __builtin_ve_vl_orm_mmm, + __builtin_ve_vl_pack_f32a, + __builtin_ve_vl_pack_f32p, + __builtin_ve_vl_pcvm_sml, + __builtin_ve_vl_pfchv_ssl, + __builtin_ve_vl_pfchvnc_ssl, + __builtin_ve_vl_pvadds_vsvMvl, + __builtin_ve_vl_pvadds_vsvl, + __builtin_ve_vl_pvadds_vsvvl, + __builtin_ve_vl_pvadds_vvvMvl, + __builtin_ve_vl_pvadds_vvvl, + __builtin_ve_vl_pvadds_vvvvl, + __builtin_ve_vl_pvaddu_vsvMvl, + __builtin_ve_vl_pvaddu_vsvl, + __builtin_ve_vl_pvaddu_vsvvl, + __builtin_ve_vl_pvaddu_vvvMvl, + __builtin_ve_vl_pvaddu_vvvl, + __builtin_ve_vl_pvaddu_vvvvl, + __builtin_ve_vl_pvand_vsvMvl, + __builtin_ve_vl_pvand_vsvl, + __builtin_ve_vl_pvand_vsvvl, + __builtin_ve_vl_pvand_vvvMvl, + __builtin_ve_vl_pvand_vvvl, + __builtin_ve_vl_pvand_vvvvl, + __builtin_ve_vl_pvbrd_vsMvl, + __builtin_ve_vl_pvbrd_vsl, + __builtin_ve_vl_pvbrd_vsvl, + __builtin_ve_vl_pvbrv_vvMvl, + __builtin_ve_vl_pvbrv_vvl, + __builtin_ve_vl_pvbrv_vvvl, + __builtin_ve_vl_pvbrvlo_vvl, + __builtin_ve_vl_pvbrvlo_vvmvl, + __builtin_ve_vl_pvbrvlo_vvvl, + __builtin_ve_vl_pvbrvup_vvl, + __builtin_ve_vl_pvbrvup_vvmvl, + __builtin_ve_vl_pvbrvup_vvvl, + __builtin_ve_vl_pvcmps_vsvMvl, + __builtin_ve_vl_pvcmps_vsvl, + __builtin_ve_vl_pvcmps_vsvvl, + __builtin_ve_vl_pvcmps_vvvMvl, + __builtin_ve_vl_pvcmps_vvvl, + __builtin_ve_vl_pvcmps_vvvvl, + __builtin_ve_vl_pvcmpu_vsvMvl, + __builtin_ve_vl_pvcmpu_vsvl, + __builtin_ve_vl_pvcmpu_vsvvl, + __builtin_ve_vl_pvcmpu_vvvMvl, + __builtin_ve_vl_pvcmpu_vvvl, + __builtin_ve_vl_pvcmpu_vvvvl, + __builtin_ve_vl_pvcvtsw_vvl, + __builtin_ve_vl_pvcvtsw_vvvl, + __builtin_ve_vl_pvcvtws_vvMvl, + __builtin_ve_vl_pvcvtws_vvl, + __builtin_ve_vl_pvcvtws_vvvl, + __builtin_ve_vl_pvcvtwsrz_vvMvl, + __builtin_ve_vl_pvcvtwsrz_vvl, + __builtin_ve_vl_pvcvtwsrz_vvvl, + __builtin_ve_vl_pveqv_vsvMvl, + __builtin_ve_vl_pveqv_vsvl, + __builtin_ve_vl_pveqv_vsvvl, + __builtin_ve_vl_pveqv_vvvMvl, + __builtin_ve_vl_pveqv_vvvl, + __builtin_ve_vl_pveqv_vvvvl, + __builtin_ve_vl_pvfadd_vsvMvl, + __builtin_ve_vl_pvfadd_vsvl, + __builtin_ve_vl_pvfadd_vsvvl, + __builtin_ve_vl_pvfadd_vvvMvl, + __builtin_ve_vl_pvfadd_vvvl, + __builtin_ve_vl_pvfadd_vvvvl, + __builtin_ve_vl_pvfcmp_vsvMvl, + __builtin_ve_vl_pvfcmp_vsvl, + __builtin_ve_vl_pvfcmp_vsvvl, + __builtin_ve_vl_pvfcmp_vvvMvl, + __builtin_ve_vl_pvfcmp_vvvl, + __builtin_ve_vl_pvfcmp_vvvvl, + __builtin_ve_vl_pvfmad_vsvvMvl, + __builtin_ve_vl_pvfmad_vsvvl, + __builtin_ve_vl_pvfmad_vsvvvl, + __builtin_ve_vl_pvfmad_vvsvMvl, + __builtin_ve_vl_pvfmad_vvsvl, + __builtin_ve_vl_pvfmad_vvsvvl, + __builtin_ve_vl_pvfmad_vvvvMvl, + __builtin_ve_vl_pvfmad_vvvvl, + __builtin_ve_vl_pvfmad_vvvvvl, + __builtin_ve_vl_pvfmax_vsvMvl, + __builtin_ve_vl_pvfmax_vsvl, + __builtin_ve_vl_pvfmax_vsvvl, + __builtin_ve_vl_pvfmax_vvvMvl, + __builtin_ve_vl_pvfmax_vvvl, + __builtin_ve_vl_pvfmax_vvvvl, + __builtin_ve_vl_pvfmin_vsvMvl, + __builtin_ve_vl_pvfmin_vsvl, + __builtin_ve_vl_pvfmin_vsvvl, + __builtin_ve_vl_pvfmin_vvvMvl, + __builtin_ve_vl_pvfmin_vvvl, + __builtin_ve_vl_pvfmin_vvvvl, + __builtin_ve_vl_pvfmkaf_Ml, + __builtin_ve_vl_pvfmkat_Ml, + __builtin_ve_vl_pvfmkseq_MvMl, + __builtin_ve_vl_pvfmkseq_Mvl, + __builtin_ve_vl_pvfmkseqnan_MvMl, + __builtin_ve_vl_pvfmkseqnan_Mvl, + __builtin_ve_vl_pvfmksge_MvMl, + __builtin_ve_vl_pvfmksge_Mvl, + __builtin_ve_vl_pvfmksgenan_MvMl, + __builtin_ve_vl_pvfmksgenan_Mvl, + __builtin_ve_vl_pvfmksgt_MvMl, + __builtin_ve_vl_pvfmksgt_Mvl, + __builtin_ve_vl_pvfmksgtnan_MvMl, + __builtin_ve_vl_pvfmksgtnan_Mvl, + __builtin_ve_vl_pvfmksle_MvMl, + __builtin_ve_vl_pvfmksle_Mvl, + __builtin_ve_vl_pvfmkslenan_MvMl, + __builtin_ve_vl_pvfmkslenan_Mvl, + __builtin_ve_vl_pvfmksloeq_mvl, + __builtin_ve_vl_pvfmksloeq_mvml, + __builtin_ve_vl_pvfmksloeqnan_mvl, + __builtin_ve_vl_pvfmksloeqnan_mvml, + __builtin_ve_vl_pvfmksloge_mvl, + __builtin_ve_vl_pvfmksloge_mvml, + __builtin_ve_vl_pvfmkslogenan_mvl, + __builtin_ve_vl_pvfmkslogenan_mvml, + __builtin_ve_vl_pvfmkslogt_mvl, + __builtin_ve_vl_pvfmkslogt_mvml, + __builtin_ve_vl_pvfmkslogtnan_mvl, + __builtin_ve_vl_pvfmkslogtnan_mvml, + __builtin_ve_vl_pvfmkslole_mvl, + __builtin_ve_vl_pvfmkslole_mvml, + __builtin_ve_vl_pvfmkslolenan_mvl, + __builtin_ve_vl_pvfmkslolenan_mvml, + __builtin_ve_vl_pvfmkslolt_mvl, + __builtin_ve_vl_pvfmkslolt_mvml, + __builtin_ve_vl_pvfmksloltnan_mvl, + __builtin_ve_vl_pvfmksloltnan_mvml, + __builtin_ve_vl_pvfmkslonan_mvl, + __builtin_ve_vl_pvfmkslonan_mvml, + __builtin_ve_vl_pvfmkslone_mvl, + __builtin_ve_vl_pvfmkslone_mvml, + __builtin_ve_vl_pvfmkslonenan_mvl, + __builtin_ve_vl_pvfmkslonenan_mvml, + __builtin_ve_vl_pvfmkslonum_mvl, + __builtin_ve_vl_pvfmkslonum_mvml, + __builtin_ve_vl_pvfmkslt_MvMl, + __builtin_ve_vl_pvfmkslt_Mvl, + __builtin_ve_vl_pvfmksltnan_MvMl, + __builtin_ve_vl_pvfmksltnan_Mvl, + __builtin_ve_vl_pvfmksnan_MvMl, + __builtin_ve_vl_pvfmksnan_Mvl, + __builtin_ve_vl_pvfmksne_MvMl, + __builtin_ve_vl_pvfmksne_Mvl, + __builtin_ve_vl_pvfmksnenan_MvMl, + __builtin_ve_vl_pvfmksnenan_Mvl, + __builtin_ve_vl_pvfmksnum_MvMl, + __builtin_ve_vl_pvfmksnum_Mvl, + __builtin_ve_vl_pvfmksupeq_mvl, + __builtin_ve_vl_pvfmksupeq_mvml, + __builtin_ve_vl_pvfmksupeqnan_mvl, + __builtin_ve_vl_pvfmksupeqnan_mvml, + __builtin_ve_vl_pvfmksupge_mvl, + __builtin_ve_vl_pvfmksupge_mvml, + __builtin_ve_vl_pvfmksupgenan_mvl, + __builtin_ve_vl_pvfmksupgenan_mvml, + __builtin_ve_vl_pvfmksupgt_mvl, + __builtin_ve_vl_pvfmksupgt_mvml, + __builtin_ve_vl_pvfmksupgtnan_mvl, + __builtin_ve_vl_pvfmksupgtnan_mvml, + __builtin_ve_vl_pvfmksuple_mvl, + __builtin_ve_vl_pvfmksuple_mvml, + __builtin_ve_vl_pvfmksuplenan_mvl, + __builtin_ve_vl_pvfmksuplenan_mvml, + __builtin_ve_vl_pvfmksuplt_mvl, + __builtin_ve_vl_pvfmksuplt_mvml, + __builtin_ve_vl_pvfmksupltnan_mvl, + __builtin_ve_vl_pvfmksupltnan_mvml, + __builtin_ve_vl_pvfmksupnan_mvl, + __builtin_ve_vl_pvfmksupnan_mvml, + __builtin_ve_vl_pvfmksupne_mvl, + __builtin_ve_vl_pvfmksupne_mvml, + __builtin_ve_vl_pvfmksupnenan_mvl, + __builtin_ve_vl_pvfmksupnenan_mvml, + __builtin_ve_vl_pvfmksupnum_mvl, + __builtin_ve_vl_pvfmksupnum_mvml, + __builtin_ve_vl_pvfmkweq_MvMl, + __builtin_ve_vl_pvfmkweq_Mvl, + __builtin_ve_vl_pvfmkweqnan_MvMl, + __builtin_ve_vl_pvfmkweqnan_Mvl, + __builtin_ve_vl_pvfmkwge_MvMl, + __builtin_ve_vl_pvfmkwge_Mvl, + __builtin_ve_vl_pvfmkwgenan_MvMl, + __builtin_ve_vl_pvfmkwgenan_Mvl, + __builtin_ve_vl_pvfmkwgt_MvMl, + __builtin_ve_vl_pvfmkwgt_Mvl, + __builtin_ve_vl_pvfmkwgtnan_MvMl, + __builtin_ve_vl_pvfmkwgtnan_Mvl, + __builtin_ve_vl_pvfmkwle_MvMl, + __builtin_ve_vl_pvfmkwle_Mvl, + __builtin_ve_vl_pvfmkwlenan_MvMl, + __builtin_ve_vl_pvfmkwlenan_Mvl, + __builtin_ve_vl_pvfmkwloeq_mvl, + __builtin_ve_vl_pvfmkwloeq_mvml, + __builtin_ve_vl_pvfmkwloeqnan_mvl, + __builtin_ve_vl_pvfmkwloeqnan_mvml, + __builtin_ve_vl_pvfmkwloge_mvl, + __builtin_ve_vl_pvfmkwloge_mvml, + __builtin_ve_vl_pvfmkwlogenan_mvl, + __builtin_ve_vl_pvfmkwlogenan_mvml, + __builtin_ve_vl_pvfmkwlogt_mvl, + __builtin_ve_vl_pvfmkwlogt_mvml, + __builtin_ve_vl_pvfmkwlogtnan_mvl, + __builtin_ve_vl_pvfmkwlogtnan_mvml, + __builtin_ve_vl_pvfmkwlole_mvl, + __builtin_ve_vl_pvfmkwlole_mvml, + __builtin_ve_vl_pvfmkwlolenan_mvl, + __builtin_ve_vl_pvfmkwlolenan_mvml, + __builtin_ve_vl_pvfmkwlolt_mvl, + __builtin_ve_vl_pvfmkwlolt_mvml, + __builtin_ve_vl_pvfmkwloltnan_mvl, + __builtin_ve_vl_pvfmkwloltnan_mvml, + __builtin_ve_vl_pvfmkwlonan_mvl, + __builtin_ve_vl_pvfmkwlonan_mvml, + __builtin_ve_vl_pvfmkwlone_mvl, + __builtin_ve_vl_pvfmkwlone_mvml, + __builtin_ve_vl_pvfmkwlonenan_mvl, + __builtin_ve_vl_pvfmkwlonenan_mvml, + __builtin_ve_vl_pvfmkwlonum_mvl, + __builtin_ve_vl_pvfmkwlonum_mvml, + __builtin_ve_vl_pvfmkwlt_MvMl, + __builtin_ve_vl_pvfmkwlt_Mvl, + __builtin_ve_vl_pvfmkwltnan_MvMl, + __builtin_ve_vl_pvfmkwltnan_Mvl, + __builtin_ve_vl_pvfmkwnan_MvMl, + __builtin_ve_vl_pvfmkwnan_Mvl, + __builtin_ve_vl_pvfmkwne_MvMl, + __builtin_ve_vl_pvfmkwne_Mvl, + __builtin_ve_vl_pvfmkwnenan_MvMl, + __builtin_ve_vl_pvfmkwnenan_Mvl, + __builtin_ve_vl_pvfmkwnum_MvMl, + __builtin_ve_vl_pvfmkwnum_Mvl, + __builtin_ve_vl_pvfmkwupeq_mvl, + __builtin_ve_vl_pvfmkwupeq_mvml, + __builtin_ve_vl_pvfmkwupeqnan_mvl, + __builtin_ve_vl_pvfmkwupeqnan_mvml, + __builtin_ve_vl_pvfmkwupge_mvl, + __builtin_ve_vl_pvfmkwupge_mvml, + __builtin_ve_vl_pvfmkwupgenan_mvl, + __builtin_ve_vl_pvfmkwupgenan_mvml, + __builtin_ve_vl_pvfmkwupgt_mvl, + __builtin_ve_vl_pvfmkwupgt_mvml, + __builtin_ve_vl_pvfmkwupgtnan_mvl, + __builtin_ve_vl_pvfmkwupgtnan_mvml, + __builtin_ve_vl_pvfmkwuple_mvl, + __builtin_ve_vl_pvfmkwuple_mvml, + __builtin_ve_vl_pvfmkwuplenan_mvl, + __builtin_ve_vl_pvfmkwuplenan_mvml, + __builtin_ve_vl_pvfmkwuplt_mvl, + __builtin_ve_vl_pvfmkwuplt_mvml, + __builtin_ve_vl_pvfmkwupltnan_mvl, + __builtin_ve_vl_pvfmkwupltnan_mvml, + __builtin_ve_vl_pvfmkwupnan_mvl, + __builtin_ve_vl_pvfmkwupnan_mvml, + __builtin_ve_vl_pvfmkwupne_mvl, + __builtin_ve_vl_pvfmkwupne_mvml, + __builtin_ve_vl_pvfmkwupnenan_mvl, + __builtin_ve_vl_pvfmkwupnenan_mvml, + __builtin_ve_vl_pvfmkwupnum_mvl, + __builtin_ve_vl_pvfmkwupnum_mvml, + __builtin_ve_vl_pvfmsb_vsvvMvl, + __builtin_ve_vl_pvfmsb_vsvvl, + __builtin_ve_vl_pvfmsb_vsvvvl, + __builtin_ve_vl_pvfmsb_vvsvMvl, + __builtin_ve_vl_pvfmsb_vvsvl, + __builtin_ve_vl_pvfmsb_vvsvvl, + __builtin_ve_vl_pvfmsb_vvvvMvl, + __builtin_ve_vl_pvfmsb_vvvvl, + __builtin_ve_vl_pvfmsb_vvvvvl, + __builtin_ve_vl_pvfmul_vsvMvl, + __builtin_ve_vl_pvfmul_vsvl, + __builtin_ve_vl_pvfmul_vsvvl, + __builtin_ve_vl_pvfmul_vvvMvl, + __builtin_ve_vl_pvfmul_vvvl, + __builtin_ve_vl_pvfmul_vvvvl, + __builtin_ve_vl_pvfnmad_vsvvMvl, + __builtin_ve_vl_pvfnmad_vsvvl, + __builtin_ve_vl_pvfnmad_vsvvvl, + __builtin_ve_vl_pvfnmad_vvsvMvl, + __builtin_ve_vl_pvfnmad_vvsvl, + __builtin_ve_vl_pvfnmad_vvsvvl, + __builtin_ve_vl_pvfnmad_vvvvMvl, + __builtin_ve_vl_pvfnmad_vvvvl, + __builtin_ve_vl_pvfnmad_vvvvvl, + __builtin_ve_vl_pvfnmsb_vsvvMvl, + __builtin_ve_vl_pvfnmsb_vsvvl, + __builtin_ve_vl_pvfnmsb_vsvvvl, + __builtin_ve_vl_pvfnmsb_vvsvMvl, + __builtin_ve_vl_pvfnmsb_vvsvl, + __builtin_ve_vl_pvfnmsb_vvsvvl, + __builtin_ve_vl_pvfnmsb_vvvvMvl, + __builtin_ve_vl_pvfnmsb_vvvvl, + __builtin_ve_vl_pvfnmsb_vvvvvl, + __builtin_ve_vl_pvfsub_vsvMvl, + __builtin_ve_vl_pvfsub_vsvl, + __builtin_ve_vl_pvfsub_vsvvl, + __builtin_ve_vl_pvfsub_vvvMvl, + __builtin_ve_vl_pvfsub_vvvl, + __builtin_ve_vl_pvfsub_vvvvl, + __builtin_ve_vl_pvldz_vvMvl, + __builtin_ve_vl_pvldz_vvl, + __builtin_ve_vl_pvldz_vvvl, + __builtin_ve_vl_pvldzlo_vvl, + __builtin_ve_vl_pvldzlo_vvmvl, + __builtin_ve_vl_pvldzlo_vvvl, + __builtin_ve_vl_pvldzup_vvl, + __builtin_ve_vl_pvldzup_vvmvl, + __builtin_ve_vl_pvldzup_vvvl, + __builtin_ve_vl_pvmaxs_vsvMvl, + __builtin_ve_vl_pvmaxs_vsvl, + __builtin_ve_vl_pvmaxs_vsvvl, + __builtin_ve_vl_pvmaxs_vvvMvl, + __builtin_ve_vl_pvmaxs_vvvl, + __builtin_ve_vl_pvmaxs_vvvvl, + __builtin_ve_vl_pvmins_vsvMvl, + __builtin_ve_vl_pvmins_vsvl, + __builtin_ve_vl_pvmins_vsvvl, + __builtin_ve_vl_pvmins_vvvMvl, + __builtin_ve_vl_pvmins_vvvl, + __builtin_ve_vl_pvmins_vvvvl, + __builtin_ve_vl_pvor_vsvMvl, + __builtin_ve_vl_pvor_vsvl, + __builtin_ve_vl_pvor_vsvvl, + __builtin_ve_vl_pvor_vvvMvl, + __builtin_ve_vl_pvor_vvvl, + __builtin_ve_vl_pvor_vvvvl, + __builtin_ve_vl_pvpcnt_vvMvl, + __builtin_ve_vl_pvpcnt_vvl, + __builtin_ve_vl_pvpcnt_vvvl, + __builtin_ve_vl_pvpcntlo_vvl, + __builtin_ve_vl_pvpcntlo_vvmvl, + __builtin_ve_vl_pvpcntlo_vvvl, + __builtin_ve_vl_pvpcntup_vvl, + __builtin_ve_vl_pvpcntup_vvmvl, + __builtin_ve_vl_pvpcntup_vvvl, + __builtin_ve_vl_pvrcp_vvl, + __builtin_ve_vl_pvrcp_vvvl, + __builtin_ve_vl_pvrsqrt_vvl, + __builtin_ve_vl_pvrsqrt_vvvl, + __builtin_ve_vl_pvrsqrtnex_vvl, + __builtin_ve_vl_pvrsqrtnex_vvvl, + __builtin_ve_vl_pvseq_vl, + __builtin_ve_vl_pvseq_vvl, + __builtin_ve_vl_pvseqlo_vl, + __builtin_ve_vl_pvseqlo_vvl, + __builtin_ve_vl_pvsequp_vl, + __builtin_ve_vl_pvsequp_vvl, + __builtin_ve_vl_pvsla_vvsMvl, + __builtin_ve_vl_pvsla_vvsl, + __builtin_ve_vl_pvsla_vvsvl, + __builtin_ve_vl_pvsla_vvvMvl, + __builtin_ve_vl_pvsla_vvvl, + __builtin_ve_vl_pvsla_vvvvl, + __builtin_ve_vl_pvsll_vvsMvl, + __builtin_ve_vl_pvsll_vvsl, + __builtin_ve_vl_pvsll_vvsvl, + __builtin_ve_vl_pvsll_vvvMvl, + __builtin_ve_vl_pvsll_vvvl, + __builtin_ve_vl_pvsll_vvvvl, + __builtin_ve_vl_pvsra_vvsMvl, + __builtin_ve_vl_pvsra_vvsl, + __builtin_ve_vl_pvsra_vvsvl, + __builtin_ve_vl_pvsra_vvvMvl, + __builtin_ve_vl_pvsra_vvvl, + __builtin_ve_vl_pvsra_vvvvl, + __builtin_ve_vl_pvsrl_vvsMvl, + __builtin_ve_vl_pvsrl_vvsl, + __builtin_ve_vl_pvsrl_vvsvl, + __builtin_ve_vl_pvsrl_vvvMvl, + __builtin_ve_vl_pvsrl_vvvl, + __builtin_ve_vl_pvsrl_vvvvl, + __builtin_ve_vl_pvsubs_vsvMvl, + __builtin_ve_vl_pvsubs_vsvl, + __builtin_ve_vl_pvsubs_vsvvl, + __builtin_ve_vl_pvsubs_vvvMvl, + __builtin_ve_vl_pvsubs_vvvl, + __builtin_ve_vl_pvsubs_vvvvl, + __builtin_ve_vl_pvsubu_vsvMvl, + __builtin_ve_vl_pvsubu_vsvl, + __builtin_ve_vl_pvsubu_vsvvl, + __builtin_ve_vl_pvsubu_vvvMvl, + __builtin_ve_vl_pvsubu_vvvl, + __builtin_ve_vl_pvsubu_vvvvl, + __builtin_ve_vl_pvxor_vsvMvl, + __builtin_ve_vl_pvxor_vsvl, + __builtin_ve_vl_pvxor_vsvvl, + __builtin_ve_vl_pvxor_vvvMvl, + __builtin_ve_vl_pvxor_vvvl, + __builtin_ve_vl_pvxor_vvvvl, + __builtin_ve_vl_scr_sss, + __builtin_ve_vl_svm_sMs, + __builtin_ve_vl_svm_sms, + __builtin_ve_vl_svob, + __builtin_ve_vl_tovm_sml, + __builtin_ve_vl_tscr_ssss, + __builtin_ve_vl_vaddsl_vsvl, + __builtin_ve_vl_vaddsl_vsvmvl, + __builtin_ve_vl_vaddsl_vsvvl, + __builtin_ve_vl_vaddsl_vvvl, + __builtin_ve_vl_vaddsl_vvvmvl, + __builtin_ve_vl_vaddsl_vvvvl, + __builtin_ve_vl_vaddswsx_vsvl, + __builtin_ve_vl_vaddswsx_vsvmvl, + __builtin_ve_vl_vaddswsx_vsvvl, + __builtin_ve_vl_vaddswsx_vvvl, + __builtin_ve_vl_vaddswsx_vvvmvl, + __builtin_ve_vl_vaddswsx_vvvvl, + __builtin_ve_vl_vaddswzx_vsvl, + __builtin_ve_vl_vaddswzx_vsvmvl, + __builtin_ve_vl_vaddswzx_vsvvl, + __builtin_ve_vl_vaddswzx_vvvl, + __builtin_ve_vl_vaddswzx_vvvmvl, + __builtin_ve_vl_vaddswzx_vvvvl, + __builtin_ve_vl_vaddul_vsvl, + __builtin_ve_vl_vaddul_vsvmvl, + __builtin_ve_vl_vaddul_vsvvl, + __builtin_ve_vl_vaddul_vvvl, + __builtin_ve_vl_vaddul_vvvmvl, + __builtin_ve_vl_vaddul_vvvvl, + __builtin_ve_vl_vadduw_vsvl, + __builtin_ve_vl_vadduw_vsvmvl, + __builtin_ve_vl_vadduw_vsvvl, + __builtin_ve_vl_vadduw_vvvl, + __builtin_ve_vl_vadduw_vvvmvl, + __builtin_ve_vl_vadduw_vvvvl, + __builtin_ve_vl_vand_vsvl, + __builtin_ve_vl_vand_vsvmvl, + __builtin_ve_vl_vand_vsvvl, + __builtin_ve_vl_vand_vvvl, + __builtin_ve_vl_vand_vvvmvl, + __builtin_ve_vl_vand_vvvvl, + __builtin_ve_vl_vbrdd_vsl, + __builtin_ve_vl_vbrdd_vsmvl, + __builtin_ve_vl_vbrdd_vsvl, + __builtin_ve_vl_vbrdl_vsl, + __builtin_ve_vl_vbrdl_vsmvl, + __builtin_ve_vl_vbrdl_vsvl, + __builtin_ve_vl_vbrds_vsl, + __builtin_ve_vl_vbrds_vsmvl, + __builtin_ve_vl_vbrds_vsvl, + __builtin_ve_vl_vbrdw_vsl, + __builtin_ve_vl_vbrdw_vsmvl, + __builtin_ve_vl_vbrdw_vsvl, + __builtin_ve_vl_vbrv_vvl, + __builtin_ve_vl_vbrv_vvmvl, + __builtin_ve_vl_vbrv_vvvl, + __builtin_ve_vl_vcmpsl_vsvl, + __builtin_ve_vl_vcmpsl_vsvmvl, + __builtin_ve_vl_vcmpsl_vsvvl, + __builtin_ve_vl_vcmpsl_vvvl, + __builtin_ve_vl_vcmpsl_vvvmvl, + __builtin_ve_vl_vcmpsl_vvvvl, + __builtin_ve_vl_vcmpswsx_vsvl, + __builtin_ve_vl_vcmpswsx_vsvmvl, + __builtin_ve_vl_vcmpswsx_vsvvl, + __builtin_ve_vl_vcmpswsx_vvvl, + __builtin_ve_vl_vcmpswsx_vvvmvl, + __builtin_ve_vl_vcmpswsx_vvvvl, + __builtin_ve_vl_vcmpswzx_vsvl, + __builtin_ve_vl_vcmpswzx_vsvmvl, + __builtin_ve_vl_vcmpswzx_vsvvl, + __builtin_ve_vl_vcmpswzx_vvvl, + __builtin_ve_vl_vcmpswzx_vvvmvl, + __builtin_ve_vl_vcmpswzx_vvvvl, + __builtin_ve_vl_vcmpul_vsvl, + __builtin_ve_vl_vcmpul_vsvmvl, + __builtin_ve_vl_vcmpul_vsvvl, + __builtin_ve_vl_vcmpul_vvvl, + __builtin_ve_vl_vcmpul_vvvmvl, + __builtin_ve_vl_vcmpul_vvvvl, + __builtin_ve_vl_vcmpuw_vsvl, + __builtin_ve_vl_vcmpuw_vsvmvl, + __builtin_ve_vl_vcmpuw_vsvvl, + __builtin_ve_vl_vcmpuw_vvvl, + __builtin_ve_vl_vcmpuw_vvvmvl, + __builtin_ve_vl_vcmpuw_vvvvl, + __builtin_ve_vl_vcp_vvmvl, + __builtin_ve_vl_vcvtdl_vvl, + __builtin_ve_vl_vcvtdl_vvvl, + __builtin_ve_vl_vcvtds_vvl, + __builtin_ve_vl_vcvtds_vvvl, + __builtin_ve_vl_vcvtdw_vvl, + __builtin_ve_vl_vcvtdw_vvvl, + __builtin_ve_vl_vcvtld_vvl, + __builtin_ve_vl_vcvtld_vvmvl, + __builtin_ve_vl_vcvtld_vvvl, + __builtin_ve_vl_vcvtldrz_vvl, + __builtin_ve_vl_vcvtldrz_vvmvl, + __builtin_ve_vl_vcvtldrz_vvvl, + __builtin_ve_vl_vcvtsd_vvl, + __builtin_ve_vl_vcvtsd_vvvl, + __builtin_ve_vl_vcvtsw_vvl, + __builtin_ve_vl_vcvtsw_vvvl, + __builtin_ve_vl_vcvtwdsx_vvl, + __builtin_ve_vl_vcvtwdsx_vvmvl, + __builtin_ve_vl_vcvtwdsx_vvvl, + __builtin_ve_vl_vcvtwdsxrz_vvl, + __builtin_ve_vl_vcvtwdsxrz_vvmvl, + __builtin_ve_vl_vcvtwdsxrz_vvvl, + __builtin_ve_vl_vcvtwdzx_vvl, + __builtin_ve_vl_vcvtwdzx_vvmvl, + __builtin_ve_vl_vcvtwdzx_vvvl, + __builtin_ve_vl_vcvtwdzxrz_vvl, + __builtin_ve_vl_vcvtwdzxrz_vvmvl, + __builtin_ve_vl_vcvtwdzxrz_vvvl, + __builtin_ve_vl_vcvtwssx_vvl, + __builtin_ve_vl_vcvtwssx_vvmvl, + __builtin_ve_vl_vcvtwssx_vvvl, + __builtin_ve_vl_vcvtwssxrz_vvl, + __builtin_ve_vl_vcvtwssxrz_vvmvl, + __builtin_ve_vl_vcvtwssxrz_vvvl, + __builtin_ve_vl_vcvtwszx_vvl, + __builtin_ve_vl_vcvtwszx_vvmvl, + __builtin_ve_vl_vcvtwszx_vvvl, + __builtin_ve_vl_vcvtwszxrz_vvl, + __builtin_ve_vl_vcvtwszxrz_vvmvl, + __builtin_ve_vl_vcvtwszxrz_vvvl, + __builtin_ve_vl_vdivsl_vsvl, + __builtin_ve_vl_vdivsl_vsvmvl, + __builtin_ve_vl_vdivsl_vsvvl, + __builtin_ve_vl_vdivsl_vvsl, + __builtin_ve_vl_vdivsl_vvsmvl, + __builtin_ve_vl_vdivsl_vvsvl, + __builtin_ve_vl_vdivsl_vvvl, + __builtin_ve_vl_vdivsl_vvvmvl, + __builtin_ve_vl_vdivsl_vvvvl, + __builtin_ve_vl_vdivswsx_vsvl, + __builtin_ve_vl_vdivswsx_vsvmvl, + __builtin_ve_vl_vdivswsx_vsvvl, + __builtin_ve_vl_vdivswsx_vvsl, + __builtin_ve_vl_vdivswsx_vvsmvl, + __builtin_ve_vl_vdivswsx_vvsvl, + __builtin_ve_vl_vdivswsx_vvvl, + __builtin_ve_vl_vdivswsx_vvvmvl, + __builtin_ve_vl_vdivswsx_vvvvl, + __builtin_ve_vl_vdivswzx_vsvl, + __builtin_ve_vl_vdivswzx_vsvmvl, + __builtin_ve_vl_vdivswzx_vsvvl, + __builtin_ve_vl_vdivswzx_vvsl, + __builtin_ve_vl_vdivswzx_vvsmvl, + __builtin_ve_vl_vdivswzx_vvsvl, + __builtin_ve_vl_vdivswzx_vvvl, + __builtin_ve_vl_vdivswzx_vvvmvl, + __builtin_ve_vl_vdivswzx_vvvvl, + __builtin_ve_vl_vdivul_vsvl, + __builtin_ve_vl_vdivul_vsvmvl, + __builtin_ve_vl_vdivul_vsvvl, + __builtin_ve_vl_vdivul_vvsl, + __builtin_ve_vl_vdivul_vvsmvl, + __builtin_ve_vl_vdivul_vvsvl, + __builtin_ve_vl_vdivul_vvvl, + __builtin_ve_vl_vdivul_vvvmvl, + __builtin_ve_vl_vdivul_vvvvl, + __builtin_ve_vl_vdivuw_vsvl, + __builtin_ve_vl_vdivuw_vsvmvl, + __builtin_ve_vl_vdivuw_vsvvl, + __builtin_ve_vl_vdivuw_vvsl, + __builtin_ve_vl_vdivuw_vvsmvl, + __builtin_ve_vl_vdivuw_vvsvl, + __builtin_ve_vl_vdivuw_vvvl, + __builtin_ve_vl_vdivuw_vvvmvl, + __builtin_ve_vl_vdivuw_vvvvl, + __builtin_ve_vl_veqv_vsvl, + __builtin_ve_vl_veqv_vsvmvl, + __builtin_ve_vl_veqv_vsvvl, + __builtin_ve_vl_veqv_vvvl, + __builtin_ve_vl_veqv_vvvmvl, + __builtin_ve_vl_veqv_vvvvl, + __builtin_ve_vl_vex_vvmvl, + __builtin_ve_vl_vfaddd_vsvl, + __builtin_ve_vl_vfaddd_vsvmvl, + __builtin_ve_vl_vfaddd_vsvvl, + __builtin_ve_vl_vfaddd_vvvl, + __builtin_ve_vl_vfaddd_vvvmvl, + __builtin_ve_vl_vfaddd_vvvvl, + __builtin_ve_vl_vfadds_vsvl, + __builtin_ve_vl_vfadds_vsvmvl, + __builtin_ve_vl_vfadds_vsvvl, + __builtin_ve_vl_vfadds_vvvl, + __builtin_ve_vl_vfadds_vvvmvl, + __builtin_ve_vl_vfadds_vvvvl, + __builtin_ve_vl_vfcmpd_vsvl, + __builtin_ve_vl_vfcmpd_vsvmvl, + __builtin_ve_vl_vfcmpd_vsvvl, + __builtin_ve_vl_vfcmpd_vvvl, + __builtin_ve_vl_vfcmpd_vvvmvl, + __builtin_ve_vl_vfcmpd_vvvvl, + __builtin_ve_vl_vfcmps_vsvl, + __builtin_ve_vl_vfcmps_vsvmvl, + __builtin_ve_vl_vfcmps_vsvvl, + __builtin_ve_vl_vfcmps_vvvl, + __builtin_ve_vl_vfcmps_vvvmvl, + __builtin_ve_vl_vfcmps_vvvvl, + __builtin_ve_vl_vfdivd_vsvl, + __builtin_ve_vl_vfdivd_vsvmvl, + __builtin_ve_vl_vfdivd_vsvvl, + __builtin_ve_vl_vfdivd_vvvl, + __builtin_ve_vl_vfdivd_vvvmvl, + __builtin_ve_vl_vfdivd_vvvvl, + __builtin_ve_vl_vfdivs_vsvl, + __builtin_ve_vl_vfdivs_vsvmvl, + __builtin_ve_vl_vfdivs_vsvvl, + __builtin_ve_vl_vfdivs_vvvl, + __builtin_ve_vl_vfdivs_vvvmvl, + __builtin_ve_vl_vfdivs_vvvvl, + __builtin_ve_vl_vfmadd_vsvvl, + __builtin_ve_vl_vfmadd_vsvvmvl, + __builtin_ve_vl_vfmadd_vsvvvl, + __builtin_ve_vl_vfmadd_vvsvl, + __builtin_ve_vl_vfmadd_vvsvmvl, + __builtin_ve_vl_vfmadd_vvsvvl, + __builtin_ve_vl_vfmadd_vvvvl, + __builtin_ve_vl_vfmadd_vvvvmvl, + __builtin_ve_vl_vfmadd_vvvvvl, + __builtin_ve_vl_vfmads_vsvvl, + __builtin_ve_vl_vfmads_vsvvmvl, + __builtin_ve_vl_vfmads_vsvvvl, + __builtin_ve_vl_vfmads_vvsvl, + __builtin_ve_vl_vfmads_vvsvmvl, + __builtin_ve_vl_vfmads_vvsvvl, + __builtin_ve_vl_vfmads_vvvvl, + __builtin_ve_vl_vfmads_vvvvmvl, + __builtin_ve_vl_vfmads_vvvvvl, + __builtin_ve_vl_vfmaxd_vsvl, + __builtin_ve_vl_vfmaxd_vsvmvl, + __builtin_ve_vl_vfmaxd_vsvvl, + __builtin_ve_vl_vfmaxd_vvvl, + __builtin_ve_vl_vfmaxd_vvvmvl, + __builtin_ve_vl_vfmaxd_vvvvl, + __builtin_ve_vl_vfmaxs_vsvl, + __builtin_ve_vl_vfmaxs_vsvmvl, + __builtin_ve_vl_vfmaxs_vsvvl, + __builtin_ve_vl_vfmaxs_vvvl, + __builtin_ve_vl_vfmaxs_vvvmvl, + __builtin_ve_vl_vfmaxs_vvvvl, + __builtin_ve_vl_vfmind_vsvl, + __builtin_ve_vl_vfmind_vsvmvl, + __builtin_ve_vl_vfmind_vsvvl, + __builtin_ve_vl_vfmind_vvvl, + __builtin_ve_vl_vfmind_vvvmvl, + __builtin_ve_vl_vfmind_vvvvl, + __builtin_ve_vl_vfmins_vsvl, + __builtin_ve_vl_vfmins_vsvmvl, + __builtin_ve_vl_vfmins_vsvvl, + __builtin_ve_vl_vfmins_vvvl, + __builtin_ve_vl_vfmins_vvvmvl, + __builtin_ve_vl_vfmins_vvvvl, + __builtin_ve_vl_vfmkdeq_mvl, + __builtin_ve_vl_vfmkdeq_mvml, + __builtin_ve_vl_vfmkdeqnan_mvl, + __builtin_ve_vl_vfmkdeqnan_mvml, + __builtin_ve_vl_vfmkdge_mvl, + __builtin_ve_vl_vfmkdge_mvml, + __builtin_ve_vl_vfmkdgenan_mvl, + __builtin_ve_vl_vfmkdgenan_mvml, + __builtin_ve_vl_vfmkdgt_mvl, + __builtin_ve_vl_vfmkdgt_mvml, + __builtin_ve_vl_vfmkdgtnan_mvl, + __builtin_ve_vl_vfmkdgtnan_mvml, + __builtin_ve_vl_vfmkdle_mvl, + __builtin_ve_vl_vfmkdle_mvml, + __builtin_ve_vl_vfmkdlenan_mvl, + __builtin_ve_vl_vfmkdlenan_mvml, + __builtin_ve_vl_vfmkdlt_mvl, + __builtin_ve_vl_vfmkdlt_mvml, + __builtin_ve_vl_vfmkdltnan_mvl, + __builtin_ve_vl_vfmkdltnan_mvml, + __builtin_ve_vl_vfmkdnan_mvl, + __builtin_ve_vl_vfmkdnan_mvml, + __builtin_ve_vl_vfmkdne_mvl, + __builtin_ve_vl_vfmkdne_mvml, + __builtin_ve_vl_vfmkdnenan_mvl, + __builtin_ve_vl_vfmkdnenan_mvml, + __builtin_ve_vl_vfmkdnum_mvl, + __builtin_ve_vl_vfmkdnum_mvml, + __builtin_ve_vl_vfmklaf_ml, + __builtin_ve_vl_vfmklat_ml, + __builtin_ve_vl_vfmkleq_mvl, + __builtin_ve_vl_vfmkleq_mvml, + __builtin_ve_vl_vfmkleqnan_mvl, + __builtin_ve_vl_vfmkleqnan_mvml, + __builtin_ve_vl_vfmklge_mvl, + __builtin_ve_vl_vfmklge_mvml, + __builtin_ve_vl_vfmklgenan_mvl, + __builtin_ve_vl_vfmklgenan_mvml, + __builtin_ve_vl_vfmklgt_mvl, + __builtin_ve_vl_vfmklgt_mvml, + __builtin_ve_vl_vfmklgtnan_mvl, + __builtin_ve_vl_vfmklgtnan_mvml, + __builtin_ve_vl_vfmklle_mvl, + __builtin_ve_vl_vfmklle_mvml, + __builtin_ve_vl_vfmkllenan_mvl, + __builtin_ve_vl_vfmkllenan_mvml, + __builtin_ve_vl_vfmkllt_mvl, + __builtin_ve_vl_vfmkllt_mvml, + __builtin_ve_vl_vfmklltnan_mvl, + __builtin_ve_vl_vfmklltnan_mvml, + __builtin_ve_vl_vfmklnan_mvl, + __builtin_ve_vl_vfmklnan_mvml, + __builtin_ve_vl_vfmklne_mvl, + __builtin_ve_vl_vfmklne_mvml, + __builtin_ve_vl_vfmklnenan_mvl, + __builtin_ve_vl_vfmklnenan_mvml, + __builtin_ve_vl_vfmklnum_mvl, + __builtin_ve_vl_vfmklnum_mvml, + __builtin_ve_vl_vfmkseq_mvl, + __builtin_ve_vl_vfmkseq_mvml, + __builtin_ve_vl_vfmkseqnan_mvl, + __builtin_ve_vl_vfmkseqnan_mvml, + __builtin_ve_vl_vfmksge_mvl, + __builtin_ve_vl_vfmksge_mvml, + __builtin_ve_vl_vfmksgenan_mvl, + __builtin_ve_vl_vfmksgenan_mvml, + __builtin_ve_vl_vfmksgt_mvl, + __builtin_ve_vl_vfmksgt_mvml, + __builtin_ve_vl_vfmksgtnan_mvl, + __builtin_ve_vl_vfmksgtnan_mvml, + __builtin_ve_vl_vfmksle_mvl, + __builtin_ve_vl_vfmksle_mvml, + __builtin_ve_vl_vfmkslenan_mvl, + __builtin_ve_vl_vfmkslenan_mvml, + __builtin_ve_vl_vfmkslt_mvl, + __builtin_ve_vl_vfmkslt_mvml, + __builtin_ve_vl_vfmksltnan_mvl, + __builtin_ve_vl_vfmksltnan_mvml, + __builtin_ve_vl_vfmksnan_mvl, + __builtin_ve_vl_vfmksnan_mvml, + __builtin_ve_vl_vfmksne_mvl, + __builtin_ve_vl_vfmksne_mvml, + __builtin_ve_vl_vfmksnenan_mvl, + __builtin_ve_vl_vfmksnenan_mvml, + __builtin_ve_vl_vfmksnum_mvl, + __builtin_ve_vl_vfmksnum_mvml, + __builtin_ve_vl_vfmkweq_mvl, + __builtin_ve_vl_vfmkweq_mvml, + __builtin_ve_vl_vfmkweqnan_mvl, + __builtin_ve_vl_vfmkweqnan_mvml, + __builtin_ve_vl_vfmkwge_mvl, + __builtin_ve_vl_vfmkwge_mvml, + __builtin_ve_vl_vfmkwgenan_mvl, + __builtin_ve_vl_vfmkwgenan_mvml, + __builtin_ve_vl_vfmkwgt_mvl, + __builtin_ve_vl_vfmkwgt_mvml, + __builtin_ve_vl_vfmkwgtnan_mvl, + __builtin_ve_vl_vfmkwgtnan_mvml, + __builtin_ve_vl_vfmkwle_mvl, + __builtin_ve_vl_vfmkwle_mvml, + __builtin_ve_vl_vfmkwlenan_mvl, + __builtin_ve_vl_vfmkwlenan_mvml, + __builtin_ve_vl_vfmkwlt_mvl, + __builtin_ve_vl_vfmkwlt_mvml, + __builtin_ve_vl_vfmkwltnan_mvl, + __builtin_ve_vl_vfmkwltnan_mvml, + __builtin_ve_vl_vfmkwnan_mvl, + __builtin_ve_vl_vfmkwnan_mvml, + __builtin_ve_vl_vfmkwne_mvl, + __builtin_ve_vl_vfmkwne_mvml, + __builtin_ve_vl_vfmkwnenan_mvl, + __builtin_ve_vl_vfmkwnenan_mvml, + __builtin_ve_vl_vfmkwnum_mvl, + __builtin_ve_vl_vfmkwnum_mvml, + __builtin_ve_vl_vfmsbd_vsvvl, + __builtin_ve_vl_vfmsbd_vsvvmvl, + __builtin_ve_vl_vfmsbd_vsvvvl, + __builtin_ve_vl_vfmsbd_vvsvl, + __builtin_ve_vl_vfmsbd_vvsvmvl, + __builtin_ve_vl_vfmsbd_vvsvvl, + __builtin_ve_vl_vfmsbd_vvvvl, + __builtin_ve_vl_vfmsbd_vvvvmvl, + __builtin_ve_vl_vfmsbd_vvvvvl, + __builtin_ve_vl_vfmsbs_vsvvl, + __builtin_ve_vl_vfmsbs_vsvvmvl, + __builtin_ve_vl_vfmsbs_vsvvvl, + __builtin_ve_vl_vfmsbs_vvsvl, + __builtin_ve_vl_vfmsbs_vvsvmvl, + __builtin_ve_vl_vfmsbs_vvsvvl, + __builtin_ve_vl_vfmsbs_vvvvl, + __builtin_ve_vl_vfmsbs_vvvvmvl, + __builtin_ve_vl_vfmsbs_vvvvvl, + __builtin_ve_vl_vfmuld_vsvl, + __builtin_ve_vl_vfmuld_vsvmvl, + __builtin_ve_vl_vfmuld_vsvvl, + __builtin_ve_vl_vfmuld_vvvl, + __builtin_ve_vl_vfmuld_vvvmvl, + __builtin_ve_vl_vfmuld_vvvvl, + __builtin_ve_vl_vfmuls_vsvl, + __builtin_ve_vl_vfmuls_vsvmvl, + __builtin_ve_vl_vfmuls_vsvvl, + __builtin_ve_vl_vfmuls_vvvl, + __builtin_ve_vl_vfmuls_vvvmvl, + __builtin_ve_vl_vfmuls_vvvvl, + __builtin_ve_vl_vfnmadd_vsvvl, + __builtin_ve_vl_vfnmadd_vsvvmvl, + __builtin_ve_vl_vfnmadd_vsvvvl, + __builtin_ve_vl_vfnmadd_vvsvl, + __builtin_ve_vl_vfnmadd_vvsvmvl, + __builtin_ve_vl_vfnmadd_vvsvvl, + __builtin_ve_vl_vfnmadd_vvvvl, + __builtin_ve_vl_vfnmadd_vvvvmvl, + __builtin_ve_vl_vfnmadd_vvvvvl, + __builtin_ve_vl_vfnmads_vsvvl, + __builtin_ve_vl_vfnmads_vsvvmvl, + __builtin_ve_vl_vfnmads_vsvvvl, + __builtin_ve_vl_vfnmads_vvsvl, + __builtin_ve_vl_vfnmads_vvsvmvl, + __builtin_ve_vl_vfnmads_vvsvvl, + __builtin_ve_vl_vfnmads_vvvvl, + __builtin_ve_vl_vfnmads_vvvvmvl, + __builtin_ve_vl_vfnmads_vvvvvl, + __builtin_ve_vl_vfnmsbd_vsvvl, + __builtin_ve_vl_vfnmsbd_vsvvmvl, + __builtin_ve_vl_vfnmsbd_vsvvvl, + __builtin_ve_vl_vfnmsbd_vvsvl, + __builtin_ve_vl_vfnmsbd_vvsvmvl, + __builtin_ve_vl_vfnmsbd_vvsvvl, + __builtin_ve_vl_vfnmsbd_vvvvl, + __builtin_ve_vl_vfnmsbd_vvvvmvl, + __builtin_ve_vl_vfnmsbd_vvvvvl, + __builtin_ve_vl_vfnmsbs_vsvvl, + __builtin_ve_vl_vfnmsbs_vsvvmvl, + __builtin_ve_vl_vfnmsbs_vsvvvl, + __builtin_ve_vl_vfnmsbs_vvsvl, + __builtin_ve_vl_vfnmsbs_vvsvmvl, + __builtin_ve_vl_vfnmsbs_vvsvvl, + __builtin_ve_vl_vfnmsbs_vvvvl, + __builtin_ve_vl_vfnmsbs_vvvvmvl, + __builtin_ve_vl_vfnmsbs_vvvvvl, + __builtin_ve_vl_vfrmaxdfst_vvl, + __builtin_ve_vl_vfrmaxdfst_vvvl, + __builtin_ve_vl_vfrmaxdlst_vvl, + __builtin_ve_vl_vfrmaxdlst_vvvl, + __builtin_ve_vl_vfrmaxsfst_vvl, + __builtin_ve_vl_vfrmaxsfst_vvvl, + __builtin_ve_vl_vfrmaxslst_vvl, + __builtin_ve_vl_vfrmaxslst_vvvl, + __builtin_ve_vl_vfrmindfst_vvl, + __builtin_ve_vl_vfrmindfst_vvvl, + __builtin_ve_vl_vfrmindlst_vvl, + __builtin_ve_vl_vfrmindlst_vvvl, + __builtin_ve_vl_vfrminsfst_vvl, + __builtin_ve_vl_vfrminsfst_vvvl, + __builtin_ve_vl_vfrminslst_vvl, + __builtin_ve_vl_vfrminslst_vvvl, + __builtin_ve_vl_vfsqrtd_vvl, + __builtin_ve_vl_vfsqrtd_vvvl, + __builtin_ve_vl_vfsqrts_vvl, + __builtin_ve_vl_vfsqrts_vvvl, + __builtin_ve_vl_vfsubd_vsvl, + __builtin_ve_vl_vfsubd_vsvmvl, + __builtin_ve_vl_vfsubd_vsvvl, + __builtin_ve_vl_vfsubd_vvvl, + __builtin_ve_vl_vfsubd_vvvmvl, + __builtin_ve_vl_vfsubd_vvvvl, + __builtin_ve_vl_vfsubs_vsvl, + __builtin_ve_vl_vfsubs_vsvmvl, + __builtin_ve_vl_vfsubs_vsvvl, + __builtin_ve_vl_vfsubs_vvvl, + __builtin_ve_vl_vfsubs_vvvmvl, + __builtin_ve_vl_vfsubs_vvvvl, + __builtin_ve_vl_vfsumd_vvl, + __builtin_ve_vl_vfsumd_vvml, + __builtin_ve_vl_vfsums_vvl, + __builtin_ve_vl_vfsums_vvml, + __builtin_ve_vl_vgt_vvssl, + __builtin_ve_vl_vgt_vvssml, + __builtin_ve_vl_vgt_vvssmvl, + __builtin_ve_vl_vgt_vvssvl, + __builtin_ve_vl_vgtlsx_vvssl, + __builtin_ve_vl_vgtlsx_vvssml, + __builtin_ve_vl_vgtlsx_vvssmvl, + __builtin_ve_vl_vgtlsx_vvssvl, + __builtin_ve_vl_vgtlsxnc_vvssl, + __builtin_ve_vl_vgtlsxnc_vvssml, + __builtin_ve_vl_vgtlsxnc_vvssmvl, + __builtin_ve_vl_vgtlsxnc_vvssvl, + __builtin_ve_vl_vgtlzx_vvssl, + __builtin_ve_vl_vgtlzx_vvssml, + __builtin_ve_vl_vgtlzx_vvssmvl, + __builtin_ve_vl_vgtlzx_vvssvl, + __builtin_ve_vl_vgtlzxnc_vvssl, + __builtin_ve_vl_vgtlzxnc_vvssml, + __builtin_ve_vl_vgtlzxnc_vvssmvl, + __builtin_ve_vl_vgtlzxnc_vvssvl, + __builtin_ve_vl_vgtnc_vvssl, + __builtin_ve_vl_vgtnc_vvssml, + __builtin_ve_vl_vgtnc_vvssmvl, + __builtin_ve_vl_vgtnc_vvssvl, + __builtin_ve_vl_vgtu_vvssl, + __builtin_ve_vl_vgtu_vvssml, + __builtin_ve_vl_vgtu_vvssmvl, + __builtin_ve_vl_vgtu_vvssvl, + __builtin_ve_vl_vgtunc_vvssl, + __builtin_ve_vl_vgtunc_vvssml, + __builtin_ve_vl_vgtunc_vvssmvl, + __builtin_ve_vl_vgtunc_vvssvl, + __builtin_ve_vl_vld2d_vssl, + __builtin_ve_vl_vld2d_vssvl, + __builtin_ve_vl_vld2dnc_vssl, + __builtin_ve_vl_vld2dnc_vssvl, + __builtin_ve_vl_vld_vssl, + __builtin_ve_vl_vld_vssvl, + __builtin_ve_vl_vldl2dsx_vssl, + __builtin_ve_vl_vldl2dsx_vssvl, + __builtin_ve_vl_vldl2dsxnc_vssl, + __builtin_ve_vl_vldl2dsxnc_vssvl, + __builtin_ve_vl_vldl2dzx_vssl, + __builtin_ve_vl_vldl2dzx_vssvl, + __builtin_ve_vl_vldl2dzxnc_vssl, + __builtin_ve_vl_vldl2dzxnc_vssvl, + __builtin_ve_vl_vldlsx_vssl, + __builtin_ve_vl_vldlsx_vssvl, + __builtin_ve_vl_vldlsxnc_vssl, + __builtin_ve_vl_vldlsxnc_vssvl, + __builtin_ve_vl_vldlzx_vssl, + __builtin_ve_vl_vldlzx_vssvl, + __builtin_ve_vl_vldlzxnc_vssl, + __builtin_ve_vl_vldlzxnc_vssvl, + __builtin_ve_vl_vldnc_vssl, + __builtin_ve_vl_vldnc_vssvl, + __builtin_ve_vl_vldu2d_vssl, + __builtin_ve_vl_vldu2d_vssvl, + __builtin_ve_vl_vldu2dnc_vssl, + __builtin_ve_vl_vldu2dnc_vssvl, + __builtin_ve_vl_vldu_vssl, + __builtin_ve_vl_vldu_vssvl, + __builtin_ve_vl_vldunc_vssl, + __builtin_ve_vl_vldunc_vssvl, + __builtin_ve_vl_vldz_vvl, + __builtin_ve_vl_vldz_vvmvl, + __builtin_ve_vl_vldz_vvvl, + __builtin_ve_vl_vmaxsl_vsvl, + __builtin_ve_vl_vmaxsl_vsvmvl, + __builtin_ve_vl_vmaxsl_vsvvl, + __builtin_ve_vl_vmaxsl_vvvl, + __builtin_ve_vl_vmaxsl_vvvmvl, + __builtin_ve_vl_vmaxsl_vvvvl, + __builtin_ve_vl_vmaxswsx_vsvl, + __builtin_ve_vl_vmaxswsx_vsvmvl, + __builtin_ve_vl_vmaxswsx_vsvvl, + __builtin_ve_vl_vmaxswsx_vvvl, + __builtin_ve_vl_vmaxswsx_vvvmvl, + __builtin_ve_vl_vmaxswsx_vvvvl, + __builtin_ve_vl_vmaxswzx_vsvl, + __builtin_ve_vl_vmaxswzx_vsvmvl, + __builtin_ve_vl_vmaxswzx_vsvvl, + __builtin_ve_vl_vmaxswzx_vvvl, + __builtin_ve_vl_vmaxswzx_vvvmvl, + __builtin_ve_vl_vmaxswzx_vvvvl, + __builtin_ve_vl_vminsl_vsvl, + __builtin_ve_vl_vminsl_vsvmvl, + __builtin_ve_vl_vminsl_vsvvl, + __builtin_ve_vl_vminsl_vvvl, + __builtin_ve_vl_vminsl_vvvmvl, + __builtin_ve_vl_vminsl_vvvvl, + __builtin_ve_vl_vminswsx_vsvl, + __builtin_ve_vl_vminswsx_vsvmvl, + __builtin_ve_vl_vminswsx_vsvvl, + __builtin_ve_vl_vminswsx_vvvl, + __builtin_ve_vl_vminswsx_vvvmvl, + __builtin_ve_vl_vminswsx_vvvvl, + __builtin_ve_vl_vminswzx_vsvl, + __builtin_ve_vl_vminswzx_vsvmvl, + __builtin_ve_vl_vminswzx_vsvvl, + __builtin_ve_vl_vminswzx_vvvl, + __builtin_ve_vl_vminswzx_vvvmvl, + __builtin_ve_vl_vminswzx_vvvvl, + __builtin_ve_vl_vmrg_vsvml, + __builtin_ve_vl_vmrg_vsvmvl, + __builtin_ve_vl_vmrg_vvvml, + __builtin_ve_vl_vmrg_vvvmvl, + __builtin_ve_vl_vmrgw_vsvMl, + __builtin_ve_vl_vmrgw_vsvMvl, + __builtin_ve_vl_vmrgw_vvvMl, + __builtin_ve_vl_vmrgw_vvvMvl, + __builtin_ve_vl_vmulsl_vsvl, + __builtin_ve_vl_vmulsl_vsvmvl, + __builtin_ve_vl_vmulsl_vsvvl, + __builtin_ve_vl_vmulsl_vvvl, + __builtin_ve_vl_vmulsl_vvvmvl, + __builtin_ve_vl_vmulsl_vvvvl, + __builtin_ve_vl_vmulslw_vsvl, + __builtin_ve_vl_vmulslw_vsvvl, + __builtin_ve_vl_vmulslw_vvvl, + __builtin_ve_vl_vmulslw_vvvvl, + __builtin_ve_vl_vmulswsx_vsvl, + __builtin_ve_vl_vmulswsx_vsvmvl, + __builtin_ve_vl_vmulswsx_vsvvl, + __builtin_ve_vl_vmulswsx_vvvl, + __builtin_ve_vl_vmulswsx_vvvmvl, + __builtin_ve_vl_vmulswsx_vvvvl, + __builtin_ve_vl_vmulswzx_vsvl, + __builtin_ve_vl_vmulswzx_vsvmvl, + __builtin_ve_vl_vmulswzx_vsvvl, + __builtin_ve_vl_vmulswzx_vvvl, + __builtin_ve_vl_vmulswzx_vvvmvl, + __builtin_ve_vl_vmulswzx_vvvvl, + __builtin_ve_vl_vmulul_vsvl, + __builtin_ve_vl_vmulul_vsvmvl, + __builtin_ve_vl_vmulul_vsvvl, + __builtin_ve_vl_vmulul_vvvl, + __builtin_ve_vl_vmulul_vvvmvl, + __builtin_ve_vl_vmulul_vvvvl, + __builtin_ve_vl_vmuluw_vsvl, + __builtin_ve_vl_vmuluw_vsvmvl, + __builtin_ve_vl_vmuluw_vsvvl, + __builtin_ve_vl_vmuluw_vvvl, + __builtin_ve_vl_vmuluw_vvvmvl, + __builtin_ve_vl_vmuluw_vvvvl, + __builtin_ve_vl_vmv_vsvl, + __builtin_ve_vl_vmv_vsvmvl, + __builtin_ve_vl_vmv_vsvvl, + __builtin_ve_vl_vor_vsvl, + __builtin_ve_vl_vor_vsvmvl, + __builtin_ve_vl_vor_vsvvl, + __builtin_ve_vl_vor_vvvl, + __builtin_ve_vl_vor_vvvmvl, + __builtin_ve_vl_vor_vvvvl, + __builtin_ve_vl_vpcnt_vvl, + __builtin_ve_vl_vpcnt_vvmvl, + __builtin_ve_vl_vpcnt_vvvl, + __builtin_ve_vl_vrand_vvl, + __builtin_ve_vl_vrand_vvml, + __builtin_ve_vl_vrcpd_vvl, + __builtin_ve_vl_vrcpd_vvvl, + __builtin_ve_vl_vrcps_vvl, + __builtin_ve_vl_vrcps_vvvl, + __builtin_ve_vl_vrmaxslfst_vvl, + __builtin_ve_vl_vrmaxslfst_vvvl, + __builtin_ve_vl_vrmaxsllst_vvl, + __builtin_ve_vl_vrmaxsllst_vvvl, + __builtin_ve_vl_vrmaxswfstsx_vvl, + __builtin_ve_vl_vrmaxswfstsx_vvvl, + __builtin_ve_vl_vrmaxswfstzx_vvl, + __builtin_ve_vl_vrmaxswfstzx_vvvl, + __builtin_ve_vl_vrmaxswlstsx_vvl, + __builtin_ve_vl_vrmaxswlstsx_vvvl, + __builtin_ve_vl_vrmaxswlstzx_vvl, + __builtin_ve_vl_vrmaxswlstzx_vvvl, + __builtin_ve_vl_vrminslfst_vvl, + __builtin_ve_vl_vrminslfst_vvvl, + __builtin_ve_vl_vrminsllst_vvl, + __builtin_ve_vl_vrminsllst_vvvl, + __builtin_ve_vl_vrminswfstsx_vvl, + __builtin_ve_vl_vrminswfstsx_vvvl, + __builtin_ve_vl_vrminswfstzx_vvl, + __builtin_ve_vl_vrminswfstzx_vvvl, + __builtin_ve_vl_vrminswlstsx_vvl, + __builtin_ve_vl_vrminswlstsx_vvvl, + __builtin_ve_vl_vrminswlstzx_vvl, + __builtin_ve_vl_vrminswlstzx_vvvl, + __builtin_ve_vl_vror_vvl, + __builtin_ve_vl_vror_vvml, + __builtin_ve_vl_vrsqrtd_vvl, + __builtin_ve_vl_vrsqrtd_vvvl, + __builtin_ve_vl_vrsqrtdnex_vvl, + __builtin_ve_vl_vrsqrtdnex_vvvl, + __builtin_ve_vl_vrsqrts_vvl, + __builtin_ve_vl_vrsqrts_vvvl, + __builtin_ve_vl_vrsqrtsnex_vvl, + __builtin_ve_vl_vrsqrtsnex_vvvl, + __builtin_ve_vl_vrxor_vvl, + __builtin_ve_vl_vrxor_vvml, + __builtin_ve_vl_vsc_vvssl, + __builtin_ve_vl_vsc_vvssml, + __builtin_ve_vl_vscl_vvssl, + __builtin_ve_vl_vscl_vvssml, + __builtin_ve_vl_vsclnc_vvssl, + __builtin_ve_vl_vsclnc_vvssml, + __builtin_ve_vl_vsclncot_vvssl, + __builtin_ve_vl_vsclncot_vvssml, + __builtin_ve_vl_vsclot_vvssl, + __builtin_ve_vl_vsclot_vvssml, + __builtin_ve_vl_vscnc_vvssl, + __builtin_ve_vl_vscnc_vvssml, + __builtin_ve_vl_vscncot_vvssl, + __builtin_ve_vl_vscncot_vvssml, + __builtin_ve_vl_vscot_vvssl, + __builtin_ve_vl_vscot_vvssml, + __builtin_ve_vl_vscu_vvssl, + __builtin_ve_vl_vscu_vvssml, + __builtin_ve_vl_vscunc_vvssl, + __builtin_ve_vl_vscunc_vvssml, + __builtin_ve_vl_vscuncot_vvssl, + __builtin_ve_vl_vscuncot_vvssml, + __builtin_ve_vl_vscuot_vvssl, + __builtin_ve_vl_vscuot_vvssml, + __builtin_ve_vl_vseq_vl, + __builtin_ve_vl_vseq_vvl, + __builtin_ve_vl_vsfa_vvssl, + __builtin_ve_vl_vsfa_vvssmvl, + __builtin_ve_vl_vsfa_vvssvl, + __builtin_ve_vl_vshf_vvvsl, + __builtin_ve_vl_vshf_vvvsvl, + __builtin_ve_vl_vslal_vvsl, + __builtin_ve_vl_vslal_vvsmvl, + __builtin_ve_vl_vslal_vvsvl, + __builtin_ve_vl_vslal_vvvl, + __builtin_ve_vl_vslal_vvvmvl, + __builtin_ve_vl_vslal_vvvvl, + __builtin_ve_vl_vslawsx_vvsl, + __builtin_ve_vl_vslawsx_vvsmvl, + __builtin_ve_vl_vslawsx_vvsvl, + __builtin_ve_vl_vslawsx_vvvl, + __builtin_ve_vl_vslawsx_vvvmvl, + __builtin_ve_vl_vslawsx_vvvvl, + __builtin_ve_vl_vslawzx_vvsl, + __builtin_ve_vl_vslawzx_vvsmvl, + __builtin_ve_vl_vslawzx_vvsvl, + __builtin_ve_vl_vslawzx_vvvl, + __builtin_ve_vl_vslawzx_vvvmvl, + __builtin_ve_vl_vslawzx_vvvvl, + __builtin_ve_vl_vsll_vvsl, + __builtin_ve_vl_vsll_vvsmvl, + __builtin_ve_vl_vsll_vvsvl, + __builtin_ve_vl_vsll_vvvl, + __builtin_ve_vl_vsll_vvvmvl, + __builtin_ve_vl_vsll_vvvvl, + __builtin_ve_vl_vsral_vvsl, + __builtin_ve_vl_vsral_vvsmvl, + __builtin_ve_vl_vsral_vvsvl, + __builtin_ve_vl_vsral_vvvl, + __builtin_ve_vl_vsral_vvvmvl, + __builtin_ve_vl_vsral_vvvvl, + __builtin_ve_vl_vsrawsx_vvsl, + __builtin_ve_vl_vsrawsx_vvsmvl, + __builtin_ve_vl_vsrawsx_vvsvl, + __builtin_ve_vl_vsrawsx_vvvl, + __builtin_ve_vl_vsrawsx_vvvmvl, + __builtin_ve_vl_vsrawsx_vvvvl, + __builtin_ve_vl_vsrawzx_vvsl, + __builtin_ve_vl_vsrawzx_vvsmvl, + __builtin_ve_vl_vsrawzx_vvsvl, + __builtin_ve_vl_vsrawzx_vvvl, + __builtin_ve_vl_vsrawzx_vvvmvl, + __builtin_ve_vl_vsrawzx_vvvvl, + __builtin_ve_vl_vsrl_vvsl, + __builtin_ve_vl_vsrl_vvsmvl, + __builtin_ve_vl_vsrl_vvsvl, + __builtin_ve_vl_vsrl_vvvl, + __builtin_ve_vl_vsrl_vvvmvl, + __builtin_ve_vl_vsrl_vvvvl, + __builtin_ve_vl_vst2d_vssl, + __builtin_ve_vl_vst2d_vssml, + __builtin_ve_vl_vst2dnc_vssl, + __builtin_ve_vl_vst2dnc_vssml, + __builtin_ve_vl_vst2dncot_vssl, + __builtin_ve_vl_vst2dncot_vssml, + __builtin_ve_vl_vst2dot_vssl, + __builtin_ve_vl_vst2dot_vssml, + __builtin_ve_vl_vst_vssl, + __builtin_ve_vl_vst_vssml, + __builtin_ve_vl_vstl2d_vssl, + __builtin_ve_vl_vstl2d_vssml, + __builtin_ve_vl_vstl2dnc_vssl, + __builtin_ve_vl_vstl2dnc_vssml, + __builtin_ve_vl_vstl2dncot_vssl, + __builtin_ve_vl_vstl2dncot_vssml, + __builtin_ve_vl_vstl2dot_vssl, + __builtin_ve_vl_vstl2dot_vssml, + __builtin_ve_vl_vstl_vssl, + __builtin_ve_vl_vstl_vssml, + __builtin_ve_vl_vstlnc_vssl, + __builtin_ve_vl_vstlnc_vssml, + __builtin_ve_vl_vstlncot_vssl, + __builtin_ve_vl_vstlncot_vssml, + __builtin_ve_vl_vstlot_vssl, + __builtin_ve_vl_vstlot_vssml, + __builtin_ve_vl_vstnc_vssl, + __builtin_ve_vl_vstnc_vssml, + __builtin_ve_vl_vstncot_vssl, + __builtin_ve_vl_vstncot_vssml, + __builtin_ve_vl_vstot_vssl, + __builtin_ve_vl_vstot_vssml, + __builtin_ve_vl_vstu2d_vssl, + __builtin_ve_vl_vstu2d_vssml, + __builtin_ve_vl_vstu2dnc_vssl, + __builtin_ve_vl_vstu2dnc_vssml, + __builtin_ve_vl_vstu2dncot_vssl, + __builtin_ve_vl_vstu2dncot_vssml, + __builtin_ve_vl_vstu2dot_vssl, + __builtin_ve_vl_vstu2dot_vssml, + __builtin_ve_vl_vstu_vssl, + __builtin_ve_vl_vstu_vssml, + __builtin_ve_vl_vstunc_vssl, + __builtin_ve_vl_vstunc_vssml, + __builtin_ve_vl_vstuncot_vssl, + __builtin_ve_vl_vstuncot_vssml, + __builtin_ve_vl_vstuot_vssl, + __builtin_ve_vl_vstuot_vssml, + __builtin_ve_vl_vsubsl_vsvl, + __builtin_ve_vl_vsubsl_vsvmvl, + __builtin_ve_vl_vsubsl_vsvvl, + __builtin_ve_vl_vsubsl_vvvl, + __builtin_ve_vl_vsubsl_vvvmvl, + __builtin_ve_vl_vsubsl_vvvvl, + __builtin_ve_vl_vsubswsx_vsvl, + __builtin_ve_vl_vsubswsx_vsvmvl, + __builtin_ve_vl_vsubswsx_vsvvl, + __builtin_ve_vl_vsubswsx_vvvl, + __builtin_ve_vl_vsubswsx_vvvmvl, + __builtin_ve_vl_vsubswsx_vvvvl, + __builtin_ve_vl_vsubswzx_vsvl, + __builtin_ve_vl_vsubswzx_vsvmvl, + __builtin_ve_vl_vsubswzx_vsvvl, + __builtin_ve_vl_vsubswzx_vvvl, + __builtin_ve_vl_vsubswzx_vvvmvl, + __builtin_ve_vl_vsubswzx_vvvvl, + __builtin_ve_vl_vsubul_vsvl, + __builtin_ve_vl_vsubul_vsvmvl, + __builtin_ve_vl_vsubul_vsvvl, + __builtin_ve_vl_vsubul_vvvl, + __builtin_ve_vl_vsubul_vvvmvl, + __builtin_ve_vl_vsubul_vvvvl, + __builtin_ve_vl_vsubuw_vsvl, + __builtin_ve_vl_vsubuw_vsvmvl, + __builtin_ve_vl_vsubuw_vsvvl, + __builtin_ve_vl_vsubuw_vvvl, + __builtin_ve_vl_vsubuw_vvvmvl, + __builtin_ve_vl_vsubuw_vvvvl, + __builtin_ve_vl_vsuml_vvl, + __builtin_ve_vl_vsuml_vvml, + __builtin_ve_vl_vsumwsx_vvl, + __builtin_ve_vl_vsumwsx_vvml, + __builtin_ve_vl_vsumwzx_vvl, + __builtin_ve_vl_vsumwzx_vvml, + __builtin_ve_vl_vxor_vsvl, + __builtin_ve_vl_vxor_vsvmvl, + __builtin_ve_vl_vxor_vsvvl, + __builtin_ve_vl_vxor_vvvl, + __builtin_ve_vl_vxor_vvvmvl, + __builtin_ve_vl_vxor_vvvvl, + __builtin_ve_vl_xorm_MMM, + __builtin_ve_vl_xorm_mmm, + __builtin_vfprintf, + __builtin_vfscanf, + __builtin_vprintf, + __builtin_vscanf, + __builtin_vsnprintf, + __builtin_vsprintf, + __builtin_vsscanf, + __builtin_wasm_max_f32, + __builtin_wasm_max_f64, + __builtin_wasm_memory_grow, + __builtin_wasm_memory_size, + __builtin_wasm_min_f32, + __builtin_wasm_min_f64, + __builtin_wasm_trunc_s_i32_f32, + __builtin_wasm_trunc_s_i32_f64, + __builtin_wasm_trunc_s_i64_f32, + __builtin_wasm_trunc_s_i64_f64, + __builtin_wasm_trunc_u_i32_f32, + __builtin_wasm_trunc_u_i32_f64, + __builtin_wasm_trunc_u_i64_f32, + __builtin_wasm_trunc_u_i64_f64, + __builtin_wcschr, + __builtin_wcscmp, + __builtin_wcslen, + __builtin_wcsncmp, + __builtin_wmemchr, + __builtin_wmemcmp, + __builtin_wmemcpy, + __builtin_wmemmove, + __c11_atomic_compare_exchange_strong, + __c11_atomic_compare_exchange_weak, + __c11_atomic_exchange, + __c11_atomic_fetch_add, + __c11_atomic_fetch_and, + __c11_atomic_fetch_max, + __c11_atomic_fetch_min, + __c11_atomic_fetch_nand, + __c11_atomic_fetch_or, + __c11_atomic_fetch_sub, + __c11_atomic_fetch_xor, + __c11_atomic_init, + __c11_atomic_is_lock_free, + __c11_atomic_load, + __c11_atomic_signal_fence, + __c11_atomic_store, + __c11_atomic_thread_fence, + __clear_cache, + __cospi, + __cospif, + __debugbreak, + __dmb, + __dsb, + __emit, + __exception_code, + __exception_info, + __exp10, + __exp10f, + __fastfail, + __finite, + __finitef, + __finitel, + __isb, + __iso_volatile_load16, + __iso_volatile_load32, + __iso_volatile_load64, + __iso_volatile_load8, + __iso_volatile_store16, + __iso_volatile_store32, + __iso_volatile_store64, + __iso_volatile_store8, + __ldrexd, + __lzcnt, + __lzcnt16, + __lzcnt64, + __noop, + __nvvm_add_rm_d, + __nvvm_add_rm_f, + __nvvm_add_rm_ftz_f, + __nvvm_add_rn_d, + __nvvm_add_rn_f, + __nvvm_add_rn_ftz_f, + __nvvm_add_rp_d, + __nvvm_add_rp_f, + __nvvm_add_rp_ftz_f, + __nvvm_add_rz_d, + __nvvm_add_rz_f, + __nvvm_add_rz_ftz_f, + __nvvm_atom_add_gen_f, + __nvvm_atom_add_gen_i, + __nvvm_atom_add_gen_l, + __nvvm_atom_add_gen_ll, + __nvvm_atom_and_gen_i, + __nvvm_atom_and_gen_l, + __nvvm_atom_and_gen_ll, + __nvvm_atom_cas_gen_i, + __nvvm_atom_cas_gen_l, + __nvvm_atom_cas_gen_ll, + __nvvm_atom_dec_gen_ui, + __nvvm_atom_inc_gen_ui, + __nvvm_atom_max_gen_i, + __nvvm_atom_max_gen_l, + __nvvm_atom_max_gen_ll, + __nvvm_atom_max_gen_ui, + __nvvm_atom_max_gen_ul, + __nvvm_atom_max_gen_ull, + __nvvm_atom_min_gen_i, + __nvvm_atom_min_gen_l, + __nvvm_atom_min_gen_ll, + __nvvm_atom_min_gen_ui, + __nvvm_atom_min_gen_ul, + __nvvm_atom_min_gen_ull, + __nvvm_atom_or_gen_i, + __nvvm_atom_or_gen_l, + __nvvm_atom_or_gen_ll, + __nvvm_atom_sub_gen_i, + __nvvm_atom_sub_gen_l, + __nvvm_atom_sub_gen_ll, + __nvvm_atom_xchg_gen_i, + __nvvm_atom_xchg_gen_l, + __nvvm_atom_xchg_gen_ll, + __nvvm_atom_xor_gen_i, + __nvvm_atom_xor_gen_l, + __nvvm_atom_xor_gen_ll, + __nvvm_bar0_and, + __nvvm_bar0_or, + __nvvm_bar0_popc, + __nvvm_bar_sync, + __nvvm_bitcast_d2ll, + __nvvm_bitcast_f2i, + __nvvm_bitcast_i2f, + __nvvm_bitcast_ll2d, + __nvvm_ceil_d, + __nvvm_ceil_f, + __nvvm_ceil_ftz_f, + __nvvm_compiler_error, + __nvvm_compiler_warn, + __nvvm_cos_approx_f, + __nvvm_cos_approx_ftz_f, + __nvvm_d2f_rm, + __nvvm_d2f_rm_ftz, + __nvvm_d2f_rn, + __nvvm_d2f_rn_ftz, + __nvvm_d2f_rp, + __nvvm_d2f_rp_ftz, + __nvvm_d2f_rz, + __nvvm_d2f_rz_ftz, + __nvvm_d2i_hi, + __nvvm_d2i_lo, + __nvvm_d2i_rm, + __nvvm_d2i_rn, + __nvvm_d2i_rp, + __nvvm_d2i_rz, + __nvvm_d2ll_rm, + __nvvm_d2ll_rn, + __nvvm_d2ll_rp, + __nvvm_d2ll_rz, + __nvvm_d2ui_rm, + __nvvm_d2ui_rn, + __nvvm_d2ui_rp, + __nvvm_d2ui_rz, + __nvvm_d2ull_rm, + __nvvm_d2ull_rn, + __nvvm_d2ull_rp, + __nvvm_d2ull_rz, + __nvvm_div_approx_f, + __nvvm_div_approx_ftz_f, + __nvvm_div_rm_d, + __nvvm_div_rm_f, + __nvvm_div_rm_ftz_f, + __nvvm_div_rn_d, + __nvvm_div_rn_f, + __nvvm_div_rn_ftz_f, + __nvvm_div_rp_d, + __nvvm_div_rp_f, + __nvvm_div_rp_ftz_f, + __nvvm_div_rz_d, + __nvvm_div_rz_f, + __nvvm_div_rz_ftz_f, + __nvvm_ex2_approx_d, + __nvvm_ex2_approx_f, + __nvvm_ex2_approx_ftz_f, + __nvvm_f2h_rn, + __nvvm_f2h_rn_ftz, + __nvvm_f2i_rm, + __nvvm_f2i_rm_ftz, + __nvvm_f2i_rn, + __nvvm_f2i_rn_ftz, + __nvvm_f2i_rp, + __nvvm_f2i_rp_ftz, + __nvvm_f2i_rz, + __nvvm_f2i_rz_ftz, + __nvvm_f2ll_rm, + __nvvm_f2ll_rm_ftz, + __nvvm_f2ll_rn, + __nvvm_f2ll_rn_ftz, + __nvvm_f2ll_rp, + __nvvm_f2ll_rp_ftz, + __nvvm_f2ll_rz, + __nvvm_f2ll_rz_ftz, + __nvvm_f2ui_rm, + __nvvm_f2ui_rm_ftz, + __nvvm_f2ui_rn, + __nvvm_f2ui_rn_ftz, + __nvvm_f2ui_rp, + __nvvm_f2ui_rp_ftz, + __nvvm_f2ui_rz, + __nvvm_f2ui_rz_ftz, + __nvvm_f2ull_rm, + __nvvm_f2ull_rm_ftz, + __nvvm_f2ull_rn, + __nvvm_f2ull_rn_ftz, + __nvvm_f2ull_rp, + __nvvm_f2ull_rp_ftz, + __nvvm_f2ull_rz, + __nvvm_f2ull_rz_ftz, + __nvvm_fabs_d, + __nvvm_fabs_f, + __nvvm_fabs_ftz_f, + __nvvm_floor_d, + __nvvm_floor_f, + __nvvm_floor_ftz_f, + __nvvm_fma_rm_d, + __nvvm_fma_rm_f, + __nvvm_fma_rm_ftz_f, + __nvvm_fma_rn_d, + __nvvm_fma_rn_f, + __nvvm_fma_rn_ftz_f, + __nvvm_fma_rp_d, + __nvvm_fma_rp_f, + __nvvm_fma_rp_ftz_f, + __nvvm_fma_rz_d, + __nvvm_fma_rz_f, + __nvvm_fma_rz_ftz_f, + __nvvm_fmax_d, + __nvvm_fmax_f, + __nvvm_fmax_ftz_f, + __nvvm_fmin_d, + __nvvm_fmin_f, + __nvvm_fmin_ftz_f, + __nvvm_i2d_rm, + __nvvm_i2d_rn, + __nvvm_i2d_rp, + __nvvm_i2d_rz, + __nvvm_i2f_rm, + __nvvm_i2f_rn, + __nvvm_i2f_rp, + __nvvm_i2f_rz, + __nvvm_isspacep_const, + __nvvm_isspacep_global, + __nvvm_isspacep_local, + __nvvm_isspacep_shared, + __nvvm_ldg_c, + __nvvm_ldg_c2, + __nvvm_ldg_c4, + __nvvm_ldg_d, + __nvvm_ldg_d2, + __nvvm_ldg_f, + __nvvm_ldg_f2, + __nvvm_ldg_f4, + __nvvm_ldg_h, + __nvvm_ldg_h2, + __nvvm_ldg_i, + __nvvm_ldg_i2, + __nvvm_ldg_i4, + __nvvm_ldg_l, + __nvvm_ldg_l2, + __nvvm_ldg_ll, + __nvvm_ldg_ll2, + __nvvm_ldg_s, + __nvvm_ldg_s2, + __nvvm_ldg_s4, + __nvvm_ldg_sc, + __nvvm_ldg_sc2, + __nvvm_ldg_sc4, + __nvvm_ldg_uc, + __nvvm_ldg_uc2, + __nvvm_ldg_uc4, + __nvvm_ldg_ui, + __nvvm_ldg_ui2, + __nvvm_ldg_ui4, + __nvvm_ldg_ul, + __nvvm_ldg_ul2, + __nvvm_ldg_ull, + __nvvm_ldg_ull2, + __nvvm_ldg_us, + __nvvm_ldg_us2, + __nvvm_ldg_us4, + __nvvm_ldu_c, + __nvvm_ldu_c2, + __nvvm_ldu_c4, + __nvvm_ldu_d, + __nvvm_ldu_d2, + __nvvm_ldu_f, + __nvvm_ldu_f2, + __nvvm_ldu_f4, + __nvvm_ldu_h, + __nvvm_ldu_h2, + __nvvm_ldu_i, + __nvvm_ldu_i2, + __nvvm_ldu_i4, + __nvvm_ldu_l, + __nvvm_ldu_l2, + __nvvm_ldu_ll, + __nvvm_ldu_ll2, + __nvvm_ldu_s, + __nvvm_ldu_s2, + __nvvm_ldu_s4, + __nvvm_ldu_sc, + __nvvm_ldu_sc2, + __nvvm_ldu_sc4, + __nvvm_ldu_uc, + __nvvm_ldu_uc2, + __nvvm_ldu_uc4, + __nvvm_ldu_ui, + __nvvm_ldu_ui2, + __nvvm_ldu_ui4, + __nvvm_ldu_ul, + __nvvm_ldu_ul2, + __nvvm_ldu_ull, + __nvvm_ldu_ull2, + __nvvm_ldu_us, + __nvvm_ldu_us2, + __nvvm_ldu_us4, + __nvvm_lg2_approx_d, + __nvvm_lg2_approx_f, + __nvvm_lg2_approx_ftz_f, + __nvvm_ll2d_rm, + __nvvm_ll2d_rn, + __nvvm_ll2d_rp, + __nvvm_ll2d_rz, + __nvvm_ll2f_rm, + __nvvm_ll2f_rn, + __nvvm_ll2f_rp, + __nvvm_ll2f_rz, + __nvvm_lohi_i2d, + __nvvm_membar_cta, + __nvvm_membar_gl, + __nvvm_membar_sys, + __nvvm_memcpy, + __nvvm_memset, + __nvvm_mul24_i, + __nvvm_mul24_ui, + __nvvm_mul_rm_d, + __nvvm_mul_rm_f, + __nvvm_mul_rm_ftz_f, + __nvvm_mul_rn_d, + __nvvm_mul_rn_f, + __nvvm_mul_rn_ftz_f, + __nvvm_mul_rp_d, + __nvvm_mul_rp_f, + __nvvm_mul_rp_ftz_f, + __nvvm_mul_rz_d, + __nvvm_mul_rz_f, + __nvvm_mul_rz_ftz_f, + __nvvm_mulhi_i, + __nvvm_mulhi_ll, + __nvvm_mulhi_ui, + __nvvm_mulhi_ull, + __nvvm_prmt, + __nvvm_rcp_approx_ftz_d, + __nvvm_rcp_approx_ftz_f, + __nvvm_rcp_rm_d, + __nvvm_rcp_rm_f, + __nvvm_rcp_rm_ftz_f, + __nvvm_rcp_rn_d, + __nvvm_rcp_rn_f, + __nvvm_rcp_rn_ftz_f, + __nvvm_rcp_rp_d, + __nvvm_rcp_rp_f, + __nvvm_rcp_rp_ftz_f, + __nvvm_rcp_rz_d, + __nvvm_rcp_rz_f, + __nvvm_rcp_rz_ftz_f, + __nvvm_read_ptx_sreg_clock, + __nvvm_read_ptx_sreg_clock64, + __nvvm_read_ptx_sreg_ctaid_w, + __nvvm_read_ptx_sreg_ctaid_x, + __nvvm_read_ptx_sreg_ctaid_y, + __nvvm_read_ptx_sreg_ctaid_z, + __nvvm_read_ptx_sreg_gridid, + __nvvm_read_ptx_sreg_laneid, + __nvvm_read_ptx_sreg_lanemask_eq, + __nvvm_read_ptx_sreg_lanemask_ge, + __nvvm_read_ptx_sreg_lanemask_gt, + __nvvm_read_ptx_sreg_lanemask_le, + __nvvm_read_ptx_sreg_lanemask_lt, + __nvvm_read_ptx_sreg_nctaid_w, + __nvvm_read_ptx_sreg_nctaid_x, + __nvvm_read_ptx_sreg_nctaid_y, + __nvvm_read_ptx_sreg_nctaid_z, + __nvvm_read_ptx_sreg_nsmid, + __nvvm_read_ptx_sreg_ntid_w, + __nvvm_read_ptx_sreg_ntid_x, + __nvvm_read_ptx_sreg_ntid_y, + __nvvm_read_ptx_sreg_ntid_z, + __nvvm_read_ptx_sreg_nwarpid, + __nvvm_read_ptx_sreg_pm0, + __nvvm_read_ptx_sreg_pm1, + __nvvm_read_ptx_sreg_pm2, + __nvvm_read_ptx_sreg_pm3, + __nvvm_read_ptx_sreg_smid, + __nvvm_read_ptx_sreg_tid_w, + __nvvm_read_ptx_sreg_tid_x, + __nvvm_read_ptx_sreg_tid_y, + __nvvm_read_ptx_sreg_tid_z, + __nvvm_read_ptx_sreg_warpid, + __nvvm_round_d, + __nvvm_round_f, + __nvvm_round_ftz_f, + __nvvm_rsqrt_approx_d, + __nvvm_rsqrt_approx_f, + __nvvm_rsqrt_approx_ftz_f, + __nvvm_sad_i, + __nvvm_sad_ui, + __nvvm_saturate_d, + __nvvm_saturate_f, + __nvvm_saturate_ftz_f, + __nvvm_shfl_bfly_f32, + __nvvm_shfl_bfly_i32, + __nvvm_shfl_down_f32, + __nvvm_shfl_down_i32, + __nvvm_shfl_idx_f32, + __nvvm_shfl_idx_i32, + __nvvm_shfl_up_f32, + __nvvm_shfl_up_i32, + __nvvm_sin_approx_f, + __nvvm_sin_approx_ftz_f, + __nvvm_sqrt_approx_f, + __nvvm_sqrt_approx_ftz_f, + __nvvm_sqrt_rm_d, + __nvvm_sqrt_rm_f, + __nvvm_sqrt_rm_ftz_f, + __nvvm_sqrt_rn_d, + __nvvm_sqrt_rn_f, + __nvvm_sqrt_rn_ftz_f, + __nvvm_sqrt_rp_d, + __nvvm_sqrt_rp_f, + __nvvm_sqrt_rp_ftz_f, + __nvvm_sqrt_rz_d, + __nvvm_sqrt_rz_f, + __nvvm_sqrt_rz_ftz_f, + __nvvm_trunc_d, + __nvvm_trunc_f, + __nvvm_trunc_ftz_f, + __nvvm_ui2d_rm, + __nvvm_ui2d_rn, + __nvvm_ui2d_rp, + __nvvm_ui2d_rz, + __nvvm_ui2f_rm, + __nvvm_ui2f_rn, + __nvvm_ui2f_rp, + __nvvm_ui2f_rz, + __nvvm_ull2d_rm, + __nvvm_ull2d_rn, + __nvvm_ull2d_rp, + __nvvm_ull2d_rz, + __nvvm_ull2f_rm, + __nvvm_ull2f_rn, + __nvvm_ull2f_rp, + __nvvm_ull2f_rz, + __nvvm_vote_all, + __nvvm_vote_any, + __nvvm_vote_ballot, + __nvvm_vote_uni, + __popcnt, + __popcnt16, + __popcnt64, + __rdtsc, + __sev, + __sevl, + __sigsetjmp, + __sinpi, + __sinpif, + __sync_add_and_fetch, + __sync_add_and_fetch_1, + __sync_add_and_fetch_16, + __sync_add_and_fetch_2, + __sync_add_and_fetch_4, + __sync_add_and_fetch_8, + __sync_and_and_fetch, + __sync_and_and_fetch_1, + __sync_and_and_fetch_16, + __sync_and_and_fetch_2, + __sync_and_and_fetch_4, + __sync_and_and_fetch_8, + __sync_bool_compare_and_swap, + __sync_bool_compare_and_swap_1, + __sync_bool_compare_and_swap_16, + __sync_bool_compare_and_swap_2, + __sync_bool_compare_and_swap_4, + __sync_bool_compare_and_swap_8, + __sync_fetch_and_add, + __sync_fetch_and_add_1, + __sync_fetch_and_add_16, + __sync_fetch_and_add_2, + __sync_fetch_and_add_4, + __sync_fetch_and_add_8, + __sync_fetch_and_and, + __sync_fetch_and_and_1, + __sync_fetch_and_and_16, + __sync_fetch_and_and_2, + __sync_fetch_and_and_4, + __sync_fetch_and_and_8, + __sync_fetch_and_max, + __sync_fetch_and_min, + __sync_fetch_and_nand, + __sync_fetch_and_nand_1, + __sync_fetch_and_nand_16, + __sync_fetch_and_nand_2, + __sync_fetch_and_nand_4, + __sync_fetch_and_nand_8, + __sync_fetch_and_or, + __sync_fetch_and_or_1, + __sync_fetch_and_or_16, + __sync_fetch_and_or_2, + __sync_fetch_and_or_4, + __sync_fetch_and_or_8, + __sync_fetch_and_sub, + __sync_fetch_and_sub_1, + __sync_fetch_and_sub_16, + __sync_fetch_and_sub_2, + __sync_fetch_and_sub_4, + __sync_fetch_and_sub_8, + __sync_fetch_and_umax, + __sync_fetch_and_umin, + __sync_fetch_and_xor, + __sync_fetch_and_xor_1, + __sync_fetch_and_xor_16, + __sync_fetch_and_xor_2, + __sync_fetch_and_xor_4, + __sync_fetch_and_xor_8, + __sync_lock_release, + __sync_lock_release_1, + __sync_lock_release_16, + __sync_lock_release_2, + __sync_lock_release_4, + __sync_lock_release_8, + __sync_lock_test_and_set, + __sync_lock_test_and_set_1, + __sync_lock_test_and_set_16, + __sync_lock_test_and_set_2, + __sync_lock_test_and_set_4, + __sync_lock_test_and_set_8, + __sync_nand_and_fetch, + __sync_nand_and_fetch_1, + __sync_nand_and_fetch_16, + __sync_nand_and_fetch_2, + __sync_nand_and_fetch_4, + __sync_nand_and_fetch_8, + __sync_or_and_fetch, + __sync_or_and_fetch_1, + __sync_or_and_fetch_16, + __sync_or_and_fetch_2, + __sync_or_and_fetch_4, + __sync_or_and_fetch_8, + __sync_sub_and_fetch, + __sync_sub_and_fetch_1, + __sync_sub_and_fetch_16, + __sync_sub_and_fetch_2, + __sync_sub_and_fetch_4, + __sync_sub_and_fetch_8, + __sync_swap, + __sync_swap_1, + __sync_swap_16, + __sync_swap_2, + __sync_swap_4, + __sync_swap_8, + __sync_synchronize, + __sync_val_compare_and_swap, + __sync_val_compare_and_swap_1, + __sync_val_compare_and_swap_16, + __sync_val_compare_and_swap_2, + __sync_val_compare_and_swap_4, + __sync_val_compare_and_swap_8, + __sync_xor_and_fetch, + __sync_xor_and_fetch_1, + __sync_xor_and_fetch_16, + __sync_xor_and_fetch_2, + __sync_xor_and_fetch_4, + __sync_xor_and_fetch_8, + __syncthreads, + __tanpi, + __tanpif, + __va_start, + __warn_memset_zero_len, + __wfe, + __wfi, + __xray_customevent, + __xray_typedevent, + __yield, + _abnormal_termination, + _alloca, + _bittest, + _bittest64, + _bittestandcomplement, + _bittestandcomplement64, + _bittestandreset, + _bittestandreset64, + _bittestandset, + _bittestandset64, + _byteswap_uint64, + _byteswap_ulong, + _byteswap_ushort, + _exception_code, + _exception_info, + _exit, + _interlockedbittestandreset, + _interlockedbittestandreset64, + _interlockedbittestandreset_acq, + _interlockedbittestandreset_nf, + _interlockedbittestandreset_rel, + _interlockedbittestandset, + _interlockedbittestandset64, + _interlockedbittestandset_acq, + _interlockedbittestandset_nf, + _interlockedbittestandset_rel, + _longjmp, + _lrotl, + _lrotr, + _rotl, + _rotl16, + _rotl64, + _rotl8, + _rotr, + _rotr16, + _rotr64, + _rotr8, + _setjmp, + _setjmpex, + abort, + abs, + acos, + acosf, + acosh, + acoshf, + acoshl, + acosl, + aligned_alloc, + alloca, + asin, + asinf, + asinh, + asinhf, + asinhl, + asinl, + atan, + atan2, + atan2f, + atan2l, + atanf, + atanh, + atanhf, + atanhl, + atanl, + bcmp, + bcopy, + bzero, + cabs, + cabsf, + cabsl, + cacos, + cacosf, + cacosh, + cacoshf, + cacoshl, + cacosl, + calloc, + carg, + cargf, + cargl, + casin, + casinf, + casinh, + casinhf, + casinhl, + casinl, + catan, + catanf, + catanh, + catanhf, + catanhl, + catanl, + cbrt, + cbrtf, + cbrtl, + ccos, + ccosf, + ccosh, + ccoshf, + ccoshl, + ccosl, + ceil, + ceilf, + ceill, + cexp, + cexpf, + cexpl, + cimag, + cimagf, + cimagl, + clog, + clogf, + clogl, + conj, + conjf, + conjl, + copysign, + copysignf, + copysignl, + cos, + cosf, + cosh, + coshf, + coshl, + cosl, + cpow, + cpowf, + cpowl, + cproj, + cprojf, + cprojl, + creal, + crealf, + creall, + csin, + csinf, + csinh, + csinhf, + csinhl, + csinl, + csqrt, + csqrtf, + csqrtl, + ctan, + ctanf, + ctanh, + ctanhf, + ctanhl, + ctanl, + erf, + erfc, + erfcf, + erfcl, + erff, + erfl, + exit, + exp, + exp2, + exp2f, + exp2l, + expf, + expl, + expm1, + expm1f, + expm1l, + fabs, + fabsf, + fabsl, + fdim, + fdimf, + fdiml, + finite, + finitef, + finitel, + floor, + floorf, + floorl, + fma, + fmaf, + fmal, + fmax, + fmaxf, + fmaxl, + fmin, + fminf, + fminl, + fmod, + fmodf, + fmodl, + fopen, + fprintf, + fread, + free, + frexp, + frexpf, + frexpl, + fscanf, + fwrite, + getcontext, + hypot, + hypotf, + hypotl, + ilogb, + ilogbf, + ilogbl, + index, + isalnum, + isalpha, + isblank, + iscntrl, + isdigit, + isgraph, + islower, + isprint, + ispunct, + isspace, + isupper, + isxdigit, + labs, + ldexp, + ldexpf, + ldexpl, + lgamma, + lgammaf, + lgammal, + llabs, + llrint, + llrintf, + llrintl, + llround, + llroundf, + llroundl, + log, + log10, + log10f, + log10l, + log1p, + log1pf, + log1pl, + log2, + log2f, + log2l, + logb, + logbf, + logbl, + logf, + logl, + longjmp, + lrint, + lrintf, + lrintl, + lround, + lroundf, + lroundl, + malloc, + memalign, + memccpy, + memchr, + memcmp, + memcpy, + memmove, + mempcpy, + memset, + modf, + modff, + modfl, + nan, + nanf, + nanl, + nearbyint, + nearbyintf, + nearbyintl, + nextafter, + nextafterf, + nextafterl, + nexttoward, + nexttowardf, + nexttowardl, + pow, + powf, + powl, + printf, + realloc, + remainder, + remainderf, + remainderl, + remquo, + remquof, + remquol, + rindex, + rint, + rintf, + rintl, + round, + roundeven, + roundevenf, + roundevenl, + roundf, + roundl, + savectx, + scalbln, + scalblnf, + scalblnl, + scalbn, + scalbnf, + scalbnl, + scanf, + setjmp, + siglongjmp, + sigsetjmp, + sin, + sinf, + sinh, + sinhf, + sinhl, + sinl, + snprintf, + sprintf, + sqrt, + sqrtf, + sqrtl, + sscanf, + stpcpy, + stpncpy, + strcasecmp, + strcat, + strchr, + strcmp, + strcpy, + strcspn, + strdup, + strerror, + strlcat, + strlcpy, + strlen, + strncasecmp, + strncat, + strncmp, + strncpy, + strndup, + strpbrk, + strrchr, + strspn, + strstr, + strtod, + strtof, + strtok, + strtol, + strtold, + strtoll, + strtoul, + strtoull, + strxfrm, + tan, + tanf, + tanh, + tanhf, + tanhl, + tanl, + tgamma, + tgammaf, + tgammal, + tolower, + toupper, + trunc, + truncf, + truncl, + va_copy, + va_end, + va_start, + vfork, + vfprintf, + vfscanf, + vprintf, + vscanf, + vsnprintf, + vsprintf, + vsscanf, + wcschr, + wcscmp, + wcslen, + wcsncmp, + wmemchr, + wmemcmp, + wmemcpy, + wmemmove, +}; const Self = @This(); @@ -71,7 +4062,7 @@ pub const longest_name = 43; /// If found, returns the index of the node within the `dafsa` array. /// Otherwise, returns `null`. pub fn findInList(first_child_index: u16, char: u8) ?u16 { - @setEvalBranchQuota(7972); + @setEvalBranchQuota(7982); var index = first_child_index; while (true) { if (dafsa[index].char == char) return index; @@ -119,8 +4110,7 @@ pub fn nameFromUniqueIndex(index: u16, buf: []u8) []u8 { var node_index: u16 = 0; var count: u16 = index; - var fbs = std.io.fixedBufferStream(buf); - const w = fbs.writer(); + var w = std.Io.Writer.fixed(buf); while (true) { var sibling_index = dafsa[node_index].child_index; @@ -142,7 +4132,7 @@ pub fn nameFromUniqueIndex(index: u16, buf: []u8) []u8 { if (count == 0) break; } - return fbs.getWritten(); + return w.buffered(); } /// We're 1 bit shy of being able to fit this in a u32: @@ -177,7 +4167,7 @@ const Node = packed struct(u64) { const dafsa = [_]Node{ .{ .char = 0, .end_of_word = false, .end_of_list = true, .number = 0, .child_index = 1 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3639, .child_index = 19 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3644, .child_index = 19 }, .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 25, .child_index = 32 }, .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 37 }, .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 82, .child_index = 39 }, @@ -200,7 +4190,7 @@ const dafsa = [_]Node{ .{ .char = 'I', .end_of_word = false, .end_of_list = false, .number = 29, .child_index = 104 }, .{ .char = 'M', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 105 }, .{ .char = 'R', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 106 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3563, .child_index = 107 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3568, .child_index = 107 }, .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 125 }, .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 11, .child_index = 127 }, .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 129 }, @@ -285,7 +4275,7 @@ const dafsa = [_]Node{ .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 241 }, .{ .char = 'G', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 242 }, .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 34, .child_index = 243 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2967, .child_index = 248 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2972, .child_index = 248 }, .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 20, .child_index = 249 }, .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 252 }, .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 255 }, @@ -424,7 +4414,7 @@ const dafsa = [_]Node{ .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 404 }, .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 405 }, .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 30, .child_index = 406 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2967, .child_index = 407 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2972, .child_index = 407 }, .{ .char = '1', .end_of_word = false, .end_of_list = false, .number = 17, .child_index = 408 }, .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 409 }, .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 410 }, @@ -583,7 +4573,7 @@ const dafsa = [_]Node{ .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 534 }, .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 535 }, .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 30, .child_index = 536 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2967, .child_index = 537 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2972, .child_index = 537 }, .{ .char = '1', .end_of_word = false, .end_of_list = true, .number = 17, .child_index = 538 }, .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 539 }, .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 540 }, @@ -713,7 +4703,7 @@ const dafsa = [_]Node{ .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 625 }, .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 626 }, .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 30, .child_index = 627 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2967, .child_index = 628 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2972, .child_index = 628 }, .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 17, .child_index = 629 }, .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 630 }, .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 631 }, @@ -804,7 +4794,7 @@ const dafsa = [_]Node{ .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 675 }, .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 572 }, .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 30, .child_index = 676 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2967, .child_index = 677 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2972, .child_index = 677 }, .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 17, .child_index = 678 }, .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 679 }, .{ .char = 'i', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 680 }, @@ -853,7 +4843,7 @@ const dafsa = [_]Node{ .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 731 }, .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 732 }, .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 30, .child_index = 733 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2967, .child_index = 734 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2972, .child_index = 734 }, .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 17, .child_index = 735 }, .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 736 }, .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, @@ -910,7 +4900,7 @@ const dafsa = [_]Node{ .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 804 }, .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 805 }, .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 30, .child_index = 806 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2967, .child_index = 818 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2972, .child_index = 818 }, .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 17, .child_index = 819 }, .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 820 }, .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 821 }, @@ -994,7 +4984,7 @@ const dafsa = [_]Node{ .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 905 }, .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 908 }, .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 910 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2967, .child_index = 911 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2972, .child_index = 911 }, .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 17, .child_index = 932 }, .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 933 }, .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 934 }, @@ -1089,8 +5079,8 @@ const dafsa = [_]Node{ .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 904 }, .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 28, .child_index = 1018 }, .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 302, .child_index = 1019 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 11, .child_index = 1028 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 114, .child_index = 1032 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 1028 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 115, .child_index = 1032 }, .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1044 }, .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 58, .child_index = 1049 }, .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 49, .child_index = 1053 }, @@ -1100,707 +5090,716 @@ const dafsa = [_]Node{ .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 52, .child_index = 1068 }, .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 686, .child_index = 1074 }, .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 25, .child_index = 1080 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1083 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 142, .child_index = 1086 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 52, .child_index = 1091 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 71, .child_index = 1095 }, - .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 19, .child_index = 1107 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 13, .child_index = 1111 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = false, .number = 1273, .child_index = 1115 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 22, .child_index = 1120 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 17, .child_index = 1123 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1124 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 1083 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 142, .child_index = 1087 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 52, .child_index = 1092 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 71, .child_index = 1096 }, + .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 20, .child_index = 1108 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 13, .child_index = 1113 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = false, .number = 1274, .child_index = 1117 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 22, .child_index = 1122 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 17, .child_index = 1125 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1126 }, .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 521 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1125 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 1126 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 36, .child_index = 1127 }, - .{ .char = '0', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1128 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1129 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1130 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1131 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1132 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1133 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1134 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1135 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1127 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 1128 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 36, .child_index = 1129 }, + .{ .char = '0', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1130 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1131 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1132 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1133 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1134 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1135 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1136 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1137 }, .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 960 }, .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 960 }, .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 946 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 14, .child_index = 1138 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1140 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1141 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 14, .child_index = 1140 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1142 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1143 }, .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 944 }, .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 944 }, .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 952 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1131 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1142 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 1126 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1131 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1131 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1143 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1144 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 36, .child_index = 1145 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1153 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1154 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1133 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1144 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 1128 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1133 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1133 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1145 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1146 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 36, .child_index = 1147 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1155 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1156 }, .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 292 }, .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 486 }, - .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1155 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 1126 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1156 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 14, .child_index = 1157 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 1159 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1160 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1161 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1162 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1164 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1165 }, + .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1157 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 1128 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1158 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 14, .child_index = 1159 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 1161 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1162 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1163 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1164 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1166 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1167 }, .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 14, .child_index = 949 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1166 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1167 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 1168 }, - .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 1169 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1170 }, - .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 6, .child_index = 1171 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1172 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1173 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1174 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1175 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1176 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1177 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1168 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1169 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 1170 }, + .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 1171 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1172 }, + .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 6, .child_index = 1173 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1174 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1175 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1176 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1177 }, .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1178 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1179 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1182 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1185 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1187 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1188 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 29, .child_index = 1189 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1196 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1197 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1198 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1199 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1179 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1180 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1181 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1184 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1187 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1189 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1190 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 29, .child_index = 1191 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1198 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1199 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1200 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1201 }, .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1012 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1200 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1201 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1202 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1203 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1204 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1205 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1206 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1202 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1203 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1204 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1205 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1206 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1207 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1208 }, .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1012 }, .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1012 }, .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1001 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1207 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1208 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1209 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1209 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1210 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1211 }, .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1012 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1210 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1211 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 28, .child_index = 1212 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1212 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1213 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 28, .child_index = 1214 }, .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 135 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1221 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1222 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1223 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 122, .child_index = 1225 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1223 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1224 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1225 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 122, .child_index = 1227 }, .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 403 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 134, .child_index = 1226 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 11, .child_index = 1227 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 1229 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 134, .child_index = 1228 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 11, .child_index = 1229 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 1231 }, .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 142 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1230 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1231 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1232 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1233 }, .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 144 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 30, .child_index = 1232 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1239 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 30, .child_index = 1234 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1241 }, .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 137 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1240 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1242 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1242 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1244 }, .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 154 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 11, .child_index = 1243 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 20, .child_index = 1247 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 1251 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 11, .child_index = 1246 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 20, .child_index = 1250 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 1254 }, .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 161 }, .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 162 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1254 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1256 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1257 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1258 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1259 }, - .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1260 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1261 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 25, .child_index = 1262 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1263 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 23, .child_index = 1264 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1266 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1267 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1268 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1269 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 20, .child_index = 1271 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1274 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1276 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1257 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1259 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1260 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1261 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1262 }, + .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1263 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1264 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 25, .child_index = 1265 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1266 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 23, .child_index = 1267 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1269 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1270 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1271 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1272 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 20, .child_index = 1274 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1277 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1279 }, .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 178 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1279 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1280 }, - .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1281 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1282 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1283 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 1284 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 13, .child_index = 1287 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1294 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1296 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1297 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 1298 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 1300 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1302 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1304 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1306 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 135, .child_index = 1307 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1308 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 534, .child_index = 1309 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1310 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 1311 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 1312 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1314 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1315 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1316 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1317 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1318 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 11, .child_index = 1320 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 108, .child_index = 1322 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1323 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 1325 }, - .{ .char = '6', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 1326 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 19, .child_index = 1327 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1331 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 1332 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1334 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 1335 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1336 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1337 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 1338 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1340 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1282 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1283 }, + .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1284 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1285 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1286 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 1287 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 13, .child_index = 1290 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1297 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1299 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1300 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 1301 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 1303 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1305 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1307 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1309 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 135, .child_index = 1310 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1311 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 534, .child_index = 1312 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1313 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 1314 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 1315 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1317 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1318 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1319 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1320 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1321 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1322 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 11, .child_index = 1324 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 108, .child_index = 1326 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1327 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 1329 }, + .{ .char = '6', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 1330 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 19, .child_index = 1331 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1335 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 1336 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1338 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 1339 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1340 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1341 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 1342 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1344 }, .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 220 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1341 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1343 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1344 }, - .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 20, .child_index = 1346 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1349 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1350 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1297 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1351 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1352 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1334 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1340 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1354 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1357 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 227 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1263, .child_index = 1358 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1359 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1345 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1347 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1348 }, + .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 20, .child_index = 1350 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1353 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1354 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1300 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1355 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1356 }, + .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1358 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1338 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1344 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1359 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1362 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1363 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1263, .child_index = 1364 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1365 }, .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 176 }, .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 231 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 14, .child_index = 1361 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 14, .child_index = 1367 }, .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 235 }, .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 236 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 17, .child_index = 1362 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 17, .child_index = 1368 }, .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 572 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1363 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 1364 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 36, .child_index = 1368 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1376 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1379 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1380 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1381 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1383 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1384 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1385 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1389 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1369 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 1370 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 36, .child_index = 1374 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1382 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1385 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1386 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1387 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1389 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1390 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1391 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1395 }, .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 451 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1390 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1384 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 1364 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1394 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1395 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1131 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1390 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1396 }, - .{ .char = 'c', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1397 }, - .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1399 }, - .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1397 }, - .{ .char = 'h', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1399 }, - .{ .char = 'i', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1397 }, - .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 1400 }, - .{ .char = 's', .end_of_word = true, .end_of_list = false, .number = 6, .child_index = 1402 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 13, .child_index = 1405 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1409 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1410 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1396 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1390 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 1370 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1400 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1401 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1133 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1396 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1402 }, + .{ .char = 'c', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1403 }, + .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1405 }, + .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1403 }, + .{ .char = 'h', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1405 }, + .{ .char = 'i', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1403 }, + .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 1406 }, + .{ .char = 's', .end_of_word = true, .end_of_list = false, .number = 6, .child_index = 1408 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 13, .child_index = 1411 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1415 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1416 }, .{ .char = '4', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 974 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1411 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1412 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 1364 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 1413 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1131 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1417 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1418 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 1370 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 1419 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1133 }, .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 950 }, .{ .char = 'i', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1389 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1414 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1415 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1131 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1419 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 1422 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 1423 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1425 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1426 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1430 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1431 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1395 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1420 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1421 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1133 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1425 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 1428 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 1429 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1431 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1432 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1436 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1437 }, .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 344 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1432 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1433 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1434 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1435 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1436 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1437 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1438 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1439 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1440 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1441 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1442 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1443 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1444 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1445 }, - .{ .char = 'A', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1446 }, - .{ .char = 'C', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1447 }, - .{ .char = 'D', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1448 }, - .{ .char = 'E', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 1449 }, - .{ .char = 'I', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1450 }, - .{ .char = 'O', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1451 }, - .{ .char = 'X', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1452 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1453 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1438 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1439 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1440 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1441 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1442 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1443 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1444 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1445 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1446 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1447 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1448 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1449 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1450 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1451 }, + .{ .char = 'A', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1452 }, + .{ .char = 'C', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1453 }, + .{ .char = 'D', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1454 }, + .{ .char = 'E', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 1455 }, + .{ .char = 'I', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1456 }, + .{ .char = 'O', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1457 }, + .{ .char = 'X', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1458 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1459 }, .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 344 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1454 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1455 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1456 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1460 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1461 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1462 }, .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 585 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1457 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1458 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1459 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1460 }, - .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1461 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1462 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1463 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1464 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1465 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1466 }, - .{ .char = 'C', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1467 }, - .{ .char = 'N', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1468 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1469 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1470 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1471 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1472 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1473 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 1474 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1477 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1480 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1481 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1483 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1484 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 122, .child_index = 1485 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 134, .child_index = 1486 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1350 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1487 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 1488 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1489 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1490 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1463 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1464 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1465 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1466 }, + .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1467 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1468 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1469 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1470 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1471 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1472 }, + .{ .char = 'C', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1473 }, + .{ .char = 'N', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1474 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1475 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1476 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1477 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1478 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1479 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 1480 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1483 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1486 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1487 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1489 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1490 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 122, .child_index = 1491 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 134, .child_index = 1492 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1354 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1493 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 1494 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1495 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1497 }, .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 294 }, .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 137 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1491 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1492 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1498 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1499 }, .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 296 }, .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 140 }, .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 164 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1493 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1494 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1500 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1501 }, .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 299 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1495 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1496 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1502 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1503 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1504 }, .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 296 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1497 }, - .{ .char = 'z', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1498 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1500 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1501 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1504 }, - .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 9, .child_index = 1505 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1505 }, + .{ .char = 'z', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1506 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1508 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1509 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1512 }, + .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 9, .child_index = 1513 }, .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 209 }, .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 306 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1508 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1516 }, .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 223 }, - .{ .char = 'z', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1498 }, + .{ .char = 'z', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1506 }, .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 496 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1509 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1510 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1511 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1512 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1513 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 1514 }, - .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 8, .child_index = 1515 }, - .{ .char = 'p', .end_of_word = true, .end_of_list = false, .number = 21, .child_index = 1518 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1524 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1526 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1527 }, - .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1528 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1529 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1530 }, - .{ .char = 'a', .end_of_word = true, .end_of_list = false, .number = 10, .child_index = 1531 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1534 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1535 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1536 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1517 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1518 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1519 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1520 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1521 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 1522 }, + .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 8, .child_index = 1523 }, + .{ .char = 'p', .end_of_word = true, .end_of_list = false, .number = 21, .child_index = 1526 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1532 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1534 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1535 }, + .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1536 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1537 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1538 }, + .{ .char = 'a', .end_of_word = true, .end_of_list = false, .number = 10, .child_index = 1539 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1542 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1543 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1544 }, .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 210 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1537 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1538 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1540 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1541 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1543 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1544 }, - .{ .char = '3', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1545 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1546 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1545 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1546 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1548 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1549 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1551 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1552 }, + .{ .char = '3', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1553 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1554 }, .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 332 }, - .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 5, .child_index = 1547 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1549 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1550 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1551 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1553 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1554 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1555 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1556 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1558 }, + .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 5, .child_index = 1555 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1557 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1558 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1559 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1561 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1562 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1563 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1564 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1566 }, .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 344 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1559 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1560 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1561 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1567 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1568 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1569 }, .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 194 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1302 }, - .{ .char = 'g', .end_of_word = true, .end_of_list = false, .number = 23, .child_index = 1562 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1305 }, + .{ .char = 'g', .end_of_word = true, .end_of_list = false, .number = 23, .child_index = 1570 }, .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 352 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1567 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1568 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1575 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1576 }, .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 295 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1569 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1570 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 135, .child_index = 1574 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1575 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 534, .child_index = 1576 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1577 }, - .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 10, .child_index = 1578 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1581 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1582 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1583 }, - .{ .char = 'j', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1585 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1587 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1588 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1589 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1590 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1591 }, - .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 8, .child_index = 1592 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 108, .child_index = 1595 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1596 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1577 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1578 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 135, .child_index = 1582 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1583 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 534, .child_index = 1584 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1585 }, + .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 10, .child_index = 1586 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1589 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1590 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1591 }, + .{ .char = 'j', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1593 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1595 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1596 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1597 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1598 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1599 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1600 }, + .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 8, .child_index = 1601 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 108, .child_index = 1604 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1605 }, .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 365 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 1598 }, - .{ .char = '0', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 1599 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1600 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 1602 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1603 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1605 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1606 }, - .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1608 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1609 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1610 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 1611 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1613 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1618 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1619 }, - .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 9, .child_index = 1505 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1620 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1621 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 1607 }, + .{ .char = '0', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 1608 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1609 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 1611 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1612 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1614 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1615 }, + .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1617 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1618 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1619 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 1620 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1622 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1627 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1628 }, + .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 9, .child_index = 1513 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1629 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1630 }, .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 210 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1622 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1631 }, .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 327 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1623 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1624 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1632 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1633 }, .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 377 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 17, .child_index = 1625 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1481 }, - .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 8, .child_index = 1632 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1635 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 17, .child_index = 1634 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1487 }, + .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 8, .child_index = 1641 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1644 }, .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 291 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1636 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1637 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1639 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1640 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1623 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1263, .child_index = 1641 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1645 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1646 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1647 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1649 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1650 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1632 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1651 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1263, .child_index = 1655 }, .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 176 }, .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 178 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 14, .child_index = 1642 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 17, .child_index = 1643 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1650 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1131 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1131 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1131 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1131 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 1651 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1653 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1654 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1655 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 1656 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1658 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1659 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1660 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 14, .child_index = 1656 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 17, .child_index = 1657 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1664 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1133 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1133 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1133 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1133 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 1665 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1667 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1668 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1669 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 1670 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1672 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1673 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1674 }, .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 519 }, .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 585 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1662 }, - .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1663 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1664 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1676 }, + .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1677 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1678 }, .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, - .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1665 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1666 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1667 }, - .{ .char = 'm', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1668 }, - .{ .char = 'n', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1668 }, - .{ .char = 'p', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1668 }, - .{ .char = 'z', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1668 }, + .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1679 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1680 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1681 }, + .{ .char = 'm', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1682 }, + .{ .char = 'n', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1682 }, + .{ .char = 'p', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1682 }, + .{ .char = 'z', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1682 }, .{ .char = 'i', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, .{ .char = 'm', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'n', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'p', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'z', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1669 }, - .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1668 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1670 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1683 }, + .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1682 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1684 }, .{ .char = '2', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = '4', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, .{ .char = '2', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, .{ .char = '2', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, - .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1399 }, + .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1405 }, .{ .char = '2', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = '4', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, - .{ .char = 'c', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1397 }, - .{ .char = 'c', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1397 }, - .{ .char = 'i', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1397 }, - .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 1400 }, - .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1397 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1671 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1672 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1673 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1676 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 1677 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1678 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1679 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1680 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1681 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1682 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1683 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1685 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1686 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 1687 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1688 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1689 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1690 }, - .{ .char = '1', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1691 }, + .{ .char = 'c', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1403 }, + .{ .char = 'c', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1403 }, + .{ .char = 'i', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1403 }, + .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 1406 }, + .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1403 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1685 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1686 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1687 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1690 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 1691 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1692 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1693 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1694 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1695 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1696 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1697 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1699 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1700 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 1701 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1702 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1703 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1704 }, + .{ .char = '1', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1705 }, .{ .char = '2', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = '4', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = '8', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1692 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1693 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1694 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1434 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1695 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1696 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1697 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1698 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1699 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1700 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1701 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1702 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1703 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1704 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1705 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1706 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1708 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1709 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1710 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1711 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1710 }, - .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1712 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1451 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1714 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1715 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1716 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1706 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1707 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1708 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1440 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1709 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1710 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1711 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1712 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1713 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1714 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1715 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1716 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1717 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1718 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1719 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1720 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1722 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1723 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1724 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1725 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1724 }, + .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1726 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1457 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1728 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1729 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1730 }, .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 899 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1717 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1718 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1719 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1720 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1731 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1732 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1733 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1734 }, .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 457 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1721 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1722 }, - .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1461 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1723 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1724 }, - .{ .char = 'F', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1725 }, - .{ .char = 'S', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1725 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1735 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1736 }, + .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1467 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1737 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1738 }, + .{ .char = 'F', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1739 }, + .{ .char = 'S', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1739 }, .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 409 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1473 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1726 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1727 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1728 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1470 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1473 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1729 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1470 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1473 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1731 }, - .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 8, .child_index = 1632 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1733 }, - .{ .char = 'c', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1734 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1737 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1738 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 122, .child_index = 1739 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 134, .child_index = 1740 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1756 }, - .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 12, .child_index = 1757 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1761 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1762 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1763 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1765 }, - .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1766 }, - .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1547 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1768 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1769 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1770 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1479 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1740 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1741 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1742 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1476 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1479 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1743 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1476 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1479 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1745 }, + .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 8, .child_index = 1641 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1747 }, + .{ .char = 'c', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1748 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1751 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1752 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 122, .child_index = 1753 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 134, .child_index = 1754 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1770 }, + .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 12, .child_index = 1771 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1775 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1776 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1777 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1778 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1780 }, + .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1781 }, + .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1555 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1783 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1784 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1785 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1786 }, .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 549 }, .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1771 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1787 }, .{ .char = 'j', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 361 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1772 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1773 }, - .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1774 }, - .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1775 }, - .{ .char = 'h', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 1766 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1788 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1789 }, + .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1790 }, + .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1791 }, + .{ .char = 'h', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 1781 }, .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1776 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1778 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1779 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1780 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1781 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1782 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 1783 }, - .{ .char = 'c', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 1766 }, - .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1784 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1792 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1794 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1795 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1796 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1797 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1798 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 1799 }, + .{ .char = 'c', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 1781 }, + .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1800 }, .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = '1', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1785 }, - .{ .char = '2', .end_of_word = true, .end_of_list = false, .number = 5, .child_index = 1547 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1786 }, - .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1775 }, + .{ .char = '1', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1801 }, + .{ .char = '2', .end_of_word = true, .end_of_list = false, .number = 5, .child_index = 1555 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1802 }, + .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1791 }, .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1787 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1788 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1789 }, - .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1547 }, - .{ .char = 'm', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1766 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1803 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1804 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1805 }, + .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1555 }, + .{ .char = 'm', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1781 }, .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 549 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1790 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1791 }, - .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1775 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1806 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1807 }, + .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1791 }, .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, - .{ .char = 'x', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1547 }, - .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1547 }, - .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1547 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1792 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1793 }, + .{ .char = 'x', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1555 }, + .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1555 }, + .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1555 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1808 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1809 }, .{ .char = 'e', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1794 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1795 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1810 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1811 }, .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 458 }, .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 344 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1796 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1493 }, - .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1797 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1798 }, - .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1775 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1812 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1500 }, + .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1813 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1814 }, + .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1791 }, .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1799 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1800 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1801 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1802 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1803 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1804 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1805 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1815 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1816 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1817 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1818 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1819 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1820 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1821 }, .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 457 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1806 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1807 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1808 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1794 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1809 }, - .{ .char = '1', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 1810 }, - .{ .char = '2', .end_of_word = true, .end_of_list = false, .number = 5, .child_index = 1547 }, - .{ .char = 'b', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 1766 }, - .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1775 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1822 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1823 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1824 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1810 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1825 }, + .{ .char = '1', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 1826 }, + .{ .char = '2', .end_of_word = true, .end_of_list = false, .number = 5, .child_index = 1555 }, + .{ .char = 'b', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 1781 }, + .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1791 }, .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1493 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1812 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1813 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1814 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1500 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1828 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1829 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1830 }, .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 484 }, .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 485 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1817 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 135, .child_index = 1818 }, - .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1766 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 534, .child_index = 1819 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1733 }, - .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1775 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1833 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 135, .child_index = 1834 }, + .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1781 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 534, .child_index = 1835 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1747 }, + .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1791 }, .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, - .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1547 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1834 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1835 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1837 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1838 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1839 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1840 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1841 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1842 }, - .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1843 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1844 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1845 }, - .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1775 }, + .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1555 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1850 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1851 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1853 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1854 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1855 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1856 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1857 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1858 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1859 }, + .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1860 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1861 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1862 }, + .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1791 }, .{ .char = 'i', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 361 }, .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 108, .child_index = 1846 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1462 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1859 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 1860 }, - .{ .char = '0', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 1863 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1864 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 108, .child_index = 1863 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1468 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1876 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 1877 }, + .{ .char = '0', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 1880 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1881 }, .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 295 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 7, .child_index = 1866 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1867 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1868 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1869 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 7, .child_index = 1883 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1884 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1885 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1886 }, .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 332 }, - .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1547 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1870 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1871 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1872 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1874 }, + .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1555 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1887 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1888 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1889 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1891 }, .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 496 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1875 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1876 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1892 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1893 }, .{ .char = 'j', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 497 }, .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 344 }, .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 519 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1877 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1878 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1872 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1879 }, - .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1547 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1872 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1880 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1894 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1895 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1889 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1896 }, + .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1555 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1889 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1897 }, .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 500 }, .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 505 }, .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 323 }, @@ -1808,11338 +5807,7384 @@ const dafsa = [_]Node{ .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 511 }, .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 512 }, .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 513 }, - .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1784 }, - .{ .char = 'h', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 1766 }, + .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1800 }, + .{ .char = 'h', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 1781 }, .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1881 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1882 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1883 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1884 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1885 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1886 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1263, .child_index = 1887 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 14, .child_index = 1888 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1889 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1890 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1898 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1899 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1900 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1901 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1902 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1903 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1904 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1905 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 518 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 519 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 520 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1263, .child_index = 1906 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 14, .child_index = 1907 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1908 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1909 }, .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 898 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1891 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1893 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1894 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1896 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1897 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1898 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1899 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1900 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1901 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1901 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1902 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1903 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1904 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1905 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1906 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1658 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1907 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1910 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1912 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1913 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1915 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1916 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 1917 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1918 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1919 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1920 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1920 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 1921 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1922 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1923 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1924 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1925 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1672 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1926 }, .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 569 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1908 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1909 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1910 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1911 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1912 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1913 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1914 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1927 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1928 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1929 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1930 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1931 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1932 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1933 }, .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 458 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1915 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1934 }, .{ .char = 'i', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 655 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1918 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1920 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 1921 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1922 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1923 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1924 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1925 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1926 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1937 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1939 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 1940 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1941 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1942 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1943 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1944 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1945 }, .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 655 }, .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 450 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1927 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1389 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 1928 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1929 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1930 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1931 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1946 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1395 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 1947 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1948 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1949 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1950 }, .{ .char = '6', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1932 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1933 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1934 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1935 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1936 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1937 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1438 }, - .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1938 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1939 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1940 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1951 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1952 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1953 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1954 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1955 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1956 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1444 }, + .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1957 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1958 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1959 }, .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 286 }, .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 572 }, .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 451 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1941 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1942 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1943 }, - .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1712 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1944 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1945 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1946 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1960 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1961 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1962 }, + .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1726 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1963 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1964 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 1965 }, .{ .char = '1', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 648 }, .{ .char = '8', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1947 }, - .{ .char = 'I', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1443 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1948 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1949 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1950 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1951 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1957 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1958 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1199 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1959 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1199 }, - .{ .char = 'S', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1960 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1961 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1962 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1966 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1967 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1969 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1470 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1473 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1972 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1966 }, + .{ .char = 'I', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1449 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1967 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1968 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1969 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 1970 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1976 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1977 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1201 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1978 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1201 }, + .{ .char = 'S', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1979 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1980 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1981 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1985 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 1986 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 1988 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1476 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1479 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1991 }, .{ .char = 'b', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 549 }, .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1973 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1974 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 122, .child_index = 1975 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 11, .child_index = 1976 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1979 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1982 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1983 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 1984 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 1985 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1992 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1993 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 122, .child_index = 1994 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 11, .child_index = 1995 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1998 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2001 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2002 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 2003 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2004 }, .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 420 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1987 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 1988 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 1991 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 51, .child_index = 1993 }, - .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2000 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 2003 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2008 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2009 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2006 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 2007 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2010 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 51, .child_index = 2012 }, + .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2019 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 2022 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2027 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2028 }, .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 274 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2011 }, - .{ .char = '2', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 1766 }, - .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1784 }, - .{ .char = 'h', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 1766 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2030 }, + .{ .char = '2', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 1781 }, + .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1800 }, + .{ .char = 'h', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 1781 }, .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2012 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2013 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2016 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1319 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2031 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2032 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2035 }, .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 569 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2017 }, - .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1784 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2036 }, + .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1800 }, .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2018 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2019 }, - .{ .char = 'b', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1528 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2037 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2038 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2039 }, + .{ .char = 'b', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1536 }, .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 332 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2020 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2021 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2022 }, - .{ .char = '1', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2023 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2025 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2027 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2028 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2029 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2030 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2031 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2032 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 2033 }, - .{ .char = '1', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2034 }, - .{ .char = '0', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1547 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2035 }, - .{ .char = '1', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1766 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2036 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2037 }, - .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1547 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2038 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2039 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2040 }, - .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1547 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2041 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2042 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2043 }, - .{ .char = 'b', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1766 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2044 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2045 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2040 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2041 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2042 }, + .{ .char = '1', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2043 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2045 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2047 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2048 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2049 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2050 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2051 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2052 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 2053 }, + .{ .char = '1', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2054 }, + .{ .char = '0', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1555 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2055 }, + .{ .char = '1', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1781 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2056 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2057 }, + .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1555 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2058 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2059 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2060 }, + .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1555 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2061 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2062 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2063 }, + .{ .char = 'b', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1781 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2064 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2065 }, .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 328 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2046 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2047 }, - .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2048 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2049 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2050 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2051 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2066 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2067 }, + .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2068 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2069 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2070 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2071 }, .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 579 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2052 }, - .{ .char = '0', .end_of_word = true, .end_of_list = false, .number = 5, .child_index = 1547 }, - .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1766 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2053 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2054 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2072 }, + .{ .char = '0', .end_of_word = true, .end_of_list = false, .number = 5, .child_index = 1555 }, + .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1781 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2073 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2074 }, .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 585 }, .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 291 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2055 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2056 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 135, .child_index = 2057 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 50, .child_index = 2069 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 56, .child_index = 2073 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 50, .child_index = 2079 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 26, .child_index = 2084 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 106, .child_index = 2087 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 2098 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 2100 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 2102 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 73, .child_index = 2103 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 2108 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2110 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 2111 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 97, .child_index = 2112 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2119 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2120 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2121 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2122 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2123 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2124 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2125 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2126 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2127 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2128 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2129 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2130 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2131 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2132 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2133 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2134 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2136 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2137 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 41, .child_index = 2138 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2144 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2145 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2147 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 19, .child_index = 2150 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2155 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2156 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 2160 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2163 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2166 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2167 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2168 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2169 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 2170 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2172 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1876 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 7, .child_index = 2173 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2174 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2175 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2176 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2177 }, - .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 10, .child_index = 2178 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1733 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2181 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2183 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2185 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2075 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2076 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 135, .child_index = 2077 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 50, .child_index = 2089 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 56, .child_index = 2093 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 50, .child_index = 2099 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 26, .child_index = 2104 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 106, .child_index = 2107 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 2118 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 2120 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 2122 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 73, .child_index = 2123 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 2128 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2130 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 2131 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 97, .child_index = 2132 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2139 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2140 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2141 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2142 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2143 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2144 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2145 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2146 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2147 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2148 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2149 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2150 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2151 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2152 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2153 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2154 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2155 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2157 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2158 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 41, .child_index = 2159 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2165 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2166 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2168 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 19, .child_index = 2171 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2176 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2177 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 2181 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2184 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2187 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2188 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2189 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2190 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 2191 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2193 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1893 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 7, .child_index = 2194 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2195 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2196 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2197 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2198 }, + .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 10, .child_index = 2199 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1747 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2202 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2204 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2206 }, .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 654 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2186 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2187 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2188 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2189 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2036 }, - .{ .char = 'c', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1547 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1589 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2190 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2191 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2192 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1263, .child_index = 2193 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 14, .child_index = 2194 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2196 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2197 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2207 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2208 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2209 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2210 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2056 }, + .{ .char = 'c', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 1555 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2211 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1598 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2212 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2213 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2214 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1959 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1263, .child_index = 2215 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 14, .child_index = 2216 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2218 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2219 }, .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 238 }, .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1007 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2198 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2220 }, .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1013 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2199 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2221 }, .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1017 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2200 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2202 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1904 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1904 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2203 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2204 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2204 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2205 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1904 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2206 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2222 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2224 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1923 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1923 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2225 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2226 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2226 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2227 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1923 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2228 }, .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 569 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2207 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2211 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2212 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2213 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2214 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2215 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2216 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2217 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2229 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2233 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2234 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2235 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2236 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2237 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2238 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2239 }, .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 655 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2218 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2240 }, .{ .char = 'i', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 655 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2219 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 2220 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1131 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2221 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2222 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1926 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2223 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2225 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 2226 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2227 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2228 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2229 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2230 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2231 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2232 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2241 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 2242 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1133 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2243 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2244 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1945 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2245 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2247 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 2248 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2249 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2250 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2251 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2252 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2253 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2254 }, .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 580 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2233 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2234 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2255 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2256 }, .{ .char = '6', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 649 }, .{ .char = '6', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 649 }, .{ .char = 'g', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2235 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2236 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2237 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2238 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2239 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2240 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2241 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2257 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2258 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2259 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2260 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2261 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2262 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2263 }, .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 582 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2242 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1464 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2243 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2245 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2247 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2264 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1470 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2265 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2267 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2269 }, .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 585 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2248 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2270 }, .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 664 }, - .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2249 }, + .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2271 }, .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 656 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2250 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2251 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2252 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2253 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2255 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2256 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2257 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2258 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2259 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2256 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2260 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2262 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2262 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2263 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2264 }, - .{ .char = 'a', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 2266 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 122, .child_index = 2267 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2268 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2269 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2272 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1940 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2272 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2273 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2274 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2275 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2277 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2278 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2279 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2280 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2281 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2278 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2282 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2284 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2284 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2285 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2286 }, + .{ .char = 'a', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 2288 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 122, .child_index = 2289 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2290 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2291 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2294 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1959 }, .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 412 }, .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 412 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2273 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2295 }, .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 412 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 7, .child_index = 2274 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2277 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2278 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2280 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2281 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2283 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2284 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2286 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2287 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2288 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2290 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2293 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 2295 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2297 }, - .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 2299 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2302 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2303 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 7, .child_index = 2296 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2299 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2300 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2302 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2303 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2305 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2306 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2308 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2309 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2310 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2312 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2315 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 2317 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2319 }, + .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 2321 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2324 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2325 }, .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 520 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2305 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2288 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2293 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2293 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 2306 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2302 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2308 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2327 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2310 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2315 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2315 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 2328 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2324 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2330 }, .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 431 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2287 }, - .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 2309 }, - .{ .char = 'v', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 2310 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2309 }, + .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 2331 }, + .{ .char = 'v', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 2332 }, .{ .char = '1', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 648 }, - .{ .char = '3', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2311 }, + .{ .char = '3', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2333 }, .{ .char = '6', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 649 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2312 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2313 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2314 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2315 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2316 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2317 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2318 }, - .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2319 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2334 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2335 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2336 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2337 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2338 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2339 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2340 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2341 }, + .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2342 }, .{ .char = '6', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 238 }, .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2320 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2321 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2322 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2323 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2325 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2326 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 2327 }, - .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2319 }, - .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2328 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2329 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2330 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2331 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2332 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2333 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2334 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2335 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2336 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2337 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2338 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2339 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2340 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2236 }, - .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 2341 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2343 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2344 }, - .{ .char = 'a', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1766 }, - .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1766 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2345 }, - .{ .char = 'y', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2346 }, - .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2346 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 19, .child_index = 2347 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2350 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 2353 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 2354 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2355 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2356 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2357 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 2360 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 21, .child_index = 2365 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2368 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 25, .child_index = 2371 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2373 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 2374 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2375 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2376 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 2377 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2378 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 2379 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2380 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 13, .child_index = 2382 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 2384 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2385 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2386 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2387 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 32, .child_index = 2388 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2390 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2387 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2391 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2392 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 2098 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2393 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 2394 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2400 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2401 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2402 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2404 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2405 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 14, .child_index = 2406 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2410 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 26, .child_index = 2413 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2420 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2423 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2424 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 2425 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2426 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2427 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 28, .child_index = 2430 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 20, .child_index = 2432 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 2433 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2435 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2436 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2437 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2110 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2439 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 2441 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2443 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2444 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 2445 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2447 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 32, .child_index = 2448 }, - .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2450 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 24, .child_index = 2452 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2453 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2110 }, - .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2454 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2455 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2456 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2457 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2458 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2459 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2460 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2461 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2462 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2463 }, - .{ .char = 'y', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1528 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2464 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2465 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2466 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2467 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2468 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2469 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2470 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2472 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2473 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2474 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 13, .child_index = 2476 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2479 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2481 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2482 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1379 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2483 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2484 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2485 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2487 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2488 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2491 }, - .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2492 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2495 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2496 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2497 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2498 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2499 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2501 }, - .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2502 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2506 }, - .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1663 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2343 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2344 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2345 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2346 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2348 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2349 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 2350 }, + .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2342 }, + .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2351 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2352 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2353 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2354 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2355 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2356 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2357 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2358 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2359 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2360 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2361 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2362 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2363 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2258 }, + .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 2364 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2366 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2367 }, + .{ .char = 'a', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1781 }, + .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1781 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2368 }, + .{ .char = 'y', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2369 }, + .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2369 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 19, .child_index = 2370 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2373 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 2376 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 2377 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2378 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2379 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2380 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 2383 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 21, .child_index = 2388 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2391 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 25, .child_index = 2394 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2396 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 2397 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2398 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2399 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 2400 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2401 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 2402 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2403 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 13, .child_index = 2405 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 2407 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2408 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2409 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2410 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 32, .child_index = 2411 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2413 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2410 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2414 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2415 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 2118 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2416 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 2417 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2423 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2424 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2425 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2427 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2428 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 14, .child_index = 2429 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2433 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 26, .child_index = 2436 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2443 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2446 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2447 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 2448 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2449 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2450 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 28, .child_index = 2453 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 20, .child_index = 2455 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 2456 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2458 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2459 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2460 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2130 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2462 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 2464 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2466 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2467 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 2468 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2470 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 32, .child_index = 2471 }, + .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2473 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 24, .child_index = 2475 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2476 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2130 }, + .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2477 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2478 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2479 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2480 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2481 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2482 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2483 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2484 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2485 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2486 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2487 }, + .{ .char = 'y', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1536 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2488 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2489 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2490 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2491 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2492 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2493 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2494 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2496 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2497 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2498 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 13, .child_index = 2500 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2503 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2505 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2506 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1385 }, .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2507 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2508 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2508 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2509 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2511 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2512 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2515 }, + .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2516 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2519 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2520 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2521 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2522 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2523 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2525 }, + .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2526 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2530 }, + .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1677 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2531 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2532 }, .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2509 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2510 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2511 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2512 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2513 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2514 }, - .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2515 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 7, .child_index = 2516 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2517 }, - .{ .char = 'o', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1766 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2040 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2518 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2520 }, - .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1775 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2533 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2534 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2535 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2536 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2537 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2538 }, + .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2539 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 7, .child_index = 2540 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2541 }, + .{ .char = 'o', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1781 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2060 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2542 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2544 }, + .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 3, .child_index = 1791 }, .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1733 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1577 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2521 }, - .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1766 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2522 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2523 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1747 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1585 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2545 }, + .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1781 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2546 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2547 }, .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 297 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2524 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2548 }, .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 429 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2525 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2526 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2527 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1263, .child_index = 2528 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2540 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2543 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2544 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2545 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2549 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2550 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2551 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2552 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1263, .child_index = 2553 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2565 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2568 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2569 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2570 }, .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 458 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2546 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2547 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2548 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2549 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2550 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2551 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2552 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1904 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2553 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2554 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2555 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2556 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2571 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2572 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2573 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2574 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2575 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2576 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2577 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1923 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2578 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2579 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2580 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2581 }, .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 496 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2557 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2559 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2560 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2561 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2562 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2582 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2584 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2585 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2586 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2587 }, .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 568 }, .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 344 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2566 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 2567 }, - .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1926 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1926 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2568 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2568 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2569 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 2570 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2571 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2572 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2573 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2574 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2575 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2576 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2591 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 2592 }, + .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1945 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1945 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2593 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2593 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2594 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 2595 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2596 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2597 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2598 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2599 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2600 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2601 }, .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 674 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2577 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2578 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2602 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2603 }, .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 584 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2579 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2580 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2581 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2582 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2583 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2584 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2604 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2605 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2606 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2607 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2608 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2609 }, .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 458 }, .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 458 }, .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 463 }, .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 457 }, .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 519 }, .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 412 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2585 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2586 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2587 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2588 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2259 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2589 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2590 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2259 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2591 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2592 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2589 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2591 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2589 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2260 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2593 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2594 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2610 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2611 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2612 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2613 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2281 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2614 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2615 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2281 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2616 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2617 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2614 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2616 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2614 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2282 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2618 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2619 }, .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 291 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2595 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 122, .child_index = 2597 }, - .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1399 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2620 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 122, .child_index = 2622 }, + .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1405 }, .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 332 }, - .{ .char = 's', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1938 }, - .{ .char = 'z', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1938 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2614 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2615 }, + .{ .char = 's', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1957 }, + .{ .char = 'z', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1957 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2639 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2640 }, .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 332 }, - .{ .char = 'c', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 2616 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2618 }, - .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 2619 }, - .{ .char = 'c', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1399 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2621 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1207 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1708 }, + .{ .char = 'c', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 2641 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2643 }, + .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 2644 }, + .{ .char = 'c', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 1405 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2646 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1209 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 1722 }, .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 463 }, .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 655 }, .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 463 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2622 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1699 }, - .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 2623 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2625 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2647 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1713 }, + .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 2648 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2650 }, .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 463 }, .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, - .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2615 }, + .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2640 }, .{ .char = 'v', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 549 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2288 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2626 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 14, .child_index = 2628 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2630 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2633 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2635 }, - .{ .char = 'c', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 2616 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2310 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2651 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 14, .child_index = 2653 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2655 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2658 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2660 }, + .{ .char = 'c', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 2641 }, .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 332 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2618 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2636 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2638 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2639 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2640 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2641 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2635 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2644 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2645 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2647 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2643 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2661 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2663 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2664 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2665 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2666 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2660 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2669 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2670 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2672 }, .{ .char = '2', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2648 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2649 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2650 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2651 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2652 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2653 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1534 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2673 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2674 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2675 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2676 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2677 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2678 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2679 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1542 }, .{ .char = '8', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2654 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2655 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2656 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2657 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2658 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2659 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2660 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 2661 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2662 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2663 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1795 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2664 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2665 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2680 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2681 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2682 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2683 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2684 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2685 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2686 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 2687 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2688 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2689 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1811 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2690 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2691 }, .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 729 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2666 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1494 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2667 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2669 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2670 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1197 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2671 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2672 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2673 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2692 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1501 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2693 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2695 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2696 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1199 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2697 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2698 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2699 }, .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 655 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2674 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2675 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2677 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2678 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 15, .child_index = 2679 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2680 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2700 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2701 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2703 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 2704 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 15, .child_index = 2705 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2706 }, .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 479 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2681 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2682 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 2683 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 2684 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2686 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2687 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2688 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2707 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2708 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 2709 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 2710 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2712 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2713 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2714 }, .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 463 }, .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 463 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2689 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2691 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2692 }, - .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2693 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 14, .child_index = 2694 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2695 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2696 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 2697 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2698 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2699 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2700 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 2701 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 13, .child_index = 2704 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2699 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 24, .child_index = 2705 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2439 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2708 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 2709 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2711 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 2712 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2713 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2439 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2714 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2385 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2715 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2717 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2722 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2724 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 2725 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 2725 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2727 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2728 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2729 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2730 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2731 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2732 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2733 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2736 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2737 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2738 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2741 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2742 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2745 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2746 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2748 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2749 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2750 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2752 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2753 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2754 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2755 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2756 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2757 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2731 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2732 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2758 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2736 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2737 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2760 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 2761 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2745 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2765 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2766 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2767 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2768 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 2769 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2773 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2775 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2779 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2781 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 20, .child_index = 2782 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 20, .child_index = 2782 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2728 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2784 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2785 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2786 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2789 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2789 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2790 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2791 }, - .{ .char = 'k', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2792 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2794 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2728 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2795 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2722 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2722 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2796 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 2797 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 2797 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2775 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 24, .child_index = 2800 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2802 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1567 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2803 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2804 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2805 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2807 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2808 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2809 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2810 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2811 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2812 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2813 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2715 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2717 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2718 }, + .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2719 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 14, .child_index = 2720 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2721 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2722 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 2723 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2724 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2725 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2726 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 2727 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 13, .child_index = 2730 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2725 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 24, .child_index = 2731 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2462 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2734 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 2735 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2737 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 2738 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2739 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2462 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2740 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2408 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2741 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2743 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2748 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2750 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 2751 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 2751 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2753 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2754 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2755 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2756 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2757 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2758 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2759 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2762 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2763 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2764 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2767 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2768 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2771 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2772 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2774 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2775 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2776 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2778 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2779 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2781 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2782 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2783 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2757 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2758 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2784 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2762 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2763 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2786 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 2787 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2771 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2791 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2792 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2793 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2794 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 2795 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2799 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2801 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2805 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2807 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 20, .child_index = 2808 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 20, .child_index = 2808 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2754 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2810 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2811 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2812 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2815 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2815 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2816 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2817 }, + .{ .char = 'k', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2818 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2820 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2754 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2821 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2748 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2748 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2822 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 2823 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 2823 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2801 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 24, .child_index = 2826 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2828 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 1575 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2829 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2830 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2831 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2832 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2833 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2834 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 496 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2835 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2836 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2837 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2838 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2839 }, .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 412 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2814 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2815 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2819 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2820 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2822 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2824 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2825 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2826 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2827 }, - .{ .char = 'e', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 2829 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 2830 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2835 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2836 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2837 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2838 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2839 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2840 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2841 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2840 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1379 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2842 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2843 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2844 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2845 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2842 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2846 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2843 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2844 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2847 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2848 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2850 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2851 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2852 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2853 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2855 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2856 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2857 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2858 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2856 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2859 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2840 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2841 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2845 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2846 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2848 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2850 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2851 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2852 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2853 }, + .{ .char = 'e', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 2855 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 2856 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2861 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2862 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2863 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2864 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2865 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2866 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2867 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2866 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1385 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2868 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2869 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2870 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2871 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2868 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2872 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2869 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2870 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2873 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2874 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2876 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2877 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2878 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2879 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2881 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2882 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2883 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2884 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2882 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2885 }, .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2860 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2861 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2862 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2863 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2864 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2865 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2866 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2868 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 7, .child_index = 2869 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2803 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2873 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2874 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2875 }, - .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1766 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1530 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2653 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2876 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2877 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2878 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2879 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2880 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2881 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2883 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2885 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2886 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2890 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2892 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 393, .child_index = 2893 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2897 }, - .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2899 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = false, .number = 836, .child_index = 2901 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2915 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2916 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2917 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2918 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2919 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2920 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2921 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2886 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2887 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2888 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2889 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2890 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2891 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2892 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2894 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 7, .child_index = 2895 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2829 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2899 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2900 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 2901 }, + .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1781 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1538 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2679 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2902 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2903 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2904 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2905 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2906 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2907 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2908 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2910 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2912 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2913 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2917 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2919 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 393, .child_index = 2920 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2924 }, + .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2926 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = false, .number = 836, .child_index = 2928 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2942 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2943 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2944 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2945 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2946 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2947 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2948 }, .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 572 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2922 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2923 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2924 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2925 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2926 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2927 }, - .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2928 }, - .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1389 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2949 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2950 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2951 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2952 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2953 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2954 }, + .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2955 }, + .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1395 }, .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 496 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1671 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1685 }, .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 506 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2929 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2930 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2956 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2957 }, .{ .char = 'z', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1131 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2931 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2932 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2933 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2934 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2935 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 2936 }, - .{ .char = '3', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2311 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1133 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2958 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2959 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2960 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2961 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2962 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 2963 }, + .{ .char = '3', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2333 }, .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 311 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 2937 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2944 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2945 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2946 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 2964 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2971 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2972 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2973 }, .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 572 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2947 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2948 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2949 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2950 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2951 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2952 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2953 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2954 }, - .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1399 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2974 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2975 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2976 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2977 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2978 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 2979 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2980 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 2981 }, + .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1405 }, .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 897 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2955 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2956 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2957 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2958 }, - .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2959 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2960 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2959 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2959 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2961 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2962 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2963 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2964 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2965 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2967 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 13, .child_index = 2968 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 15, .child_index = 2972 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2974 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 2976 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2980 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 2981 }, - .{ .char = 'k', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2985 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2986 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 2989 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2992 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 11, .child_index = 2994 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 23, .child_index = 2997 }, - .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3003 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3004 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 3006 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3008 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3009 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2982 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2983 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2984 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2985 }, + .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2986 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2987 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2986 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2986 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2988 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2989 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2990 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2991 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 2992 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2994 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 13, .child_index = 2995 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 15, .child_index = 2999 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3001 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 3003 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3007 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 3008 }, + .{ .char = 'k', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3012 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 3013 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 3016 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3019 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 11, .child_index = 3021 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 23, .child_index = 3024 }, + .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3030 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3031 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 3033 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3035 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3036 }, .{ .char = '2', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 549 }, .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3010 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3037 }, .{ .char = '2', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, - .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1399 }, - .{ .char = 'c', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1399 }, - .{ .char = 'b', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1712 }, + .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1405 }, + .{ .char = 'c', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1405 }, + .{ .char = 'b', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1726 }, .{ .char = '6', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 649 }, .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3011 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3038 }, .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 463 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2635 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 3013 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3018 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3020 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3021 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3020 }, - .{ .char = 't', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 3024 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2660 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 3040 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3045 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3047 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3048 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3047 }, + .{ .char = 't', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 3051 }, .{ .char = 'x', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3011 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3025 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3026 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3027 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3028 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3038 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3052 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3053 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3054 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3055 }, .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 311 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3029 }, - .{ .char = 't', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 3024 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3056 }, + .{ .char = 't', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 3051 }, .{ .char = 'x', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3031 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1800 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3032 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3033 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3034 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3035 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3058 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1816 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3059 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3060 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3061 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3062 }, .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 512 }, - .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3036 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3037 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3038 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3039 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3063 }, + .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3064 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3065 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3066 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3067 }, .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 291 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3040 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3068 }, .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 568 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3041 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3042 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3043 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 3044 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3045 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3046 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1174 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3047 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3048 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3049 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3050 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3051 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3052 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3053 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3054 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3055 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3056 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3057 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3058 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3059 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3060 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 15, .child_index = 3061 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3065 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3066 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3067 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3068 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3071 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3071 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3075 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2790 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3069 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3070 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3071 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 3072 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3073 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3074 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1176 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3075 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3076 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3077 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3078 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3079 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3080 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3081 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3082 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3083 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3084 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3085 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3086 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3087 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3088 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 15, .child_index = 3089 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3093 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3094 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3095 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3096 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3099 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3099 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3103 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2816 }, .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 463 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3077 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3078 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3079 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3080 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3081 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 14, .child_index = 3082 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3087 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3088 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 3089 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3091 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3092 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3093 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3094 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3095 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 7, .child_index = 3096 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 13, .child_index = 3098 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3100 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3101 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2722 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2728 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3102 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2728 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2722 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 3104 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2439 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2722 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2439 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2722 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3105 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3106 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3107 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3108 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3109 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 14, .child_index = 3110 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3115 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3116 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 3117 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3119 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3120 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3121 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3122 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3123 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 7, .child_index = 3124 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 13, .child_index = 3126 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3128 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3129 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2748 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2754 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3130 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2754 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2748 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 3132 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2462 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2748 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2462 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2748 }, .{ .char = 'b', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'h', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'v', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2775 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2779 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3106 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3102 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2728 }, - .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2728 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3102 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3107 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3108 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2780 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2732 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2758 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3109 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3111 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3112 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3113 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3114 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2780 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2779 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3112 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2730 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3115 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3115 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3116 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3117 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2760 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2780 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3117 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2780 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2732 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2758 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3109 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3118 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3120 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3107 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3107 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3121 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2779 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3122 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2779 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3123 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3124 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2801 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2805 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3134 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3130 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2754 }, + .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2754 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3130 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3135 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3136 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2806 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2758 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2784 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3137 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3139 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3140 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3141 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3142 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2806 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2805 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3140 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2756 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3143 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3143 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3144 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3145 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2786 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2806 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3145 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2806 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2758 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2784 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3137 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3146 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3148 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3135 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3135 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3149 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2805 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3150 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2805 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3151 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3152 }, .{ .char = 'b', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'h', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2775 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3125 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2786 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3127 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2728 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3130 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2786 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3131 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3132 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2779 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2779 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2801 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3153 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2812 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3155 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2754 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3158 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2812 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3159 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3160 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2805 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2805 }, .{ .char = 'v', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 412 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3121 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3122 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2779 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3133 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3136 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2775 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2779 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2722 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 3137 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2722 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2779 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3139 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3140 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3141 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3142 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3143 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2230 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3144 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3145 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3146 }, - .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1528 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3147 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3148 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3149 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3149 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3150 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2805 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3161 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3164 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2801 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2805 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2748 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 3165 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2748 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2805 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3167 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3168 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3169 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3170 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3171 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2252 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3172 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3173 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3174 }, + .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 1536 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3175 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3176 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3177 }, .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 311 }, - .{ .char = 't', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 3150 }, + .{ .char = 't', .end_of_word = true, .end_of_list = false, .number = 4, .child_index = 3178 }, .{ .char = 'z', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 451 }, .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 458 }, .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 458 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3152 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3154 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3156 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3157 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3158 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3159 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2825 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3180 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3182 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3184 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3185 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3186 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3187 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2851 }, .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, .{ .char = 'c', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, - .{ .char = 'm', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 2829 }, - .{ .char = 'n', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 2829 }, - .{ .char = 'p', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 2829 }, - .{ .char = 'z', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2829 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3160 }, - .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2829 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3161 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3162 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3163 }, + .{ .char = 'm', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 2855 }, + .{ .char = 'n', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 2855 }, + .{ .char = 'p', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 2855 }, + .{ .char = 'z', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2855 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3188 }, + .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2855 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3189 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3190 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3191 }, .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 463 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3164 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3166 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3192 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3194 }, .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 585 }, .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 585 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3169 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3170 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3172 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3174 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3175 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3197 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3198 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3200 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3202 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3203 }, .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 654 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3176 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3177 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3177 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3204 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3205 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3205 }, .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 654 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3178 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3206 }, .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 463 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2507 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3179 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3180 }, - .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3181 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3182 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 3183 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3184 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3185 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3186 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3187 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3188 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3189 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2243 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3190 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2531 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3207 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3208 }, + .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3209 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3210 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 3211 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3212 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3213 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3214 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3215 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3216 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3217 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2265 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3218 }, .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 585 }, .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 664 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3193 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3194 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1534 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3221 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3222 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 1542 }, .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 450 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3195 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3196 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3197 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3198 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3199 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3200 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3201 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3202 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3203 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3204 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3205 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 3206 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3208 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3209 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3198 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3210 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3211 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3208 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3212 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 388, .child_index = 3213 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3204 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3225 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3208 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3227 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 36, .child_index = 3228 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 15, .child_index = 3230 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 71, .child_index = 3231 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 45, .child_index = 3234 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 3235 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 294, .child_index = 3237 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 32, .child_index = 3244 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 35, .child_index = 3245 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 81, .child_index = 3246 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3251 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3252 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 42, .child_index = 3253 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 163, .child_index = 3259 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3267 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2892 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3268 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3269 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3268 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3270 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3271 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3272 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3273 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3274 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3275 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3276 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3277 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3278 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3223 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3224 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3225 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3226 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3227 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3228 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3229 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3230 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3231 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3232 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3233 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3234 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 3235 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3237 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3238 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3227 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3239 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3240 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3237 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3241 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 388, .child_index = 3242 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3233 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3254 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3237 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3256 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 36, .child_index = 3257 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 15, .child_index = 3259 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 71, .child_index = 3260 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 45, .child_index = 3263 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 3264 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 294, .child_index = 3266 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 32, .child_index = 3273 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 35, .child_index = 3274 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 81, .child_index = 3275 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3280 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3281 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 42, .child_index = 3282 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 163, .child_index = 3288 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3296 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2919 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3297 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3298 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3297 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3299 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3300 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3301 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3302 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3303 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3304 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3305 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3306 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3307 }, .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 655 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3279 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3280 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3281 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3282 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3283 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3284 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3285 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 3286 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3287 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2245 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3289 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3290 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3291 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3292 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3293 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3294 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3295 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3296 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3297 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3298 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3299 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 3300 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3301 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3302 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3303 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 3304 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3305 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3308 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3309 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3310 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3311 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3312 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3313 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3314 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 3315 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3316 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2267 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3318 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3319 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3320 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3321 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3322 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3323 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3324 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3325 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3326 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3327 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3328 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 3329 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3330 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3331 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3332 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 3333 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3334 }, .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 486 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3306 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3307 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3308 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2959 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3309 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3335 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3336 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3337 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2986 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3338 }, .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 457 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3310 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3311 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3312 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3313 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3314 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3315 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3316 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3317 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3318 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 3319 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3321 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3322 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3323 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3324 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1948 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3325 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3326 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3328 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3330 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2865 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 3331 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3332 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3333 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3334 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3335 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3336 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3337 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3338 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3339 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3340 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3341 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3342 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 3343 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3344 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3345 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3351 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3352 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3339 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3340 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3341 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3342 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3343 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3344 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3345 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3346 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3347 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 3348 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3350 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3351 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3352 }, .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3353 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3354 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3356 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3357 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3352 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3358 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3359 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 3360 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3361 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3362 }, - .{ .char = 'x', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3181 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1967 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3354 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3355 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3357 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3359 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2891 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 3360 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3361 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3362 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3363 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3364 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3365 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3366 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3367 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3368 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3369 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3370 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3371 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 3372 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3373 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3374 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3380 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3381 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3382 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3383 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3385 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3386 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3381 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3387 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3388 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 3389 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3390 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3391 }, + .{ .char = 'x', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3209 }, .{ .char = '1', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 648 }, .{ .char = '8', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3363 }, - .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 3365 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3020 }, - .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3363 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3363 }, - .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 3365 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3020 }, - .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3365 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3363 }, - .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3363 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3363 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3392 }, + .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 3394 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3047 }, + .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3392 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3392 }, + .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 3394 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3047 }, + .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3394 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3392 }, + .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3392 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3392 }, .{ .char = '1', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 648 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3026 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3053 }, .{ .char = '1', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 648 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3366 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3395 }, .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 238 }, .{ .char = '8', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2319 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3367 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3368 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3369 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3370 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3371 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3372 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2342 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3396 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3397 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3398 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3399 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3400 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2870 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3401 }, .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 291 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3373 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3374 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3402 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3403 }, .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 581 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3375 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3376 }, - .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3377 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 3378 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3379 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3380 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3404 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3405 }, + .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3406 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 3407 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3408 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3409 }, .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 450 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3381 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3410 }, .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 569 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3382 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3383 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3411 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3412 }, .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 458 }, - .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3384 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2343 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3385 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3052 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3386 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3387 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3388 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3389 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 3390 }, + .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3413 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2366 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3414 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3080 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3415 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3416 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3417 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3418 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 3419 }, .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 569 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3392 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3421 }, .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 569 }, .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 519 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3394 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3395 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3396 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3398 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3400 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3401 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3402 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3404 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3405 }, - .{ .char = 'p', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 3406 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3407 }, - .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3408 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3409 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2248 }, - .{ .char = 'b', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3408 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3410 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3411 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3413 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3415 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3416 }, - .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3408 }, - .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3417 }, - .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3418 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 17, .child_index = 3419 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3065 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3421 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3423 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3424 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3425 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3427 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3429 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3430 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3431 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3433 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3434 }, + .{ .char = 'p', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 3435 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3436 }, + .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3437 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3438 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2270 }, + .{ .char = 'b', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3437 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3439 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3440 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3442 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3444 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3445 }, + .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3437 }, + .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3446 }, + .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3447 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 17, .child_index = 3448 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3093 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3450 }, .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 291 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3418 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3447 }, .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 451 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3422 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 3423 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3418 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 3390 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3392 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2779 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3127 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2779 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2779 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2722 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2722 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3451 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 3452 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3447 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 7, .child_index = 3419 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3421 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2805 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3155 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2805 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2805 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 2748 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2748 }, .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 568 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3424 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3426 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3125 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2765 }, - .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2746 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3427 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3428 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3453 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3455 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3153 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2791 }, + .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2772 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3456 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3457 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, .{ .char = 'h', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3431 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2779 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2779 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2794 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2779 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3460 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2805 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2805 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2820 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2805 }, .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2779 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2779 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2779 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2790 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2765 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3131 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2805 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 2805 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2805 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2816 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2791 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3159 }, .{ .char = 'b', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'h', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2722 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3102 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3432 }, - .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1766 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2053 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3434 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3435 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3436 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3437 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3439 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3440 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 2748 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3130 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3461 }, + .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 1781 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2073 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3463 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3464 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3465 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3466 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3468 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3469 }, .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 463 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3441 }, - .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3442 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3443 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3470 }, + .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3471 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3472 }, .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 3444 }, - .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3444 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2560 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2560 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3445 }, - .{ .char = 'b', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2829 }, - .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2829 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3446 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3447 }, - .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2829 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3448 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3449 }, + .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 3473 }, + .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3473 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2585 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2585 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3474 }, + .{ .char = 'b', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2855 }, + .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2855 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3475 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3476 }, + .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2855 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3477 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3478 }, .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 585 }, .{ .char = '4', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 585 }, .{ .char = 'e', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, .{ .char = 'u', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3450 }, - .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3452 }, - .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 3408 }, - .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3408 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3453 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3454 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3455 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1389 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3456 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3164 }, - .{ .char = 'v', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 3458 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3479 }, + .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3481 }, + .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 3437 }, + .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3437 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3482 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3483 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3484 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1395 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3485 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3192 }, + .{ .char = 'v', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 3487 }, .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3460 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 3461 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3462 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3463 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3464 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3465 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3466 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3467 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3489 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 3490 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3491 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3492 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3493 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3494 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3495 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3496 }, .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 463 }, .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 457 }, .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 655 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3468 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3469 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2878 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3470 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3497 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3498 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3499 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2905 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3500 }, .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 238 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3210 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3210 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3471 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3472 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3473 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3474 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3475 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3476 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3477 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3478 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3481 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3482 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3483 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3484 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3485 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 3486 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3488 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 20, .child_index = 3489 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3491 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 242, .child_index = 3492 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 3497 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3498 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3500 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 3501 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3502 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 42, .child_index = 3504 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3508 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3509 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3239 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3239 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3501 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3502 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3503 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3504 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3505 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3506 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3507 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3508 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3511 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3512 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3513 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3514 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3515 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 3516 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3518 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 20, .child_index = 3519 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3521 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 242, .child_index = 3522 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 3527 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3528 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3530 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 3531 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3532 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 42, .child_index = 3534 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3538 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3539 }, .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 412 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3510 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 30, .child_index = 3511 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3512 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 15, .child_index = 3513 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 30, .child_index = 3515 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3516 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 3517 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 45, .child_index = 3518 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3519 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3516 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3520 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3521 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3522 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 186, .child_index = 3523 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 36, .child_index = 3528 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 3529 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 20, .child_index = 3530 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 32, .child_index = 3532 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 35, .child_index = 3536 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 3542 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 3543 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3544 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 34, .child_index = 3545 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3546 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3547 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3548 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3549 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3550 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 3551 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3553 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3554 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3555 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 3556 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3561 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3562 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3563 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 3564 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 3564 }, - .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 48, .child_index = 3566 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 36, .child_index = 3572 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3251 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3574 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3575 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3576 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3577 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3578 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3579 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3369 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3583 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3584 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3585 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3586 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3540 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 30, .child_index = 3541 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3542 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 15, .child_index = 3543 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 30, .child_index = 3545 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3546 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 3547 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 45, .child_index = 3548 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3549 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3546 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3550 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3551 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3552 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 186, .child_index = 3553 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 36, .child_index = 3558 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 3559 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 20, .child_index = 3560 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 32, .child_index = 3562 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 35, .child_index = 3566 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 3572 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 3573 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3574 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 34, .child_index = 3575 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3576 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3577 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3578 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3579 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3580 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 3581 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3583 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3584 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3585 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 3586 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3591 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3592 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3593 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 3594 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 24, .child_index = 3594 }, + .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 48, .child_index = 3596 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 36, .child_index = 3602 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3280 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3604 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3605 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3606 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3607 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3608 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3609 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3398 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3613 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3614 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3615 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3616 }, .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 457 }, - .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1665 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2640 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3588 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2343 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3056 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3589 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 3590 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3591 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3591 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3592 }, - .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 6, .child_index = 1171 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3593 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2245 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3290 }, - .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 6, .child_index = 1171 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3594 }, - .{ .char = 'h', .end_of_word = true, .end_of_list = true, .number = 6, .child_index = 1171 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3595 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3596 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3597 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 3598 }, + .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1679 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2665 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3618 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2366 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3084 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3619 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 3620 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3621 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3621 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3622 }, + .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 6, .child_index = 1173 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3623 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2267 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3319 }, + .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 6, .child_index = 1173 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3624 }, + .{ .char = 'h', .end_of_word = true, .end_of_list = true, .number = 6, .child_index = 1173 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3625 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3626 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3627 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 3628 }, .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 572 }, - .{ .char = 'E', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3599 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3600 }, - .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 10, .child_index = 3601 }, + .{ .char = 'E', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3629 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3630 }, + .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 10, .child_index = 3631 }, .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 572 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3606 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3607 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3608 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3609 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3610 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3611 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3612 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3613 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3614 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3615 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3636 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3637 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3638 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3639 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3640 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3641 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3642 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3643 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3644 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3645 }, .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 496 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3616 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3617 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3618 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3619 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3620 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3626 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2555 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3342 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3627 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3628 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3629 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3630 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3631 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3632 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 3633 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3634 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3636 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3637 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3646 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3647 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3648 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3649 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3650 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3656 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2580 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3371 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3657 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3658 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3659 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3660 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3661 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3662 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 3663 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3664 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3666 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3667 }, .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 291 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3638 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3640 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3641 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3642 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3643 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3644 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3668 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3670 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3671 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3672 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3673 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3674 }, .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 680 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 3645 }, - .{ .char = 'q', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 3646 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3648 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3649 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3651 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3652 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 3653 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3655 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3656 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 3675 }, + .{ .char = 'q', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 3676 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3678 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3679 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3681 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3682 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 3683 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3685 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3686 }, .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 572 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3657 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3658 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3687 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3688 }, .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 496 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3659 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3660 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3658 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3661 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 3662 }, - .{ .char = 'T', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3663 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3664 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3689 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3690 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3688 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3691 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 3692 }, + .{ .char = 'T', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3693 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3694 }, .{ .char = 'b', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, .{ .char = 'x', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 655 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3456 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3665 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3579 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3666 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3667 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3668 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3669 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3670 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3671 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3672 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3673 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 3674 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3675 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3676 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3677 }, - .{ .char = 'c', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3442 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3678 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2672 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3679 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3680 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3681 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3682 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3683 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3684 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3686 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3687 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3690 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2790 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3691 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3692 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3693 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3695 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3400 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3696 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3698 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3699 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3700 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3701 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3401 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3485 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3695 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3609 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3696 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3697 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3698 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3699 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3700 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3701 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3702 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3703 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 3704 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3705 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3706 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3707 }, + .{ .char = 'c', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3471 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3708 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2698 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3709 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3710 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3711 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3712 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3713 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3714 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3716 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3717 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3720 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2816 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3721 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3722 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3723 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3725 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3429 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3726 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3728 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3729 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3730 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3731 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3430 }, .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 291 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3702 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3732 }, .{ .char = 'u', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3705 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3735 }, .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 291 }, .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 656 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3698 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3707 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3708 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3709 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3711 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3713 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3714 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 3716 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 7, .child_index = 3718 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3720 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3721 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 3724 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3727 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3727 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3728 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2780 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3728 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3737 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3738 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3739 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3741 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3743 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3744 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 3746 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 7, .child_index = 3748 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3750 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3751 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 3754 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3757 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3757 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3758 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2806 }, .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3427 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3730 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3731 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3732 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3733 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3734 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3735 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3736 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3737 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3738 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3739 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3456 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3760 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3761 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3762 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3763 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3764 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3765 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3766 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3767 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3768 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3769 }, .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3740 }, + .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3770 }, .{ .char = 'z', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3741 }, - .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2829 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3742 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3743 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3744 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3771 }, + .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2855 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3772 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3773 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3774 }, .{ .char = '0', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = '1', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, .{ .char = 'i', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 412 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3745 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3747 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3775 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3777 }, .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3748 }, - .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3749 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3750 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 3751 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3752 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3753 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3754 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3755 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3756 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3757 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3579 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3468 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3778 }, + .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3779 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3780 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 3781 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3782 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3783 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3784 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3785 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3786 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3787 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3609 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3497 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3788 }, .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 572 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3758 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3759 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3204 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3760 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3761 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3762 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3763 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3765 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3765 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3765 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3766 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3767 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3768 }, - .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3770 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3771 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3772 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3773 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3774 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3776 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3777 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3778 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3779 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3780 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 206, .child_index = 3781 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 3786 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3787 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 3788 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3789 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3790 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3791 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 3792 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3793 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3794 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3795 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3796 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3796 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3798 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3500 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3789 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3790 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3233 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3791 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3792 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3793 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3794 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3796 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3796 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3796 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3797 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3798 }, .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3799 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3800 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 30, .child_index = 3801 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3547 }, + .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3801 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3802 }, .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3803 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3807 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 30, .child_index = 3801 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3808 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 3809 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 45, .child_index = 3813 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3547 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3815 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3816 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3817 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 30, .child_index = 3818 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3820 }, - .{ .char = 'k', .end_of_word = false, .end_of_list = false, .number = 114, .child_index = 3821 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 3825 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3826 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 36, .child_index = 3827 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 3829 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3831 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 3832 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3834 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 3835 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3837 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3838 }, - .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3840 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3841 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 3842 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3845 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3846 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3807 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 3849 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 3849 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3850 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 34, .child_index = 3852 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3854 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3855 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3856 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3857 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3858 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3860 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3861 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3862 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3863 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3553 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3864 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3865 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3804 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3805 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3807 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3808 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3809 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3810 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3811 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 206, .child_index = 3812 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 3817 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3818 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 3819 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3820 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3821 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3822 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 3823 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3824 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3825 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3826 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3827 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3827 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3829 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3530 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3830 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3831 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 30, .child_index = 3832 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3577 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3834 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3838 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 30, .child_index = 3832 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3839 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 40, .child_index = 3840 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 45, .child_index = 3844 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3577 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3846 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3847 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3848 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 30, .child_index = 3849 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3851 }, + .{ .char = 'k', .end_of_word = false, .end_of_list = false, .number = 114, .child_index = 3852 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 3856 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3857 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 36, .child_index = 3858 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 3860 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3862 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 3863 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3865 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 3866 }, .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3868 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3869 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3865 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3870 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3871 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3872 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 3873 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3875 }, - .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3876 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3877 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 3878 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3882 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3883 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 3878 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 30, .child_index = 3801 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3884 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3886 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3888 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3889 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3890 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3869 }, + .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3871 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3872 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 3873 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3876 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3877 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3838 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 3880 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 3880 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3881 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 34, .child_index = 3883 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3885 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3886 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3887 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3888 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3889 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 3891 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 3892 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3893 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3894 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3583 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3895 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3896 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3899 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3900 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3896 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3901 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3902 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3903 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 3904 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3906 }, + .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3907 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3908 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 16, .child_index = 3909 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3913 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3914 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 16, .child_index = 3909 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 30, .child_index = 3832 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3915 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3917 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3919 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3920 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3921 }, .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 572 }, .{ .char = '1', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 648 }, - .{ .char = '3', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2311 }, + .{ .char = '3', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2333 }, .{ .char = '6', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 649 }, .{ .char = '8', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3891 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3894 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3895 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3922 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3925 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3926 }, .{ .char = 'i', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 549 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2343 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3898 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 3899 }, - .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 6, .child_index = 1171 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3591 }, - .{ .char = 'b', .end_of_word = true, .end_of_list = true, .number = 6, .child_index = 1171 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3900 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3901 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2366 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3929 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 3930 }, + .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 6, .child_index = 1173 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3621 }, + .{ .char = 'b', .end_of_word = true, .end_of_list = true, .number = 6, .child_index = 1173 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3931 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3932 }, .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 323 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1699 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 3902 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3903 }, - .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3024 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 1713 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 3933 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3934 }, + .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 3051 }, .{ .char = '1', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 648 }, .{ .char = '8', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, - .{ .char = 'A', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3904 }, - .{ .char = 'P', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3046 }, - .{ .char = 'S', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3905 }, - .{ .char = 'M', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3906 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3907 }, + .{ .char = 'A', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3935 }, + .{ .char = 'P', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3074 }, + .{ .char = 'S', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3936 }, + .{ .char = 'M', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3937 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3938 }, .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 521 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2507 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3908 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3909 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3910 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3911 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3912 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3913 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3914 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3918 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3919 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3920 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3922 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3923 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3924 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3925 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3927 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3928 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3929 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3930 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3659 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3931 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3932 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3933 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3934 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 3935 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3936 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2934 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3937 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3342 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3938 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2531 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3939 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3940 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3941 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3942 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3943 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3944 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3945 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3949 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3950 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3951 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3953 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3954 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3955 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 3956 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3958 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3959 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3960 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3961 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3689 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3962 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3963 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3964 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3965 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 3966 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3967 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2961 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3968 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3371 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3969 }, .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3939 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3940 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3941 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3942 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3943 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 3944 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3947 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3970 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3971 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3972 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3973 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3974 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 3975 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3978 }, .{ .char = 'f', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3948 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3949 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3950 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3951 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3950 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3952 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3954 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3955 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3956 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3958 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3959 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3979 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3980 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3981 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3982 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3981 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3983 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3985 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3986 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3987 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3989 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3990 }, .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 680 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3960 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3961 }, - .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 3962 }, - .{ .char = 'T', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 3964 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3966 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3967 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3968 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3969 }, - .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3970 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3991 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3992 }, + .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 3993 }, + .{ .char = 'T', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 3995 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3997 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3998 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3999 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4000 }, + .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4001 }, .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 664 }, .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 344 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3971 }, - .{ .char = 'j', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3972 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3973 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 3974 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3975 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3679 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3976 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3977 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4002 }, + .{ .char = 'j', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4003 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4004 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 4005 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4006 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3709 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4007 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4008 }, .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 579 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3978 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2237 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3979 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3980 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4009 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2259 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4010 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4011 }, .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 656 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3981 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3982 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4012 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4013 }, .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 656 }, .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 412 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3418 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3985 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2568 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3698 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3698 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3698 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3400 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3987 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3988 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3447 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4016 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2593 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3728 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3728 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3728 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3429 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4018 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4019 }, .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 578 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3990 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3992 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3993 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3994 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3996 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4021 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4023 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4024 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4025 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4027 }, .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3997 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3998 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3999 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4000 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4001 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3981 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3401 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4002 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3698 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4028 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4029 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4030 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4031 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4032 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4012 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3430 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4033 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3728 }, .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 656 }, .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 412 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4003 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4005 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4006 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4008 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4010 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4034 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4036 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4037 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4039 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4041 }, .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 656 }, .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 412 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3981 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4012 }, .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 656 }, .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 412 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3980 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4011 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2780 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2780 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4014 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4015 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4016 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4017 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4018 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4019 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2507 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4020 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4021 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4022 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4011 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4042 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2806 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2806 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4045 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4046 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4047 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4048 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4049 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4050 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2531 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4051 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4052 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4053 }, .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4023 }, - .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2829 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4024 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4025 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4054 }, + .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 2855 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4055 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4056 }, .{ .char = '4', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = '8', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4026 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4027 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3748 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4028 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4029 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4030 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4031 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4032 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4033 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4035 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4036 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4037 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4038 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4041 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1197 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4042 }, - .{ .char = 'M', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4043 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4044 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4045 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4046 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4047 }, - .{ .char = 'M', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4049 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4050 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4051 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4052 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4054 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3791 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4056 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4057 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4054 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4060 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3791 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3773 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4062 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 15, .child_index = 4063 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4065 }, - .{ .char = 'k', .end_of_word = false, .end_of_list = false, .number = 170, .child_index = 4066 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 4069 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4070 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 4071 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4073 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4057 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4074 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4074 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4075 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4076 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4077 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4078 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4079 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4082 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4082 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4054 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4083 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4085 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 4086 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4088 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4090 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4090 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4090 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4090 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4091 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4092 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4093 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4096 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4097 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 24, .child_index = 4099 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 27, .child_index = 4101 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 4103 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4105 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4105 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4105 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 4107 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4105 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4105 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 28, .child_index = 4109 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 30, .child_index = 4113 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 28, .child_index = 4109 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 28, .child_index = 4109 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 4107 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4105 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 4118 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 3825 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4119 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4120 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4121 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 4105 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4122 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4124 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4125 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4125 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4126 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3834 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3837 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4127 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4129 }, - .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4130 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4131 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4131 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4132 }, - .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3840 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3841 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3845 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 4086 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4133 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4134 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 22, .child_index = 4135 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4088 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4137 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4138 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3807 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3862 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4077 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4077 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4140 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4140 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4141 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4142 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3877 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3864 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3868 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3869 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4143 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4145 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4146 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4147 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4148 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3875 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4149 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4151 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4152 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4155 }, - .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3876 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3877 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3882 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3883 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4156 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4158 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3862 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4159 }, - .{ .char = '3', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2311 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4057 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4058 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3778 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4059 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4060 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4061 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4062 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4063 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4064 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4066 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4067 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4068 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4069 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4070 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4073 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1199 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4074 }, + .{ .char = 'M', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4075 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4076 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4077 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4078 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4079 }, + .{ .char = 'M', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4081 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4082 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4083 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4084 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4086 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3822 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4088 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4089 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4086 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4092 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3822 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3804 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4094 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 15, .child_index = 4095 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4097 }, + .{ .char = 'k', .end_of_word = false, .end_of_list = false, .number = 170, .child_index = 4098 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 4101 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4102 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 4103 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4105 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4089 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4106 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4106 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4107 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4108 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4109 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4110 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4111 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4114 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4114 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4086 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4115 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4117 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 4118 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4120 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4122 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4122 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4122 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4122 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4123 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4124 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4125 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4128 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4129 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 24, .child_index = 4131 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 27, .child_index = 4133 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 4135 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4137 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4137 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4137 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 4139 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4137 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4137 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 28, .child_index = 4141 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 30, .child_index = 4145 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 28, .child_index = 4141 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 28, .child_index = 4141 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 4139 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4137 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 18, .child_index = 4150 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 3856 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4151 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4152 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4153 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 4137 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4154 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4156 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4157 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4157 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4158 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3865 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3868 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4159 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4161 }, + .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4162 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4163 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4163 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4164 }, + .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3871 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3872 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3876 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 4118 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4165 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4166 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 22, .child_index = 4167 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4120 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4169 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4170 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3838 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3893 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4109 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4109 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4172 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4172 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4173 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4174 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3908 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3895 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3899 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3900 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4175 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4177 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4178 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4179 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4180 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3906 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4181 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4183 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4184 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4187 }, + .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 3907 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3908 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3913 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3914 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4188 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4190 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3893 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4191 }, + .{ .char = '3', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2333 }, .{ .char = '6', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 649 }, - .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4161 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4162 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4164 }, + .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4193 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4194 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4196 }, .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'i', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 549 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1389 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1395 }, .{ .char = 'i', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 549 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3586 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3367 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 4165 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4173 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4174 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 4175 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4176 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1708 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2622 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4177 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4178 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4179 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4180 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4181 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4182 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4183 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3616 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3396 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 33, .child_index = 4197 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4205 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4206 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 4207 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4208 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 1722 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 2647 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4209 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4210 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4211 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4212 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4213 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4214 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4215 }, .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 680 }, .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 458 }, .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 568 }, .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 569 }, .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 569 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4184 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4185 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4186 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4188 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2680 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3927 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4189 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4190 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4191 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4193 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4194 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4216 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4217 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4218 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4220 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2706 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3958 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4221 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4222 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4223 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4225 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4226 }, .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 654 }, .{ .char = '3', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 496 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4195 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4196 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4197 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4198 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4199 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4200 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4201 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4202 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4203 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4204 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4205 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4206 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4207 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4208 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4209 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4210 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4211 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4212 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4213 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4214 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4215 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4217 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4218 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4220 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4221 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4222 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3011 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4223 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4227 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4228 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4229 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4230 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4231 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4232 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4233 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4234 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4235 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4236 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4237 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4238 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4239 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4240 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4241 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4242 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4243 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4244 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4245 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4246 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4247 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4249 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4250 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4252 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4253 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4254 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3038 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4255 }, .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 549 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4224 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4225 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4226 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4227 }, - .{ .char = 'A', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 4228 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4256 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4257 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4258 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4259 }, + .{ .char = 'A', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 4260 }, .{ .char = 'T', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 585 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4229 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4230 }, - .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 4231 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4261 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4262 }, + .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 4, .child_index = 4263 }, .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 572 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4233 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1840 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4234 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 4235 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4247 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4248 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4249 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4250 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4265 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1856 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4266 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 25, .child_index = 4267 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4279 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4280 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4281 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4282 }, .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 572 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4251 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4254 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4283 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4286 }, .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 656 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3981 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4012 }, .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 412 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4256 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4256 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4256 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4256 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3401 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4257 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4258 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4260 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2507 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4261 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4288 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4288 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4288 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4288 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3430 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4289 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4290 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4292 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2531 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4293 }, .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 656 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4262 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3997 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3998 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4263 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3981 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4264 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3997 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4005 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4265 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4266 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4267 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4268 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4271 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4256 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4294 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4028 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4029 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4295 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4012 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4296 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4028 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4036 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4297 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4298 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4299 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4300 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4303 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4288 }, .{ .char = 'd', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'h', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2779 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2779 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4272 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4273 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4275 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4276 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4277 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3196 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4278 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4279 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4280 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4281 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3456 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3308 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4284 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4285 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4286 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4287 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4288 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4289 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4290 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4291 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3676 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4041 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4292 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2805 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 2805 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4304 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4305 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4307 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4308 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4309 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3225 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4310 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4311 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4312 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4313 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3485 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3337 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4316 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4317 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4318 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4319 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4320 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4321 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4322 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4323 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3706 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4324 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4073 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4325 }, .{ .char = 'i', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4292 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4293 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1197 }, - .{ .char = 'M', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1197 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1197 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4294 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4295 }, - .{ .char = 'M', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4296 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4325 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4326 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1199 }, + .{ .char = 'M', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1199 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1199 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4327 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4328 }, + .{ .char = 'M', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4329 }, .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 654 }, - .{ .char = 'M', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4296 }, + .{ .char = 'M', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4329 }, .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 654 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4297 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4298 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4299 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3791 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3791 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4300 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4301 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4302 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4303 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4304 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4305 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3791 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 4306 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3791 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3791 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4307 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 84, .child_index = 4309 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 84, .child_index = 4309 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4306 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3791 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 4314 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4069 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3791 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3791 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4315 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4057 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4317 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4318 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4146 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4319 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4320 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4321 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4330 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4331 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4332 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3822 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3822 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4333 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4334 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4335 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4336 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4337 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4338 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3822 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 4339 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3822 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3822 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4340 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 84, .child_index = 4342 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 84, .child_index = 4342 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4339 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3822 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 4347 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4101 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3822 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3822 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4348 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4089 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4350 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4351 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4178 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4352 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4353 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4354 }, .{ .char = 'M', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 344 }, .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 344 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3761 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3547 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4322 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3547 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3547 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4324 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4325 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4326 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4077 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4077 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4077 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4327 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4077 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4077 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 4329 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4329 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 4331 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 4332 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 4331 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4331 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3547 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3547 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 4334 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4334 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4335 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4336 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4336 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4338 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4341 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4335 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4336 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4336 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4338 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 4107 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4343 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4343 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3858 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3862 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3862 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4345 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3838 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3834 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3841 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3845 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4346 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4347 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4127 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3841 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4349 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4351 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 4352 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4322 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4325 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4325 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4325 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4354 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4356 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4357 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3864 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3869 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3864 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4359 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4361 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4362 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4363 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4363 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4364 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3877 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3882 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3883 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4365 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3877 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3883 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3877 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4366 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4366 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4367 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4369 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4369 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4370 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4371 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4373 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4374 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 4375 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4379 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4380 }, - .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4381 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4382 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4383 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4384 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 4385 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4387 }, - .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4388 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4389 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4390 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4391 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4392 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4394 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4395 }, - .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4396 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4399 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4400 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4401 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4402 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3792 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3577 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4355 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3577 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3577 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4357 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4358 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4359 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4109 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4109 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4109 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4360 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4109 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4109 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 12, .child_index = 4362 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4362 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 4364 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 4365 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 4364 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4364 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3577 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3577 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 4367 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4367 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4368 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4369 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4369 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4371 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4374 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4368 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4369 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4369 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4371 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 18, .child_index = 4139 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4376 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4376 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3889 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3893 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3893 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4378 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 3869 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 3865 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3872 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3876 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4379 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4380 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4159 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3872 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4382 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4384 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 4385 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4355 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4358 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4358 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4358 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 12, .child_index = 4387 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4389 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4390 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3895 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3900 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3895 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4392 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4394 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4395 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4396 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4396 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4397 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3908 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 3913 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3914 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4398 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3908 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3914 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3908 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4399 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4399 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4400 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4402 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4402 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4403 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4404 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4406 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4407 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 10, .child_index = 4408 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4412 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4413 }, + .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4414 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4415 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4416 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4417 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 10, .child_index = 4418 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4420 }, + .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4421 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4422 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4423 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4424 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4425 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4427 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4428 }, + .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4429 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4432 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4433 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4434 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4435 }, .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 405 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4403 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4404 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4436 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4437 }, .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 459 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4405 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4406 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4407 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4409 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4410 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4411 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4412 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4413 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4414 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4415 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4416 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4418 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2319 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4420 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4421 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4422 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4423 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3979 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4424 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4425 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4426 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4427 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4438 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4439 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4440 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4442 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4443 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4444 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4445 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4446 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4447 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4448 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4449 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4451 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2342 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4453 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4454 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4455 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4456 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4010 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4457 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4458 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4459 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4460 }, .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 569 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4428 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4429 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4430 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4428 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4461 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4462 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4463 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4461 }, .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 291 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4431 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3941 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4432 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4434 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3648 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4435 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4436 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4464 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3972 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4465 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4467 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3678 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4468 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4469 }, .{ .char = 'T', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4437 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4438 }, - .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 3024 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4470 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4471 }, + .{ .char = 'f', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 3051 }, .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4439 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4440 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4441 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4443 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4444 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4447 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4448 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4450 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2245 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4451 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3609 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4452 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4454 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4457 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4458 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4459 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4460 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4461 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4472 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4473 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4474 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4476 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4477 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4480 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4481 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4483 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 2267 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4484 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3639 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4485 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4487 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4490 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4491 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4492 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4493 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4494 }, .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 656 }, .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 412 }, .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 656 }, .{ .char = 'w', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4462 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4463 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3401 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3405 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4464 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2507 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4465 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4466 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3405 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4467 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3698 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4468 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4469 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4266 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4470 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4471 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4472 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1893 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4473 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4474 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4495 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4496 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3430 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3434 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4497 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2531 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4498 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4499 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3434 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4500 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3728 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4501 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4502 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4298 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4503 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4504 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4505 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1912 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4506 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4507 }, .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 460 }, - .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4475 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4476 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4477 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4478 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2137 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4479 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1379 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4480 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4481 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4482 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4483 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4484 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4485 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4486 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4487 }, + .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4508 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4509 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4510 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4511 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 2158 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4512 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1385 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4513 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4514 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4515 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4516 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4517 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4518 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4519 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4520 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4521 }, .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 344 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4488 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4522 }, .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 344 }, .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 655 }, .{ .char = 'M', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = '3', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4489 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4490 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4491 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4492 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4493 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3807 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3807 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4077 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4494 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4496 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4497 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4497 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4498 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4499 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 36, .child_index = 4501 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4504 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 28, .child_index = 4507 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4306 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4493 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4493 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4146 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4508 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3870 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3870 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4510 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4511 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4511 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4512 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4513 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4516 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4091 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4517 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4518 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4518 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4519 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 4520 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4520 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4521 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4522 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4522 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4522 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4524 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4522 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4525 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4526 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4526 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4527 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4527 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4529 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4359 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4131 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4131 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4530 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4530 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4531 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3855 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4533 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4527 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4534 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4536 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4508 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4508 }, + .{ .char = '3', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4523 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4524 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4525 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4526 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4527 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3838 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3838 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4109 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4528 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4530 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4531 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4531 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4532 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4533 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 36, .child_index = 4535 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 8, .child_index = 4538 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 28, .child_index = 4541 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4339 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4527 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4527 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4178 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4542 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3901 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3901 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4544 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4545 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4545 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4546 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4547 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4550 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4123 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4551 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 4552 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4552 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4553 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 9, .child_index = 4554 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4554 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4555 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4556 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4556 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4556 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4558 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4556 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4559 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4560 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4560 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4561 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4561 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4563 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4392 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4163 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4163 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4564 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4564 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4565 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 6, .child_index = 3886 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4567 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4561 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4568 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4570 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4542 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4542 }, .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 655 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4538 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4539 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3875 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4540 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4536 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3862 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4542 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2230 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4543 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4544 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4545 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4546 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4547 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4548 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4549 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4380 }, - .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4381 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4382 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4550 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4554 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4555 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4556 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4557 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4558 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 4559 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4560 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4561 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4562 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4563 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4564 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4565 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4572 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4573 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3906 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4574 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4570 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3893 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4576 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2252 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4577 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4578 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4579 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4580 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4581 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4582 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4583 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4413 }, + .{ .char = 't', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4414 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4415 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4584 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4588 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4589 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4590 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4591 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4592 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = false, .number = 5, .child_index = 4593 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4594 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4595 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4596 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4597 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4598 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4599 }, .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 311 }, .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 460 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4566 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4568 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4569 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4571 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2214 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4572 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4573 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3913 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4574 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4600 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4602 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4603 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4605 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2236 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4606 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4607 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3944 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4608 }, .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 496 }, .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 496 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4575 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4576 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3637 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4577 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4578 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4579 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4609 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4610 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 3667 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4611 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4612 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4613 }, .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 311 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4580 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4582 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4583 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4584 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1389 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4614 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4616 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4617 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4618 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 1395 }, .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 451 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4420 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4585 }, - .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4586 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4587 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4588 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4589 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3324 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4453 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4619 }, + .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4620 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4621 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4622 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4623 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3353 }, .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 579 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4590 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4591 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1940 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4592 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2819 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4624 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4625 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1959 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4626 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2845 }, .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 580 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3648 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4593 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4594 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4595 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4596 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4597 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4598 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3678 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4627 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4628 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4629 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4630 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4631 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4632 }, .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 457 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4599 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4633 }, .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 344 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4600 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4601 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4602 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4634 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4635 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4636 }, .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 738 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4603 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2268 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4605 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4637 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 2290 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4639 }, .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 568 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4606 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4607 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4640 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4641 }, .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 580 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4608 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4642 }, .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 457 }, .{ .char = 'q', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 286 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4609 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4610 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4611 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4612 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4613 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4614 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4643 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4644 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4645 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4646 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4647 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4648 }, .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 412 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4261 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4293 }, .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 561 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4615 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3701 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4616 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4617 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4261 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4618 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4619 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4620 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2199 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4621 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4622 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4623 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4624 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3301 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1129 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4627 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4628 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4632 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4634 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4635 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4636 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4637 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4638 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4639 }, - .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4640 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4649 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3731 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4650 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4651 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4293 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4652 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4653 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4654 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2221 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4655 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4656 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4657 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4658 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3330 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1131 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4661 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4662 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 8, .child_index = 4666 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4668 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4669 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4670 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4671 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4672 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4673 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4674 }, + .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4675 }, .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 655 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4298 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4642 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4642 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4301 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4645 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4646 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4648 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4649 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4649 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4649 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4649 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 28, .child_index = 4109 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4649 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4651 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4649 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4652 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 28, .child_index = 4109 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4317 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4653 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4654 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3547 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4513 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4331 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4677 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4677 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4334 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4680 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4681 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4683 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4684 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4684 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4684 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4684 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 28, .child_index = 4141 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4684 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4686 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4684 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4687 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 28, .child_index = 4141 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4350 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4688 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4689 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 3577 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4547 }, .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4516 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4550 }, .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 655 }, .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 655 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3807 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4327 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4656 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4331 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4658 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4660 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4661 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4662 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4662 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4295 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4663 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4663 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4664 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4667 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4668 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4668 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4669 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4670 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4670 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 3838 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4360 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4691 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4364 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 9, .child_index = 4693 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4695 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4696 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4697 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4697 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4328 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4698 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4698 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4699 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4702 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4703 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4703 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4704 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4705 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4705 }, .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 655 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4512 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4346 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4513 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4513 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3609 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4671 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4673 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4674 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4381 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4675 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4676 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4546 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4546 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4379 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4547 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4547 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3639 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4706 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4708 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4709 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4414 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4710 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4711 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4580 }, .{ .char = '0', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = '1', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = '2', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = '3', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 458 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4677 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4678 }, - .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 6, .child_index = 1171 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4679 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4680 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4681 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4682 }, - .{ .char = 'C', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4683 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4684 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4685 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4686 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4687 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4688 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4689 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3026 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4690 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4692 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4207 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3342 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4693 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4712 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4713 }, + .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 6, .child_index = 1173 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4714 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4715 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4716 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4717 }, + .{ .char = 'C', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4718 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4719 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4720 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4721 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4722 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4723 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4724 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3053 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4725 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4727 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4239 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3371 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4728 }, .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 460 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3470 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4694 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4695 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4696 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4697 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4698 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3500 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4729 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4730 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4731 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4732 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4733 }, .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 460 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4700 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4701 }, - .{ .char = '3', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4702 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4703 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4735 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4736 }, + .{ .char = '3', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4737 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4738 }, .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 585 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4704 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4705 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4706 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4707 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4708 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4709 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4710 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4711 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4712 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4713 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4714 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4715 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4716 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4717 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4718 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4719 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4739 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4740 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4741 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4742 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4743 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4744 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4745 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4746 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4747 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4748 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4749 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4750 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4751 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4752 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4753 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4754 }, .{ .char = 's', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 664 }, - .{ .char = 'g', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 4720 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4722 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4723 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4716 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1663 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4724 }, + .{ .char = 'g', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 4755 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4757 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4758 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4751 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1677 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4759 }, .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 585 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4725 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4726 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4760 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4761 }, .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 561 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4727 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4728 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4730 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4731 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4732 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4733 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4734 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4735 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4736 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4738 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4739 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4740 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4741 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4742 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4743 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4744 }, - .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4745 }, - .{ .char = '3', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4745 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4746 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4747 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4748 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4636 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4751 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4752 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4762 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4763 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4765 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4766 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4767 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4768 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4769 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4770 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4771 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4773 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4774 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4775 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4776 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4777 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4778 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4779 }, + .{ .char = '2', .end_of_word = false, .end_of_list = false, .number = 4, .child_index = 4780 }, + .{ .char = '3', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4780 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4781 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4782 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4783 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4670 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4786 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4787 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4788 }, .{ .char = 'a', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'M', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4516 }, + .{ .char = 'M', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4550 }, .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 655 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4753 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4301 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4315 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4789 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4334 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4348 }, .{ .char = 'M', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 655 }, - .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4754 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4755 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4756 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4756 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4757 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4642 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4642 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4325 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4540 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4091 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4138 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4356 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4524 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4660 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4758 }, + .{ .char = '_', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4790 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4791 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4792 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4792 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4793 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4677 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4677 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4358 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4574 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4123 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4170 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4389 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4558 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4695 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4794 }, .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4359 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4392 }, .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 655 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4359 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4759 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4760 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4762 }, - .{ .char = '3', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4763 }, - .{ .char = '6', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4764 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4765 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4766 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4554 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4767 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4769 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4554 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4392 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4795 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4796 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4798 }, + .{ .char = '3', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4799 }, + .{ .char = '6', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4800 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4801 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4802 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4588 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4803 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4805 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4588 }, .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 873 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4560 }, - .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 4773 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4775 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4776 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4777 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4778 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4779 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4780 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4780 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4781 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4594 }, + .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 5, .child_index = 4809 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4811 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4812 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4813 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4814 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4815 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4816 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4816 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4817 }, .{ .char = '1', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 648 }, - .{ .char = '8', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4782 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4783 }, + .{ .char = '8', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4818 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4819 }, .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 680 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3659 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4636 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4784 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2790 }, - .{ .char = '1', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 4785 }, - .{ .char = '2', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4785 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4786 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3689 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4670 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4820 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2816 }, + .{ .char = '1', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 4821 }, + .{ .char = '2', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4821 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4822 }, .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 496 }, - .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3941 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4787 }, - .{ .char = 'c', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 4788 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4789 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4790 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4791 }, - .{ .char = 'g', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4792 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4793 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3342 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4794 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4289 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4795 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4796 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4797 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4798 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4799 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4800 }, - .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2236 }, - .{ .char = '1', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4801 }, + .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3972 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4823 }, + .{ .char = 'c', .end_of_word = true, .end_of_list = true, .number = 3, .child_index = 4824 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4825 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4826 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4827 }, + .{ .char = 'g', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4828 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4829 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3371 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4830 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4321 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4831 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4832 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4833 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4834 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4835 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4836 }, + .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2258 }, + .{ .char = '1', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4837 }, .{ .char = '2', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4802 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4803 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4804 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4805 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4806 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4807 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4469 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4618 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4469 }, - .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4266 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4808 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4809 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4810 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4811 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4812 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4812 }, - .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4813 }, - .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4814 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4815 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4816 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4817 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4818 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4819 }, - .{ .char = 'D', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4820 }, - .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4822 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4207 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4838 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4839 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4840 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4841 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4842 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4843 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4502 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4652 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4502 }, + .{ .char = 'q', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4298 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4844 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4845 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4846 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4847 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4848 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4848 }, + .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4849 }, + .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4850 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4851 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4852 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4853 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4854 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4855 }, + .{ .char = 'D', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4856 }, + .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4858 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4239 }, .{ .char = 'x', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'y', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'z', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4823 }, - .{ .char = '5', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4824 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4301 }, - .{ .char = 'M', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4825 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4651 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4754 }, - .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4077 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4077 }, - .{ .char = 'M', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4359 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4146 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4146 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4826 }, - .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3268 }, - .{ .char = '4', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3268 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4828 }, - .{ .char = 'k', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1938 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4859 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3065 }, + .{ .char = '5', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4860 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4334 }, + .{ .char = 'M', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4861 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4686 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4790 }, + .{ .char = 'x', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4109 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4109 }, + .{ .char = 'M', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4392 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4178 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4178 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4862 }, + .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3297 }, + .{ .char = '4', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3297 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4864 }, + .{ .char = 'k', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 1957 }, .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 458 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4829 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4865 }, .{ .char = 'w', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'x', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'y', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'z', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, .{ .char = '6', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 649 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4830 }, - .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 6, .child_index = 4833 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4837 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4838 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4839 }, - .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4840 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3886 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4841 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4842 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4843 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4844 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4845 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4846 }, - .{ .char = '1', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4847 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4416 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4210 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4848 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4849 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4850 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4851 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4852 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4854 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4855 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4856 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4857 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4858 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4859 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4866 }, + .{ .char = 'e', .end_of_word = true, .end_of_list = true, .number = 6, .child_index = 4869 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4873 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4874 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4875 }, + .{ .char = 'n', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4876 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 3917 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4877 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4878 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4879 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4880 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4881 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4882 }, + .{ .char = '1', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4883 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4449 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4242 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4884 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4885 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4886 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4887 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 6, .child_index = 4888 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4890 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4891 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4892 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4893 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4894 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4895 }, .{ .char = '0', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4860 }, - .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4861 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4862 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4863 }, - .{ .char = 'j', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4864 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4865 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4867 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4868 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4869 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4739 }, - .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4813 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4896 }, + .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4897 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4898 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4899 }, + .{ .char = 'j', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4900 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4901 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4903 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4904 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4905 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4774 }, + .{ .char = 'd', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4849 }, .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 291 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4870 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4871 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4872 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4873 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4874 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4873 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4875 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4875 }, - .{ .char = 'D', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4877 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4880 }, - .{ .char = '1', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4881 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4882 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4757 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4757 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4884 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4885 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4886 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4906 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4907 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4908 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4909 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4910 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4909 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4911 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4911 }, + .{ .char = 'D', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4913 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4916 }, + .{ .char = '1', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4917 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4918 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4793 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4793 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4920 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4921 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4922 }, .{ .char = 'n', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 496 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3366 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3395 }, .{ .char = '1', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 648 }, .{ .char = '6', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 649 }, .{ .char = '8', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, - .{ .char = 'P', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4887 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4888 }, - .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4889 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3052 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4890 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4891 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2568 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4892 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2808 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3026 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4894 }, - .{ .char = '6', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3941 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2790 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4895 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4896 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3961 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4485 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4409 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4897 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4898 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4899 }, + .{ .char = 'P', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4923 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4924 }, + .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4925 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3080 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4926 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4927 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2593 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4928 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2834 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3053 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4930 }, + .{ .char = '6', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3972 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2816 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4931 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4932 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3992 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 3, .child_index = 4518 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 3, .child_index = 4442 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4933 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4934 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4935 }, .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 311 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4900 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4901 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4936 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4937 }, .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 471 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4902 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4903 }, - .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4904 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4905 }, - .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 4906 }, - .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4906 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4907 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2877 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4908 }, - .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4813 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4938 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4939 }, + .{ .char = 'z', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4940 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4941 }, + .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 2, .child_index = 4942 }, + .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4942 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4943 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2904 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4944 }, + .{ .char = 'p', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4849 }, .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 183 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4909 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4910 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4911 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4912 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4912 }, - .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4912 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4912 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4913 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4693 }, - .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4914 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4945 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4946 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4947 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4948 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4948 }, + .{ .char = 'f', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4948 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4948 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4949 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4728 }, + .{ .char = '2', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4950 }, .{ .char = 'M', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 655 }, .{ .char = 'l', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4916 }, - .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4917 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4918 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4919 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4920 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4921 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2963 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4925 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3026 }, - .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3026 }, - .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4926 }, - .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3366 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4952 }, + .{ .char = 's', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4953 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4954 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4955 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4956 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 4, .child_index = 4957 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2990 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4961 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 3053 }, + .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3053 }, + .{ .char = 'm', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4962 }, + .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3395 }, .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 311 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4927 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4928 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4963 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4964 }, .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 451 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4929 }, - .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4930 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4965 }, + .{ .char = 'c', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4966 }, .{ .char = 'v', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 323 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4931 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4932 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4017 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4967 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4968 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4048 }, .{ .char = 'a', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4933 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4934 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4935 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4913 }, - .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4936 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4969 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4970 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4971 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4949 }, + .{ .char = 'h', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4972 }, .{ .char = '_', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4912 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4948 }, .{ .char = 'l', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 'u', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4937 }, - .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4938 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4973 }, + .{ .char = 'k', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4974 }, .{ .char = 'q', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4939 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4940 }, - .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4941 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4587 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4975 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4976 }, + .{ .char = 'b', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4977 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4621 }, .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 520 }, .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 420 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4942 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4943 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4944 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4945 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3301 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4946 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4947 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3195 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4948 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2460 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4949 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4913 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4950 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4952 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4955 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4956 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4957 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4978 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4979 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4980 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4981 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3330 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4982 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4983 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3224 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4984 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2483 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4985 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4949 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4986 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 5, .child_index = 4988 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4991 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4992 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4993 }, .{ .char = '1', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4958 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3578 }, + .{ .char = 'n', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4994 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 3608 }, .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 457 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2230 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4959 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 2252 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4995 }, .{ .char = 'u', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 572 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4960 }, - .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4961 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4996 }, + .{ .char = 's', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4997 }, .{ .char = 'w', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 821 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4918 }, - .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4962 }, - .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4962 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4964 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4965 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4966 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4207 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4954 }, + .{ .char = 'g', .end_of_word = false, .end_of_list = false, .number = 2, .child_index = 4998 }, + .{ .char = 'l', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4998 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 5000 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5001 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5002 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4239 }, .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 450 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4967 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4969 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 5003 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5005 }, .{ .char = 'e', .end_of_word = true, .end_of_list = false, .number = 1, .child_index = 0 }, .{ .char = 't', .end_of_word = true, .end_of_list = true, .number = 1, .child_index = 0 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 4970 }, - .{ .char = 'S', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4971 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4972 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 4973 }, - .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4974 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1440 }, - .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 4975 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4976 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 2, .child_index = 5006 }, + .{ .char = 'S', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5007 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5008 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = false, .number = 1, .child_index = 5009 }, + .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5010 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1446 }, + .{ .char = 'r', .end_of_word = true, .end_of_list = true, .number = 2, .child_index = 5011 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5012 }, .{ .char = 'o', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 654 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4977 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4978 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5013 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5014 }, .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 459 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4979 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4980 }, - .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4981 }, - .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1701 }, - .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4982 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4983 }, - .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4984 }, - .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4913 }, - .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4985 }, - .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4986 }, - .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4987 }, - .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4913 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5015 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5016 }, + .{ .char = 'd', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5017 }, + .{ .char = 'i', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 1715 }, + .{ .char = 'a', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5018 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5019 }, + .{ .char = '_', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5020 }, + .{ .char = 'r', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4949 }, + .{ .char = 't', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5021 }, + .{ .char = 'y', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5022 }, + .{ .char = 'p', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 5023 }, + .{ .char = 'e', .end_of_word = false, .end_of_list = true, .number = 1, .child_index = 4949 }, }; pub const data = blk: { - @setEvalBranchQuota(27902); + @setEvalBranchQuota(27937); break :blk [_]@This(){ - // _Block_object_assign - .{ .tag = @enumFromInt(0), .properties = .{ .param_str = "vv*vC*iC", .header = .blocks, .attributes = .{ .lib_function_without_prefix = true } } }, - // _Block_object_dispose - .{ .tag = @enumFromInt(1), .properties = .{ .param_str = "vvC*iC", .header = .blocks, .attributes = .{ .lib_function_without_prefix = true } } }, - // _Exit - .{ .tag = @enumFromInt(2), .properties = .{ .param_str = "vi", .header = .stdlib, .attributes = .{ .noreturn = true, .lib_function_without_prefix = true } } }, - // _InterlockedAnd - .{ .tag = @enumFromInt(3), .properties = .{ .param_str = "NiNiD*Ni", .language = .all_ms_languages } }, - // _InterlockedAnd16 - .{ .tag = @enumFromInt(4), .properties = .{ .param_str = "ssD*s", .language = .all_ms_languages } }, - // _InterlockedAnd8 - .{ .tag = @enumFromInt(5), .properties = .{ .param_str = "ccD*c", .language = .all_ms_languages } }, - // _InterlockedCompareExchange - .{ .tag = @enumFromInt(6), .properties = .{ .param_str = "NiNiD*NiNi", .language = .all_ms_languages } }, - // _InterlockedCompareExchange16 - .{ .tag = @enumFromInt(7), .properties = .{ .param_str = "ssD*ss", .language = .all_ms_languages } }, - // _InterlockedCompareExchange64 - .{ .tag = @enumFromInt(8), .properties = .{ .param_str = "LLiLLiD*LLiLLi", .language = .all_ms_languages } }, - // _InterlockedCompareExchange8 - .{ .tag = @enumFromInt(9), .properties = .{ .param_str = "ccD*cc", .language = .all_ms_languages } }, - // _InterlockedCompareExchangePointer - .{ .tag = @enumFromInt(10), .properties = .{ .param_str = "v*v*D*v*v*", .language = .all_ms_languages } }, - // _InterlockedCompareExchangePointer_nf - .{ .tag = @enumFromInt(11), .properties = .{ .param_str = "v*v*D*v*v*", .language = .all_ms_languages } }, - // _InterlockedDecrement - .{ .tag = @enumFromInt(12), .properties = .{ .param_str = "NiNiD*", .language = .all_ms_languages } }, - // _InterlockedDecrement16 - .{ .tag = @enumFromInt(13), .properties = .{ .param_str = "ssD*", .language = .all_ms_languages } }, - // _InterlockedExchange - .{ .tag = @enumFromInt(14), .properties = .{ .param_str = "NiNiD*Ni", .language = .all_ms_languages } }, - // _InterlockedExchange16 - .{ .tag = @enumFromInt(15), .properties = .{ .param_str = "ssD*s", .language = .all_ms_languages } }, - // _InterlockedExchange8 - .{ .tag = @enumFromInt(16), .properties = .{ .param_str = "ccD*c", .language = .all_ms_languages } }, - // _InterlockedExchangeAdd - .{ .tag = @enumFromInt(17), .properties = .{ .param_str = "NiNiD*Ni", .language = .all_ms_languages } }, - // _InterlockedExchangeAdd16 - .{ .tag = @enumFromInt(18), .properties = .{ .param_str = "ssD*s", .language = .all_ms_languages } }, - // _InterlockedExchangeAdd8 - .{ .tag = @enumFromInt(19), .properties = .{ .param_str = "ccD*c", .language = .all_ms_languages } }, - // _InterlockedExchangePointer - .{ .tag = @enumFromInt(20), .properties = .{ .param_str = "v*v*D*v*", .language = .all_ms_languages } }, - // _InterlockedExchangeSub - .{ .tag = @enumFromInt(21), .properties = .{ .param_str = "NiNiD*Ni", .language = .all_ms_languages } }, - // _InterlockedExchangeSub16 - .{ .tag = @enumFromInt(22), .properties = .{ .param_str = "ssD*s", .language = .all_ms_languages } }, - // _InterlockedExchangeSub8 - .{ .tag = @enumFromInt(23), .properties = .{ .param_str = "ccD*c", .language = .all_ms_languages } }, - // _InterlockedIncrement - .{ .tag = @enumFromInt(24), .properties = .{ .param_str = "NiNiD*", .language = .all_ms_languages } }, - // _InterlockedIncrement16 - .{ .tag = @enumFromInt(25), .properties = .{ .param_str = "ssD*", .language = .all_ms_languages } }, - // _InterlockedOr - .{ .tag = @enumFromInt(26), .properties = .{ .param_str = "NiNiD*Ni", .language = .all_ms_languages } }, - // _InterlockedOr16 - .{ .tag = @enumFromInt(27), .properties = .{ .param_str = "ssD*s", .language = .all_ms_languages } }, - // _InterlockedOr8 - .{ .tag = @enumFromInt(28), .properties = .{ .param_str = "ccD*c", .language = .all_ms_languages } }, - // _InterlockedXor - .{ .tag = @enumFromInt(29), .properties = .{ .param_str = "NiNiD*Ni", .language = .all_ms_languages } }, - // _InterlockedXor16 - .{ .tag = @enumFromInt(30), .properties = .{ .param_str = "ssD*s", .language = .all_ms_languages } }, - // _InterlockedXor8 - .{ .tag = @enumFromInt(31), .properties = .{ .param_str = "ccD*c", .language = .all_ms_languages } }, - // _MoveFromCoprocessor - .{ .tag = @enumFromInt(32), .properties = .{ .param_str = "UiIUiIUiIUiIUiIUi", .language = .all_ms_languages, .target_set = TargetSet.initOne(.arm) } }, - // _MoveFromCoprocessor2 - .{ .tag = @enumFromInt(33), .properties = .{ .param_str = "UiIUiIUiIUiIUiIUi", .language = .all_ms_languages, .target_set = TargetSet.initOne(.arm) } }, - // _MoveToCoprocessor - .{ .tag = @enumFromInt(34), .properties = .{ .param_str = "vUiIUiIUiIUiIUiIUi", .language = .all_ms_languages, .target_set = TargetSet.initOne(.arm) } }, - // _MoveToCoprocessor2 - .{ .tag = @enumFromInt(35), .properties = .{ .param_str = "vUiIUiIUiIUiIUiIUi", .language = .all_ms_languages, .target_set = TargetSet.initOne(.arm) } }, - // _ReturnAddress - .{ .tag = @enumFromInt(36), .properties = .{ .param_str = "v*", .language = .all_ms_languages } }, - // __GetExceptionInfo - .{ .tag = @enumFromInt(37), .properties = .{ .param_str = "v*.", .language = .all_ms_languages, .attributes = .{ .custom_typecheck = true, .eval_args = false } } }, - // __abnormal_termination - .{ .tag = @enumFromInt(38), .properties = .{ .param_str = "i", .language = .all_ms_languages } }, - // __annotation - .{ .tag = @enumFromInt(39), .properties = .{ .param_str = "wC*.", .language = .all_ms_languages } }, - // __arithmetic_fence - .{ .tag = @enumFromInt(40), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true, .const_evaluable = true } } }, - // __assume - .{ .tag = @enumFromInt(41), .properties = .{ .param_str = "vb", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, - // __atomic_add_fetch - .{ .tag = @enumFromInt(42), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __atomic_always_lock_free - .{ .tag = @enumFromInt(43), .properties = .{ .param_str = "bzvCD*", .attributes = .{ .const_evaluable = true } } }, - // __atomic_and_fetch - .{ .tag = @enumFromInt(44), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __atomic_clear - .{ .tag = @enumFromInt(45), .properties = .{ .param_str = "vvD*i" } }, - // __atomic_compare_exchange - .{ .tag = @enumFromInt(46), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __atomic_compare_exchange_n - .{ .tag = @enumFromInt(47), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __atomic_exchange - .{ .tag = @enumFromInt(48), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __atomic_exchange_n - .{ .tag = @enumFromInt(49), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __atomic_fetch_add - .{ .tag = @enumFromInt(50), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __atomic_fetch_and - .{ .tag = @enumFromInt(51), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __atomic_fetch_max - .{ .tag = @enumFromInt(52), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __atomic_fetch_min - .{ .tag = @enumFromInt(53), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __atomic_fetch_nand - .{ .tag = @enumFromInt(54), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __atomic_fetch_or - .{ .tag = @enumFromInt(55), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __atomic_fetch_sub - .{ .tag = @enumFromInt(56), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __atomic_fetch_xor - .{ .tag = @enumFromInt(57), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __atomic_is_lock_free - .{ .tag = @enumFromInt(58), .properties = .{ .param_str = "bzvCD*", .attributes = .{ .const_evaluable = true } } }, - // __atomic_load - .{ .tag = @enumFromInt(59), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __atomic_load_n - .{ .tag = @enumFromInt(60), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __atomic_max_fetch - .{ .tag = @enumFromInt(61), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __atomic_min_fetch - .{ .tag = @enumFromInt(62), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __atomic_nand_fetch - .{ .tag = @enumFromInt(63), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __atomic_or_fetch - .{ .tag = @enumFromInt(64), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __atomic_signal_fence - .{ .tag = @enumFromInt(65), .properties = .{ .param_str = "vi" } }, - // __atomic_store - .{ .tag = @enumFromInt(66), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __atomic_store_n - .{ .tag = @enumFromInt(67), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __atomic_sub_fetch - .{ .tag = @enumFromInt(68), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __atomic_test_and_set - .{ .tag = @enumFromInt(69), .properties = .{ .param_str = "bvD*i" } }, - // __atomic_thread_fence - .{ .tag = @enumFromInt(70), .properties = .{ .param_str = "vi" } }, - // __atomic_xor_fetch - .{ .tag = @enumFromInt(71), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __builtin___CFStringMakeConstantString - .{ .tag = @enumFromInt(72), .properties = .{ .param_str = "FC*cC*", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin___NSStringMakeConstantString - .{ .tag = @enumFromInt(73), .properties = .{ .param_str = "FC*cC*", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin___clear_cache - .{ .tag = @enumFromInt(74), .properties = .{ .param_str = "vc*c*" } }, - // __builtin___fprintf_chk - .{ .tag = @enumFromInt(75), .properties = .{ .param_str = "iP*RicC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .printf, .format_string_position = 2 } } }, - // __builtin___get_unsafe_stack_bottom - .{ .tag = @enumFromInt(76), .properties = .{ .param_str = "v*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin___get_unsafe_stack_ptr - .{ .tag = @enumFromInt(77), .properties = .{ .param_str = "v*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin___get_unsafe_stack_start - .{ .tag = @enumFromInt(78), .properties = .{ .param_str = "v*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin___get_unsafe_stack_top - .{ .tag = @enumFromInt(79), .properties = .{ .param_str = "v*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin___memccpy_chk - .{ .tag = @enumFromInt(80), .properties = .{ .param_str = "v*v*vC*izz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin___memcpy_chk - .{ .tag = @enumFromInt(81), .properties = .{ .param_str = "v*v*vC*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin___memmove_chk - .{ .tag = @enumFromInt(82), .properties = .{ .param_str = "v*v*vC*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin___mempcpy_chk - .{ .tag = @enumFromInt(83), .properties = .{ .param_str = "v*v*vC*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin___memset_chk - .{ .tag = @enumFromInt(84), .properties = .{ .param_str = "v*v*izz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin___printf_chk - .{ .tag = @enumFromInt(85), .properties = .{ .param_str = "iicC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .printf, .format_string_position = 1 } } }, - // __builtin___snprintf_chk - .{ .tag = @enumFromInt(86), .properties = .{ .param_str = "ic*RzizcC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .printf, .format_string_position = 4 } } }, - // __builtin___sprintf_chk - .{ .tag = @enumFromInt(87), .properties = .{ .param_str = "ic*RizcC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .printf, .format_string_position = 3 } } }, - // __builtin___stpcpy_chk - .{ .tag = @enumFromInt(88), .properties = .{ .param_str = "c*c*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin___stpncpy_chk - .{ .tag = @enumFromInt(89), .properties = .{ .param_str = "c*c*cC*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin___strcat_chk - .{ .tag = @enumFromInt(90), .properties = .{ .param_str = "c*c*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin___strcpy_chk - .{ .tag = @enumFromInt(91), .properties = .{ .param_str = "c*c*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin___strlcat_chk - .{ .tag = @enumFromInt(92), .properties = .{ .param_str = "zc*cC*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin___strlcpy_chk - .{ .tag = @enumFromInt(93), .properties = .{ .param_str = "zc*cC*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin___strncat_chk - .{ .tag = @enumFromInt(94), .properties = .{ .param_str = "c*c*cC*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin___strncpy_chk - .{ .tag = @enumFromInt(95), .properties = .{ .param_str = "c*c*cC*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin___vfprintf_chk - .{ .tag = @enumFromInt(96), .properties = .{ .param_str = "iP*RicC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vprintf, .format_string_position = 2 } } }, - // __builtin___vprintf_chk - .{ .tag = @enumFromInt(97), .properties = .{ .param_str = "iicC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vprintf, .format_string_position = 1 } } }, - // __builtin___vsnprintf_chk - .{ .tag = @enumFromInt(98), .properties = .{ .param_str = "ic*RzizcC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vprintf, .format_string_position = 4 } } }, - // __builtin___vsprintf_chk - .{ .tag = @enumFromInt(99), .properties = .{ .param_str = "ic*RizcC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vprintf, .format_string_position = 3 } } }, - // __builtin_abort - .{ .tag = @enumFromInt(100), .properties = .{ .param_str = "v", .attributes = .{ .noreturn = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_abs - .{ .tag = @enumFromInt(101), .properties = .{ .param_str = "ii", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_acos - .{ .tag = @enumFromInt(102), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_acosf - .{ .tag = @enumFromInt(103), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_acosf128 - .{ .tag = @enumFromInt(104), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_acosh - .{ .tag = @enumFromInt(105), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_acoshf - .{ .tag = @enumFromInt(106), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_acoshf128 - .{ .tag = @enumFromInt(107), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_acoshl - .{ .tag = @enumFromInt(108), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_acosl - .{ .tag = @enumFromInt(109), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_add_overflow - .{ .tag = @enumFromInt(110), .properties = .{ .param_str = "b.", .attributes = .{ .custom_typecheck = true, .const_evaluable = true } } }, - // __builtin_addc - .{ .tag = @enumFromInt(111), .properties = .{ .param_str = "UiUiCUiCUiCUi*" } }, - // __builtin_addcb - .{ .tag = @enumFromInt(112), .properties = .{ .param_str = "UcUcCUcCUcCUc*" } }, - // __builtin_addcl - .{ .tag = @enumFromInt(113), .properties = .{ .param_str = "ULiULiCULiCULiCULi*" } }, - // __builtin_addcll - .{ .tag = @enumFromInt(114), .properties = .{ .param_str = "ULLiULLiCULLiCULLiCULLi*" } }, - // __builtin_addcs - .{ .tag = @enumFromInt(115), .properties = .{ .param_str = "UsUsCUsCUsCUs*" } }, - // __builtin_align_down - .{ .tag = @enumFromInt(116), .properties = .{ .param_str = "v*vC*z", .attributes = .{ .@"const" = true, .custom_typecheck = true, .const_evaluable = true } } }, - // __builtin_align_up - .{ .tag = @enumFromInt(117), .properties = .{ .param_str = "v*vC*z", .attributes = .{ .@"const" = true, .custom_typecheck = true, .const_evaluable = true } } }, - // __builtin_alloca - .{ .tag = @enumFromInt(118), .properties = .{ .param_str = "v*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_alloca_uninitialized - .{ .tag = @enumFromInt(119), .properties = .{ .param_str = "v*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_alloca_with_align - .{ .tag = @enumFromInt(120), .properties = .{ .param_str = "v*zIz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_alloca_with_align_uninitialized - .{ .tag = @enumFromInt(121), .properties = .{ .param_str = "v*zIz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_amdgcn_alignbit - .{ .tag = @enumFromInt(122), .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_alignbyte - .{ .tag = @enumFromInt(123), .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_atomic_dec32 - .{ .tag = @enumFromInt(124), .properties = .{ .param_str = "UZiUZiD*UZiUicC*", .target_set = TargetSet.initOne(.amdgpu) } }, - // __builtin_amdgcn_atomic_dec64 - .{ .tag = @enumFromInt(125), .properties = .{ .param_str = "UWiUWiD*UWiUicC*", .target_set = TargetSet.initOne(.amdgpu) } }, - // __builtin_amdgcn_atomic_inc32 - .{ .tag = @enumFromInt(126), .properties = .{ .param_str = "UZiUZiD*UZiUicC*", .target_set = TargetSet.initOne(.amdgpu) } }, - // __builtin_amdgcn_atomic_inc64 - .{ .tag = @enumFromInt(127), .properties = .{ .param_str = "UWiUWiD*UWiUicC*", .target_set = TargetSet.initOne(.amdgpu) } }, - // __builtin_amdgcn_buffer_wbinvl1 - .{ .tag = @enumFromInt(128), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.amdgpu) } }, - // __builtin_amdgcn_class - .{ .tag = @enumFromInt(129), .properties = .{ .param_str = "bdi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_classf - .{ .tag = @enumFromInt(130), .properties = .{ .param_str = "bfi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_cosf - .{ .tag = @enumFromInt(131), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_cubeid - .{ .tag = @enumFromInt(132), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_cubema - .{ .tag = @enumFromInt(133), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_cubesc - .{ .tag = @enumFromInt(134), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_cubetc - .{ .tag = @enumFromInt(135), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_cvt_pk_i16 - .{ .tag = @enumFromInt(136), .properties = .{ .param_str = "E2sii", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_cvt_pk_u16 - .{ .tag = @enumFromInt(137), .properties = .{ .param_str = "E2UsUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_cvt_pk_u8_f32 - .{ .tag = @enumFromInt(138), .properties = .{ .param_str = "UifUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_cvt_pknorm_i16 - .{ .tag = @enumFromInt(139), .properties = .{ .param_str = "E2sff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_cvt_pknorm_u16 - .{ .tag = @enumFromInt(140), .properties = .{ .param_str = "E2Usff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_cvt_pkrtz - .{ .tag = @enumFromInt(141), .properties = .{ .param_str = "E2hff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_dispatch_ptr - .{ .tag = @enumFromInt(142), .properties = .{ .param_str = "v*4", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_div_fixup - .{ .tag = @enumFromInt(143), .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_div_fixupf - .{ .tag = @enumFromInt(144), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_div_fmas - .{ .tag = @enumFromInt(145), .properties = .{ .param_str = "ddddb", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_div_fmasf - .{ .tag = @enumFromInt(146), .properties = .{ .param_str = "ffffb", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_div_scale - .{ .tag = @enumFromInt(147), .properties = .{ .param_str = "dddbb*", .target_set = TargetSet.initOne(.amdgpu) } }, - // __builtin_amdgcn_div_scalef - .{ .tag = @enumFromInt(148), .properties = .{ .param_str = "fffbb*", .target_set = TargetSet.initOne(.amdgpu) } }, - // __builtin_amdgcn_ds_append - .{ .tag = @enumFromInt(149), .properties = .{ .param_str = "ii*3", .target_set = TargetSet.initOne(.amdgpu) } }, - // __builtin_amdgcn_ds_bpermute - .{ .tag = @enumFromInt(150), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_ds_consume - .{ .tag = @enumFromInt(151), .properties = .{ .param_str = "ii*3", .target_set = TargetSet.initOne(.amdgpu) } }, - // __builtin_amdgcn_ds_faddf - .{ .tag = @enumFromInt(152), .properties = .{ .param_str = "ff*3fIiIiIb", .target_set = TargetSet.initOne(.amdgpu) } }, - // __builtin_amdgcn_ds_fmaxf - .{ .tag = @enumFromInt(153), .properties = .{ .param_str = "ff*3fIiIiIb", .target_set = TargetSet.initOne(.amdgpu) } }, - // __builtin_amdgcn_ds_fminf - .{ .tag = @enumFromInt(154), .properties = .{ .param_str = "ff*3fIiIiIb", .target_set = TargetSet.initOne(.amdgpu) } }, - // __builtin_amdgcn_ds_permute - .{ .tag = @enumFromInt(155), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_ds_swizzle - .{ .tag = @enumFromInt(156), .properties = .{ .param_str = "iiIi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_endpgm - .{ .tag = @enumFromInt(157), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .noreturn = true } } }, - // __builtin_amdgcn_exp2f - .{ .tag = @enumFromInt(158), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_fcmp - .{ .tag = @enumFromInt(159), .properties = .{ .param_str = "WUiddIi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_fcmpf - .{ .tag = @enumFromInt(160), .properties = .{ .param_str = "WUiffIi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_fence - .{ .tag = @enumFromInt(161), .properties = .{ .param_str = "vUicC*", .target_set = TargetSet.initOne(.amdgpu) } }, - // __builtin_amdgcn_fmed3f - .{ .tag = @enumFromInt(162), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_fract - .{ .tag = @enumFromInt(163), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_fractf - .{ .tag = @enumFromInt(164), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_frexp_exp - .{ .tag = @enumFromInt(165), .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_frexp_expf - .{ .tag = @enumFromInt(166), .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_frexp_mant - .{ .tag = @enumFromInt(167), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_frexp_mantf - .{ .tag = @enumFromInt(168), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_grid_size_x - .{ .tag = @enumFromInt(169), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_grid_size_y - .{ .tag = @enumFromInt(170), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_grid_size_z - .{ .tag = @enumFromInt(171), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_groupstaticsize - .{ .tag = @enumFromInt(172), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu) } }, - // __builtin_amdgcn_iglp_opt - .{ .tag = @enumFromInt(173), .properties = .{ .param_str = "vIi", .target_set = TargetSet.initOne(.amdgpu) } }, - // __builtin_amdgcn_implicitarg_ptr - .{ .tag = @enumFromInt(174), .properties = .{ .param_str = "v*4", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_interp_mov - .{ .tag = @enumFromInt(175), .properties = .{ .param_str = "fUiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_interp_p1 - .{ .tag = @enumFromInt(176), .properties = .{ .param_str = "ffUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_interp_p1_f16 - .{ .tag = @enumFromInt(177), .properties = .{ .param_str = "ffUiUibUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_interp_p2 - .{ .tag = @enumFromInt(178), .properties = .{ .param_str = "fffUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_interp_p2_f16 - .{ .tag = @enumFromInt(179), .properties = .{ .param_str = "hffUiUibUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_is_private - .{ .tag = @enumFromInt(180), .properties = .{ .param_str = "bvC*0", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_is_shared - .{ .tag = @enumFromInt(181), .properties = .{ .param_str = "bvC*0", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_kernarg_segment_ptr - .{ .tag = @enumFromInt(182), .properties = .{ .param_str = "v*4", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_ldexp - .{ .tag = @enumFromInt(183), .properties = .{ .param_str = "ddi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_ldexpf - .{ .tag = @enumFromInt(184), .properties = .{ .param_str = "ffi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_lerp - .{ .tag = @enumFromInt(185), .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_log_clampf - .{ .tag = @enumFromInt(186), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_logf - .{ .tag = @enumFromInt(187), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_mbcnt_hi - .{ .tag = @enumFromInt(188), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_mbcnt_lo - .{ .tag = @enumFromInt(189), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_mqsad_pk_u16_u8 - .{ .tag = @enumFromInt(190), .properties = .{ .param_str = "WUiWUiUiWUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_mqsad_u32_u8 - .{ .tag = @enumFromInt(191), .properties = .{ .param_str = "V4UiWUiUiV4Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_msad_u8 - .{ .tag = @enumFromInt(192), .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_qsad_pk_u16_u8 - .{ .tag = @enumFromInt(193), .properties = .{ .param_str = "WUiWUiUiWUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_queue_ptr - .{ .tag = @enumFromInt(194), .properties = .{ .param_str = "v*4", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_rcp - .{ .tag = @enumFromInt(195), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_rcpf - .{ .tag = @enumFromInt(196), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_read_exec - .{ .tag = @enumFromInt(197), .properties = .{ .param_str = "WUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_read_exec_hi - .{ .tag = @enumFromInt(198), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_read_exec_lo - .{ .tag = @enumFromInt(199), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_readfirstlane - .{ .tag = @enumFromInt(200), .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_readlane - .{ .tag = @enumFromInt(201), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_rsq - .{ .tag = @enumFromInt(202), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_rsq_clamp - .{ .tag = @enumFromInt(203), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_rsq_clampf - .{ .tag = @enumFromInt(204), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_rsqf - .{ .tag = @enumFromInt(205), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_s_barrier - .{ .tag = @enumFromInt(206), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.amdgpu) } }, - // __builtin_amdgcn_s_dcache_inv - .{ .tag = @enumFromInt(207), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.amdgpu) } }, - // __builtin_amdgcn_s_decperflevel - .{ .tag = @enumFromInt(208), .properties = .{ .param_str = "vIi", .target_set = TargetSet.initOne(.amdgpu) } }, - // __builtin_amdgcn_s_getpc - .{ .tag = @enumFromInt(209), .properties = .{ .param_str = "WUi", .target_set = TargetSet.initOne(.amdgpu) } }, - // __builtin_amdgcn_s_getreg - .{ .tag = @enumFromInt(210), .properties = .{ .param_str = "UiIi", .target_set = TargetSet.initOne(.amdgpu) } }, - // __builtin_amdgcn_s_incperflevel - .{ .tag = @enumFromInt(211), .properties = .{ .param_str = "vIi", .target_set = TargetSet.initOne(.amdgpu) } }, - // __builtin_amdgcn_s_sendmsg - .{ .tag = @enumFromInt(212), .properties = .{ .param_str = "vIiUi", .target_set = TargetSet.initOne(.amdgpu) } }, - // __builtin_amdgcn_s_sendmsghalt - .{ .tag = @enumFromInt(213), .properties = .{ .param_str = "vIiUi", .target_set = TargetSet.initOne(.amdgpu) } }, - // __builtin_amdgcn_s_setprio - .{ .tag = @enumFromInt(214), .properties = .{ .param_str = "vIs", .target_set = TargetSet.initOne(.amdgpu) } }, - // __builtin_amdgcn_s_setreg - .{ .tag = @enumFromInt(215), .properties = .{ .param_str = "vIiUi", .target_set = TargetSet.initOne(.amdgpu) } }, - // __builtin_amdgcn_s_sleep - .{ .tag = @enumFromInt(216), .properties = .{ .param_str = "vIi", .target_set = TargetSet.initOne(.amdgpu) } }, - // __builtin_amdgcn_s_waitcnt - .{ .tag = @enumFromInt(217), .properties = .{ .param_str = "vIi", .target_set = TargetSet.initOne(.amdgpu) } }, - // __builtin_amdgcn_sad_hi_u8 - .{ .tag = @enumFromInt(218), .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_sad_u16 - .{ .tag = @enumFromInt(219), .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_sad_u8 - .{ .tag = @enumFromInt(220), .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_sbfe - .{ .tag = @enumFromInt(221), .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_sched_barrier - .{ .tag = @enumFromInt(222), .properties = .{ .param_str = "vIi", .target_set = TargetSet.initOne(.amdgpu) } }, - // __builtin_amdgcn_sched_group_barrier - .{ .tag = @enumFromInt(223), .properties = .{ .param_str = "vIiIiIi", .target_set = TargetSet.initOne(.amdgpu) } }, - // __builtin_amdgcn_sicmp - .{ .tag = @enumFromInt(224), .properties = .{ .param_str = "WUiiiIi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_sicmpl - .{ .tag = @enumFromInt(225), .properties = .{ .param_str = "WUiWiWiIi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_sinf - .{ .tag = @enumFromInt(226), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_sqrt - .{ .tag = @enumFromInt(227), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_sqrtf - .{ .tag = @enumFromInt(228), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_trig_preop - .{ .tag = @enumFromInt(229), .properties = .{ .param_str = "ddi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_trig_preopf - .{ .tag = @enumFromInt(230), .properties = .{ .param_str = "ffi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_ubfe - .{ .tag = @enumFromInt(231), .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_uicmp - .{ .tag = @enumFromInt(232), .properties = .{ .param_str = "WUiUiUiIi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_uicmpl - .{ .tag = @enumFromInt(233), .properties = .{ .param_str = "WUiWUiWUiIi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_wave_barrier - .{ .tag = @enumFromInt(234), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.amdgpu) } }, - // __builtin_amdgcn_workgroup_id_x - .{ .tag = @enumFromInt(235), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_workgroup_id_y - .{ .tag = @enumFromInt(236), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_workgroup_id_z - .{ .tag = @enumFromInt(237), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_workgroup_size_x - .{ .tag = @enumFromInt(238), .properties = .{ .param_str = "Us", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_workgroup_size_y - .{ .tag = @enumFromInt(239), .properties = .{ .param_str = "Us", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_workgroup_size_z - .{ .tag = @enumFromInt(240), .properties = .{ .param_str = "Us", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_workitem_id_x - .{ .tag = @enumFromInt(241), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_workitem_id_y - .{ .tag = @enumFromInt(242), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_amdgcn_workitem_id_z - .{ .tag = @enumFromInt(243), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_annotation - .{ .tag = @enumFromInt(244), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __builtin_arm_cdp - .{ .tag = @enumFromInt(245), .properties = .{ .param_str = "vUIiUIiUIiUIiUIiUIi", .target_set = TargetSet.initOne(.arm) } }, - // __builtin_arm_cdp2 - .{ .tag = @enumFromInt(246), .properties = .{ .param_str = "vUIiUIiUIiUIiUIiUIi", .target_set = TargetSet.initOne(.arm) } }, - // __builtin_arm_clrex - .{ .tag = @enumFromInt(247), .properties = .{ .param_str = "v", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, - // __builtin_arm_cls - .{ .tag = @enumFromInt(248), .properties = .{ .param_str = "UiZUi", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_cls64 - .{ .tag = @enumFromInt(249), .properties = .{ .param_str = "UiWUi", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_clz - .{ .tag = @enumFromInt(250), .properties = .{ .param_str = "UiZUi", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_clz64 - .{ .tag = @enumFromInt(251), .properties = .{ .param_str = "UiWUi", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_cmse_TT - .{ .tag = @enumFromInt(252), .properties = .{ .param_str = "Uiv*", .target_set = TargetSet.initOne(.arm) } }, - // __builtin_arm_cmse_TTA - .{ .tag = @enumFromInt(253), .properties = .{ .param_str = "Uiv*", .target_set = TargetSet.initOne(.arm) } }, - // __builtin_arm_cmse_TTAT - .{ .tag = @enumFromInt(254), .properties = .{ .param_str = "Uiv*", .target_set = TargetSet.initOne(.arm) } }, - // __builtin_arm_cmse_TTT - .{ .tag = @enumFromInt(255), .properties = .{ .param_str = "Uiv*", .target_set = TargetSet.initOne(.arm) } }, - // __builtin_arm_dbg - .{ .tag = @enumFromInt(256), .properties = .{ .param_str = "vUi", .target_set = TargetSet.initOne(.arm) } }, - // __builtin_arm_dmb - .{ .tag = @enumFromInt(257), .properties = .{ .param_str = "vUi", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_dsb - .{ .tag = @enumFromInt(258), .properties = .{ .param_str = "vUi", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_get_fpscr - .{ .tag = @enumFromInt(259), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_isb - .{ .tag = @enumFromInt(260), .properties = .{ .param_str = "vUi", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_ldaex - .{ .tag = @enumFromInt(261), .properties = .{ .param_str = "v.", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .custom_typecheck = true } } }, - // __builtin_arm_ldc - .{ .tag = @enumFromInt(262), .properties = .{ .param_str = "vUIiUIivC*", .target_set = TargetSet.initOne(.arm) } }, - // __builtin_arm_ldc2 - .{ .tag = @enumFromInt(263), .properties = .{ .param_str = "vUIiUIivC*", .target_set = TargetSet.initOne(.arm) } }, - // __builtin_arm_ldc2l - .{ .tag = @enumFromInt(264), .properties = .{ .param_str = "vUIiUIivC*", .target_set = TargetSet.initOne(.arm) } }, - // __builtin_arm_ldcl - .{ .tag = @enumFromInt(265), .properties = .{ .param_str = "vUIiUIivC*", .target_set = TargetSet.initOne(.arm) } }, - // __builtin_arm_ldrex - .{ .tag = @enumFromInt(266), .properties = .{ .param_str = "v.", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .custom_typecheck = true } } }, - // __builtin_arm_ldrexd - .{ .tag = @enumFromInt(267), .properties = .{ .param_str = "LLUiv*", .target_set = TargetSet.initOne(.arm) } }, - // __builtin_arm_mcr - .{ .tag = @enumFromInt(268), .properties = .{ .param_str = "vUIiUIiUiUIiUIiUIi", .target_set = TargetSet.initOne(.arm) } }, - // __builtin_arm_mcr2 - .{ .tag = @enumFromInt(269), .properties = .{ .param_str = "vUIiUIiUiUIiUIiUIi", .target_set = TargetSet.initOne(.arm) } }, - // __builtin_arm_mcrr - .{ .tag = @enumFromInt(270), .properties = .{ .param_str = "vUIiUIiLLUiUIi", .target_set = TargetSet.initOne(.arm) } }, - // __builtin_arm_mcrr2 - .{ .tag = @enumFromInt(271), .properties = .{ .param_str = "vUIiUIiLLUiUIi", .target_set = TargetSet.initOne(.arm) } }, - // __builtin_arm_mrc - .{ .tag = @enumFromInt(272), .properties = .{ .param_str = "UiUIiUIiUIiUIiUIi", .target_set = TargetSet.initOne(.arm) } }, - // __builtin_arm_mrc2 - .{ .tag = @enumFromInt(273), .properties = .{ .param_str = "UiUIiUIiUIiUIiUIi", .target_set = TargetSet.initOne(.arm) } }, - // __builtin_arm_mrrc - .{ .tag = @enumFromInt(274), .properties = .{ .param_str = "LLUiUIiUIiUIi", .target_set = TargetSet.initOne(.arm) } }, - // __builtin_arm_mrrc2 - .{ .tag = @enumFromInt(275), .properties = .{ .param_str = "LLUiUIiUIiUIi", .target_set = TargetSet.initOne(.arm) } }, - // __builtin_arm_nop - .{ .tag = @enumFromInt(276), .properties = .{ .param_str = "v", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, - // __builtin_arm_prefetch - .{ .tag = @enumFromInt(277), .properties = .{ .param_str = "!", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_qadd - .{ .tag = @enumFromInt(278), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_qadd16 - .{ .tag = @enumFromInt(279), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_qadd8 - .{ .tag = @enumFromInt(280), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_qasx - .{ .tag = @enumFromInt(281), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_qdbl - .{ .tag = @enumFromInt(282), .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_qsax - .{ .tag = @enumFromInt(283), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_qsub - .{ .tag = @enumFromInt(284), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_qsub16 - .{ .tag = @enumFromInt(285), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_qsub8 - .{ .tag = @enumFromInt(286), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_rbit - .{ .tag = @enumFromInt(287), .properties = .{ .param_str = "UiUi", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_rbit64 - .{ .tag = @enumFromInt(288), .properties = .{ .param_str = "WUiWUi", .target_set = TargetSet.initOne(.aarch64), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_rsr - .{ .tag = @enumFromInt(289), .properties = .{ .param_str = "UicC*", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_rsr64 - .{ .tag = @enumFromInt(290), .properties = .{ .param_str = "!", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_rsrp - .{ .tag = @enumFromInt(291), .properties = .{ .param_str = "v*cC*", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_sadd16 - .{ .tag = @enumFromInt(292), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_sadd8 - .{ .tag = @enumFromInt(293), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_sasx - .{ .tag = @enumFromInt(294), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_sel - .{ .tag = @enumFromInt(295), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_set_fpscr - .{ .tag = @enumFromInt(296), .properties = .{ .param_str = "vUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_sev - .{ .tag = @enumFromInt(297), .properties = .{ .param_str = "v", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, - // __builtin_arm_sevl - .{ .tag = @enumFromInt(298), .properties = .{ .param_str = "v", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, - // __builtin_arm_shadd16 - .{ .tag = @enumFromInt(299), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_shadd8 - .{ .tag = @enumFromInt(300), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_shasx - .{ .tag = @enumFromInt(301), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_shsax - .{ .tag = @enumFromInt(302), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_shsub16 - .{ .tag = @enumFromInt(303), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_shsub8 - .{ .tag = @enumFromInt(304), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_smlabb - .{ .tag = @enumFromInt(305), .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_smlabt - .{ .tag = @enumFromInt(306), .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_smlad - .{ .tag = @enumFromInt(307), .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_smladx - .{ .tag = @enumFromInt(308), .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_smlald - .{ .tag = @enumFromInt(309), .properties = .{ .param_str = "LLiiiLLi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_smlaldx - .{ .tag = @enumFromInt(310), .properties = .{ .param_str = "LLiiiLLi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_smlatb - .{ .tag = @enumFromInt(311), .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_smlatt - .{ .tag = @enumFromInt(312), .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_smlawb - .{ .tag = @enumFromInt(313), .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_smlawt - .{ .tag = @enumFromInt(314), .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_smlsd - .{ .tag = @enumFromInt(315), .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_smlsdx - .{ .tag = @enumFromInt(316), .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_smlsld - .{ .tag = @enumFromInt(317), .properties = .{ .param_str = "LLiiiLLi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_smlsldx - .{ .tag = @enumFromInt(318), .properties = .{ .param_str = "LLiiiLLi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_smuad - .{ .tag = @enumFromInt(319), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_smuadx - .{ .tag = @enumFromInt(320), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_smulbb - .{ .tag = @enumFromInt(321), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_smulbt - .{ .tag = @enumFromInt(322), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_smultb - .{ .tag = @enumFromInt(323), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_smultt - .{ .tag = @enumFromInt(324), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_smulwb - .{ .tag = @enumFromInt(325), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_smulwt - .{ .tag = @enumFromInt(326), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_smusd - .{ .tag = @enumFromInt(327), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_smusdx - .{ .tag = @enumFromInt(328), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_ssat - .{ .tag = @enumFromInt(329), .properties = .{ .param_str = "iiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_ssat16 - .{ .tag = @enumFromInt(330), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_ssax - .{ .tag = @enumFromInt(331), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_ssub16 - .{ .tag = @enumFromInt(332), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_ssub8 - .{ .tag = @enumFromInt(333), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_stc - .{ .tag = @enumFromInt(334), .properties = .{ .param_str = "vUIiUIiv*", .target_set = TargetSet.initOne(.arm) } }, - // __builtin_arm_stc2 - .{ .tag = @enumFromInt(335), .properties = .{ .param_str = "vUIiUIiv*", .target_set = TargetSet.initOne(.arm) } }, - // __builtin_arm_stc2l - .{ .tag = @enumFromInt(336), .properties = .{ .param_str = "vUIiUIiv*", .target_set = TargetSet.initOne(.arm) } }, - // __builtin_arm_stcl - .{ .tag = @enumFromInt(337), .properties = .{ .param_str = "vUIiUIiv*", .target_set = TargetSet.initOne(.arm) } }, - // __builtin_arm_stlex - .{ .tag = @enumFromInt(338), .properties = .{ .param_str = "i.", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .custom_typecheck = true } } }, - // __builtin_arm_strex - .{ .tag = @enumFromInt(339), .properties = .{ .param_str = "i.", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .custom_typecheck = true } } }, - // __builtin_arm_strexd - .{ .tag = @enumFromInt(340), .properties = .{ .param_str = "iLLUiv*", .target_set = TargetSet.initOne(.arm) } }, - // __builtin_arm_sxtab16 - .{ .tag = @enumFromInt(341), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_sxtb16 - .{ .tag = @enumFromInt(342), .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_tcancel - .{ .tag = @enumFromInt(343), .properties = .{ .param_str = "vWUIi", .target_set = TargetSet.initOne(.aarch64) } }, - // __builtin_arm_tcommit - .{ .tag = @enumFromInt(344), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.aarch64) } }, - // __builtin_arm_tstart - .{ .tag = @enumFromInt(345), .properties = .{ .param_str = "WUi", .target_set = TargetSet.initOne(.aarch64), .attributes = .{ .returns_twice = true } } }, - // __builtin_arm_ttest - .{ .tag = @enumFromInt(346), .properties = .{ .param_str = "WUi", .target_set = TargetSet.initOne(.aarch64), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_uadd16 - .{ .tag = @enumFromInt(347), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_uadd8 - .{ .tag = @enumFromInt(348), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_uasx - .{ .tag = @enumFromInt(349), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_uhadd16 - .{ .tag = @enumFromInt(350), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_uhadd8 - .{ .tag = @enumFromInt(351), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_uhasx - .{ .tag = @enumFromInt(352), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_uhsax - .{ .tag = @enumFromInt(353), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_uhsub16 - .{ .tag = @enumFromInt(354), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_uhsub8 - .{ .tag = @enumFromInt(355), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_uqadd16 - .{ .tag = @enumFromInt(356), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_uqadd8 - .{ .tag = @enumFromInt(357), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_uqasx - .{ .tag = @enumFromInt(358), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_uqsax - .{ .tag = @enumFromInt(359), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_uqsub16 - .{ .tag = @enumFromInt(360), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_uqsub8 - .{ .tag = @enumFromInt(361), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_usad8 - .{ .tag = @enumFromInt(362), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_usada8 - .{ .tag = @enumFromInt(363), .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_usat - .{ .tag = @enumFromInt(364), .properties = .{ .param_str = "UiiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_usat16 - .{ .tag = @enumFromInt(365), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_usax - .{ .tag = @enumFromInt(366), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_usub16 - .{ .tag = @enumFromInt(367), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_usub8 - .{ .tag = @enumFromInt(368), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_uxtab16 - .{ .tag = @enumFromInt(369), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_uxtb16 - .{ .tag = @enumFromInt(370), .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_vcvtr_d - .{ .tag = @enumFromInt(371), .properties = .{ .param_str = "fdi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_vcvtr_f - .{ .tag = @enumFromInt(372), .properties = .{ .param_str = "ffi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_wfe - .{ .tag = @enumFromInt(373), .properties = .{ .param_str = "v", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, - // __builtin_arm_wfi - .{ .tag = @enumFromInt(374), .properties = .{ .param_str = "v", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, - // __builtin_arm_wsr - .{ .tag = @enumFromInt(375), .properties = .{ .param_str = "vcC*Ui", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_wsr64 - .{ .tag = @enumFromInt(376), .properties = .{ .param_str = "!", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_wsrp - .{ .tag = @enumFromInt(377), .properties = .{ .param_str = "vcC*vC*", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, - // __builtin_arm_yield - .{ .tag = @enumFromInt(378), .properties = .{ .param_str = "v", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, - // __builtin_asin - .{ .tag = @enumFromInt(379), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_asinf - .{ .tag = @enumFromInt(380), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_asinf128 - .{ .tag = @enumFromInt(381), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_asinh - .{ .tag = @enumFromInt(382), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_asinhf - .{ .tag = @enumFromInt(383), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_asinhf128 - .{ .tag = @enumFromInt(384), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_asinhl - .{ .tag = @enumFromInt(385), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_asinl - .{ .tag = @enumFromInt(386), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_assume - .{ .tag = @enumFromInt(387), .properties = .{ .param_str = "vb", .attributes = .{ .const_evaluable = true } } }, - // __builtin_assume_aligned - .{ .tag = @enumFromInt(388), .properties = .{ .param_str = "v*vC*z.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .const_evaluable = true } } }, - // __builtin_assume_separate_storage - .{ .tag = @enumFromInt(389), .properties = .{ .param_str = "vvCD*vCD*", .attributes = .{ .const_evaluable = true } } }, - // __builtin_atan - .{ .tag = @enumFromInt(390), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_atan2 - .{ .tag = @enumFromInt(391), .properties = .{ .param_str = "ddd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_atan2f - .{ .tag = @enumFromInt(392), .properties = .{ .param_str = "fff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_atan2f128 - .{ .tag = @enumFromInt(393), .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_atan2l - .{ .tag = @enumFromInt(394), .properties = .{ .param_str = "LdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_atanf - .{ .tag = @enumFromInt(395), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_atanf128 - .{ .tag = @enumFromInt(396), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_atanh - .{ .tag = @enumFromInt(397), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_atanhf - .{ .tag = @enumFromInt(398), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_atanhf128 - .{ .tag = @enumFromInt(399), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_atanhl - .{ .tag = @enumFromInt(400), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_atanl - .{ .tag = @enumFromInt(401), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_bcmp - .{ .tag = @enumFromInt(402), .properties = .{ .param_str = "ivC*vC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_bcopy - .{ .tag = @enumFromInt(403), .properties = .{ .param_str = "vvC*v*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_bitrev - .{ .tag = @enumFromInt(404), .properties = .{ .param_str = "UiUi", .target_set = TargetSet.initOne(.xcore), .attributes = .{ .@"const" = true } } }, - // __builtin_bitreverse16 - .{ .tag = @enumFromInt(405), .properties = .{ .param_str = "UsUs", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_bitreverse32 - .{ .tag = @enumFromInt(406), .properties = .{ .param_str = "UZiUZi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_bitreverse64 - .{ .tag = @enumFromInt(407), .properties = .{ .param_str = "UWiUWi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_bitreverse8 - .{ .tag = @enumFromInt(408), .properties = .{ .param_str = "UcUc", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_bswap16 - .{ .tag = @enumFromInt(409), .properties = .{ .param_str = "UsUs", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_bswap32 - .{ .tag = @enumFromInt(410), .properties = .{ .param_str = "UZiUZi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_bswap64 - .{ .tag = @enumFromInt(411), .properties = .{ .param_str = "UWiUWi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_bzero - .{ .tag = @enumFromInt(412), .properties = .{ .param_str = "vv*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_cabs - .{ .tag = @enumFromInt(413), .properties = .{ .param_str = "dXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_cabsf - .{ .tag = @enumFromInt(414), .properties = .{ .param_str = "fXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_cabsl - .{ .tag = @enumFromInt(415), .properties = .{ .param_str = "LdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_cacos - .{ .tag = @enumFromInt(416), .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_cacosf - .{ .tag = @enumFromInt(417), .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_cacosh - .{ .tag = @enumFromInt(418), .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_cacoshf - .{ .tag = @enumFromInt(419), .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_cacoshl - .{ .tag = @enumFromInt(420), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_cacosl - .{ .tag = @enumFromInt(421), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_call_with_static_chain - .{ .tag = @enumFromInt(422), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __builtin_calloc - .{ .tag = @enumFromInt(423), .properties = .{ .param_str = "v*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_canonicalize - .{ .tag = @enumFromInt(424), .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true } } }, - // __builtin_canonicalizef - .{ .tag = @enumFromInt(425), .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true } } }, - // __builtin_canonicalizef16 - .{ .tag = @enumFromInt(426), .properties = .{ .param_str = "hh", .attributes = .{ .@"const" = true } } }, - // __builtin_canonicalizel - .{ .tag = @enumFromInt(427), .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true } } }, - // __builtin_carg - .{ .tag = @enumFromInt(428), .properties = .{ .param_str = "dXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_cargf - .{ .tag = @enumFromInt(429), .properties = .{ .param_str = "fXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_cargl - .{ .tag = @enumFromInt(430), .properties = .{ .param_str = "LdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_casin - .{ .tag = @enumFromInt(431), .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_casinf - .{ .tag = @enumFromInt(432), .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_casinh - .{ .tag = @enumFromInt(433), .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_casinhf - .{ .tag = @enumFromInt(434), .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_casinhl - .{ .tag = @enumFromInt(435), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_casinl - .{ .tag = @enumFromInt(436), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_catan - .{ .tag = @enumFromInt(437), .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_catanf - .{ .tag = @enumFromInt(438), .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_catanh - .{ .tag = @enumFromInt(439), .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_catanhf - .{ .tag = @enumFromInt(440), .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_catanhl - .{ .tag = @enumFromInt(441), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_catanl - .{ .tag = @enumFromInt(442), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_cbrt - .{ .tag = @enumFromInt(443), .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_cbrtf - .{ .tag = @enumFromInt(444), .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_cbrtf128 - .{ .tag = @enumFromInt(445), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_cbrtl - .{ .tag = @enumFromInt(446), .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_ccos - .{ .tag = @enumFromInt(447), .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_ccosf - .{ .tag = @enumFromInt(448), .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_ccosh - .{ .tag = @enumFromInt(449), .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_ccoshf - .{ .tag = @enumFromInt(450), .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_ccoshl - .{ .tag = @enumFromInt(451), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_ccosl - .{ .tag = @enumFromInt(452), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_ceil - .{ .tag = @enumFromInt(453), .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_ceilf - .{ .tag = @enumFromInt(454), .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_ceilf128 - .{ .tag = @enumFromInt(455), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_ceilf16 - .{ .tag = @enumFromInt(456), .properties = .{ .param_str = "hh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_ceill - .{ .tag = @enumFromInt(457), .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_cexp - .{ .tag = @enumFromInt(458), .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_cexpf - .{ .tag = @enumFromInt(459), .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_cexpl - .{ .tag = @enumFromInt(460), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_char_memchr - .{ .tag = @enumFromInt(461), .properties = .{ .param_str = "c*cC*iz", .attributes = .{ .const_evaluable = true } } }, - // __builtin_cimag - .{ .tag = @enumFromInt(462), .properties = .{ .param_str = "dXd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_cimagf - .{ .tag = @enumFromInt(463), .properties = .{ .param_str = "fXf", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_cimagl - .{ .tag = @enumFromInt(464), .properties = .{ .param_str = "LdXLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_classify_type - .{ .tag = @enumFromInt(465), .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .eval_args = false, .const_evaluable = true } } }, - // __builtin_clog - .{ .tag = @enumFromInt(466), .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_clogf - .{ .tag = @enumFromInt(467), .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_clogl - .{ .tag = @enumFromInt(468), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_clrsb - .{ .tag = @enumFromInt(469), .properties = .{ .param_str = "ii", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_clrsbl - .{ .tag = @enumFromInt(470), .properties = .{ .param_str = "iLi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_clrsbll - .{ .tag = @enumFromInt(471), .properties = .{ .param_str = "iLLi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_clz - .{ .tag = @enumFromInt(472), .properties = .{ .param_str = "iUi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_clzl - .{ .tag = @enumFromInt(473), .properties = .{ .param_str = "iULi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_clzll - .{ .tag = @enumFromInt(474), .properties = .{ .param_str = "iULLi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_clzs - .{ .tag = @enumFromInt(475), .properties = .{ .param_str = "iUs", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_complex - .{ .tag = @enumFromInt(476), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .const_evaluable = true } } }, - // __builtin_conj - .{ .tag = @enumFromInt(477), .properties = .{ .param_str = "XdXd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_conjf - .{ .tag = @enumFromInt(478), .properties = .{ .param_str = "XfXf", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_conjl - .{ .tag = @enumFromInt(479), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_constant_p - .{ .tag = @enumFromInt(480), .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .eval_args = false, .const_evaluable = true } } }, - // __builtin_convertvector - .{ .tag = @enumFromInt(481), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_copysign - .{ .tag = @enumFromInt(482), .properties = .{ .param_str = "ddd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_copysignf - .{ .tag = @enumFromInt(483), .properties = .{ .param_str = "fff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_copysignf128 - .{ .tag = @enumFromInt(484), .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_copysignf16 - .{ .tag = @enumFromInt(485), .properties = .{ .param_str = "hhh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_copysignl - .{ .tag = @enumFromInt(486), .properties = .{ .param_str = "LdLdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_cos - .{ .tag = @enumFromInt(487), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_cosf - .{ .tag = @enumFromInt(488), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_cosf128 - .{ .tag = @enumFromInt(489), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_cosf16 - .{ .tag = @enumFromInt(490), .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_cosh - .{ .tag = @enumFromInt(491), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_coshf - .{ .tag = @enumFromInt(492), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_coshf128 - .{ .tag = @enumFromInt(493), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_coshl - .{ .tag = @enumFromInt(494), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_cosl - .{ .tag = @enumFromInt(495), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_cpow - .{ .tag = @enumFromInt(496), .properties = .{ .param_str = "XdXdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_cpowf - .{ .tag = @enumFromInt(497), .properties = .{ .param_str = "XfXfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_cpowl - .{ .tag = @enumFromInt(498), .properties = .{ .param_str = "XLdXLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_cproj - .{ .tag = @enumFromInt(499), .properties = .{ .param_str = "XdXd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_cprojf - .{ .tag = @enumFromInt(500), .properties = .{ .param_str = "XfXf", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_cprojl - .{ .tag = @enumFromInt(501), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_cpu_init - .{ .tag = @enumFromInt(502), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.x86) } }, - // __builtin_cpu_is - .{ .tag = @enumFromInt(503), .properties = .{ .param_str = "bcC*", .target_set = TargetSet.initOne(.x86), .attributes = .{ .@"const" = true } } }, - // __builtin_cpu_supports - .{ .tag = @enumFromInt(504), .properties = .{ .param_str = "bcC*", .target_set = TargetSet.initOne(.x86), .attributes = .{ .@"const" = true } } }, - // __builtin_creal - .{ .tag = @enumFromInt(505), .properties = .{ .param_str = "dXd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_crealf - .{ .tag = @enumFromInt(506), .properties = .{ .param_str = "fXf", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_creall - .{ .tag = @enumFromInt(507), .properties = .{ .param_str = "LdXLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_csin - .{ .tag = @enumFromInt(508), .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_csinf - .{ .tag = @enumFromInt(509), .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_csinh - .{ .tag = @enumFromInt(510), .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_csinhf - .{ .tag = @enumFromInt(511), .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_csinhl - .{ .tag = @enumFromInt(512), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_csinl - .{ .tag = @enumFromInt(513), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_csqrt - .{ .tag = @enumFromInt(514), .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_csqrtf - .{ .tag = @enumFromInt(515), .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_csqrtl - .{ .tag = @enumFromInt(516), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_ctan - .{ .tag = @enumFromInt(517), .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_ctanf - .{ .tag = @enumFromInt(518), .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_ctanh - .{ .tag = @enumFromInt(519), .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_ctanhf - .{ .tag = @enumFromInt(520), .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_ctanhl - .{ .tag = @enumFromInt(521), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_ctanl - .{ .tag = @enumFromInt(522), .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_ctz - .{ .tag = @enumFromInt(523), .properties = .{ .param_str = "iUi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_ctzl - .{ .tag = @enumFromInt(524), .properties = .{ .param_str = "iULi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_ctzll - .{ .tag = @enumFromInt(525), .properties = .{ .param_str = "iULLi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_ctzs - .{ .tag = @enumFromInt(526), .properties = .{ .param_str = "iUs", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_dcbf - .{ .tag = @enumFromInt(527), .properties = .{ .param_str = "vvC*", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_debugtrap - .{ .tag = @enumFromInt(528), .properties = .{ .param_str = "v" } }, - // __builtin_dump_struct - .{ .tag = @enumFromInt(529), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __builtin_dwarf_cfa - .{ .tag = @enumFromInt(530), .properties = .{ .param_str = "v*" } }, - // __builtin_dwarf_sp_column - .{ .tag = @enumFromInt(531), .properties = .{ .param_str = "Ui" } }, - // __builtin_dynamic_object_size - .{ .tag = @enumFromInt(532), .properties = .{ .param_str = "zvC*i", .attributes = .{ .eval_args = false, .const_evaluable = true } } }, - // __builtin_eh_return - .{ .tag = @enumFromInt(533), .properties = .{ .param_str = "vzv*", .attributes = .{ .noreturn = true } } }, - // __builtin_eh_return_data_regno - .{ .tag = @enumFromInt(534), .properties = .{ .param_str = "iIi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_elementwise_abs - .{ .tag = @enumFromInt(535), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_elementwise_add_sat - .{ .tag = @enumFromInt(536), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_elementwise_bitreverse - .{ .tag = @enumFromInt(537), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_elementwise_canonicalize - .{ .tag = @enumFromInt(538), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_elementwise_ceil - .{ .tag = @enumFromInt(539), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_elementwise_copysign - .{ .tag = @enumFromInt(540), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_elementwise_cos - .{ .tag = @enumFromInt(541), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_elementwise_exp - .{ .tag = @enumFromInt(542), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_elementwise_exp2 - .{ .tag = @enumFromInt(543), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_elementwise_floor - .{ .tag = @enumFromInt(544), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_elementwise_fma - .{ .tag = @enumFromInt(545), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_elementwise_log - .{ .tag = @enumFromInt(546), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_elementwise_log10 - .{ .tag = @enumFromInt(547), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_elementwise_log2 - .{ .tag = @enumFromInt(548), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_elementwise_max - .{ .tag = @enumFromInt(549), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_elementwise_min - .{ .tag = @enumFromInt(550), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_elementwise_nearbyint - .{ .tag = @enumFromInt(551), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_elementwise_pow - .{ .tag = @enumFromInt(552), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_elementwise_rint - .{ .tag = @enumFromInt(553), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_elementwise_round - .{ .tag = @enumFromInt(554), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_elementwise_roundeven - .{ .tag = @enumFromInt(555), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_elementwise_sin - .{ .tag = @enumFromInt(556), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_elementwise_sqrt - .{ .tag = @enumFromInt(557), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_elementwise_sub_sat - .{ .tag = @enumFromInt(558), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_elementwise_trunc - .{ .tag = @enumFromInt(559), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_erf - .{ .tag = @enumFromInt(560), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_erfc - .{ .tag = @enumFromInt(561), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_erfcf - .{ .tag = @enumFromInt(562), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_erfcf128 - .{ .tag = @enumFromInt(563), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_erfcl - .{ .tag = @enumFromInt(564), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_erff - .{ .tag = @enumFromInt(565), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_erff128 - .{ .tag = @enumFromInt(566), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_erfl - .{ .tag = @enumFromInt(567), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_exp - .{ .tag = @enumFromInt(568), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_exp10 - .{ .tag = @enumFromInt(569), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_exp10f - .{ .tag = @enumFromInt(570), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_exp10f128 - .{ .tag = @enumFromInt(571), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_exp10f16 - .{ .tag = @enumFromInt(572), .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_exp10l - .{ .tag = @enumFromInt(573), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_exp2 - .{ .tag = @enumFromInt(574), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_exp2f - .{ .tag = @enumFromInt(575), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_exp2f128 - .{ .tag = @enumFromInt(576), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_exp2f16 - .{ .tag = @enumFromInt(577), .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_exp2l - .{ .tag = @enumFromInt(578), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_expect - .{ .tag = @enumFromInt(579), .properties = .{ .param_str = "LiLiLi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_expect_with_probability - .{ .tag = @enumFromInt(580), .properties = .{ .param_str = "LiLiLid", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_expf - .{ .tag = @enumFromInt(581), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_expf128 - .{ .tag = @enumFromInt(582), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_expf16 - .{ .tag = @enumFromInt(583), .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_expl - .{ .tag = @enumFromInt(584), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_expm1 - .{ .tag = @enumFromInt(585), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_expm1f - .{ .tag = @enumFromInt(586), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_expm1f128 - .{ .tag = @enumFromInt(587), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_expm1l - .{ .tag = @enumFromInt(588), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_extend_pointer - .{ .tag = @enumFromInt(589), .properties = .{ .param_str = "ULLiv*" } }, - // __builtin_extract_return_addr - .{ .tag = @enumFromInt(590), .properties = .{ .param_str = "v*v*" } }, - // __builtin_fabs - .{ .tag = @enumFromInt(591), .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_fabsf - .{ .tag = @enumFromInt(592), .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_fabsf128 - .{ .tag = @enumFromInt(593), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_fabsf16 - .{ .tag = @enumFromInt(594), .properties = .{ .param_str = "hh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_fabsl - .{ .tag = @enumFromInt(595), .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_fdim - .{ .tag = @enumFromInt(596), .properties = .{ .param_str = "ddd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_fdimf - .{ .tag = @enumFromInt(597), .properties = .{ .param_str = "fff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_fdimf128 - .{ .tag = @enumFromInt(598), .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_fdiml - .{ .tag = @enumFromInt(599), .properties = .{ .param_str = "LdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_ffs - .{ .tag = @enumFromInt(600), .properties = .{ .param_str = "ii", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_ffsl - .{ .tag = @enumFromInt(601), .properties = .{ .param_str = "iLi", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_ffsll - .{ .tag = @enumFromInt(602), .properties = .{ .param_str = "iLLi", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_floor - .{ .tag = @enumFromInt(603), .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_floorf - .{ .tag = @enumFromInt(604), .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_floorf128 - .{ .tag = @enumFromInt(605), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_floorf16 - .{ .tag = @enumFromInt(606), .properties = .{ .param_str = "hh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_floorl - .{ .tag = @enumFromInt(607), .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_flt_rounds - .{ .tag = @enumFromInt(608), .properties = .{ .param_str = "i" } }, - // __builtin_fma - .{ .tag = @enumFromInt(609), .properties = .{ .param_str = "dddd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_fmaf - .{ .tag = @enumFromInt(610), .properties = .{ .param_str = "ffff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_fmaf128 - .{ .tag = @enumFromInt(611), .properties = .{ .param_str = "LLdLLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_fmaf16 - .{ .tag = @enumFromInt(612), .properties = .{ .param_str = "hhhh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_fmal - .{ .tag = @enumFromInt(613), .properties = .{ .param_str = "LdLdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_fmax - .{ .tag = @enumFromInt(614), .properties = .{ .param_str = "ddd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_fmaxf - .{ .tag = @enumFromInt(615), .properties = .{ .param_str = "fff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_fmaxf128 - .{ .tag = @enumFromInt(616), .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_fmaxf16 - .{ .tag = @enumFromInt(617), .properties = .{ .param_str = "hhh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_fmaxl - .{ .tag = @enumFromInt(618), .properties = .{ .param_str = "LdLdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_fmin - .{ .tag = @enumFromInt(619), .properties = .{ .param_str = "ddd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_fminf - .{ .tag = @enumFromInt(620), .properties = .{ .param_str = "fff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_fminf128 - .{ .tag = @enumFromInt(621), .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_fminf16 - .{ .tag = @enumFromInt(622), .properties = .{ .param_str = "hhh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_fminl - .{ .tag = @enumFromInt(623), .properties = .{ .param_str = "LdLdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_fmod - .{ .tag = @enumFromInt(624), .properties = .{ .param_str = "ddd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_fmodf - .{ .tag = @enumFromInt(625), .properties = .{ .param_str = "fff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_fmodf128 - .{ .tag = @enumFromInt(626), .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_fmodf16 - .{ .tag = @enumFromInt(627), .properties = .{ .param_str = "hhh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_fmodl - .{ .tag = @enumFromInt(628), .properties = .{ .param_str = "LdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_fpclassify - .{ .tag = @enumFromInt(629), .properties = .{ .param_str = "iiiiii.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_fprintf - .{ .tag = @enumFromInt(630), .properties = .{ .param_str = "iP*RcC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .printf, .format_string_position = 1 } } }, - // __builtin_frame_address - .{ .tag = @enumFromInt(631), .properties = .{ .param_str = "v*IUi" } }, - // __builtin_free - .{ .tag = @enumFromInt(632), .properties = .{ .param_str = "vv*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_frexp - .{ .tag = @enumFromInt(633), .properties = .{ .param_str = "ddi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_frexpf - .{ .tag = @enumFromInt(634), .properties = .{ .param_str = "ffi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_frexpf128 - .{ .tag = @enumFromInt(635), .properties = .{ .param_str = "LLdLLdi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_frexpf16 - .{ .tag = @enumFromInt(636), .properties = .{ .param_str = "hhi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_frexpl - .{ .tag = @enumFromInt(637), .properties = .{ .param_str = "LdLdi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_frob_return_addr - .{ .tag = @enumFromInt(638), .properties = .{ .param_str = "v*v*" } }, - // __builtin_fscanf - .{ .tag = @enumFromInt(639), .properties = .{ .param_str = "iP*RcC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .scanf, .format_string_position = 1 } } }, - // __builtin_getid - .{ .tag = @enumFromInt(640), .properties = .{ .param_str = "Si", .target_set = TargetSet.initOne(.xcore), .attributes = .{ .@"const" = true } } }, - // __builtin_getps - .{ .tag = @enumFromInt(641), .properties = .{ .param_str = "UiUi", .target_set = TargetSet.initOne(.xcore) } }, - // __builtin_huge_val - .{ .tag = @enumFromInt(642), .properties = .{ .param_str = "d", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_huge_valf - .{ .tag = @enumFromInt(643), .properties = .{ .param_str = "f", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_huge_valf128 - .{ .tag = @enumFromInt(644), .properties = .{ .param_str = "LLd", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_huge_valf16 - .{ .tag = @enumFromInt(645), .properties = .{ .param_str = "x", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_huge_vall - .{ .tag = @enumFromInt(646), .properties = .{ .param_str = "Ld", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_hypot - .{ .tag = @enumFromInt(647), .properties = .{ .param_str = "ddd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_hypotf - .{ .tag = @enumFromInt(648), .properties = .{ .param_str = "fff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_hypotf128 - .{ .tag = @enumFromInt(649), .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_hypotl - .{ .tag = @enumFromInt(650), .properties = .{ .param_str = "LdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_ia32_rdpmc - .{ .tag = @enumFromInt(651), .properties = .{ .param_str = "UOii", .target_set = TargetSet.initOne(.x86) } }, - // __builtin_ia32_rdtsc - .{ .tag = @enumFromInt(652), .properties = .{ .param_str = "UOi", .target_set = TargetSet.initOne(.x86) } }, - // __builtin_ia32_rdtscp - .{ .tag = @enumFromInt(653), .properties = .{ .param_str = "UOiUi*", .target_set = TargetSet.initOne(.x86) } }, - // __builtin_ilogb - .{ .tag = @enumFromInt(654), .properties = .{ .param_str = "id", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_ilogbf - .{ .tag = @enumFromInt(655), .properties = .{ .param_str = "if", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_ilogbf128 - .{ .tag = @enumFromInt(656), .properties = .{ .param_str = "iLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_ilogbl - .{ .tag = @enumFromInt(657), .properties = .{ .param_str = "iLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_index - .{ .tag = @enumFromInt(658), .properties = .{ .param_str = "c*cC*i", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_inf - .{ .tag = @enumFromInt(659), .properties = .{ .param_str = "d", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_inff - .{ .tag = @enumFromInt(660), .properties = .{ .param_str = "f", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_inff128 - .{ .tag = @enumFromInt(661), .properties = .{ .param_str = "LLd", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_inff16 - .{ .tag = @enumFromInt(662), .properties = .{ .param_str = "x", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_infl - .{ .tag = @enumFromInt(663), .properties = .{ .param_str = "Ld", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_init_dwarf_reg_size_table - .{ .tag = @enumFromInt(664), .properties = .{ .param_str = "vv*" } }, - // __builtin_is_aligned - .{ .tag = @enumFromInt(665), .properties = .{ .param_str = "bvC*z", .attributes = .{ .@"const" = true, .custom_typecheck = true, .const_evaluable = true } } }, - // __builtin_isfinite - .{ .tag = @enumFromInt(666), .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_isfpclass - .{ .tag = @enumFromInt(667), .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .const_evaluable = true } } }, - // __builtin_isgreater - .{ .tag = @enumFromInt(668), .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_isgreaterequal - .{ .tag = @enumFromInt(669), .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_isinf - .{ .tag = @enumFromInt(670), .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_isinf_sign - .{ .tag = @enumFromInt(671), .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_isless - .{ .tag = @enumFromInt(672), .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_islessequal - .{ .tag = @enumFromInt(673), .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_islessgreater - .{ .tag = @enumFromInt(674), .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_isnan - .{ .tag = @enumFromInt(675), .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_isnormal - .{ .tag = @enumFromInt(676), .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_isunordered - .{ .tag = @enumFromInt(677), .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_labs - .{ .tag = @enumFromInt(678), .properties = .{ .param_str = "LiLi", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_launder - .{ .tag = @enumFromInt(679), .properties = .{ .param_str = "v*v*", .attributes = .{ .custom_typecheck = true, .const_evaluable = true } } }, - // __builtin_ldexp - .{ .tag = @enumFromInt(680), .properties = .{ .param_str = "ddi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_ldexpf - .{ .tag = @enumFromInt(681), .properties = .{ .param_str = "ffi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_ldexpf128 - .{ .tag = @enumFromInt(682), .properties = .{ .param_str = "LLdLLdi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_ldexpf16 - .{ .tag = @enumFromInt(683), .properties = .{ .param_str = "hhi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_ldexpl - .{ .tag = @enumFromInt(684), .properties = .{ .param_str = "LdLdi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_lgamma - .{ .tag = @enumFromInt(685), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_lgammaf - .{ .tag = @enumFromInt(686), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_lgammaf128 - .{ .tag = @enumFromInt(687), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_lgammal - .{ .tag = @enumFromInt(688), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_llabs - .{ .tag = @enumFromInt(689), .properties = .{ .param_str = "LLiLLi", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_llrint - .{ .tag = @enumFromInt(690), .properties = .{ .param_str = "LLid", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_llrintf - .{ .tag = @enumFromInt(691), .properties = .{ .param_str = "LLif", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_llrintf128 - .{ .tag = @enumFromInt(692), .properties = .{ .param_str = "LLiLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_llrintl - .{ .tag = @enumFromInt(693), .properties = .{ .param_str = "LLiLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_llround - .{ .tag = @enumFromInt(694), .properties = .{ .param_str = "LLid", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_llroundf - .{ .tag = @enumFromInt(695), .properties = .{ .param_str = "LLif", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_llroundf128 - .{ .tag = @enumFromInt(696), .properties = .{ .param_str = "LLiLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_llroundl - .{ .tag = @enumFromInt(697), .properties = .{ .param_str = "LLiLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_log - .{ .tag = @enumFromInt(698), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_log10 - .{ .tag = @enumFromInt(699), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_log10f - .{ .tag = @enumFromInt(700), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_log10f128 - .{ .tag = @enumFromInt(701), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_log10f16 - .{ .tag = @enumFromInt(702), .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_log10l - .{ .tag = @enumFromInt(703), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_log1p - .{ .tag = @enumFromInt(704), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_log1pf - .{ .tag = @enumFromInt(705), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_log1pf128 - .{ .tag = @enumFromInt(706), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_log1pl - .{ .tag = @enumFromInt(707), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_log2 - .{ .tag = @enumFromInt(708), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_log2f - .{ .tag = @enumFromInt(709), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_log2f128 - .{ .tag = @enumFromInt(710), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_log2f16 - .{ .tag = @enumFromInt(711), .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_log2l - .{ .tag = @enumFromInt(712), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_logb - .{ .tag = @enumFromInt(713), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_logbf - .{ .tag = @enumFromInt(714), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_logbf128 - .{ .tag = @enumFromInt(715), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_logbl - .{ .tag = @enumFromInt(716), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_logf - .{ .tag = @enumFromInt(717), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_logf128 - .{ .tag = @enumFromInt(718), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_logf16 - .{ .tag = @enumFromInt(719), .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_logl - .{ .tag = @enumFromInt(720), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_longjmp - .{ .tag = @enumFromInt(721), .properties = .{ .param_str = "vv**i", .attributes = .{ .noreturn = true } } }, - // __builtin_lrint - .{ .tag = @enumFromInt(722), .properties = .{ .param_str = "Lid", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_lrintf - .{ .tag = @enumFromInt(723), .properties = .{ .param_str = "Lif", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_lrintf128 - .{ .tag = @enumFromInt(724), .properties = .{ .param_str = "LiLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_lrintl - .{ .tag = @enumFromInt(725), .properties = .{ .param_str = "LiLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_lround - .{ .tag = @enumFromInt(726), .properties = .{ .param_str = "Lid", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_lroundf - .{ .tag = @enumFromInt(727), .properties = .{ .param_str = "Lif", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_lroundf128 - .{ .tag = @enumFromInt(728), .properties = .{ .param_str = "LiLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_lroundl - .{ .tag = @enumFromInt(729), .properties = .{ .param_str = "LiLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_malloc - .{ .tag = @enumFromInt(730), .properties = .{ .param_str = "v*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_matrix_column_major_load - .{ .tag = @enumFromInt(731), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_matrix_column_major_store - .{ .tag = @enumFromInt(732), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_matrix_transpose - .{ .tag = @enumFromInt(733), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_memchr - .{ .tag = @enumFromInt(734), .properties = .{ .param_str = "v*vC*iz", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_memcmp - .{ .tag = @enumFromInt(735), .properties = .{ .param_str = "ivC*vC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_memcpy - .{ .tag = @enumFromInt(736), .properties = .{ .param_str = "v*v*vC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_memcpy_inline - .{ .tag = @enumFromInt(737), .properties = .{ .param_str = "vv*vC*Iz" } }, - // __builtin_memmove - .{ .tag = @enumFromInt(738), .properties = .{ .param_str = "v*v*vC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_mempcpy - .{ .tag = @enumFromInt(739), .properties = .{ .param_str = "v*v*vC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_memset - .{ .tag = @enumFromInt(740), .properties = .{ .param_str = "v*v*iz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_memset_inline - .{ .tag = @enumFromInt(741), .properties = .{ .param_str = "vv*iIz" } }, - // __builtin_mips_absq_s_ph - .{ .tag = @enumFromInt(742), .properties = .{ .param_str = "V2sV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_absq_s_qb - .{ .tag = @enumFromInt(743), .properties = .{ .param_str = "V4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_absq_s_w - .{ .tag = @enumFromInt(744), .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_addq_ph - .{ .tag = @enumFromInt(745), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_addq_s_ph - .{ .tag = @enumFromInt(746), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_addq_s_w - .{ .tag = @enumFromInt(747), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_addqh_ph - .{ .tag = @enumFromInt(748), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_addqh_r_ph - .{ .tag = @enumFromInt(749), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_addqh_r_w - .{ .tag = @enumFromInt(750), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_addqh_w - .{ .tag = @enumFromInt(751), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_addsc - .{ .tag = @enumFromInt(752), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_addu_ph - .{ .tag = @enumFromInt(753), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_addu_qb - .{ .tag = @enumFromInt(754), .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_addu_s_ph - .{ .tag = @enumFromInt(755), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_addu_s_qb - .{ .tag = @enumFromInt(756), .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_adduh_qb - .{ .tag = @enumFromInt(757), .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_adduh_r_qb - .{ .tag = @enumFromInt(758), .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_addwc - .{ .tag = @enumFromInt(759), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_append - .{ .tag = @enumFromInt(760), .properties = .{ .param_str = "iiiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_balign - .{ .tag = @enumFromInt(761), .properties = .{ .param_str = "iiiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_bitrev - .{ .tag = @enumFromInt(762), .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_bposge32 - .{ .tag = @enumFromInt(763), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_cmp_eq_ph - .{ .tag = @enumFromInt(764), .properties = .{ .param_str = "vV2sV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_cmp_le_ph - .{ .tag = @enumFromInt(765), .properties = .{ .param_str = "vV2sV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_cmp_lt_ph - .{ .tag = @enumFromInt(766), .properties = .{ .param_str = "vV2sV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_cmpgdu_eq_qb - .{ .tag = @enumFromInt(767), .properties = .{ .param_str = "iV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_cmpgdu_le_qb - .{ .tag = @enumFromInt(768), .properties = .{ .param_str = "iV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_cmpgdu_lt_qb - .{ .tag = @enumFromInt(769), .properties = .{ .param_str = "iV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_cmpgu_eq_qb - .{ .tag = @enumFromInt(770), .properties = .{ .param_str = "iV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_cmpgu_le_qb - .{ .tag = @enumFromInt(771), .properties = .{ .param_str = "iV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_cmpgu_lt_qb - .{ .tag = @enumFromInt(772), .properties = .{ .param_str = "iV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_cmpu_eq_qb - .{ .tag = @enumFromInt(773), .properties = .{ .param_str = "vV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_cmpu_le_qb - .{ .tag = @enumFromInt(774), .properties = .{ .param_str = "vV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_cmpu_lt_qb - .{ .tag = @enumFromInt(775), .properties = .{ .param_str = "vV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_dpa_w_ph - .{ .tag = @enumFromInt(776), .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_dpaq_s_w_ph - .{ .tag = @enumFromInt(777), .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_dpaq_sa_l_w - .{ .tag = @enumFromInt(778), .properties = .{ .param_str = "LLiLLiii", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_dpaqx_s_w_ph - .{ .tag = @enumFromInt(779), .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_dpaqx_sa_w_ph - .{ .tag = @enumFromInt(780), .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_dpau_h_qbl - .{ .tag = @enumFromInt(781), .properties = .{ .param_str = "LLiLLiV4ScV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_dpau_h_qbr - .{ .tag = @enumFromInt(782), .properties = .{ .param_str = "LLiLLiV4ScV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_dpax_w_ph - .{ .tag = @enumFromInt(783), .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_dps_w_ph - .{ .tag = @enumFromInt(784), .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_dpsq_s_w_ph - .{ .tag = @enumFromInt(785), .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_dpsq_sa_l_w - .{ .tag = @enumFromInt(786), .properties = .{ .param_str = "LLiLLiii", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_dpsqx_s_w_ph - .{ .tag = @enumFromInt(787), .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_dpsqx_sa_w_ph - .{ .tag = @enumFromInt(788), .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_dpsu_h_qbl - .{ .tag = @enumFromInt(789), .properties = .{ .param_str = "LLiLLiV4ScV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_dpsu_h_qbr - .{ .tag = @enumFromInt(790), .properties = .{ .param_str = "LLiLLiV4ScV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_dpsx_w_ph - .{ .tag = @enumFromInt(791), .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_extp - .{ .tag = @enumFromInt(792), .properties = .{ .param_str = "iLLii", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_extpdp - .{ .tag = @enumFromInt(793), .properties = .{ .param_str = "iLLii", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_extr_r_w - .{ .tag = @enumFromInt(794), .properties = .{ .param_str = "iLLii", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_extr_rs_w - .{ .tag = @enumFromInt(795), .properties = .{ .param_str = "iLLii", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_extr_s_h - .{ .tag = @enumFromInt(796), .properties = .{ .param_str = "iLLii", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_extr_w - .{ .tag = @enumFromInt(797), .properties = .{ .param_str = "iLLii", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_insv - .{ .tag = @enumFromInt(798), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_lbux - .{ .tag = @enumFromInt(799), .properties = .{ .param_str = "iv*i", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_lhx - .{ .tag = @enumFromInt(800), .properties = .{ .param_str = "iv*i", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_lwx - .{ .tag = @enumFromInt(801), .properties = .{ .param_str = "iv*i", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_madd - .{ .tag = @enumFromInt(802), .properties = .{ .param_str = "LLiLLiii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_maddu - .{ .tag = @enumFromInt(803), .properties = .{ .param_str = "LLiLLiUiUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_maq_s_w_phl - .{ .tag = @enumFromInt(804), .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_maq_s_w_phr - .{ .tag = @enumFromInt(805), .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_maq_sa_w_phl - .{ .tag = @enumFromInt(806), .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_maq_sa_w_phr - .{ .tag = @enumFromInt(807), .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_modsub - .{ .tag = @enumFromInt(808), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_msub - .{ .tag = @enumFromInt(809), .properties = .{ .param_str = "LLiLLiii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_msubu - .{ .tag = @enumFromInt(810), .properties = .{ .param_str = "LLiLLiUiUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_mthlip - .{ .tag = @enumFromInt(811), .properties = .{ .param_str = "LLiLLii", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_mul_ph - .{ .tag = @enumFromInt(812), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_mul_s_ph - .{ .tag = @enumFromInt(813), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_muleq_s_w_phl - .{ .tag = @enumFromInt(814), .properties = .{ .param_str = "iV2sV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_muleq_s_w_phr - .{ .tag = @enumFromInt(815), .properties = .{ .param_str = "iV2sV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_muleu_s_ph_qbl - .{ .tag = @enumFromInt(816), .properties = .{ .param_str = "V2sV4ScV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_muleu_s_ph_qbr - .{ .tag = @enumFromInt(817), .properties = .{ .param_str = "V2sV4ScV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_mulq_rs_ph - .{ .tag = @enumFromInt(818), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_mulq_rs_w - .{ .tag = @enumFromInt(819), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_mulq_s_ph - .{ .tag = @enumFromInt(820), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_mulq_s_w - .{ .tag = @enumFromInt(821), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_mulsa_w_ph - .{ .tag = @enumFromInt(822), .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_mulsaq_s_w_ph - .{ .tag = @enumFromInt(823), .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_mult - .{ .tag = @enumFromInt(824), .properties = .{ .param_str = "LLiii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_multu - .{ .tag = @enumFromInt(825), .properties = .{ .param_str = "LLiUiUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_packrl_ph - .{ .tag = @enumFromInt(826), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_pick_ph - .{ .tag = @enumFromInt(827), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_pick_qb - .{ .tag = @enumFromInt(828), .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_preceq_w_phl - .{ .tag = @enumFromInt(829), .properties = .{ .param_str = "iV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_preceq_w_phr - .{ .tag = @enumFromInt(830), .properties = .{ .param_str = "iV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_precequ_ph_qbl - .{ .tag = @enumFromInt(831), .properties = .{ .param_str = "V2sV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_precequ_ph_qbla - .{ .tag = @enumFromInt(832), .properties = .{ .param_str = "V2sV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_precequ_ph_qbr - .{ .tag = @enumFromInt(833), .properties = .{ .param_str = "V2sV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_precequ_ph_qbra - .{ .tag = @enumFromInt(834), .properties = .{ .param_str = "V2sV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_preceu_ph_qbl - .{ .tag = @enumFromInt(835), .properties = .{ .param_str = "V2sV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_preceu_ph_qbla - .{ .tag = @enumFromInt(836), .properties = .{ .param_str = "V2sV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_preceu_ph_qbr - .{ .tag = @enumFromInt(837), .properties = .{ .param_str = "V2sV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_preceu_ph_qbra - .{ .tag = @enumFromInt(838), .properties = .{ .param_str = "V2sV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_precr_qb_ph - .{ .tag = @enumFromInt(839), .properties = .{ .param_str = "V4ScV2sV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_precr_sra_ph_w - .{ .tag = @enumFromInt(840), .properties = .{ .param_str = "V2siiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_precr_sra_r_ph_w - .{ .tag = @enumFromInt(841), .properties = .{ .param_str = "V2siiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_precrq_ph_w - .{ .tag = @enumFromInt(842), .properties = .{ .param_str = "V2sii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_precrq_qb_ph - .{ .tag = @enumFromInt(843), .properties = .{ .param_str = "V4ScV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_precrq_rs_ph_w - .{ .tag = @enumFromInt(844), .properties = .{ .param_str = "V2sii", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_precrqu_s_qb_ph - .{ .tag = @enumFromInt(845), .properties = .{ .param_str = "V4ScV2sV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_prepend - .{ .tag = @enumFromInt(846), .properties = .{ .param_str = "iiiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_raddu_w_qb - .{ .tag = @enumFromInt(847), .properties = .{ .param_str = "iV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_rddsp - .{ .tag = @enumFromInt(848), .properties = .{ .param_str = "iIi", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_repl_ph - .{ .tag = @enumFromInt(849), .properties = .{ .param_str = "V2si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_repl_qb - .{ .tag = @enumFromInt(850), .properties = .{ .param_str = "V4Sci", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_shilo - .{ .tag = @enumFromInt(851), .properties = .{ .param_str = "LLiLLii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_shll_ph - .{ .tag = @enumFromInt(852), .properties = .{ .param_str = "V2sV2si", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_shll_qb - .{ .tag = @enumFromInt(853), .properties = .{ .param_str = "V4ScV4Sci", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_shll_s_ph - .{ .tag = @enumFromInt(854), .properties = .{ .param_str = "V2sV2si", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_shll_s_w - .{ .tag = @enumFromInt(855), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_shra_ph - .{ .tag = @enumFromInt(856), .properties = .{ .param_str = "V2sV2si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_shra_qb - .{ .tag = @enumFromInt(857), .properties = .{ .param_str = "V4ScV4Sci", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_shra_r_ph - .{ .tag = @enumFromInt(858), .properties = .{ .param_str = "V2sV2si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_shra_r_qb - .{ .tag = @enumFromInt(859), .properties = .{ .param_str = "V4ScV4Sci", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_shra_r_w - .{ .tag = @enumFromInt(860), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_shrl_ph - .{ .tag = @enumFromInt(861), .properties = .{ .param_str = "V2sV2si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_shrl_qb - .{ .tag = @enumFromInt(862), .properties = .{ .param_str = "V4ScV4Sci", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_subq_ph - .{ .tag = @enumFromInt(863), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_subq_s_ph - .{ .tag = @enumFromInt(864), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_subq_s_w - .{ .tag = @enumFromInt(865), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_subqh_ph - .{ .tag = @enumFromInt(866), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_subqh_r_ph - .{ .tag = @enumFromInt(867), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_subqh_r_w - .{ .tag = @enumFromInt(868), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_subqh_w - .{ .tag = @enumFromInt(869), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_subu_ph - .{ .tag = @enumFromInt(870), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_subu_qb - .{ .tag = @enumFromInt(871), .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_subu_s_ph - .{ .tag = @enumFromInt(872), .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_subu_s_qb - .{ .tag = @enumFromInt(873), .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_mips_subuh_qb - .{ .tag = @enumFromInt(874), .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_subuh_r_qb - .{ .tag = @enumFromInt(875), .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mips_wrdsp - .{ .tag = @enumFromInt(876), .properties = .{ .param_str = "viIi", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_modf - .{ .tag = @enumFromInt(877), .properties = .{ .param_str = "ddd*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_modff - .{ .tag = @enumFromInt(878), .properties = .{ .param_str = "fff*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_modff128 - .{ .tag = @enumFromInt(879), .properties = .{ .param_str = "LLdLLdLLd*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_modfl - .{ .tag = @enumFromInt(880), .properties = .{ .param_str = "LdLdLd*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_msa_add_a_b - .{ .tag = @enumFromInt(881), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_add_a_d - .{ .tag = @enumFromInt(882), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_add_a_h - .{ .tag = @enumFromInt(883), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_add_a_w - .{ .tag = @enumFromInt(884), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_adds_a_b - .{ .tag = @enumFromInt(885), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_adds_a_d - .{ .tag = @enumFromInt(886), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_adds_a_h - .{ .tag = @enumFromInt(887), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_adds_a_w - .{ .tag = @enumFromInt(888), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_adds_s_b - .{ .tag = @enumFromInt(889), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_adds_s_d - .{ .tag = @enumFromInt(890), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_adds_s_h - .{ .tag = @enumFromInt(891), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_adds_s_w - .{ .tag = @enumFromInt(892), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_adds_u_b - .{ .tag = @enumFromInt(893), .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_adds_u_d - .{ .tag = @enumFromInt(894), .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_adds_u_h - .{ .tag = @enumFromInt(895), .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_adds_u_w - .{ .tag = @enumFromInt(896), .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_addv_b - .{ .tag = @enumFromInt(897), .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_addv_d - .{ .tag = @enumFromInt(898), .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_addv_h - .{ .tag = @enumFromInt(899), .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_addv_w - .{ .tag = @enumFromInt(900), .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_addvi_b - .{ .tag = @enumFromInt(901), .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_addvi_d - .{ .tag = @enumFromInt(902), .properties = .{ .param_str = "V2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_addvi_h - .{ .tag = @enumFromInt(903), .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_addvi_w - .{ .tag = @enumFromInt(904), .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_and_v - .{ .tag = @enumFromInt(905), .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_andi_b - .{ .tag = @enumFromInt(906), .properties = .{ .param_str = "V16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_asub_s_b - .{ .tag = @enumFromInt(907), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_asub_s_d - .{ .tag = @enumFromInt(908), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_asub_s_h - .{ .tag = @enumFromInt(909), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_asub_s_w - .{ .tag = @enumFromInt(910), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_asub_u_b - .{ .tag = @enumFromInt(911), .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_asub_u_d - .{ .tag = @enumFromInt(912), .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_asub_u_h - .{ .tag = @enumFromInt(913), .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_asub_u_w - .{ .tag = @enumFromInt(914), .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ave_s_b - .{ .tag = @enumFromInt(915), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ave_s_d - .{ .tag = @enumFromInt(916), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ave_s_h - .{ .tag = @enumFromInt(917), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ave_s_w - .{ .tag = @enumFromInt(918), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ave_u_b - .{ .tag = @enumFromInt(919), .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ave_u_d - .{ .tag = @enumFromInt(920), .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ave_u_h - .{ .tag = @enumFromInt(921), .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ave_u_w - .{ .tag = @enumFromInt(922), .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_aver_s_b - .{ .tag = @enumFromInt(923), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_aver_s_d - .{ .tag = @enumFromInt(924), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_aver_s_h - .{ .tag = @enumFromInt(925), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_aver_s_w - .{ .tag = @enumFromInt(926), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_aver_u_b - .{ .tag = @enumFromInt(927), .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_aver_u_d - .{ .tag = @enumFromInt(928), .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_aver_u_h - .{ .tag = @enumFromInt(929), .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_aver_u_w - .{ .tag = @enumFromInt(930), .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bclr_b - .{ .tag = @enumFromInt(931), .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bclr_d - .{ .tag = @enumFromInt(932), .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bclr_h - .{ .tag = @enumFromInt(933), .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bclr_w - .{ .tag = @enumFromInt(934), .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bclri_b - .{ .tag = @enumFromInt(935), .properties = .{ .param_str = "V16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bclri_d - .{ .tag = @enumFromInt(936), .properties = .{ .param_str = "V2ULLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bclri_h - .{ .tag = @enumFromInt(937), .properties = .{ .param_str = "V8UsV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bclri_w - .{ .tag = @enumFromInt(938), .properties = .{ .param_str = "V4UiV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_binsl_b - .{ .tag = @enumFromInt(939), .properties = .{ .param_str = "V16UcV16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_binsl_d - .{ .tag = @enumFromInt(940), .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_binsl_h - .{ .tag = @enumFromInt(941), .properties = .{ .param_str = "V8UsV8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_binsl_w - .{ .tag = @enumFromInt(942), .properties = .{ .param_str = "V4UiV4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_binsli_b - .{ .tag = @enumFromInt(943), .properties = .{ .param_str = "V16UcV16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_binsli_d - .{ .tag = @enumFromInt(944), .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_binsli_h - .{ .tag = @enumFromInt(945), .properties = .{ .param_str = "V8UsV8UsV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_binsli_w - .{ .tag = @enumFromInt(946), .properties = .{ .param_str = "V4UiV4UiV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_binsr_b - .{ .tag = @enumFromInt(947), .properties = .{ .param_str = "V16UcV16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_binsr_d - .{ .tag = @enumFromInt(948), .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_binsr_h - .{ .tag = @enumFromInt(949), .properties = .{ .param_str = "V8UsV8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_binsr_w - .{ .tag = @enumFromInt(950), .properties = .{ .param_str = "V4UiV4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_binsri_b - .{ .tag = @enumFromInt(951), .properties = .{ .param_str = "V16UcV16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_binsri_d - .{ .tag = @enumFromInt(952), .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_binsri_h - .{ .tag = @enumFromInt(953), .properties = .{ .param_str = "V8UsV8UsV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_binsri_w - .{ .tag = @enumFromInt(954), .properties = .{ .param_str = "V4UiV4UiV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bmnz_v - .{ .tag = @enumFromInt(955), .properties = .{ .param_str = "V16UcV16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bmnzi_b - .{ .tag = @enumFromInt(956), .properties = .{ .param_str = "V16UcV16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bmz_v - .{ .tag = @enumFromInt(957), .properties = .{ .param_str = "V16UcV16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bmzi_b - .{ .tag = @enumFromInt(958), .properties = .{ .param_str = "V16UcV16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bneg_b - .{ .tag = @enumFromInt(959), .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bneg_d - .{ .tag = @enumFromInt(960), .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bneg_h - .{ .tag = @enumFromInt(961), .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bneg_w - .{ .tag = @enumFromInt(962), .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bnegi_b - .{ .tag = @enumFromInt(963), .properties = .{ .param_str = "V16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bnegi_d - .{ .tag = @enumFromInt(964), .properties = .{ .param_str = "V2ULLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bnegi_h - .{ .tag = @enumFromInt(965), .properties = .{ .param_str = "V8UsV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bnegi_w - .{ .tag = @enumFromInt(966), .properties = .{ .param_str = "V4UiV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bnz_b - .{ .tag = @enumFromInt(967), .properties = .{ .param_str = "iV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bnz_d - .{ .tag = @enumFromInt(968), .properties = .{ .param_str = "iV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bnz_h - .{ .tag = @enumFromInt(969), .properties = .{ .param_str = "iV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bnz_v - .{ .tag = @enumFromInt(970), .properties = .{ .param_str = "iV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bnz_w - .{ .tag = @enumFromInt(971), .properties = .{ .param_str = "iV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bsel_v - .{ .tag = @enumFromInt(972), .properties = .{ .param_str = "V16UcV16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bseli_b - .{ .tag = @enumFromInt(973), .properties = .{ .param_str = "V16UcV16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bset_b - .{ .tag = @enumFromInt(974), .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bset_d - .{ .tag = @enumFromInt(975), .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bset_h - .{ .tag = @enumFromInt(976), .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bset_w - .{ .tag = @enumFromInt(977), .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bseti_b - .{ .tag = @enumFromInt(978), .properties = .{ .param_str = "V16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bseti_d - .{ .tag = @enumFromInt(979), .properties = .{ .param_str = "V2ULLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bseti_h - .{ .tag = @enumFromInt(980), .properties = .{ .param_str = "V8UsV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bseti_w - .{ .tag = @enumFromInt(981), .properties = .{ .param_str = "V4UiV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bz_b - .{ .tag = @enumFromInt(982), .properties = .{ .param_str = "iV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bz_d - .{ .tag = @enumFromInt(983), .properties = .{ .param_str = "iV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bz_h - .{ .tag = @enumFromInt(984), .properties = .{ .param_str = "iV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bz_v - .{ .tag = @enumFromInt(985), .properties = .{ .param_str = "iV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_bz_w - .{ .tag = @enumFromInt(986), .properties = .{ .param_str = "iV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ceq_b - .{ .tag = @enumFromInt(987), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ceq_d - .{ .tag = @enumFromInt(988), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ceq_h - .{ .tag = @enumFromInt(989), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ceq_w - .{ .tag = @enumFromInt(990), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ceqi_b - .{ .tag = @enumFromInt(991), .properties = .{ .param_str = "V16ScV16ScISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ceqi_d - .{ .tag = @enumFromInt(992), .properties = .{ .param_str = "V2SLLiV2SLLiISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ceqi_h - .{ .tag = @enumFromInt(993), .properties = .{ .param_str = "V8SsV8SsISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ceqi_w - .{ .tag = @enumFromInt(994), .properties = .{ .param_str = "V4SiV4SiISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_cfcmsa - .{ .tag = @enumFromInt(995), .properties = .{ .param_str = "iIi", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_msa_cle_s_b - .{ .tag = @enumFromInt(996), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_cle_s_d - .{ .tag = @enumFromInt(997), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_cle_s_h - .{ .tag = @enumFromInt(998), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_cle_s_w - .{ .tag = @enumFromInt(999), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_cle_u_b - .{ .tag = @enumFromInt(1000), .properties = .{ .param_str = "V16ScV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_cle_u_d - .{ .tag = @enumFromInt(1001), .properties = .{ .param_str = "V2SLLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_cle_u_h - .{ .tag = @enumFromInt(1002), .properties = .{ .param_str = "V8SsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_cle_u_w - .{ .tag = @enumFromInt(1003), .properties = .{ .param_str = "V4SiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_clei_s_b - .{ .tag = @enumFromInt(1004), .properties = .{ .param_str = "V16ScV16ScISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_clei_s_d - .{ .tag = @enumFromInt(1005), .properties = .{ .param_str = "V2SLLiV2SLLiISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_clei_s_h - .{ .tag = @enumFromInt(1006), .properties = .{ .param_str = "V8SsV8SsISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_clei_s_w - .{ .tag = @enumFromInt(1007), .properties = .{ .param_str = "V4SiV4SiISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_clei_u_b - .{ .tag = @enumFromInt(1008), .properties = .{ .param_str = "V16ScV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_clei_u_d - .{ .tag = @enumFromInt(1009), .properties = .{ .param_str = "V2SLLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_clei_u_h - .{ .tag = @enumFromInt(1010), .properties = .{ .param_str = "V8SsV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_clei_u_w - .{ .tag = @enumFromInt(1011), .properties = .{ .param_str = "V4SiV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_clt_s_b - .{ .tag = @enumFromInt(1012), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_clt_s_d - .{ .tag = @enumFromInt(1013), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_clt_s_h - .{ .tag = @enumFromInt(1014), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_clt_s_w - .{ .tag = @enumFromInt(1015), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_clt_u_b - .{ .tag = @enumFromInt(1016), .properties = .{ .param_str = "V16ScV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_clt_u_d - .{ .tag = @enumFromInt(1017), .properties = .{ .param_str = "V2SLLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_clt_u_h - .{ .tag = @enumFromInt(1018), .properties = .{ .param_str = "V8SsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_clt_u_w - .{ .tag = @enumFromInt(1019), .properties = .{ .param_str = "V4SiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_clti_s_b - .{ .tag = @enumFromInt(1020), .properties = .{ .param_str = "V16ScV16ScISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_clti_s_d - .{ .tag = @enumFromInt(1021), .properties = .{ .param_str = "V2SLLiV2SLLiISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_clti_s_h - .{ .tag = @enumFromInt(1022), .properties = .{ .param_str = "V8SsV8SsISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_clti_s_w - .{ .tag = @enumFromInt(1023), .properties = .{ .param_str = "V4SiV4SiISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_clti_u_b - .{ .tag = @enumFromInt(1024), .properties = .{ .param_str = "V16ScV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_clti_u_d - .{ .tag = @enumFromInt(1025), .properties = .{ .param_str = "V2SLLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_clti_u_h - .{ .tag = @enumFromInt(1026), .properties = .{ .param_str = "V8SsV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_clti_u_w - .{ .tag = @enumFromInt(1027), .properties = .{ .param_str = "V4SiV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_copy_s_b - .{ .tag = @enumFromInt(1028), .properties = .{ .param_str = "iV16ScIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_copy_s_d - .{ .tag = @enumFromInt(1029), .properties = .{ .param_str = "LLiV2SLLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_copy_s_h - .{ .tag = @enumFromInt(1030), .properties = .{ .param_str = "iV8SsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_copy_s_w - .{ .tag = @enumFromInt(1031), .properties = .{ .param_str = "iV4SiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_copy_u_b - .{ .tag = @enumFromInt(1032), .properties = .{ .param_str = "iV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_copy_u_d - .{ .tag = @enumFromInt(1033), .properties = .{ .param_str = "LLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_copy_u_h - .{ .tag = @enumFromInt(1034), .properties = .{ .param_str = "iV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_copy_u_w - .{ .tag = @enumFromInt(1035), .properties = .{ .param_str = "iV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ctcmsa - .{ .tag = @enumFromInt(1036), .properties = .{ .param_str = "vIii", .target_set = TargetSet.initOne(.mips) } }, - // __builtin_msa_div_s_b - .{ .tag = @enumFromInt(1037), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_div_s_d - .{ .tag = @enumFromInt(1038), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_div_s_h - .{ .tag = @enumFromInt(1039), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_div_s_w - .{ .tag = @enumFromInt(1040), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_div_u_b - .{ .tag = @enumFromInt(1041), .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_div_u_d - .{ .tag = @enumFromInt(1042), .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_div_u_h - .{ .tag = @enumFromInt(1043), .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_div_u_w - .{ .tag = @enumFromInt(1044), .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_dotp_s_d - .{ .tag = @enumFromInt(1045), .properties = .{ .param_str = "V2SLLiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_dotp_s_h - .{ .tag = @enumFromInt(1046), .properties = .{ .param_str = "V8SsV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_dotp_s_w - .{ .tag = @enumFromInt(1047), .properties = .{ .param_str = "V4SiV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_dotp_u_d - .{ .tag = @enumFromInt(1048), .properties = .{ .param_str = "V2ULLiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_dotp_u_h - .{ .tag = @enumFromInt(1049), .properties = .{ .param_str = "V8UsV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_dotp_u_w - .{ .tag = @enumFromInt(1050), .properties = .{ .param_str = "V4UiV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_dpadd_s_d - .{ .tag = @enumFromInt(1051), .properties = .{ .param_str = "V2SLLiV2SLLiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_dpadd_s_h - .{ .tag = @enumFromInt(1052), .properties = .{ .param_str = "V8SsV8SsV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_dpadd_s_w - .{ .tag = @enumFromInt(1053), .properties = .{ .param_str = "V4SiV4SiV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_dpadd_u_d - .{ .tag = @enumFromInt(1054), .properties = .{ .param_str = "V2ULLiV2ULLiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_dpadd_u_h - .{ .tag = @enumFromInt(1055), .properties = .{ .param_str = "V8UsV8UsV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_dpadd_u_w - .{ .tag = @enumFromInt(1056), .properties = .{ .param_str = "V4UiV4UiV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_dpsub_s_d - .{ .tag = @enumFromInt(1057), .properties = .{ .param_str = "V2SLLiV2SLLiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_dpsub_s_h - .{ .tag = @enumFromInt(1058), .properties = .{ .param_str = "V8SsV8SsV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_dpsub_s_w - .{ .tag = @enumFromInt(1059), .properties = .{ .param_str = "V4SiV4SiV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_dpsub_u_d - .{ .tag = @enumFromInt(1060), .properties = .{ .param_str = "V2ULLiV2ULLiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_dpsub_u_h - .{ .tag = @enumFromInt(1061), .properties = .{ .param_str = "V8UsV8UsV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_dpsub_u_w - .{ .tag = @enumFromInt(1062), .properties = .{ .param_str = "V4UiV4UiV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fadd_d - .{ .tag = @enumFromInt(1063), .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fadd_w - .{ .tag = @enumFromInt(1064), .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fcaf_d - .{ .tag = @enumFromInt(1065), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fcaf_w - .{ .tag = @enumFromInt(1066), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fceq_d - .{ .tag = @enumFromInt(1067), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fceq_w - .{ .tag = @enumFromInt(1068), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fclass_d - .{ .tag = @enumFromInt(1069), .properties = .{ .param_str = "V2LLiV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fclass_w - .{ .tag = @enumFromInt(1070), .properties = .{ .param_str = "V4iV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fcle_d - .{ .tag = @enumFromInt(1071), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fcle_w - .{ .tag = @enumFromInt(1072), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fclt_d - .{ .tag = @enumFromInt(1073), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fclt_w - .{ .tag = @enumFromInt(1074), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fcne_d - .{ .tag = @enumFromInt(1075), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fcne_w - .{ .tag = @enumFromInt(1076), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fcor_d - .{ .tag = @enumFromInt(1077), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fcor_w - .{ .tag = @enumFromInt(1078), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fcueq_d - .{ .tag = @enumFromInt(1079), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fcueq_w - .{ .tag = @enumFromInt(1080), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fcule_d - .{ .tag = @enumFromInt(1081), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fcule_w - .{ .tag = @enumFromInt(1082), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fcult_d - .{ .tag = @enumFromInt(1083), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fcult_w - .{ .tag = @enumFromInt(1084), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fcun_d - .{ .tag = @enumFromInt(1085), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fcun_w - .{ .tag = @enumFromInt(1086), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fcune_d - .{ .tag = @enumFromInt(1087), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fcune_w - .{ .tag = @enumFromInt(1088), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fdiv_d - .{ .tag = @enumFromInt(1089), .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fdiv_w - .{ .tag = @enumFromInt(1090), .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fexdo_h - .{ .tag = @enumFromInt(1091), .properties = .{ .param_str = "V8hV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fexdo_w - .{ .tag = @enumFromInt(1092), .properties = .{ .param_str = "V4fV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fexp2_d - .{ .tag = @enumFromInt(1093), .properties = .{ .param_str = "V2dV2dV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fexp2_w - .{ .tag = @enumFromInt(1094), .properties = .{ .param_str = "V4fV4fV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fexupl_d - .{ .tag = @enumFromInt(1095), .properties = .{ .param_str = "V2dV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fexupl_w - .{ .tag = @enumFromInt(1096), .properties = .{ .param_str = "V4fV8h", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fexupr_d - .{ .tag = @enumFromInt(1097), .properties = .{ .param_str = "V2dV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fexupr_w - .{ .tag = @enumFromInt(1098), .properties = .{ .param_str = "V4fV8h", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ffint_s_d - .{ .tag = @enumFromInt(1099), .properties = .{ .param_str = "V2dV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ffint_s_w - .{ .tag = @enumFromInt(1100), .properties = .{ .param_str = "V4fV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ffint_u_d - .{ .tag = @enumFromInt(1101), .properties = .{ .param_str = "V2dV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ffint_u_w - .{ .tag = @enumFromInt(1102), .properties = .{ .param_str = "V4fV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ffql_d - .{ .tag = @enumFromInt(1103), .properties = .{ .param_str = "V2dV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ffql_w - .{ .tag = @enumFromInt(1104), .properties = .{ .param_str = "V4fV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ffqr_d - .{ .tag = @enumFromInt(1105), .properties = .{ .param_str = "V2dV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ffqr_w - .{ .tag = @enumFromInt(1106), .properties = .{ .param_str = "V4fV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fill_b - .{ .tag = @enumFromInt(1107), .properties = .{ .param_str = "V16Sci", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fill_d - .{ .tag = @enumFromInt(1108), .properties = .{ .param_str = "V2SLLiLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fill_h - .{ .tag = @enumFromInt(1109), .properties = .{ .param_str = "V8Ssi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fill_w - .{ .tag = @enumFromInt(1110), .properties = .{ .param_str = "V4Sii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_flog2_d - .{ .tag = @enumFromInt(1111), .properties = .{ .param_str = "V2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_flog2_w - .{ .tag = @enumFromInt(1112), .properties = .{ .param_str = "V4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fmadd_d - .{ .tag = @enumFromInt(1113), .properties = .{ .param_str = "V2dV2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fmadd_w - .{ .tag = @enumFromInt(1114), .properties = .{ .param_str = "V4fV4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fmax_a_d - .{ .tag = @enumFromInt(1115), .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fmax_a_w - .{ .tag = @enumFromInt(1116), .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fmax_d - .{ .tag = @enumFromInt(1117), .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fmax_w - .{ .tag = @enumFromInt(1118), .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fmin_a_d - .{ .tag = @enumFromInt(1119), .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fmin_a_w - .{ .tag = @enumFromInt(1120), .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fmin_d - .{ .tag = @enumFromInt(1121), .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fmin_w - .{ .tag = @enumFromInt(1122), .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fmsub_d - .{ .tag = @enumFromInt(1123), .properties = .{ .param_str = "V2dV2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fmsub_w - .{ .tag = @enumFromInt(1124), .properties = .{ .param_str = "V4fV4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fmul_d - .{ .tag = @enumFromInt(1125), .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fmul_w - .{ .tag = @enumFromInt(1126), .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_frcp_d - .{ .tag = @enumFromInt(1127), .properties = .{ .param_str = "V2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_frcp_w - .{ .tag = @enumFromInt(1128), .properties = .{ .param_str = "V4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_frint_d - .{ .tag = @enumFromInt(1129), .properties = .{ .param_str = "V2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_frint_w - .{ .tag = @enumFromInt(1130), .properties = .{ .param_str = "V4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_frsqrt_d - .{ .tag = @enumFromInt(1131), .properties = .{ .param_str = "V2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_frsqrt_w - .{ .tag = @enumFromInt(1132), .properties = .{ .param_str = "V4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fsaf_d - .{ .tag = @enumFromInt(1133), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fsaf_w - .{ .tag = @enumFromInt(1134), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fseq_d - .{ .tag = @enumFromInt(1135), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fseq_w - .{ .tag = @enumFromInt(1136), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fsle_d - .{ .tag = @enumFromInt(1137), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fsle_w - .{ .tag = @enumFromInt(1138), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fslt_d - .{ .tag = @enumFromInt(1139), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fslt_w - .{ .tag = @enumFromInt(1140), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fsne_d - .{ .tag = @enumFromInt(1141), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fsne_w - .{ .tag = @enumFromInt(1142), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fsor_d - .{ .tag = @enumFromInt(1143), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fsor_w - .{ .tag = @enumFromInt(1144), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fsqrt_d - .{ .tag = @enumFromInt(1145), .properties = .{ .param_str = "V2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fsqrt_w - .{ .tag = @enumFromInt(1146), .properties = .{ .param_str = "V4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fsub_d - .{ .tag = @enumFromInt(1147), .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fsub_w - .{ .tag = @enumFromInt(1148), .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fsueq_d - .{ .tag = @enumFromInt(1149), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fsueq_w - .{ .tag = @enumFromInt(1150), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fsule_d - .{ .tag = @enumFromInt(1151), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fsule_w - .{ .tag = @enumFromInt(1152), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fsult_d - .{ .tag = @enumFromInt(1153), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fsult_w - .{ .tag = @enumFromInt(1154), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fsun_d - .{ .tag = @enumFromInt(1155), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fsun_w - .{ .tag = @enumFromInt(1156), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fsune_d - .{ .tag = @enumFromInt(1157), .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_fsune_w - .{ .tag = @enumFromInt(1158), .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ftint_s_d - .{ .tag = @enumFromInt(1159), .properties = .{ .param_str = "V2SLLiV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ftint_s_w - .{ .tag = @enumFromInt(1160), .properties = .{ .param_str = "V4SiV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ftint_u_d - .{ .tag = @enumFromInt(1161), .properties = .{ .param_str = "V2ULLiV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ftint_u_w - .{ .tag = @enumFromInt(1162), .properties = .{ .param_str = "V4UiV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ftq_h - .{ .tag = @enumFromInt(1163), .properties = .{ .param_str = "V4UiV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ftq_w - .{ .tag = @enumFromInt(1164), .properties = .{ .param_str = "V2ULLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ftrunc_s_d - .{ .tag = @enumFromInt(1165), .properties = .{ .param_str = "V2SLLiV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ftrunc_s_w - .{ .tag = @enumFromInt(1166), .properties = .{ .param_str = "V4SiV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ftrunc_u_d - .{ .tag = @enumFromInt(1167), .properties = .{ .param_str = "V2ULLiV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ftrunc_u_w - .{ .tag = @enumFromInt(1168), .properties = .{ .param_str = "V4UiV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_hadd_s_d - .{ .tag = @enumFromInt(1169), .properties = .{ .param_str = "V2SLLiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_hadd_s_h - .{ .tag = @enumFromInt(1170), .properties = .{ .param_str = "V8SsV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_hadd_s_w - .{ .tag = @enumFromInt(1171), .properties = .{ .param_str = "V4SiV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_hadd_u_d - .{ .tag = @enumFromInt(1172), .properties = .{ .param_str = "V2ULLiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_hadd_u_h - .{ .tag = @enumFromInt(1173), .properties = .{ .param_str = "V8UsV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_hadd_u_w - .{ .tag = @enumFromInt(1174), .properties = .{ .param_str = "V4UiV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_hsub_s_d - .{ .tag = @enumFromInt(1175), .properties = .{ .param_str = "V2SLLiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_hsub_s_h - .{ .tag = @enumFromInt(1176), .properties = .{ .param_str = "V8SsV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_hsub_s_w - .{ .tag = @enumFromInt(1177), .properties = .{ .param_str = "V4SiV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_hsub_u_d - .{ .tag = @enumFromInt(1178), .properties = .{ .param_str = "V2ULLiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_hsub_u_h - .{ .tag = @enumFromInt(1179), .properties = .{ .param_str = "V8UsV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_hsub_u_w - .{ .tag = @enumFromInt(1180), .properties = .{ .param_str = "V4UiV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ilvev_b - .{ .tag = @enumFromInt(1181), .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ilvev_d - .{ .tag = @enumFromInt(1182), .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ilvev_h - .{ .tag = @enumFromInt(1183), .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ilvev_w - .{ .tag = @enumFromInt(1184), .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ilvl_b - .{ .tag = @enumFromInt(1185), .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ilvl_d - .{ .tag = @enumFromInt(1186), .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ilvl_h - .{ .tag = @enumFromInt(1187), .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ilvl_w - .{ .tag = @enumFromInt(1188), .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ilvod_b - .{ .tag = @enumFromInt(1189), .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ilvod_d - .{ .tag = @enumFromInt(1190), .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ilvod_h - .{ .tag = @enumFromInt(1191), .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ilvod_w - .{ .tag = @enumFromInt(1192), .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ilvr_b - .{ .tag = @enumFromInt(1193), .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ilvr_d - .{ .tag = @enumFromInt(1194), .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ilvr_h - .{ .tag = @enumFromInt(1195), .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ilvr_w - .{ .tag = @enumFromInt(1196), .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_insert_b - .{ .tag = @enumFromInt(1197), .properties = .{ .param_str = "V16ScV16ScIUii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_insert_d - .{ .tag = @enumFromInt(1198), .properties = .{ .param_str = "V2SLLiV2SLLiIUiLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_insert_h - .{ .tag = @enumFromInt(1199), .properties = .{ .param_str = "V8SsV8SsIUii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_insert_w - .{ .tag = @enumFromInt(1200), .properties = .{ .param_str = "V4SiV4SiIUii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_insve_b - .{ .tag = @enumFromInt(1201), .properties = .{ .param_str = "V16ScV16ScIUiV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_insve_d - .{ .tag = @enumFromInt(1202), .properties = .{ .param_str = "V2SLLiV2SLLiIUiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_insve_h - .{ .tag = @enumFromInt(1203), .properties = .{ .param_str = "V8SsV8SsIUiV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_insve_w - .{ .tag = @enumFromInt(1204), .properties = .{ .param_str = "V4SiV4SiIUiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ld_b - .{ .tag = @enumFromInt(1205), .properties = .{ .param_str = "V16Scv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ld_d - .{ .tag = @enumFromInt(1206), .properties = .{ .param_str = "V2SLLiv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ld_h - .{ .tag = @enumFromInt(1207), .properties = .{ .param_str = "V8Ssv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ld_w - .{ .tag = @enumFromInt(1208), .properties = .{ .param_str = "V4Siv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ldi_b - .{ .tag = @enumFromInt(1209), .properties = .{ .param_str = "V16cIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ldi_d - .{ .tag = @enumFromInt(1210), .properties = .{ .param_str = "V2LLiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ldi_h - .{ .tag = @enumFromInt(1211), .properties = .{ .param_str = "V8sIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ldi_w - .{ .tag = @enumFromInt(1212), .properties = .{ .param_str = "V4iIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ldr_d - .{ .tag = @enumFromInt(1213), .properties = .{ .param_str = "V2SLLiv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ldr_w - .{ .tag = @enumFromInt(1214), .properties = .{ .param_str = "V4Siv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_madd_q_h - .{ .tag = @enumFromInt(1215), .properties = .{ .param_str = "V8SsV8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_madd_q_w - .{ .tag = @enumFromInt(1216), .properties = .{ .param_str = "V4SiV4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_maddr_q_h - .{ .tag = @enumFromInt(1217), .properties = .{ .param_str = "V8SsV8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_maddr_q_w - .{ .tag = @enumFromInt(1218), .properties = .{ .param_str = "V4SiV4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_maddv_b - .{ .tag = @enumFromInt(1219), .properties = .{ .param_str = "V16ScV16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_maddv_d - .{ .tag = @enumFromInt(1220), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_maddv_h - .{ .tag = @enumFromInt(1221), .properties = .{ .param_str = "V8SsV8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_maddv_w - .{ .tag = @enumFromInt(1222), .properties = .{ .param_str = "V4SiV4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_max_a_b - .{ .tag = @enumFromInt(1223), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_max_a_d - .{ .tag = @enumFromInt(1224), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_max_a_h - .{ .tag = @enumFromInt(1225), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_max_a_w - .{ .tag = @enumFromInt(1226), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_max_s_b - .{ .tag = @enumFromInt(1227), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_max_s_d - .{ .tag = @enumFromInt(1228), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_max_s_h - .{ .tag = @enumFromInt(1229), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_max_s_w - .{ .tag = @enumFromInt(1230), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_max_u_b - .{ .tag = @enumFromInt(1231), .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_max_u_d - .{ .tag = @enumFromInt(1232), .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_max_u_h - .{ .tag = @enumFromInt(1233), .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_max_u_w - .{ .tag = @enumFromInt(1234), .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_maxi_s_b - .{ .tag = @enumFromInt(1235), .properties = .{ .param_str = "V16ScV16ScIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_maxi_s_d - .{ .tag = @enumFromInt(1236), .properties = .{ .param_str = "V2SLLiV2SLLiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_maxi_s_h - .{ .tag = @enumFromInt(1237), .properties = .{ .param_str = "V8SsV8SsIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_maxi_s_w - .{ .tag = @enumFromInt(1238), .properties = .{ .param_str = "V4SiV4SiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_maxi_u_b - .{ .tag = @enumFromInt(1239), .properties = .{ .param_str = "V16UcV16UcIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_maxi_u_d - .{ .tag = @enumFromInt(1240), .properties = .{ .param_str = "V2ULLiV2ULLiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_maxi_u_h - .{ .tag = @enumFromInt(1241), .properties = .{ .param_str = "V8UsV8UsIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_maxi_u_w - .{ .tag = @enumFromInt(1242), .properties = .{ .param_str = "V4UiV4UiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_min_a_b - .{ .tag = @enumFromInt(1243), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_min_a_d - .{ .tag = @enumFromInt(1244), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_min_a_h - .{ .tag = @enumFromInt(1245), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_min_a_w - .{ .tag = @enumFromInt(1246), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_min_s_b - .{ .tag = @enumFromInt(1247), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_min_s_d - .{ .tag = @enumFromInt(1248), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_min_s_h - .{ .tag = @enumFromInt(1249), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_min_s_w - .{ .tag = @enumFromInt(1250), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_min_u_b - .{ .tag = @enumFromInt(1251), .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_min_u_d - .{ .tag = @enumFromInt(1252), .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_min_u_h - .{ .tag = @enumFromInt(1253), .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_min_u_w - .{ .tag = @enumFromInt(1254), .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_mini_s_b - .{ .tag = @enumFromInt(1255), .properties = .{ .param_str = "V16ScV16ScIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_mini_s_d - .{ .tag = @enumFromInt(1256), .properties = .{ .param_str = "V2SLLiV2SLLiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_mini_s_h - .{ .tag = @enumFromInt(1257), .properties = .{ .param_str = "V8SsV8SsIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_mini_s_w - .{ .tag = @enumFromInt(1258), .properties = .{ .param_str = "V4SiV4SiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_mini_u_b - .{ .tag = @enumFromInt(1259), .properties = .{ .param_str = "V16UcV16UcIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_mini_u_d - .{ .tag = @enumFromInt(1260), .properties = .{ .param_str = "V2ULLiV2ULLiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_mini_u_h - .{ .tag = @enumFromInt(1261), .properties = .{ .param_str = "V8UsV8UsIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_mini_u_w - .{ .tag = @enumFromInt(1262), .properties = .{ .param_str = "V4UiV4UiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_mod_s_b - .{ .tag = @enumFromInt(1263), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_mod_s_d - .{ .tag = @enumFromInt(1264), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_mod_s_h - .{ .tag = @enumFromInt(1265), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_mod_s_w - .{ .tag = @enumFromInt(1266), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_mod_u_b - .{ .tag = @enumFromInt(1267), .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_mod_u_d - .{ .tag = @enumFromInt(1268), .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_mod_u_h - .{ .tag = @enumFromInt(1269), .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_mod_u_w - .{ .tag = @enumFromInt(1270), .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_move_v - .{ .tag = @enumFromInt(1271), .properties = .{ .param_str = "V16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_msub_q_h - .{ .tag = @enumFromInt(1272), .properties = .{ .param_str = "V8SsV8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_msub_q_w - .{ .tag = @enumFromInt(1273), .properties = .{ .param_str = "V4SiV4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_msubr_q_h - .{ .tag = @enumFromInt(1274), .properties = .{ .param_str = "V8SsV8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_msubr_q_w - .{ .tag = @enumFromInt(1275), .properties = .{ .param_str = "V4SiV4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_msubv_b - .{ .tag = @enumFromInt(1276), .properties = .{ .param_str = "V16ScV16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_msubv_d - .{ .tag = @enumFromInt(1277), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_msubv_h - .{ .tag = @enumFromInt(1278), .properties = .{ .param_str = "V8SsV8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_msubv_w - .{ .tag = @enumFromInt(1279), .properties = .{ .param_str = "V4SiV4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_mul_q_h - .{ .tag = @enumFromInt(1280), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_mul_q_w - .{ .tag = @enumFromInt(1281), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_mulr_q_h - .{ .tag = @enumFromInt(1282), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_mulr_q_w - .{ .tag = @enumFromInt(1283), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_mulv_b - .{ .tag = @enumFromInt(1284), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_mulv_d - .{ .tag = @enumFromInt(1285), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_mulv_h - .{ .tag = @enumFromInt(1286), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_mulv_w - .{ .tag = @enumFromInt(1287), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_nloc_b - .{ .tag = @enumFromInt(1288), .properties = .{ .param_str = "V16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_nloc_d - .{ .tag = @enumFromInt(1289), .properties = .{ .param_str = "V2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_nloc_h - .{ .tag = @enumFromInt(1290), .properties = .{ .param_str = "V8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_nloc_w - .{ .tag = @enumFromInt(1291), .properties = .{ .param_str = "V4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_nlzc_b - .{ .tag = @enumFromInt(1292), .properties = .{ .param_str = "V16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_nlzc_d - .{ .tag = @enumFromInt(1293), .properties = .{ .param_str = "V2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_nlzc_h - .{ .tag = @enumFromInt(1294), .properties = .{ .param_str = "V8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_nlzc_w - .{ .tag = @enumFromInt(1295), .properties = .{ .param_str = "V4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_nor_v - .{ .tag = @enumFromInt(1296), .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_nori_b - .{ .tag = @enumFromInt(1297), .properties = .{ .param_str = "V16UcV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_or_v - .{ .tag = @enumFromInt(1298), .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_ori_b - .{ .tag = @enumFromInt(1299), .properties = .{ .param_str = "V16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_pckev_b - .{ .tag = @enumFromInt(1300), .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_pckev_d - .{ .tag = @enumFromInt(1301), .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_pckev_h - .{ .tag = @enumFromInt(1302), .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_pckev_w - .{ .tag = @enumFromInt(1303), .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_pckod_b - .{ .tag = @enumFromInt(1304), .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_pckod_d - .{ .tag = @enumFromInt(1305), .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_pckod_h - .{ .tag = @enumFromInt(1306), .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_pckod_w - .{ .tag = @enumFromInt(1307), .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_pcnt_b - .{ .tag = @enumFromInt(1308), .properties = .{ .param_str = "V16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_pcnt_d - .{ .tag = @enumFromInt(1309), .properties = .{ .param_str = "V2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_pcnt_h - .{ .tag = @enumFromInt(1310), .properties = .{ .param_str = "V8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_pcnt_w - .{ .tag = @enumFromInt(1311), .properties = .{ .param_str = "V4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_sat_s_b - .{ .tag = @enumFromInt(1312), .properties = .{ .param_str = "V16ScV16ScIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_sat_s_d - .{ .tag = @enumFromInt(1313), .properties = .{ .param_str = "V2SLLiV2SLLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_sat_s_h - .{ .tag = @enumFromInt(1314), .properties = .{ .param_str = "V8SsV8SsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_sat_s_w - .{ .tag = @enumFromInt(1315), .properties = .{ .param_str = "V4SiV4SiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_sat_u_b - .{ .tag = @enumFromInt(1316), .properties = .{ .param_str = "V16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_sat_u_d - .{ .tag = @enumFromInt(1317), .properties = .{ .param_str = "V2ULLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_sat_u_h - .{ .tag = @enumFromInt(1318), .properties = .{ .param_str = "V8UsV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_sat_u_w - .{ .tag = @enumFromInt(1319), .properties = .{ .param_str = "V4UiV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_shf_b - .{ .tag = @enumFromInt(1320), .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_shf_h - .{ .tag = @enumFromInt(1321), .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_shf_w - .{ .tag = @enumFromInt(1322), .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_sld_b - .{ .tag = @enumFromInt(1323), .properties = .{ .param_str = "V16cV16cV16cUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_sld_d - .{ .tag = @enumFromInt(1324), .properties = .{ .param_str = "V2LLiV2LLiV2LLiUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_sld_h - .{ .tag = @enumFromInt(1325), .properties = .{ .param_str = "V8sV8sV8sUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_sld_w - .{ .tag = @enumFromInt(1326), .properties = .{ .param_str = "V4iV4iV4iUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_sldi_b - .{ .tag = @enumFromInt(1327), .properties = .{ .param_str = "V16cV16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_sldi_d - .{ .tag = @enumFromInt(1328), .properties = .{ .param_str = "V2LLiV2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_sldi_h - .{ .tag = @enumFromInt(1329), .properties = .{ .param_str = "V8sV8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_sldi_w - .{ .tag = @enumFromInt(1330), .properties = .{ .param_str = "V4iV4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_sll_b - .{ .tag = @enumFromInt(1331), .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_sll_d - .{ .tag = @enumFromInt(1332), .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_sll_h - .{ .tag = @enumFromInt(1333), .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_sll_w - .{ .tag = @enumFromInt(1334), .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_slli_b - .{ .tag = @enumFromInt(1335), .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_slli_d - .{ .tag = @enumFromInt(1336), .properties = .{ .param_str = "V2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_slli_h - .{ .tag = @enumFromInt(1337), .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_slli_w - .{ .tag = @enumFromInt(1338), .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_splat_b - .{ .tag = @enumFromInt(1339), .properties = .{ .param_str = "V16cV16cUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_splat_d - .{ .tag = @enumFromInt(1340), .properties = .{ .param_str = "V2LLiV2LLiUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_splat_h - .{ .tag = @enumFromInt(1341), .properties = .{ .param_str = "V8sV8sUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_splat_w - .{ .tag = @enumFromInt(1342), .properties = .{ .param_str = "V4iV4iUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_splati_b - .{ .tag = @enumFromInt(1343), .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_splati_d - .{ .tag = @enumFromInt(1344), .properties = .{ .param_str = "V2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_splati_h - .{ .tag = @enumFromInt(1345), .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_splati_w - .{ .tag = @enumFromInt(1346), .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_sra_b - .{ .tag = @enumFromInt(1347), .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_sra_d - .{ .tag = @enumFromInt(1348), .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_sra_h - .{ .tag = @enumFromInt(1349), .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_sra_w - .{ .tag = @enumFromInt(1350), .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_srai_b - .{ .tag = @enumFromInt(1351), .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_srai_d - .{ .tag = @enumFromInt(1352), .properties = .{ .param_str = "V2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_srai_h - .{ .tag = @enumFromInt(1353), .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_srai_w - .{ .tag = @enumFromInt(1354), .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_srar_b - .{ .tag = @enumFromInt(1355), .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_srar_d - .{ .tag = @enumFromInt(1356), .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_srar_h - .{ .tag = @enumFromInt(1357), .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_srar_w - .{ .tag = @enumFromInt(1358), .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_srari_b - .{ .tag = @enumFromInt(1359), .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_srari_d - .{ .tag = @enumFromInt(1360), .properties = .{ .param_str = "V2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_srari_h - .{ .tag = @enumFromInt(1361), .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_srari_w - .{ .tag = @enumFromInt(1362), .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_srl_b - .{ .tag = @enumFromInt(1363), .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_srl_d - .{ .tag = @enumFromInt(1364), .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_srl_h - .{ .tag = @enumFromInt(1365), .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_srl_w - .{ .tag = @enumFromInt(1366), .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_srli_b - .{ .tag = @enumFromInt(1367), .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_srli_d - .{ .tag = @enumFromInt(1368), .properties = .{ .param_str = "V2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_srli_h - .{ .tag = @enumFromInt(1369), .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_srli_w - .{ .tag = @enumFromInt(1370), .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_srlr_b - .{ .tag = @enumFromInt(1371), .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_srlr_d - .{ .tag = @enumFromInt(1372), .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_srlr_h - .{ .tag = @enumFromInt(1373), .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_srlr_w - .{ .tag = @enumFromInt(1374), .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_srlri_b - .{ .tag = @enumFromInt(1375), .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_srlri_d - .{ .tag = @enumFromInt(1376), .properties = .{ .param_str = "V2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_srlri_h - .{ .tag = @enumFromInt(1377), .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_srlri_w - .{ .tag = @enumFromInt(1378), .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_st_b - .{ .tag = @enumFromInt(1379), .properties = .{ .param_str = "vV16Scv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_st_d - .{ .tag = @enumFromInt(1380), .properties = .{ .param_str = "vV2SLLiv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_st_h - .{ .tag = @enumFromInt(1381), .properties = .{ .param_str = "vV8Ssv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_st_w - .{ .tag = @enumFromInt(1382), .properties = .{ .param_str = "vV4Siv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_str_d - .{ .tag = @enumFromInt(1383), .properties = .{ .param_str = "vV2SLLiv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_str_w - .{ .tag = @enumFromInt(1384), .properties = .{ .param_str = "vV4Siv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_subs_s_b - .{ .tag = @enumFromInt(1385), .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_subs_s_d - .{ .tag = @enumFromInt(1386), .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_subs_s_h - .{ .tag = @enumFromInt(1387), .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_subs_s_w - .{ .tag = @enumFromInt(1388), .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_subs_u_b - .{ .tag = @enumFromInt(1389), .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_subs_u_d - .{ .tag = @enumFromInt(1390), .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_subs_u_h - .{ .tag = @enumFromInt(1391), .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_subs_u_w - .{ .tag = @enumFromInt(1392), .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_subsus_u_b - .{ .tag = @enumFromInt(1393), .properties = .{ .param_str = "V16UcV16UcV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_subsus_u_d - .{ .tag = @enumFromInt(1394), .properties = .{ .param_str = "V2ULLiV2ULLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_subsus_u_h - .{ .tag = @enumFromInt(1395), .properties = .{ .param_str = "V8UsV8UsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_subsus_u_w - .{ .tag = @enumFromInt(1396), .properties = .{ .param_str = "V4UiV4UiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_subsuu_s_b - .{ .tag = @enumFromInt(1397), .properties = .{ .param_str = "V16ScV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_subsuu_s_d - .{ .tag = @enumFromInt(1398), .properties = .{ .param_str = "V2SLLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_subsuu_s_h - .{ .tag = @enumFromInt(1399), .properties = .{ .param_str = "V8SsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_subsuu_s_w - .{ .tag = @enumFromInt(1400), .properties = .{ .param_str = "V4SiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_subv_b - .{ .tag = @enumFromInt(1401), .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_subv_d - .{ .tag = @enumFromInt(1402), .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_subv_h - .{ .tag = @enumFromInt(1403), .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_subv_w - .{ .tag = @enumFromInt(1404), .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_subvi_b - .{ .tag = @enumFromInt(1405), .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_subvi_d - .{ .tag = @enumFromInt(1406), .properties = .{ .param_str = "V2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_subvi_h - .{ .tag = @enumFromInt(1407), .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_subvi_w - .{ .tag = @enumFromInt(1408), .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_vshf_b - .{ .tag = @enumFromInt(1409), .properties = .{ .param_str = "V16cV16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_vshf_d - .{ .tag = @enumFromInt(1410), .properties = .{ .param_str = "V2LLiV2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_vshf_h - .{ .tag = @enumFromInt(1411), .properties = .{ .param_str = "V8sV8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_vshf_w - .{ .tag = @enumFromInt(1412), .properties = .{ .param_str = "V4iV4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_xor_v - .{ .tag = @enumFromInt(1413), .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_msa_xori_b - .{ .tag = @enumFromInt(1414), .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, - // __builtin_mul_overflow - .{ .tag = @enumFromInt(1415), .properties = .{ .param_str = "b.", .attributes = .{ .custom_typecheck = true, .const_evaluable = true } } }, - // __builtin_nan - .{ .tag = @enumFromInt(1416), .properties = .{ .param_str = "dcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_nanf - .{ .tag = @enumFromInt(1417), .properties = .{ .param_str = "fcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_nanf128 - .{ .tag = @enumFromInt(1418), .properties = .{ .param_str = "LLdcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_nanf16 - .{ .tag = @enumFromInt(1419), .properties = .{ .param_str = "xcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_nanl - .{ .tag = @enumFromInt(1420), .properties = .{ .param_str = "LdcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_nans - .{ .tag = @enumFromInt(1421), .properties = .{ .param_str = "dcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_nansf - .{ .tag = @enumFromInt(1422), .properties = .{ .param_str = "fcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_nansf128 - .{ .tag = @enumFromInt(1423), .properties = .{ .param_str = "LLdcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_nansf16 - .{ .tag = @enumFromInt(1424), .properties = .{ .param_str = "xcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_nansl - .{ .tag = @enumFromInt(1425), .properties = .{ .param_str = "LdcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_nearbyint - .{ .tag = @enumFromInt(1426), .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_nearbyintf - .{ .tag = @enumFromInt(1427), .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_nearbyintf128 - .{ .tag = @enumFromInt(1428), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_nearbyintl - .{ .tag = @enumFromInt(1429), .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_nextafter - .{ .tag = @enumFromInt(1430), .properties = .{ .param_str = "ddd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_nextafterf - .{ .tag = @enumFromInt(1431), .properties = .{ .param_str = "fff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_nextafterf128 - .{ .tag = @enumFromInt(1432), .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_nextafterl - .{ .tag = @enumFromInt(1433), .properties = .{ .param_str = "LdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_nexttoward - .{ .tag = @enumFromInt(1434), .properties = .{ .param_str = "ddLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_nexttowardf - .{ .tag = @enumFromInt(1435), .properties = .{ .param_str = "ffLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_nexttowardf128 - .{ .tag = @enumFromInt(1436), .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_nexttowardl - .{ .tag = @enumFromInt(1437), .properties = .{ .param_str = "LdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_nondeterministic_value - .{ .tag = @enumFromInt(1438), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __builtin_nontemporal_load - .{ .tag = @enumFromInt(1439), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __builtin_nontemporal_store - .{ .tag = @enumFromInt(1440), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __builtin_objc_memmove_collectable - .{ .tag = @enumFromInt(1441), .properties = .{ .param_str = "v*v*vC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_object_size - .{ .tag = @enumFromInt(1442), .properties = .{ .param_str = "zvC*i", .attributes = .{ .eval_args = false, .const_evaluable = true } } }, - // __builtin_operator_delete - .{ .tag = @enumFromInt(1443), .properties = .{ .param_str = "vv*", .attributes = .{ .custom_typecheck = true, .const_evaluable = true } } }, - // __builtin_operator_new - .{ .tag = @enumFromInt(1444), .properties = .{ .param_str = "v*z", .attributes = .{ .@"const" = true, .custom_typecheck = true, .const_evaluable = true } } }, - // __builtin_os_log_format - .{ .tag = @enumFromInt(1445), .properties = .{ .param_str = "v*v*cC*.", .attributes = .{ .custom_typecheck = true, .format_kind = .printf } } }, - // __builtin_os_log_format_buffer_size - .{ .tag = @enumFromInt(1446), .properties = .{ .param_str = "zcC*.", .attributes = .{ .custom_typecheck = true, .format_kind = .printf, .eval_args = false, .const_evaluable = true } } }, - // __builtin_pack_longdouble - .{ .tag = @enumFromInt(1447), .properties = .{ .param_str = "Lddd", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_parity - .{ .tag = @enumFromInt(1448), .properties = .{ .param_str = "iUi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_parityl - .{ .tag = @enumFromInt(1449), .properties = .{ .param_str = "iULi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_parityll - .{ .tag = @enumFromInt(1450), .properties = .{ .param_str = "iULLi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_popcount - .{ .tag = @enumFromInt(1451), .properties = .{ .param_str = "iUi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_popcountl - .{ .tag = @enumFromInt(1452), .properties = .{ .param_str = "iULi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_popcountll - .{ .tag = @enumFromInt(1453), .properties = .{ .param_str = "iULLi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_pow - .{ .tag = @enumFromInt(1454), .properties = .{ .param_str = "ddd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_powf - .{ .tag = @enumFromInt(1455), .properties = .{ .param_str = "fff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_powf128 - .{ .tag = @enumFromInt(1456), .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_powf16 - .{ .tag = @enumFromInt(1457), .properties = .{ .param_str = "hhh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_powi - .{ .tag = @enumFromInt(1458), .properties = .{ .param_str = "ddi", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_powif - .{ .tag = @enumFromInt(1459), .properties = .{ .param_str = "ffi", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_powil - .{ .tag = @enumFromInt(1460), .properties = .{ .param_str = "LdLdi", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_powl - .{ .tag = @enumFromInt(1461), .properties = .{ .param_str = "LdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_ppc_alignx - .{ .tag = @enumFromInt(1462), .properties = .{ .param_str = "vIivC*", .target_set = TargetSet.initOne(.ppc), .attributes = .{ .@"const" = true } } }, - // __builtin_ppc_cmpb - .{ .tag = @enumFromInt(1463), .properties = .{ .param_str = "LLiLLiLLi", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_compare_and_swap - .{ .tag = @enumFromInt(1464), .properties = .{ .param_str = "iiD*i*i", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_compare_and_swaplp - .{ .tag = @enumFromInt(1465), .properties = .{ .param_str = "iLiD*Li*Li", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_dcbfl - .{ .tag = @enumFromInt(1466), .properties = .{ .param_str = "vvC*", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_dcbflp - .{ .tag = @enumFromInt(1467), .properties = .{ .param_str = "vvC*", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_dcbst - .{ .tag = @enumFromInt(1468), .properties = .{ .param_str = "vvC*", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_dcbt - .{ .tag = @enumFromInt(1469), .properties = .{ .param_str = "vv*", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_dcbtst - .{ .tag = @enumFromInt(1470), .properties = .{ .param_str = "vv*", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_dcbtstt - .{ .tag = @enumFromInt(1471), .properties = .{ .param_str = "vv*", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_dcbtt - .{ .tag = @enumFromInt(1472), .properties = .{ .param_str = "vv*", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_dcbz - .{ .tag = @enumFromInt(1473), .properties = .{ .param_str = "vv*", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_eieio - .{ .tag = @enumFromInt(1474), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_fcfid - .{ .tag = @enumFromInt(1475), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_fcfud - .{ .tag = @enumFromInt(1476), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_fctid - .{ .tag = @enumFromInt(1477), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_fctidz - .{ .tag = @enumFromInt(1478), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_fctiw - .{ .tag = @enumFromInt(1479), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_fctiwz - .{ .tag = @enumFromInt(1480), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_fctudz - .{ .tag = @enumFromInt(1481), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_fctuwz - .{ .tag = @enumFromInt(1482), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_fetch_and_add - .{ .tag = @enumFromInt(1483), .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_fetch_and_addlp - .{ .tag = @enumFromInt(1484), .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_fetch_and_and - .{ .tag = @enumFromInt(1485), .properties = .{ .param_str = "UiUiD*Ui", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_fetch_and_andlp - .{ .tag = @enumFromInt(1486), .properties = .{ .param_str = "ULiULiD*ULi", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_fetch_and_or - .{ .tag = @enumFromInt(1487), .properties = .{ .param_str = "UiUiD*Ui", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_fetch_and_orlp - .{ .tag = @enumFromInt(1488), .properties = .{ .param_str = "ULiULiD*ULi", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_fetch_and_swap - .{ .tag = @enumFromInt(1489), .properties = .{ .param_str = "UiUiD*Ui", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_fetch_and_swaplp - .{ .tag = @enumFromInt(1490), .properties = .{ .param_str = "ULiULiD*ULi", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_fmsub - .{ .tag = @enumFromInt(1491), .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_fmsubs - .{ .tag = @enumFromInt(1492), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_fnabs - .{ .tag = @enumFromInt(1493), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_fnabss - .{ .tag = @enumFromInt(1494), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_fnmadd - .{ .tag = @enumFromInt(1495), .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_fnmadds - .{ .tag = @enumFromInt(1496), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_fnmsub - .{ .tag = @enumFromInt(1497), .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_fnmsubs - .{ .tag = @enumFromInt(1498), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_fre - .{ .tag = @enumFromInt(1499), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_fres - .{ .tag = @enumFromInt(1500), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_fric - .{ .tag = @enumFromInt(1501), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_frim - .{ .tag = @enumFromInt(1502), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_frims - .{ .tag = @enumFromInt(1503), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_frin - .{ .tag = @enumFromInt(1504), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_frins - .{ .tag = @enumFromInt(1505), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_frip - .{ .tag = @enumFromInt(1506), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_frips - .{ .tag = @enumFromInt(1507), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_friz - .{ .tag = @enumFromInt(1508), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_frizs - .{ .tag = @enumFromInt(1509), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_frsqrte - .{ .tag = @enumFromInt(1510), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_frsqrtes - .{ .tag = @enumFromInt(1511), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_fsel - .{ .tag = @enumFromInt(1512), .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_fsels - .{ .tag = @enumFromInt(1513), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_fsqrt - .{ .tag = @enumFromInt(1514), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_fsqrts - .{ .tag = @enumFromInt(1515), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_get_timebase - .{ .tag = @enumFromInt(1516), .properties = .{ .param_str = "ULLi", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_iospace_eieio - .{ .tag = @enumFromInt(1517), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_iospace_lwsync - .{ .tag = @enumFromInt(1518), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_iospace_sync - .{ .tag = @enumFromInt(1519), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_isync - .{ .tag = @enumFromInt(1520), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_ldarx - .{ .tag = @enumFromInt(1521), .properties = .{ .param_str = "LiLiD*", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_load2r - .{ .tag = @enumFromInt(1522), .properties = .{ .param_str = "UsUs*", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_load4r - .{ .tag = @enumFromInt(1523), .properties = .{ .param_str = "UiUi*", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_lwarx - .{ .tag = @enumFromInt(1524), .properties = .{ .param_str = "iiD*", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_lwsync - .{ .tag = @enumFromInt(1525), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_maxfe - .{ .tag = @enumFromInt(1526), .properties = .{ .param_str = "LdLdLdLd.", .target_set = TargetSet.initOne(.ppc), .attributes = .{ .custom_typecheck = true } } }, - // __builtin_ppc_maxfl - .{ .tag = @enumFromInt(1527), .properties = .{ .param_str = "dddd.", .target_set = TargetSet.initOne(.ppc), .attributes = .{ .custom_typecheck = true } } }, - // __builtin_ppc_maxfs - .{ .tag = @enumFromInt(1528), .properties = .{ .param_str = "ffff.", .target_set = TargetSet.initOne(.ppc), .attributes = .{ .custom_typecheck = true } } }, - // __builtin_ppc_mfmsr - .{ .tag = @enumFromInt(1529), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_mfspr - .{ .tag = @enumFromInt(1530), .properties = .{ .param_str = "ULiIi", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_mftbu - .{ .tag = @enumFromInt(1531), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_minfe - .{ .tag = @enumFromInt(1532), .properties = .{ .param_str = "LdLdLdLd.", .target_set = TargetSet.initOne(.ppc), .attributes = .{ .custom_typecheck = true } } }, - // __builtin_ppc_minfl - .{ .tag = @enumFromInt(1533), .properties = .{ .param_str = "dddd.", .target_set = TargetSet.initOne(.ppc), .attributes = .{ .custom_typecheck = true } } }, - // __builtin_ppc_minfs - .{ .tag = @enumFromInt(1534), .properties = .{ .param_str = "ffff.", .target_set = TargetSet.initOne(.ppc), .attributes = .{ .custom_typecheck = true } } }, - // __builtin_ppc_mtfsb0 - .{ .tag = @enumFromInt(1535), .properties = .{ .param_str = "vUIi", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_mtfsb1 - .{ .tag = @enumFromInt(1536), .properties = .{ .param_str = "vUIi", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_mtfsf - .{ .tag = @enumFromInt(1537), .properties = .{ .param_str = "vUIiUi", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_mtfsfi - .{ .tag = @enumFromInt(1538), .properties = .{ .param_str = "vUIiUIi", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_mtmsr - .{ .tag = @enumFromInt(1539), .properties = .{ .param_str = "vUi", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_mtspr - .{ .tag = @enumFromInt(1540), .properties = .{ .param_str = "vIiULi", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_mulhd - .{ .tag = @enumFromInt(1541), .properties = .{ .param_str = "LLiLiLi", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_mulhdu - .{ .tag = @enumFromInt(1542), .properties = .{ .param_str = "ULLiULiULi", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_mulhw - .{ .tag = @enumFromInt(1543), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_mulhwu - .{ .tag = @enumFromInt(1544), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_popcntb - .{ .tag = @enumFromInt(1545), .properties = .{ .param_str = "ULiULi", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_poppar4 - .{ .tag = @enumFromInt(1546), .properties = .{ .param_str = "iUi", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_poppar8 - .{ .tag = @enumFromInt(1547), .properties = .{ .param_str = "iULLi", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_rdlam - .{ .tag = @enumFromInt(1548), .properties = .{ .param_str = "UWiUWiUWiUWIi", .target_set = TargetSet.initOne(.ppc), .attributes = .{ .@"const" = true } } }, - // __builtin_ppc_recipdivd - .{ .tag = @enumFromInt(1549), .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_recipdivf - .{ .tag = @enumFromInt(1550), .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_rldimi - .{ .tag = @enumFromInt(1551), .properties = .{ .param_str = "ULLiULLiULLiIUiIULLi", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_rlwimi - .{ .tag = @enumFromInt(1552), .properties = .{ .param_str = "UiUiUiIUiIUi", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_rlwnm - .{ .tag = @enumFromInt(1553), .properties = .{ .param_str = "UiUiUiIUi", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_rsqrtd - .{ .tag = @enumFromInt(1554), .properties = .{ .param_str = "V2dV2d", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_rsqrtf - .{ .tag = @enumFromInt(1555), .properties = .{ .param_str = "V4fV4f", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_stdcx - .{ .tag = @enumFromInt(1556), .properties = .{ .param_str = "iLiD*Li", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_stfiw - .{ .tag = @enumFromInt(1557), .properties = .{ .param_str = "viC*d", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_store2r - .{ .tag = @enumFromInt(1558), .properties = .{ .param_str = "vUiUs*", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_store4r - .{ .tag = @enumFromInt(1559), .properties = .{ .param_str = "vUiUi*", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_stwcx - .{ .tag = @enumFromInt(1560), .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_swdiv - .{ .tag = @enumFromInt(1561), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_swdiv_nochk - .{ .tag = @enumFromInt(1562), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_swdivs - .{ .tag = @enumFromInt(1563), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_swdivs_nochk - .{ .tag = @enumFromInt(1564), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_sync - .{ .tag = @enumFromInt(1565), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_tdw - .{ .tag = @enumFromInt(1566), .properties = .{ .param_str = "vLLiLLiIUi", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_trap - .{ .tag = @enumFromInt(1567), .properties = .{ .param_str = "vi", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_trapd - .{ .tag = @enumFromInt(1568), .properties = .{ .param_str = "vLi", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_ppc_tw - .{ .tag = @enumFromInt(1569), .properties = .{ .param_str = "viiIUi", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_prefetch - .{ .tag = @enumFromInt(1570), .properties = .{ .param_str = "vvC*.", .attributes = .{ .@"const" = true } } }, - // __builtin_preserve_access_index - .{ .tag = @enumFromInt(1571), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __builtin_printf - .{ .tag = @enumFromInt(1572), .properties = .{ .param_str = "icC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .printf } } }, - // __builtin_ptx_get_image_channel_data_typei_ - .{ .tag = @enumFromInt(1573), .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.nvptx) } }, - // __builtin_ptx_get_image_channel_orderi_ - .{ .tag = @enumFromInt(1574), .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.nvptx) } }, - // __builtin_ptx_get_image_depthi_ - .{ .tag = @enumFromInt(1575), .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.nvptx) } }, - // __builtin_ptx_get_image_heighti_ - .{ .tag = @enumFromInt(1576), .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.nvptx) } }, - // __builtin_ptx_get_image_widthi_ - .{ .tag = @enumFromInt(1577), .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.nvptx) } }, - // __builtin_ptx_read_image2Dff_ - .{ .tag = @enumFromInt(1578), .properties = .{ .param_str = "V4fiiff", .target_set = TargetSet.initOne(.nvptx) } }, - // __builtin_ptx_read_image2Dfi_ - .{ .tag = @enumFromInt(1579), .properties = .{ .param_str = "V4fiiii", .target_set = TargetSet.initOne(.nvptx) } }, - // __builtin_ptx_read_image2Dif_ - .{ .tag = @enumFromInt(1580), .properties = .{ .param_str = "V4iiiff", .target_set = TargetSet.initOne(.nvptx) } }, - // __builtin_ptx_read_image2Dii_ - .{ .tag = @enumFromInt(1581), .properties = .{ .param_str = "V4iiiii", .target_set = TargetSet.initOne(.nvptx) } }, - // __builtin_ptx_read_image3Dff_ - .{ .tag = @enumFromInt(1582), .properties = .{ .param_str = "V4fiiffff", .target_set = TargetSet.initOne(.nvptx) } }, - // __builtin_ptx_read_image3Dfi_ - .{ .tag = @enumFromInt(1583), .properties = .{ .param_str = "V4fiiiiii", .target_set = TargetSet.initOne(.nvptx) } }, - // __builtin_ptx_read_image3Dif_ - .{ .tag = @enumFromInt(1584), .properties = .{ .param_str = "V4iiiffff", .target_set = TargetSet.initOne(.nvptx) } }, - // __builtin_ptx_read_image3Dii_ - .{ .tag = @enumFromInt(1585), .properties = .{ .param_str = "V4iiiiiii", .target_set = TargetSet.initOne(.nvptx) } }, - // __builtin_ptx_write_image2Df_ - .{ .tag = @enumFromInt(1586), .properties = .{ .param_str = "viiiffff", .target_set = TargetSet.initOne(.nvptx) } }, - // __builtin_ptx_write_image2Di_ - .{ .tag = @enumFromInt(1587), .properties = .{ .param_str = "viiiiiii", .target_set = TargetSet.initOne(.nvptx) } }, - // __builtin_ptx_write_image2Dui_ - .{ .tag = @enumFromInt(1588), .properties = .{ .param_str = "viiiUiUiUiUi", .target_set = TargetSet.initOne(.nvptx) } }, - // __builtin_r600_implicitarg_ptr - .{ .tag = @enumFromInt(1589), .properties = .{ .param_str = "Uc*7", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_r600_read_tgid_x - .{ .tag = @enumFromInt(1590), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_r600_read_tgid_y - .{ .tag = @enumFromInt(1591), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_r600_read_tgid_z - .{ .tag = @enumFromInt(1592), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_r600_read_tidig_x - .{ .tag = @enumFromInt(1593), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_r600_read_tidig_y - .{ .tag = @enumFromInt(1594), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_r600_read_tidig_z - .{ .tag = @enumFromInt(1595), .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_r600_recipsqrt_ieee - .{ .tag = @enumFromInt(1596), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_r600_recipsqrt_ieeef - .{ .tag = @enumFromInt(1597), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, - // __builtin_readcyclecounter - .{ .tag = @enumFromInt(1598), .properties = .{ .param_str = "ULLi" } }, - // __builtin_readflm - .{ .tag = @enumFromInt(1599), .properties = .{ .param_str = "d", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_realloc - .{ .tag = @enumFromInt(1600), .properties = .{ .param_str = "v*v*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_reduce_add - .{ .tag = @enumFromInt(1601), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_reduce_and - .{ .tag = @enumFromInt(1602), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_reduce_max - .{ .tag = @enumFromInt(1603), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_reduce_min - .{ .tag = @enumFromInt(1604), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_reduce_mul - .{ .tag = @enumFromInt(1605), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_reduce_or - .{ .tag = @enumFromInt(1606), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_reduce_xor - .{ .tag = @enumFromInt(1607), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_remainder - .{ .tag = @enumFromInt(1608), .properties = .{ .param_str = "ddd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_remainderf - .{ .tag = @enumFromInt(1609), .properties = .{ .param_str = "fff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_remainderf128 - .{ .tag = @enumFromInt(1610), .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_remainderl - .{ .tag = @enumFromInt(1611), .properties = .{ .param_str = "LdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_remquo - .{ .tag = @enumFromInt(1612), .properties = .{ .param_str = "dddi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_remquof - .{ .tag = @enumFromInt(1613), .properties = .{ .param_str = "fffi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_remquof128 - .{ .tag = @enumFromInt(1614), .properties = .{ .param_str = "LLdLLdLLdi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_remquol - .{ .tag = @enumFromInt(1615), .properties = .{ .param_str = "LdLdLdi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_return_address - .{ .tag = @enumFromInt(1616), .properties = .{ .param_str = "v*IUi" } }, - // __builtin_rindex - .{ .tag = @enumFromInt(1617), .properties = .{ .param_str = "c*cC*i", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_rint - .{ .tag = @enumFromInt(1618), .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_rintf - .{ .tag = @enumFromInt(1619), .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_rintf128 - .{ .tag = @enumFromInt(1620), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_rintf16 - .{ .tag = @enumFromInt(1621), .properties = .{ .param_str = "hh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_rintl - .{ .tag = @enumFromInt(1622), .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_rotateleft16 - .{ .tag = @enumFromInt(1623), .properties = .{ .param_str = "UsUsUs", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_rotateleft32 - .{ .tag = @enumFromInt(1624), .properties = .{ .param_str = "UZiUZiUZi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_rotateleft64 - .{ .tag = @enumFromInt(1625), .properties = .{ .param_str = "UWiUWiUWi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_rotateleft8 - .{ .tag = @enumFromInt(1626), .properties = .{ .param_str = "UcUcUc", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_rotateright16 - .{ .tag = @enumFromInt(1627), .properties = .{ .param_str = "UsUsUs", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_rotateright32 - .{ .tag = @enumFromInt(1628), .properties = .{ .param_str = "UZiUZiUZi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_rotateright64 - .{ .tag = @enumFromInt(1629), .properties = .{ .param_str = "UWiUWiUWi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_rotateright8 - .{ .tag = @enumFromInt(1630), .properties = .{ .param_str = "UcUcUc", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __builtin_round - .{ .tag = @enumFromInt(1631), .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_roundeven - .{ .tag = @enumFromInt(1632), .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_roundevenf - .{ .tag = @enumFromInt(1633), .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_roundevenf128 - .{ .tag = @enumFromInt(1634), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_roundevenf16 - .{ .tag = @enumFromInt(1635), .properties = .{ .param_str = "hh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_roundevenl - .{ .tag = @enumFromInt(1636), .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_roundf - .{ .tag = @enumFromInt(1637), .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_roundf128 - .{ .tag = @enumFromInt(1638), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_roundf16 - .{ .tag = @enumFromInt(1639), .properties = .{ .param_str = "hh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_roundl - .{ .tag = @enumFromInt(1640), .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_sadd_overflow - .{ .tag = @enumFromInt(1641), .properties = .{ .param_str = "bSiCSiCSi*", .attributes = .{ .const_evaluable = true } } }, - // __builtin_saddl_overflow - .{ .tag = @enumFromInt(1642), .properties = .{ .param_str = "bSLiCSLiCSLi*", .attributes = .{ .const_evaluable = true } } }, - // __builtin_saddll_overflow - .{ .tag = @enumFromInt(1643), .properties = .{ .param_str = "bSLLiCSLLiCSLLi*", .attributes = .{ .const_evaluable = true } } }, - // __builtin_scalbln - .{ .tag = @enumFromInt(1644), .properties = .{ .param_str = "ddLi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_scalblnf - .{ .tag = @enumFromInt(1645), .properties = .{ .param_str = "ffLi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_scalblnf128 - .{ .tag = @enumFromInt(1646), .properties = .{ .param_str = "LLdLLdLi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_scalblnl - .{ .tag = @enumFromInt(1647), .properties = .{ .param_str = "LdLdLi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_scalbn - .{ .tag = @enumFromInt(1648), .properties = .{ .param_str = "ddi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_scalbnf - .{ .tag = @enumFromInt(1649), .properties = .{ .param_str = "ffi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_scalbnf128 - .{ .tag = @enumFromInt(1650), .properties = .{ .param_str = "LLdLLdi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_scalbnl - .{ .tag = @enumFromInt(1651), .properties = .{ .param_str = "LdLdi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_scanf - .{ .tag = @enumFromInt(1652), .properties = .{ .param_str = "icC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .scanf } } }, - // __builtin_set_flt_rounds - .{ .tag = @enumFromInt(1653), .properties = .{ .param_str = "vi" } }, - // __builtin_setflm - .{ .tag = @enumFromInt(1654), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_setjmp - .{ .tag = @enumFromInt(1655), .properties = .{ .param_str = "iv**", .attributes = .{ .returns_twice = true } } }, - // __builtin_setps - .{ .tag = @enumFromInt(1656), .properties = .{ .param_str = "vUiUi", .target_set = TargetSet.initOne(.xcore) } }, - // __builtin_setrnd - .{ .tag = @enumFromInt(1657), .properties = .{ .param_str = "di", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_shufflevector - .{ .tag = @enumFromInt(1658), .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, - // __builtin_signbit - .{ .tag = @enumFromInt(1659), .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_signbitf - .{ .tag = @enumFromInt(1660), .properties = .{ .param_str = "if", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_signbitl - .{ .tag = @enumFromInt(1661), .properties = .{ .param_str = "iLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_sin - .{ .tag = @enumFromInt(1662), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_sinf - .{ .tag = @enumFromInt(1663), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_sinf128 - .{ .tag = @enumFromInt(1664), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_sinf16 - .{ .tag = @enumFromInt(1665), .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_sinh - .{ .tag = @enumFromInt(1666), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_sinhf - .{ .tag = @enumFromInt(1667), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_sinhf128 - .{ .tag = @enumFromInt(1668), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_sinhl - .{ .tag = @enumFromInt(1669), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_sinl - .{ .tag = @enumFromInt(1670), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_smul_overflow - .{ .tag = @enumFromInt(1671), .properties = .{ .param_str = "bSiCSiCSi*", .attributes = .{ .const_evaluable = true } } }, - // __builtin_smull_overflow - .{ .tag = @enumFromInt(1672), .properties = .{ .param_str = "bSLiCSLiCSLi*", .attributes = .{ .const_evaluable = true } } }, - // __builtin_smulll_overflow - .{ .tag = @enumFromInt(1673), .properties = .{ .param_str = "bSLLiCSLLiCSLLi*", .attributes = .{ .const_evaluable = true } } }, - // __builtin_snprintf - .{ .tag = @enumFromInt(1674), .properties = .{ .param_str = "ic*RzcC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .printf, .format_string_position = 2 } } }, - // __builtin_sponentry - .{ .tag = @enumFromInt(1675), .properties = .{ .param_str = "v*", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, - // __builtin_sprintf - .{ .tag = @enumFromInt(1676), .properties = .{ .param_str = "ic*RcC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .printf, .format_string_position = 1 } } }, - // __builtin_sqrt - .{ .tag = @enumFromInt(1677), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_sqrtf - .{ .tag = @enumFromInt(1678), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_sqrtf128 - .{ .tag = @enumFromInt(1679), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_sqrtf16 - .{ .tag = @enumFromInt(1680), .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_sqrtl - .{ .tag = @enumFromInt(1681), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_sscanf - .{ .tag = @enumFromInt(1682), .properties = .{ .param_str = "icC*RcC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .scanf, .format_string_position = 1 } } }, - // __builtin_ssub_overflow - .{ .tag = @enumFromInt(1683), .properties = .{ .param_str = "bSiCSiCSi*", .attributes = .{ .const_evaluable = true } } }, - // __builtin_ssubl_overflow - .{ .tag = @enumFromInt(1684), .properties = .{ .param_str = "bSLiCSLiCSLi*", .attributes = .{ .const_evaluable = true } } }, - // __builtin_ssubll_overflow - .{ .tag = @enumFromInt(1685), .properties = .{ .param_str = "bSLLiCSLLiCSLLi*", .attributes = .{ .const_evaluable = true } } }, - // __builtin_stdarg_start - .{ .tag = @enumFromInt(1686), .properties = .{ .param_str = "vA.", .attributes = .{ .custom_typecheck = true } } }, - // __builtin_stpcpy - .{ .tag = @enumFromInt(1687), .properties = .{ .param_str = "c*c*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_stpncpy - .{ .tag = @enumFromInt(1688), .properties = .{ .param_str = "c*c*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_strcasecmp - .{ .tag = @enumFromInt(1689), .properties = .{ .param_str = "icC*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_strcat - .{ .tag = @enumFromInt(1690), .properties = .{ .param_str = "c*c*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_strchr - .{ .tag = @enumFromInt(1691), .properties = .{ .param_str = "c*cC*i", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_strcmp - .{ .tag = @enumFromInt(1692), .properties = .{ .param_str = "icC*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_strcpy - .{ .tag = @enumFromInt(1693), .properties = .{ .param_str = "c*c*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_strcspn - .{ .tag = @enumFromInt(1694), .properties = .{ .param_str = "zcC*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_strdup - .{ .tag = @enumFromInt(1695), .properties = .{ .param_str = "c*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_strlen - .{ .tag = @enumFromInt(1696), .properties = .{ .param_str = "zcC*", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_strncasecmp - .{ .tag = @enumFromInt(1697), .properties = .{ .param_str = "icC*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_strncat - .{ .tag = @enumFromInt(1698), .properties = .{ .param_str = "c*c*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_strncmp - .{ .tag = @enumFromInt(1699), .properties = .{ .param_str = "icC*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_strncpy - .{ .tag = @enumFromInt(1700), .properties = .{ .param_str = "c*c*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_strndup - .{ .tag = @enumFromInt(1701), .properties = .{ .param_str = "c*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_strpbrk - .{ .tag = @enumFromInt(1702), .properties = .{ .param_str = "c*cC*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_strrchr - .{ .tag = @enumFromInt(1703), .properties = .{ .param_str = "c*cC*i", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_strspn - .{ .tag = @enumFromInt(1704), .properties = .{ .param_str = "zcC*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_strstr - .{ .tag = @enumFromInt(1705), .properties = .{ .param_str = "c*cC*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, - // __builtin_sub_overflow - .{ .tag = @enumFromInt(1706), .properties = .{ .param_str = "b.", .attributes = .{ .custom_typecheck = true, .const_evaluable = true } } }, - // __builtin_subc - .{ .tag = @enumFromInt(1707), .properties = .{ .param_str = "UiUiCUiCUiCUi*" } }, - // __builtin_subcb - .{ .tag = @enumFromInt(1708), .properties = .{ .param_str = "UcUcCUcCUcCUc*" } }, - // __builtin_subcl - .{ .tag = @enumFromInt(1709), .properties = .{ .param_str = "ULiULiCULiCULiCULi*" } }, - // __builtin_subcll - .{ .tag = @enumFromInt(1710), .properties = .{ .param_str = "ULLiULLiCULLiCULLiCULLi*" } }, - // __builtin_subcs - .{ .tag = @enumFromInt(1711), .properties = .{ .param_str = "UsUsCUsCUsCUs*" } }, - // __builtin_tan - .{ .tag = @enumFromInt(1712), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_tanf - .{ .tag = @enumFromInt(1713), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_tanf128 - .{ .tag = @enumFromInt(1714), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_tanh - .{ .tag = @enumFromInt(1715), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_tanhf - .{ .tag = @enumFromInt(1716), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_tanhf128 - .{ .tag = @enumFromInt(1717), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_tanhl - .{ .tag = @enumFromInt(1718), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_tanl - .{ .tag = @enumFromInt(1719), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_tgamma - .{ .tag = @enumFromInt(1720), .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_tgammaf - .{ .tag = @enumFromInt(1721), .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_tgammaf128 - .{ .tag = @enumFromInt(1722), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_tgammal - .{ .tag = @enumFromInt(1723), .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __builtin_thread_pointer - .{ .tag = @enumFromInt(1724), .properties = .{ .param_str = "v*", .attributes = .{ .@"const" = true } } }, - // __builtin_trap - .{ .tag = @enumFromInt(1725), .properties = .{ .param_str = "v", .attributes = .{ .noreturn = true } } }, - // __builtin_trunc - .{ .tag = @enumFromInt(1726), .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_truncf - .{ .tag = @enumFromInt(1727), .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_truncf128 - .{ .tag = @enumFromInt(1728), .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_truncf16 - .{ .tag = @enumFromInt(1729), .properties = .{ .param_str = "hh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_truncl - .{ .tag = @enumFromInt(1730), .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, - // __builtin_uadd_overflow - .{ .tag = @enumFromInt(1731), .properties = .{ .param_str = "bUiCUiCUi*", .attributes = .{ .const_evaluable = true } } }, - // __builtin_uaddl_overflow - .{ .tag = @enumFromInt(1732), .properties = .{ .param_str = "bULiCULiCULi*", .attributes = .{ .const_evaluable = true } } }, - // __builtin_uaddll_overflow - .{ .tag = @enumFromInt(1733), .properties = .{ .param_str = "bULLiCULLiCULLi*", .attributes = .{ .const_evaluable = true } } }, - // __builtin_umul_overflow - .{ .tag = @enumFromInt(1734), .properties = .{ .param_str = "bUiCUiCUi*", .attributes = .{ .const_evaluable = true } } }, - // __builtin_umull_overflow - .{ .tag = @enumFromInt(1735), .properties = .{ .param_str = "bULiCULiCULi*", .attributes = .{ .const_evaluable = true } } }, - // __builtin_umulll_overflow - .{ .tag = @enumFromInt(1736), .properties = .{ .param_str = "bULLiCULLiCULLi*", .attributes = .{ .const_evaluable = true } } }, - // __builtin_unpack_longdouble - .{ .tag = @enumFromInt(1737), .properties = .{ .param_str = "dLdIi", .target_set = TargetSet.initOne(.ppc) } }, - // __builtin_unpredictable - .{ .tag = @enumFromInt(1738), .properties = .{ .param_str = "LiLi", .attributes = .{ .@"const" = true } } }, - // __builtin_unreachable - .{ .tag = @enumFromInt(1739), .properties = .{ .param_str = "v", .attributes = .{ .noreturn = true } } }, - // __builtin_unwind_init - .{ .tag = @enumFromInt(1740), .properties = .{ .param_str = "v" } }, - // __builtin_usub_overflow - .{ .tag = @enumFromInt(1741), .properties = .{ .param_str = "bUiCUiCUi*", .attributes = .{ .const_evaluable = true } } }, - // __builtin_usubl_overflow - .{ .tag = @enumFromInt(1742), .properties = .{ .param_str = "bULiCULiCULi*", .attributes = .{ .const_evaluable = true } } }, - // __builtin_usubll_overflow - .{ .tag = @enumFromInt(1743), .properties = .{ .param_str = "bULLiCULLiCULLi*", .attributes = .{ .const_evaluable = true } } }, - // __builtin_va_copy - .{ .tag = @enumFromInt(1744), .properties = .{ .param_str = "vAA" } }, - // __builtin_va_end - .{ .tag = @enumFromInt(1745), .properties = .{ .param_str = "vA" } }, - // __builtin_va_start - .{ .tag = @enumFromInt(1746), .properties = .{ .param_str = "vA.", .attributes = .{ .custom_typecheck = true } } }, - // __builtin_ve_vl_andm_MMM - .{ .tag = @enumFromInt(1747), .properties = .{ .param_str = "V512bV512bV512b", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_andm_mmm - .{ .tag = @enumFromInt(1748), .properties = .{ .param_str = "V256bV256bV256b", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_eqvm_MMM - .{ .tag = @enumFromInt(1749), .properties = .{ .param_str = "V512bV512bV512b", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_eqvm_mmm - .{ .tag = @enumFromInt(1750), .properties = .{ .param_str = "V256bV256bV256b", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_extract_vm512l - .{ .tag = @enumFromInt(1751), .properties = .{ .param_str = "V256bV512b", .target_set = TargetSet.initOne(.ve) } }, - // __builtin_ve_vl_extract_vm512u - .{ .tag = @enumFromInt(1752), .properties = .{ .param_str = "V256bV512b", .target_set = TargetSet.initOne(.ve) } }, - // __builtin_ve_vl_fencec_s - .{ .tag = @enumFromInt(1753), .properties = .{ .param_str = "vUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_fencei - .{ .tag = @enumFromInt(1754), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_fencem_s - .{ .tag = @enumFromInt(1755), .properties = .{ .param_str = "vUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_fidcr_sss - .{ .tag = @enumFromInt(1756), .properties = .{ .param_str = "LUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_insert_vm512l - .{ .tag = @enumFromInt(1757), .properties = .{ .param_str = "V512bV512bV256b", .target_set = TargetSet.initOne(.ve) } }, - // __builtin_ve_vl_insert_vm512u - .{ .tag = @enumFromInt(1758), .properties = .{ .param_str = "V512bV512bV256b", .target_set = TargetSet.initOne(.ve) } }, - // __builtin_ve_vl_lcr_sss - .{ .tag = @enumFromInt(1759), .properties = .{ .param_str = "LUiLUiLUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_lsv_vvss - .{ .tag = @enumFromInt(1760), .properties = .{ .param_str = "V256dV256dUiLUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_lvm_MMss - .{ .tag = @enumFromInt(1761), .properties = .{ .param_str = "V512bV512bLUiLUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_lvm_mmss - .{ .tag = @enumFromInt(1762), .properties = .{ .param_str = "V256bV256bLUiLUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_lvsd_svs - .{ .tag = @enumFromInt(1763), .properties = .{ .param_str = "dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_lvsl_svs - .{ .tag = @enumFromInt(1764), .properties = .{ .param_str = "LUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_lvss_svs - .{ .tag = @enumFromInt(1765), .properties = .{ .param_str = "fV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_lzvm_sml - .{ .tag = @enumFromInt(1766), .properties = .{ .param_str = "LUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_negm_MM - .{ .tag = @enumFromInt(1767), .properties = .{ .param_str = "V512bV512b", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_negm_mm - .{ .tag = @enumFromInt(1768), .properties = .{ .param_str = "V256bV256b", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_nndm_MMM - .{ .tag = @enumFromInt(1769), .properties = .{ .param_str = "V512bV512bV512b", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_nndm_mmm - .{ .tag = @enumFromInt(1770), .properties = .{ .param_str = "V256bV256bV256b", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_orm_MMM - .{ .tag = @enumFromInt(1771), .properties = .{ .param_str = "V512bV512bV512b", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_orm_mmm - .{ .tag = @enumFromInt(1772), .properties = .{ .param_str = "V256bV256bV256b", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pack_f32a - .{ .tag = @enumFromInt(1773), .properties = .{ .param_str = "ULifC*", .target_set = TargetSet.initOne(.ve) } }, - // __builtin_ve_vl_pack_f32p - .{ .tag = @enumFromInt(1774), .properties = .{ .param_str = "ULifC*fC*", .target_set = TargetSet.initOne(.ve) } }, - // __builtin_ve_vl_pcvm_sml - .{ .tag = @enumFromInt(1775), .properties = .{ .param_str = "LUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pfchv_ssl - .{ .tag = @enumFromInt(1776), .properties = .{ .param_str = "vLivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pfchvnc_ssl - .{ .tag = @enumFromInt(1777), .properties = .{ .param_str = "vLivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvadds_vsvMvl - .{ .tag = @enumFromInt(1778), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvadds_vsvl - .{ .tag = @enumFromInt(1779), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvadds_vsvvl - .{ .tag = @enumFromInt(1780), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvadds_vvvMvl - .{ .tag = @enumFromInt(1781), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvadds_vvvl - .{ .tag = @enumFromInt(1782), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvadds_vvvvl - .{ .tag = @enumFromInt(1783), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvaddu_vsvMvl - .{ .tag = @enumFromInt(1784), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvaddu_vsvl - .{ .tag = @enumFromInt(1785), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvaddu_vsvvl - .{ .tag = @enumFromInt(1786), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvaddu_vvvMvl - .{ .tag = @enumFromInt(1787), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvaddu_vvvl - .{ .tag = @enumFromInt(1788), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvaddu_vvvvl - .{ .tag = @enumFromInt(1789), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvand_vsvMvl - .{ .tag = @enumFromInt(1790), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvand_vsvl - .{ .tag = @enumFromInt(1791), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvand_vsvvl - .{ .tag = @enumFromInt(1792), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvand_vvvMvl - .{ .tag = @enumFromInt(1793), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvand_vvvl - .{ .tag = @enumFromInt(1794), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvand_vvvvl - .{ .tag = @enumFromInt(1795), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvbrd_vsMvl - .{ .tag = @enumFromInt(1796), .properties = .{ .param_str = "V256dLUiV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvbrd_vsl - .{ .tag = @enumFromInt(1797), .properties = .{ .param_str = "V256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvbrd_vsvl - .{ .tag = @enumFromInt(1798), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvbrv_vvMvl - .{ .tag = @enumFromInt(1799), .properties = .{ .param_str = "V256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvbrv_vvl - .{ .tag = @enumFromInt(1800), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvbrv_vvvl - .{ .tag = @enumFromInt(1801), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvbrvlo_vvl - .{ .tag = @enumFromInt(1802), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvbrvlo_vvmvl - .{ .tag = @enumFromInt(1803), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvbrvlo_vvvl - .{ .tag = @enumFromInt(1804), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvbrvup_vvl - .{ .tag = @enumFromInt(1805), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvbrvup_vvmvl - .{ .tag = @enumFromInt(1806), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvbrvup_vvvl - .{ .tag = @enumFromInt(1807), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvcmps_vsvMvl - .{ .tag = @enumFromInt(1808), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvcmps_vsvl - .{ .tag = @enumFromInt(1809), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvcmps_vsvvl - .{ .tag = @enumFromInt(1810), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvcmps_vvvMvl - .{ .tag = @enumFromInt(1811), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvcmps_vvvl - .{ .tag = @enumFromInt(1812), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvcmps_vvvvl - .{ .tag = @enumFromInt(1813), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvcmpu_vsvMvl - .{ .tag = @enumFromInt(1814), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvcmpu_vsvl - .{ .tag = @enumFromInt(1815), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvcmpu_vsvvl - .{ .tag = @enumFromInt(1816), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvcmpu_vvvMvl - .{ .tag = @enumFromInt(1817), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvcmpu_vvvl - .{ .tag = @enumFromInt(1818), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvcmpu_vvvvl - .{ .tag = @enumFromInt(1819), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvcvtsw_vvl - .{ .tag = @enumFromInt(1820), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvcvtsw_vvvl - .{ .tag = @enumFromInt(1821), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvcvtws_vvMvl - .{ .tag = @enumFromInt(1822), .properties = .{ .param_str = "V256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvcvtws_vvl - .{ .tag = @enumFromInt(1823), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvcvtws_vvvl - .{ .tag = @enumFromInt(1824), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvcvtwsrz_vvMvl - .{ .tag = @enumFromInt(1825), .properties = .{ .param_str = "V256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvcvtwsrz_vvl - .{ .tag = @enumFromInt(1826), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvcvtwsrz_vvvl - .{ .tag = @enumFromInt(1827), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pveqv_vsvMvl - .{ .tag = @enumFromInt(1828), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pveqv_vsvl - .{ .tag = @enumFromInt(1829), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pveqv_vsvvl - .{ .tag = @enumFromInt(1830), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pveqv_vvvMvl - .{ .tag = @enumFromInt(1831), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pveqv_vvvl - .{ .tag = @enumFromInt(1832), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pveqv_vvvvl - .{ .tag = @enumFromInt(1833), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfadd_vsvMvl - .{ .tag = @enumFromInt(1834), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfadd_vsvl - .{ .tag = @enumFromInt(1835), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfadd_vsvvl - .{ .tag = @enumFromInt(1836), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfadd_vvvMvl - .{ .tag = @enumFromInt(1837), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfadd_vvvl - .{ .tag = @enumFromInt(1838), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfadd_vvvvl - .{ .tag = @enumFromInt(1839), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfcmp_vsvMvl - .{ .tag = @enumFromInt(1840), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfcmp_vsvl - .{ .tag = @enumFromInt(1841), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfcmp_vsvvl - .{ .tag = @enumFromInt(1842), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfcmp_vvvMvl - .{ .tag = @enumFromInt(1843), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfcmp_vvvl - .{ .tag = @enumFromInt(1844), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfcmp_vvvvl - .{ .tag = @enumFromInt(1845), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmad_vsvvMvl - .{ .tag = @enumFromInt(1846), .properties = .{ .param_str = "V256dLUiV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmad_vsvvl - .{ .tag = @enumFromInt(1847), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmad_vsvvvl - .{ .tag = @enumFromInt(1848), .properties = .{ .param_str = "V256dLUiV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmad_vvsvMvl - .{ .tag = @enumFromInt(1849), .properties = .{ .param_str = "V256dV256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmad_vvsvl - .{ .tag = @enumFromInt(1850), .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmad_vvsvvl - .{ .tag = @enumFromInt(1851), .properties = .{ .param_str = "V256dV256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmad_vvvvMvl - .{ .tag = @enumFromInt(1852), .properties = .{ .param_str = "V256dV256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmad_vvvvl - .{ .tag = @enumFromInt(1853), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmad_vvvvvl - .{ .tag = @enumFromInt(1854), .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmax_vsvMvl - .{ .tag = @enumFromInt(1855), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmax_vsvl - .{ .tag = @enumFromInt(1856), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmax_vsvvl - .{ .tag = @enumFromInt(1857), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmax_vvvMvl - .{ .tag = @enumFromInt(1858), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmax_vvvl - .{ .tag = @enumFromInt(1859), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmax_vvvvl - .{ .tag = @enumFromInt(1860), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmin_vsvMvl - .{ .tag = @enumFromInt(1861), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmin_vsvl - .{ .tag = @enumFromInt(1862), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmin_vsvvl - .{ .tag = @enumFromInt(1863), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmin_vvvMvl - .{ .tag = @enumFromInt(1864), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmin_vvvl - .{ .tag = @enumFromInt(1865), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmin_vvvvl - .{ .tag = @enumFromInt(1866), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkaf_Ml - .{ .tag = @enumFromInt(1867), .properties = .{ .param_str = "V512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkat_Ml - .{ .tag = @enumFromInt(1868), .properties = .{ .param_str = "V512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkseq_MvMl - .{ .tag = @enumFromInt(1869), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkseq_Mvl - .{ .tag = @enumFromInt(1870), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkseqnan_MvMl - .{ .tag = @enumFromInt(1871), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkseqnan_Mvl - .{ .tag = @enumFromInt(1872), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksge_MvMl - .{ .tag = @enumFromInt(1873), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksge_Mvl - .{ .tag = @enumFromInt(1874), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksgenan_MvMl - .{ .tag = @enumFromInt(1875), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksgenan_Mvl - .{ .tag = @enumFromInt(1876), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksgt_MvMl - .{ .tag = @enumFromInt(1877), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksgt_Mvl - .{ .tag = @enumFromInt(1878), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksgtnan_MvMl - .{ .tag = @enumFromInt(1879), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksgtnan_Mvl - .{ .tag = @enumFromInt(1880), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksle_MvMl - .{ .tag = @enumFromInt(1881), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksle_Mvl - .{ .tag = @enumFromInt(1882), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkslenan_MvMl - .{ .tag = @enumFromInt(1883), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkslenan_Mvl - .{ .tag = @enumFromInt(1884), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksloeq_mvl - .{ .tag = @enumFromInt(1885), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksloeq_mvml - .{ .tag = @enumFromInt(1886), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksloeqnan_mvl - .{ .tag = @enumFromInt(1887), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksloeqnan_mvml - .{ .tag = @enumFromInt(1888), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksloge_mvl - .{ .tag = @enumFromInt(1889), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksloge_mvml - .{ .tag = @enumFromInt(1890), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkslogenan_mvl - .{ .tag = @enumFromInt(1891), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkslogenan_mvml - .{ .tag = @enumFromInt(1892), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkslogt_mvl - .{ .tag = @enumFromInt(1893), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkslogt_mvml - .{ .tag = @enumFromInt(1894), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkslogtnan_mvl - .{ .tag = @enumFromInt(1895), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkslogtnan_mvml - .{ .tag = @enumFromInt(1896), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkslole_mvl - .{ .tag = @enumFromInt(1897), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkslole_mvml - .{ .tag = @enumFromInt(1898), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkslolenan_mvl - .{ .tag = @enumFromInt(1899), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkslolenan_mvml - .{ .tag = @enumFromInt(1900), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkslolt_mvl - .{ .tag = @enumFromInt(1901), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkslolt_mvml - .{ .tag = @enumFromInt(1902), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksloltnan_mvl - .{ .tag = @enumFromInt(1903), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksloltnan_mvml - .{ .tag = @enumFromInt(1904), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkslonan_mvl - .{ .tag = @enumFromInt(1905), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkslonan_mvml - .{ .tag = @enumFromInt(1906), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkslone_mvl - .{ .tag = @enumFromInt(1907), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkslone_mvml - .{ .tag = @enumFromInt(1908), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkslonenan_mvl - .{ .tag = @enumFromInt(1909), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkslonenan_mvml - .{ .tag = @enumFromInt(1910), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkslonum_mvl - .{ .tag = @enumFromInt(1911), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkslonum_mvml - .{ .tag = @enumFromInt(1912), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkslt_MvMl - .{ .tag = @enumFromInt(1913), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkslt_Mvl - .{ .tag = @enumFromInt(1914), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksltnan_MvMl - .{ .tag = @enumFromInt(1915), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksltnan_Mvl - .{ .tag = @enumFromInt(1916), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksnan_MvMl - .{ .tag = @enumFromInt(1917), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksnan_Mvl - .{ .tag = @enumFromInt(1918), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksne_MvMl - .{ .tag = @enumFromInt(1919), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksne_Mvl - .{ .tag = @enumFromInt(1920), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksnenan_MvMl - .{ .tag = @enumFromInt(1921), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksnenan_Mvl - .{ .tag = @enumFromInt(1922), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksnum_MvMl - .{ .tag = @enumFromInt(1923), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksnum_Mvl - .{ .tag = @enumFromInt(1924), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksupeq_mvl - .{ .tag = @enumFromInt(1925), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksupeq_mvml - .{ .tag = @enumFromInt(1926), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksupeqnan_mvl - .{ .tag = @enumFromInt(1927), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksupeqnan_mvml - .{ .tag = @enumFromInt(1928), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksupge_mvl - .{ .tag = @enumFromInt(1929), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksupge_mvml - .{ .tag = @enumFromInt(1930), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksupgenan_mvl - .{ .tag = @enumFromInt(1931), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksupgenan_mvml - .{ .tag = @enumFromInt(1932), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksupgt_mvl - .{ .tag = @enumFromInt(1933), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksupgt_mvml - .{ .tag = @enumFromInt(1934), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksupgtnan_mvl - .{ .tag = @enumFromInt(1935), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksupgtnan_mvml - .{ .tag = @enumFromInt(1936), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksuple_mvl - .{ .tag = @enumFromInt(1937), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksuple_mvml - .{ .tag = @enumFromInt(1938), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksuplenan_mvl - .{ .tag = @enumFromInt(1939), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksuplenan_mvml - .{ .tag = @enumFromInt(1940), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksuplt_mvl - .{ .tag = @enumFromInt(1941), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksuplt_mvml - .{ .tag = @enumFromInt(1942), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksupltnan_mvl - .{ .tag = @enumFromInt(1943), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksupltnan_mvml - .{ .tag = @enumFromInt(1944), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksupnan_mvl - .{ .tag = @enumFromInt(1945), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksupnan_mvml - .{ .tag = @enumFromInt(1946), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksupne_mvl - .{ .tag = @enumFromInt(1947), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksupne_mvml - .{ .tag = @enumFromInt(1948), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksupnenan_mvl - .{ .tag = @enumFromInt(1949), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksupnenan_mvml - .{ .tag = @enumFromInt(1950), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksupnum_mvl - .{ .tag = @enumFromInt(1951), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmksupnum_mvml - .{ .tag = @enumFromInt(1952), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkweq_MvMl - .{ .tag = @enumFromInt(1953), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkweq_Mvl - .{ .tag = @enumFromInt(1954), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkweqnan_MvMl - .{ .tag = @enumFromInt(1955), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkweqnan_Mvl - .{ .tag = @enumFromInt(1956), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwge_MvMl - .{ .tag = @enumFromInt(1957), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwge_Mvl - .{ .tag = @enumFromInt(1958), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwgenan_MvMl - .{ .tag = @enumFromInt(1959), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwgenan_Mvl - .{ .tag = @enumFromInt(1960), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwgt_MvMl - .{ .tag = @enumFromInt(1961), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwgt_Mvl - .{ .tag = @enumFromInt(1962), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwgtnan_MvMl - .{ .tag = @enumFromInt(1963), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwgtnan_Mvl - .{ .tag = @enumFromInt(1964), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwle_MvMl - .{ .tag = @enumFromInt(1965), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwle_Mvl - .{ .tag = @enumFromInt(1966), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwlenan_MvMl - .{ .tag = @enumFromInt(1967), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwlenan_Mvl - .{ .tag = @enumFromInt(1968), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwloeq_mvl - .{ .tag = @enumFromInt(1969), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwloeq_mvml - .{ .tag = @enumFromInt(1970), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwloeqnan_mvl - .{ .tag = @enumFromInt(1971), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwloeqnan_mvml - .{ .tag = @enumFromInt(1972), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwloge_mvl - .{ .tag = @enumFromInt(1973), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwloge_mvml - .{ .tag = @enumFromInt(1974), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwlogenan_mvl - .{ .tag = @enumFromInt(1975), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwlogenan_mvml - .{ .tag = @enumFromInt(1976), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwlogt_mvl - .{ .tag = @enumFromInt(1977), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwlogt_mvml - .{ .tag = @enumFromInt(1978), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwlogtnan_mvl - .{ .tag = @enumFromInt(1979), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwlogtnan_mvml - .{ .tag = @enumFromInt(1980), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwlole_mvl - .{ .tag = @enumFromInt(1981), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwlole_mvml - .{ .tag = @enumFromInt(1982), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwlolenan_mvl - .{ .tag = @enumFromInt(1983), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwlolenan_mvml - .{ .tag = @enumFromInt(1984), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwlolt_mvl - .{ .tag = @enumFromInt(1985), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwlolt_mvml - .{ .tag = @enumFromInt(1986), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwloltnan_mvl - .{ .tag = @enumFromInt(1987), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwloltnan_mvml - .{ .tag = @enumFromInt(1988), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwlonan_mvl - .{ .tag = @enumFromInt(1989), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwlonan_mvml - .{ .tag = @enumFromInt(1990), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwlone_mvl - .{ .tag = @enumFromInt(1991), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwlone_mvml - .{ .tag = @enumFromInt(1992), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwlonenan_mvl - .{ .tag = @enumFromInt(1993), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwlonenan_mvml - .{ .tag = @enumFromInt(1994), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwlonum_mvl - .{ .tag = @enumFromInt(1995), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwlonum_mvml - .{ .tag = @enumFromInt(1996), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwlt_MvMl - .{ .tag = @enumFromInt(1997), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwlt_Mvl - .{ .tag = @enumFromInt(1998), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwltnan_MvMl - .{ .tag = @enumFromInt(1999), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwltnan_Mvl - .{ .tag = @enumFromInt(2000), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwnan_MvMl - .{ .tag = @enumFromInt(2001), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwnan_Mvl - .{ .tag = @enumFromInt(2002), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwne_MvMl - .{ .tag = @enumFromInt(2003), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwne_Mvl - .{ .tag = @enumFromInt(2004), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwnenan_MvMl - .{ .tag = @enumFromInt(2005), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwnenan_Mvl - .{ .tag = @enumFromInt(2006), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwnum_MvMl - .{ .tag = @enumFromInt(2007), .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwnum_Mvl - .{ .tag = @enumFromInt(2008), .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwupeq_mvl - .{ .tag = @enumFromInt(2009), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwupeq_mvml - .{ .tag = @enumFromInt(2010), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwupeqnan_mvl - .{ .tag = @enumFromInt(2011), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwupeqnan_mvml - .{ .tag = @enumFromInt(2012), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwupge_mvl - .{ .tag = @enumFromInt(2013), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwupge_mvml - .{ .tag = @enumFromInt(2014), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwupgenan_mvl - .{ .tag = @enumFromInt(2015), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwupgenan_mvml - .{ .tag = @enumFromInt(2016), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwupgt_mvl - .{ .tag = @enumFromInt(2017), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwupgt_mvml - .{ .tag = @enumFromInt(2018), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwupgtnan_mvl - .{ .tag = @enumFromInt(2019), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwupgtnan_mvml - .{ .tag = @enumFromInt(2020), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwuple_mvl - .{ .tag = @enumFromInt(2021), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwuple_mvml - .{ .tag = @enumFromInt(2022), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwuplenan_mvl - .{ .tag = @enumFromInt(2023), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwuplenan_mvml - .{ .tag = @enumFromInt(2024), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwuplt_mvl - .{ .tag = @enumFromInt(2025), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwuplt_mvml - .{ .tag = @enumFromInt(2026), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwupltnan_mvl - .{ .tag = @enumFromInt(2027), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwupltnan_mvml - .{ .tag = @enumFromInt(2028), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwupnan_mvl - .{ .tag = @enumFromInt(2029), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwupnan_mvml - .{ .tag = @enumFromInt(2030), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwupne_mvl - .{ .tag = @enumFromInt(2031), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwupne_mvml - .{ .tag = @enumFromInt(2032), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwupnenan_mvl - .{ .tag = @enumFromInt(2033), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwupnenan_mvml - .{ .tag = @enumFromInt(2034), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwupnum_mvl - .{ .tag = @enumFromInt(2035), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmkwupnum_mvml - .{ .tag = @enumFromInt(2036), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmsb_vsvvMvl - .{ .tag = @enumFromInt(2037), .properties = .{ .param_str = "V256dLUiV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmsb_vsvvl - .{ .tag = @enumFromInt(2038), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmsb_vsvvvl - .{ .tag = @enumFromInt(2039), .properties = .{ .param_str = "V256dLUiV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmsb_vvsvMvl - .{ .tag = @enumFromInt(2040), .properties = .{ .param_str = "V256dV256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmsb_vvsvl - .{ .tag = @enumFromInt(2041), .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmsb_vvsvvl - .{ .tag = @enumFromInt(2042), .properties = .{ .param_str = "V256dV256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmsb_vvvvMvl - .{ .tag = @enumFromInt(2043), .properties = .{ .param_str = "V256dV256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmsb_vvvvl - .{ .tag = @enumFromInt(2044), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmsb_vvvvvl - .{ .tag = @enumFromInt(2045), .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmul_vsvMvl - .{ .tag = @enumFromInt(2046), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmul_vsvl - .{ .tag = @enumFromInt(2047), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmul_vsvvl - .{ .tag = @enumFromInt(2048), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmul_vvvMvl - .{ .tag = @enumFromInt(2049), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmul_vvvl - .{ .tag = @enumFromInt(2050), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfmul_vvvvl - .{ .tag = @enumFromInt(2051), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfnmad_vsvvMvl - .{ .tag = @enumFromInt(2052), .properties = .{ .param_str = "V256dLUiV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfnmad_vsvvl - .{ .tag = @enumFromInt(2053), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfnmad_vsvvvl - .{ .tag = @enumFromInt(2054), .properties = .{ .param_str = "V256dLUiV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfnmad_vvsvMvl - .{ .tag = @enumFromInt(2055), .properties = .{ .param_str = "V256dV256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfnmad_vvsvl - .{ .tag = @enumFromInt(2056), .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfnmad_vvsvvl - .{ .tag = @enumFromInt(2057), .properties = .{ .param_str = "V256dV256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfnmad_vvvvMvl - .{ .tag = @enumFromInt(2058), .properties = .{ .param_str = "V256dV256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfnmad_vvvvl - .{ .tag = @enumFromInt(2059), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfnmad_vvvvvl - .{ .tag = @enumFromInt(2060), .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfnmsb_vsvvMvl - .{ .tag = @enumFromInt(2061), .properties = .{ .param_str = "V256dLUiV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfnmsb_vsvvl - .{ .tag = @enumFromInt(2062), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfnmsb_vsvvvl - .{ .tag = @enumFromInt(2063), .properties = .{ .param_str = "V256dLUiV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfnmsb_vvsvMvl - .{ .tag = @enumFromInt(2064), .properties = .{ .param_str = "V256dV256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfnmsb_vvsvl - .{ .tag = @enumFromInt(2065), .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfnmsb_vvsvvl - .{ .tag = @enumFromInt(2066), .properties = .{ .param_str = "V256dV256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfnmsb_vvvvMvl - .{ .tag = @enumFromInt(2067), .properties = .{ .param_str = "V256dV256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfnmsb_vvvvl - .{ .tag = @enumFromInt(2068), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfnmsb_vvvvvl - .{ .tag = @enumFromInt(2069), .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfsub_vsvMvl - .{ .tag = @enumFromInt(2070), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfsub_vsvl - .{ .tag = @enumFromInt(2071), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfsub_vsvvl - .{ .tag = @enumFromInt(2072), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfsub_vvvMvl - .{ .tag = @enumFromInt(2073), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfsub_vvvl - .{ .tag = @enumFromInt(2074), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvfsub_vvvvl - .{ .tag = @enumFromInt(2075), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvldz_vvMvl - .{ .tag = @enumFromInt(2076), .properties = .{ .param_str = "V256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvldz_vvl - .{ .tag = @enumFromInt(2077), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvldz_vvvl - .{ .tag = @enumFromInt(2078), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvldzlo_vvl - .{ .tag = @enumFromInt(2079), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvldzlo_vvmvl - .{ .tag = @enumFromInt(2080), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvldzlo_vvvl - .{ .tag = @enumFromInt(2081), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvldzup_vvl - .{ .tag = @enumFromInt(2082), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvldzup_vvmvl - .{ .tag = @enumFromInt(2083), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvldzup_vvvl - .{ .tag = @enumFromInt(2084), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvmaxs_vsvMvl - .{ .tag = @enumFromInt(2085), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvmaxs_vsvl - .{ .tag = @enumFromInt(2086), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvmaxs_vsvvl - .{ .tag = @enumFromInt(2087), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvmaxs_vvvMvl - .{ .tag = @enumFromInt(2088), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvmaxs_vvvl - .{ .tag = @enumFromInt(2089), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvmaxs_vvvvl - .{ .tag = @enumFromInt(2090), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvmins_vsvMvl - .{ .tag = @enumFromInt(2091), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvmins_vsvl - .{ .tag = @enumFromInt(2092), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvmins_vsvvl - .{ .tag = @enumFromInt(2093), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvmins_vvvMvl - .{ .tag = @enumFromInt(2094), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvmins_vvvl - .{ .tag = @enumFromInt(2095), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvmins_vvvvl - .{ .tag = @enumFromInt(2096), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvor_vsvMvl - .{ .tag = @enumFromInt(2097), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvor_vsvl - .{ .tag = @enumFromInt(2098), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvor_vsvvl - .{ .tag = @enumFromInt(2099), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvor_vvvMvl - .{ .tag = @enumFromInt(2100), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvor_vvvl - .{ .tag = @enumFromInt(2101), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvor_vvvvl - .{ .tag = @enumFromInt(2102), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvpcnt_vvMvl - .{ .tag = @enumFromInt(2103), .properties = .{ .param_str = "V256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvpcnt_vvl - .{ .tag = @enumFromInt(2104), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvpcnt_vvvl - .{ .tag = @enumFromInt(2105), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvpcntlo_vvl - .{ .tag = @enumFromInt(2106), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvpcntlo_vvmvl - .{ .tag = @enumFromInt(2107), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvpcntlo_vvvl - .{ .tag = @enumFromInt(2108), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvpcntup_vvl - .{ .tag = @enumFromInt(2109), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvpcntup_vvmvl - .{ .tag = @enumFromInt(2110), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvpcntup_vvvl - .{ .tag = @enumFromInt(2111), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvrcp_vvl - .{ .tag = @enumFromInt(2112), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvrcp_vvvl - .{ .tag = @enumFromInt(2113), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvrsqrt_vvl - .{ .tag = @enumFromInt(2114), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvrsqrt_vvvl - .{ .tag = @enumFromInt(2115), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvrsqrtnex_vvl - .{ .tag = @enumFromInt(2116), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvrsqrtnex_vvvl - .{ .tag = @enumFromInt(2117), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvseq_vl - .{ .tag = @enumFromInt(2118), .properties = .{ .param_str = "V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvseq_vvl - .{ .tag = @enumFromInt(2119), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvseqlo_vl - .{ .tag = @enumFromInt(2120), .properties = .{ .param_str = "V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvseqlo_vvl - .{ .tag = @enumFromInt(2121), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsequp_vl - .{ .tag = @enumFromInt(2122), .properties = .{ .param_str = "V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsequp_vvl - .{ .tag = @enumFromInt(2123), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsla_vvsMvl - .{ .tag = @enumFromInt(2124), .properties = .{ .param_str = "V256dV256dLUiV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsla_vvsl - .{ .tag = @enumFromInt(2125), .properties = .{ .param_str = "V256dV256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsla_vvsvl - .{ .tag = @enumFromInt(2126), .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsla_vvvMvl - .{ .tag = @enumFromInt(2127), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsla_vvvl - .{ .tag = @enumFromInt(2128), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsla_vvvvl - .{ .tag = @enumFromInt(2129), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsll_vvsMvl - .{ .tag = @enumFromInt(2130), .properties = .{ .param_str = "V256dV256dLUiV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsll_vvsl - .{ .tag = @enumFromInt(2131), .properties = .{ .param_str = "V256dV256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsll_vvsvl - .{ .tag = @enumFromInt(2132), .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsll_vvvMvl - .{ .tag = @enumFromInt(2133), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsll_vvvl - .{ .tag = @enumFromInt(2134), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsll_vvvvl - .{ .tag = @enumFromInt(2135), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsra_vvsMvl - .{ .tag = @enumFromInt(2136), .properties = .{ .param_str = "V256dV256dLUiV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsra_vvsl - .{ .tag = @enumFromInt(2137), .properties = .{ .param_str = "V256dV256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsra_vvsvl - .{ .tag = @enumFromInt(2138), .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsra_vvvMvl - .{ .tag = @enumFromInt(2139), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsra_vvvl - .{ .tag = @enumFromInt(2140), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsra_vvvvl - .{ .tag = @enumFromInt(2141), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsrl_vvsMvl - .{ .tag = @enumFromInt(2142), .properties = .{ .param_str = "V256dV256dLUiV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsrl_vvsl - .{ .tag = @enumFromInt(2143), .properties = .{ .param_str = "V256dV256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsrl_vvsvl - .{ .tag = @enumFromInt(2144), .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsrl_vvvMvl - .{ .tag = @enumFromInt(2145), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsrl_vvvl - .{ .tag = @enumFromInt(2146), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsrl_vvvvl - .{ .tag = @enumFromInt(2147), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsubs_vsvMvl - .{ .tag = @enumFromInt(2148), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsubs_vsvl - .{ .tag = @enumFromInt(2149), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsubs_vsvvl - .{ .tag = @enumFromInt(2150), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsubs_vvvMvl - .{ .tag = @enumFromInt(2151), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsubs_vvvl - .{ .tag = @enumFromInt(2152), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsubs_vvvvl - .{ .tag = @enumFromInt(2153), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsubu_vsvMvl - .{ .tag = @enumFromInt(2154), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsubu_vsvl - .{ .tag = @enumFromInt(2155), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsubu_vsvvl - .{ .tag = @enumFromInt(2156), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsubu_vvvMvl - .{ .tag = @enumFromInt(2157), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsubu_vvvl - .{ .tag = @enumFromInt(2158), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvsubu_vvvvl - .{ .tag = @enumFromInt(2159), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvxor_vsvMvl - .{ .tag = @enumFromInt(2160), .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvxor_vsvl - .{ .tag = @enumFromInt(2161), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvxor_vsvvl - .{ .tag = @enumFromInt(2162), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvxor_vvvMvl - .{ .tag = @enumFromInt(2163), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvxor_vvvl - .{ .tag = @enumFromInt(2164), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_pvxor_vvvvl - .{ .tag = @enumFromInt(2165), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_scr_sss - .{ .tag = @enumFromInt(2166), .properties = .{ .param_str = "vLUiLUiLUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_svm_sMs - .{ .tag = @enumFromInt(2167), .properties = .{ .param_str = "LUiV512bLUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_svm_sms - .{ .tag = @enumFromInt(2168), .properties = .{ .param_str = "LUiV256bLUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_svob - .{ .tag = @enumFromInt(2169), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_tovm_sml - .{ .tag = @enumFromInt(2170), .properties = .{ .param_str = "LUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_tscr_ssss - .{ .tag = @enumFromInt(2171), .properties = .{ .param_str = "LUiLUiLUiLUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vaddsl_vsvl - .{ .tag = @enumFromInt(2172), .properties = .{ .param_str = "V256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vaddsl_vsvmvl - .{ .tag = @enumFromInt(2173), .properties = .{ .param_str = "V256dLiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vaddsl_vsvvl - .{ .tag = @enumFromInt(2174), .properties = .{ .param_str = "V256dLiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vaddsl_vvvl - .{ .tag = @enumFromInt(2175), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vaddsl_vvvmvl - .{ .tag = @enumFromInt(2176), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vaddsl_vvvvl - .{ .tag = @enumFromInt(2177), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vaddswsx_vsvl - .{ .tag = @enumFromInt(2178), .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vaddswsx_vsvmvl - .{ .tag = @enumFromInt(2179), .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vaddswsx_vsvvl - .{ .tag = @enumFromInt(2180), .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vaddswsx_vvvl - .{ .tag = @enumFromInt(2181), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vaddswsx_vvvmvl - .{ .tag = @enumFromInt(2182), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vaddswsx_vvvvl - .{ .tag = @enumFromInt(2183), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vaddswzx_vsvl - .{ .tag = @enumFromInt(2184), .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vaddswzx_vsvmvl - .{ .tag = @enumFromInt(2185), .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vaddswzx_vsvvl - .{ .tag = @enumFromInt(2186), .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vaddswzx_vvvl - .{ .tag = @enumFromInt(2187), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vaddswzx_vvvmvl - .{ .tag = @enumFromInt(2188), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vaddswzx_vvvvl - .{ .tag = @enumFromInt(2189), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vaddul_vsvl - .{ .tag = @enumFromInt(2190), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vaddul_vsvmvl - .{ .tag = @enumFromInt(2191), .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vaddul_vsvvl - .{ .tag = @enumFromInt(2192), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vaddul_vvvl - .{ .tag = @enumFromInt(2193), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vaddul_vvvmvl - .{ .tag = @enumFromInt(2194), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vaddul_vvvvl - .{ .tag = @enumFromInt(2195), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vadduw_vsvl - .{ .tag = @enumFromInt(2196), .properties = .{ .param_str = "V256dUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vadduw_vsvmvl - .{ .tag = @enumFromInt(2197), .properties = .{ .param_str = "V256dUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vadduw_vsvvl - .{ .tag = @enumFromInt(2198), .properties = .{ .param_str = "V256dUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vadduw_vvvl - .{ .tag = @enumFromInt(2199), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vadduw_vvvmvl - .{ .tag = @enumFromInt(2200), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vadduw_vvvvl - .{ .tag = @enumFromInt(2201), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vand_vsvl - .{ .tag = @enumFromInt(2202), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vand_vsvmvl - .{ .tag = @enumFromInt(2203), .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vand_vsvvl - .{ .tag = @enumFromInt(2204), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vand_vvvl - .{ .tag = @enumFromInt(2205), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vand_vvvmvl - .{ .tag = @enumFromInt(2206), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vand_vvvvl - .{ .tag = @enumFromInt(2207), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vbrdd_vsl - .{ .tag = @enumFromInt(2208), .properties = .{ .param_str = "V256ddUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vbrdd_vsmvl - .{ .tag = @enumFromInt(2209), .properties = .{ .param_str = "V256ddV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vbrdd_vsvl - .{ .tag = @enumFromInt(2210), .properties = .{ .param_str = "V256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vbrdl_vsl - .{ .tag = @enumFromInt(2211), .properties = .{ .param_str = "V256dLiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vbrdl_vsmvl - .{ .tag = @enumFromInt(2212), .properties = .{ .param_str = "V256dLiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vbrdl_vsvl - .{ .tag = @enumFromInt(2213), .properties = .{ .param_str = "V256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vbrds_vsl - .{ .tag = @enumFromInt(2214), .properties = .{ .param_str = "V256dfUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vbrds_vsmvl - .{ .tag = @enumFromInt(2215), .properties = .{ .param_str = "V256dfV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vbrds_vsvl - .{ .tag = @enumFromInt(2216), .properties = .{ .param_str = "V256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vbrdw_vsl - .{ .tag = @enumFromInt(2217), .properties = .{ .param_str = "V256diUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vbrdw_vsmvl - .{ .tag = @enumFromInt(2218), .properties = .{ .param_str = "V256diV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vbrdw_vsvl - .{ .tag = @enumFromInt(2219), .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vbrv_vvl - .{ .tag = @enumFromInt(2220), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vbrv_vvmvl - .{ .tag = @enumFromInt(2221), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vbrv_vvvl - .{ .tag = @enumFromInt(2222), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcmpsl_vsvl - .{ .tag = @enumFromInt(2223), .properties = .{ .param_str = "V256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcmpsl_vsvmvl - .{ .tag = @enumFromInt(2224), .properties = .{ .param_str = "V256dLiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcmpsl_vsvvl - .{ .tag = @enumFromInt(2225), .properties = .{ .param_str = "V256dLiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcmpsl_vvvl - .{ .tag = @enumFromInt(2226), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcmpsl_vvvmvl - .{ .tag = @enumFromInt(2227), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcmpsl_vvvvl - .{ .tag = @enumFromInt(2228), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcmpswsx_vsvl - .{ .tag = @enumFromInt(2229), .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcmpswsx_vsvmvl - .{ .tag = @enumFromInt(2230), .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcmpswsx_vsvvl - .{ .tag = @enumFromInt(2231), .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcmpswsx_vvvl - .{ .tag = @enumFromInt(2232), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcmpswsx_vvvmvl - .{ .tag = @enumFromInt(2233), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcmpswsx_vvvvl - .{ .tag = @enumFromInt(2234), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcmpswzx_vsvl - .{ .tag = @enumFromInt(2235), .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcmpswzx_vsvmvl - .{ .tag = @enumFromInt(2236), .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcmpswzx_vsvvl - .{ .tag = @enumFromInt(2237), .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcmpswzx_vvvl - .{ .tag = @enumFromInt(2238), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcmpswzx_vvvmvl - .{ .tag = @enumFromInt(2239), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcmpswzx_vvvvl - .{ .tag = @enumFromInt(2240), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcmpul_vsvl - .{ .tag = @enumFromInt(2241), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcmpul_vsvmvl - .{ .tag = @enumFromInt(2242), .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcmpul_vsvvl - .{ .tag = @enumFromInt(2243), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcmpul_vvvl - .{ .tag = @enumFromInt(2244), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcmpul_vvvmvl - .{ .tag = @enumFromInt(2245), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcmpul_vvvvl - .{ .tag = @enumFromInt(2246), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcmpuw_vsvl - .{ .tag = @enumFromInt(2247), .properties = .{ .param_str = "V256dUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcmpuw_vsvmvl - .{ .tag = @enumFromInt(2248), .properties = .{ .param_str = "V256dUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcmpuw_vsvvl - .{ .tag = @enumFromInt(2249), .properties = .{ .param_str = "V256dUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcmpuw_vvvl - .{ .tag = @enumFromInt(2250), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcmpuw_vvvmvl - .{ .tag = @enumFromInt(2251), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcmpuw_vvvvl - .{ .tag = @enumFromInt(2252), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcp_vvmvl - .{ .tag = @enumFromInt(2253), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtdl_vvl - .{ .tag = @enumFromInt(2254), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtdl_vvvl - .{ .tag = @enumFromInt(2255), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtds_vvl - .{ .tag = @enumFromInt(2256), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtds_vvvl - .{ .tag = @enumFromInt(2257), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtdw_vvl - .{ .tag = @enumFromInt(2258), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtdw_vvvl - .{ .tag = @enumFromInt(2259), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtld_vvl - .{ .tag = @enumFromInt(2260), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtld_vvmvl - .{ .tag = @enumFromInt(2261), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtld_vvvl - .{ .tag = @enumFromInt(2262), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtldrz_vvl - .{ .tag = @enumFromInt(2263), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtldrz_vvmvl - .{ .tag = @enumFromInt(2264), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtldrz_vvvl - .{ .tag = @enumFromInt(2265), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtsd_vvl - .{ .tag = @enumFromInt(2266), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtsd_vvvl - .{ .tag = @enumFromInt(2267), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtsw_vvl - .{ .tag = @enumFromInt(2268), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtsw_vvvl - .{ .tag = @enumFromInt(2269), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtwdsx_vvl - .{ .tag = @enumFromInt(2270), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtwdsx_vvmvl - .{ .tag = @enumFromInt(2271), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtwdsx_vvvl - .{ .tag = @enumFromInt(2272), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtwdsxrz_vvl - .{ .tag = @enumFromInt(2273), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtwdsxrz_vvmvl - .{ .tag = @enumFromInt(2274), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtwdsxrz_vvvl - .{ .tag = @enumFromInt(2275), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtwdzx_vvl - .{ .tag = @enumFromInt(2276), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtwdzx_vvmvl - .{ .tag = @enumFromInt(2277), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtwdzx_vvvl - .{ .tag = @enumFromInt(2278), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtwdzxrz_vvl - .{ .tag = @enumFromInt(2279), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtwdzxrz_vvmvl - .{ .tag = @enumFromInt(2280), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtwdzxrz_vvvl - .{ .tag = @enumFromInt(2281), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtwssx_vvl - .{ .tag = @enumFromInt(2282), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtwssx_vvmvl - .{ .tag = @enumFromInt(2283), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtwssx_vvvl - .{ .tag = @enumFromInt(2284), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtwssxrz_vvl - .{ .tag = @enumFromInt(2285), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtwssxrz_vvmvl - .{ .tag = @enumFromInt(2286), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtwssxrz_vvvl - .{ .tag = @enumFromInt(2287), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtwszx_vvl - .{ .tag = @enumFromInt(2288), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtwszx_vvmvl - .{ .tag = @enumFromInt(2289), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtwszx_vvvl - .{ .tag = @enumFromInt(2290), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtwszxrz_vvl - .{ .tag = @enumFromInt(2291), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtwszxrz_vvmvl - .{ .tag = @enumFromInt(2292), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vcvtwszxrz_vvvl - .{ .tag = @enumFromInt(2293), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivsl_vsvl - .{ .tag = @enumFromInt(2294), .properties = .{ .param_str = "V256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivsl_vsvmvl - .{ .tag = @enumFromInt(2295), .properties = .{ .param_str = "V256dLiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivsl_vsvvl - .{ .tag = @enumFromInt(2296), .properties = .{ .param_str = "V256dLiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivsl_vvsl - .{ .tag = @enumFromInt(2297), .properties = .{ .param_str = "V256dV256dLiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivsl_vvsmvl - .{ .tag = @enumFromInt(2298), .properties = .{ .param_str = "V256dV256dLiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivsl_vvsvl - .{ .tag = @enumFromInt(2299), .properties = .{ .param_str = "V256dV256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivsl_vvvl - .{ .tag = @enumFromInt(2300), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivsl_vvvmvl - .{ .tag = @enumFromInt(2301), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivsl_vvvvl - .{ .tag = @enumFromInt(2302), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivswsx_vsvl - .{ .tag = @enumFromInt(2303), .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivswsx_vsvmvl - .{ .tag = @enumFromInt(2304), .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivswsx_vsvvl - .{ .tag = @enumFromInt(2305), .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivswsx_vvsl - .{ .tag = @enumFromInt(2306), .properties = .{ .param_str = "V256dV256diUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivswsx_vvsmvl - .{ .tag = @enumFromInt(2307), .properties = .{ .param_str = "V256dV256diV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivswsx_vvsvl - .{ .tag = @enumFromInt(2308), .properties = .{ .param_str = "V256dV256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivswsx_vvvl - .{ .tag = @enumFromInt(2309), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivswsx_vvvmvl - .{ .tag = @enumFromInt(2310), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivswsx_vvvvl - .{ .tag = @enumFromInt(2311), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivswzx_vsvl - .{ .tag = @enumFromInt(2312), .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivswzx_vsvmvl - .{ .tag = @enumFromInt(2313), .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivswzx_vsvvl - .{ .tag = @enumFromInt(2314), .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivswzx_vvsl - .{ .tag = @enumFromInt(2315), .properties = .{ .param_str = "V256dV256diUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivswzx_vvsmvl - .{ .tag = @enumFromInt(2316), .properties = .{ .param_str = "V256dV256diV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivswzx_vvsvl - .{ .tag = @enumFromInt(2317), .properties = .{ .param_str = "V256dV256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivswzx_vvvl - .{ .tag = @enumFromInt(2318), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivswzx_vvvmvl - .{ .tag = @enumFromInt(2319), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivswzx_vvvvl - .{ .tag = @enumFromInt(2320), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivul_vsvl - .{ .tag = @enumFromInt(2321), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivul_vsvmvl - .{ .tag = @enumFromInt(2322), .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivul_vsvvl - .{ .tag = @enumFromInt(2323), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivul_vvsl - .{ .tag = @enumFromInt(2324), .properties = .{ .param_str = "V256dV256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivul_vvsmvl - .{ .tag = @enumFromInt(2325), .properties = .{ .param_str = "V256dV256dLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivul_vvsvl - .{ .tag = @enumFromInt(2326), .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivul_vvvl - .{ .tag = @enumFromInt(2327), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivul_vvvmvl - .{ .tag = @enumFromInt(2328), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivul_vvvvl - .{ .tag = @enumFromInt(2329), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivuw_vsvl - .{ .tag = @enumFromInt(2330), .properties = .{ .param_str = "V256dUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivuw_vsvmvl - .{ .tag = @enumFromInt(2331), .properties = .{ .param_str = "V256dUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivuw_vsvvl - .{ .tag = @enumFromInt(2332), .properties = .{ .param_str = "V256dUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivuw_vvsl - .{ .tag = @enumFromInt(2333), .properties = .{ .param_str = "V256dV256dUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivuw_vvsmvl - .{ .tag = @enumFromInt(2334), .properties = .{ .param_str = "V256dV256dUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivuw_vvsvl - .{ .tag = @enumFromInt(2335), .properties = .{ .param_str = "V256dV256dUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivuw_vvvl - .{ .tag = @enumFromInt(2336), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivuw_vvvmvl - .{ .tag = @enumFromInt(2337), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vdivuw_vvvvl - .{ .tag = @enumFromInt(2338), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_veqv_vsvl - .{ .tag = @enumFromInt(2339), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_veqv_vsvmvl - .{ .tag = @enumFromInt(2340), .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_veqv_vsvvl - .{ .tag = @enumFromInt(2341), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_veqv_vvvl - .{ .tag = @enumFromInt(2342), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_veqv_vvvmvl - .{ .tag = @enumFromInt(2343), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_veqv_vvvvl - .{ .tag = @enumFromInt(2344), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vex_vvmvl - .{ .tag = @enumFromInt(2345), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfaddd_vsvl - .{ .tag = @enumFromInt(2346), .properties = .{ .param_str = "V256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfaddd_vsvmvl - .{ .tag = @enumFromInt(2347), .properties = .{ .param_str = "V256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfaddd_vsvvl - .{ .tag = @enumFromInt(2348), .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfaddd_vvvl - .{ .tag = @enumFromInt(2349), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfaddd_vvvmvl - .{ .tag = @enumFromInt(2350), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfaddd_vvvvl - .{ .tag = @enumFromInt(2351), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfadds_vsvl - .{ .tag = @enumFromInt(2352), .properties = .{ .param_str = "V256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfadds_vsvmvl - .{ .tag = @enumFromInt(2353), .properties = .{ .param_str = "V256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfadds_vsvvl - .{ .tag = @enumFromInt(2354), .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfadds_vvvl - .{ .tag = @enumFromInt(2355), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfadds_vvvmvl - .{ .tag = @enumFromInt(2356), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfadds_vvvvl - .{ .tag = @enumFromInt(2357), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfcmpd_vsvl - .{ .tag = @enumFromInt(2358), .properties = .{ .param_str = "V256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfcmpd_vsvmvl - .{ .tag = @enumFromInt(2359), .properties = .{ .param_str = "V256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfcmpd_vsvvl - .{ .tag = @enumFromInt(2360), .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfcmpd_vvvl - .{ .tag = @enumFromInt(2361), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfcmpd_vvvmvl - .{ .tag = @enumFromInt(2362), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfcmpd_vvvvl - .{ .tag = @enumFromInt(2363), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfcmps_vsvl - .{ .tag = @enumFromInt(2364), .properties = .{ .param_str = "V256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfcmps_vsvmvl - .{ .tag = @enumFromInt(2365), .properties = .{ .param_str = "V256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfcmps_vsvvl - .{ .tag = @enumFromInt(2366), .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfcmps_vvvl - .{ .tag = @enumFromInt(2367), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfcmps_vvvmvl - .{ .tag = @enumFromInt(2368), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfcmps_vvvvl - .{ .tag = @enumFromInt(2369), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfdivd_vsvl - .{ .tag = @enumFromInt(2370), .properties = .{ .param_str = "V256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfdivd_vsvmvl - .{ .tag = @enumFromInt(2371), .properties = .{ .param_str = "V256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfdivd_vsvvl - .{ .tag = @enumFromInt(2372), .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfdivd_vvvl - .{ .tag = @enumFromInt(2373), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfdivd_vvvmvl - .{ .tag = @enumFromInt(2374), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfdivd_vvvvl - .{ .tag = @enumFromInt(2375), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfdivs_vsvl - .{ .tag = @enumFromInt(2376), .properties = .{ .param_str = "V256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfdivs_vsvmvl - .{ .tag = @enumFromInt(2377), .properties = .{ .param_str = "V256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfdivs_vsvvl - .{ .tag = @enumFromInt(2378), .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfdivs_vvvl - .{ .tag = @enumFromInt(2379), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfdivs_vvvmvl - .{ .tag = @enumFromInt(2380), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfdivs_vvvvl - .{ .tag = @enumFromInt(2381), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmadd_vsvvl - .{ .tag = @enumFromInt(2382), .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmadd_vsvvmvl - .{ .tag = @enumFromInt(2383), .properties = .{ .param_str = "V256ddV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmadd_vsvvvl - .{ .tag = @enumFromInt(2384), .properties = .{ .param_str = "V256ddV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmadd_vvsvl - .{ .tag = @enumFromInt(2385), .properties = .{ .param_str = "V256dV256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmadd_vvsvmvl - .{ .tag = @enumFromInt(2386), .properties = .{ .param_str = "V256dV256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmadd_vvsvvl - .{ .tag = @enumFromInt(2387), .properties = .{ .param_str = "V256dV256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmadd_vvvvl - .{ .tag = @enumFromInt(2388), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmadd_vvvvmvl - .{ .tag = @enumFromInt(2389), .properties = .{ .param_str = "V256dV256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmadd_vvvvvl - .{ .tag = @enumFromInt(2390), .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmads_vsvvl - .{ .tag = @enumFromInt(2391), .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmads_vsvvmvl - .{ .tag = @enumFromInt(2392), .properties = .{ .param_str = "V256dfV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmads_vsvvvl - .{ .tag = @enumFromInt(2393), .properties = .{ .param_str = "V256dfV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmads_vvsvl - .{ .tag = @enumFromInt(2394), .properties = .{ .param_str = "V256dV256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmads_vvsvmvl - .{ .tag = @enumFromInt(2395), .properties = .{ .param_str = "V256dV256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmads_vvsvvl - .{ .tag = @enumFromInt(2396), .properties = .{ .param_str = "V256dV256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmads_vvvvl - .{ .tag = @enumFromInt(2397), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmads_vvvvmvl - .{ .tag = @enumFromInt(2398), .properties = .{ .param_str = "V256dV256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmads_vvvvvl - .{ .tag = @enumFromInt(2399), .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmaxd_vsvl - .{ .tag = @enumFromInt(2400), .properties = .{ .param_str = "V256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmaxd_vsvmvl - .{ .tag = @enumFromInt(2401), .properties = .{ .param_str = "V256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmaxd_vsvvl - .{ .tag = @enumFromInt(2402), .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmaxd_vvvl - .{ .tag = @enumFromInt(2403), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmaxd_vvvmvl - .{ .tag = @enumFromInt(2404), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmaxd_vvvvl - .{ .tag = @enumFromInt(2405), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmaxs_vsvl - .{ .tag = @enumFromInt(2406), .properties = .{ .param_str = "V256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmaxs_vsvmvl - .{ .tag = @enumFromInt(2407), .properties = .{ .param_str = "V256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmaxs_vsvvl - .{ .tag = @enumFromInt(2408), .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmaxs_vvvl - .{ .tag = @enumFromInt(2409), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmaxs_vvvmvl - .{ .tag = @enumFromInt(2410), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmaxs_vvvvl - .{ .tag = @enumFromInt(2411), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmind_vsvl - .{ .tag = @enumFromInt(2412), .properties = .{ .param_str = "V256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmind_vsvmvl - .{ .tag = @enumFromInt(2413), .properties = .{ .param_str = "V256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmind_vsvvl - .{ .tag = @enumFromInt(2414), .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmind_vvvl - .{ .tag = @enumFromInt(2415), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmind_vvvmvl - .{ .tag = @enumFromInt(2416), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmind_vvvvl - .{ .tag = @enumFromInt(2417), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmins_vsvl - .{ .tag = @enumFromInt(2418), .properties = .{ .param_str = "V256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmins_vsvmvl - .{ .tag = @enumFromInt(2419), .properties = .{ .param_str = "V256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmins_vsvvl - .{ .tag = @enumFromInt(2420), .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmins_vvvl - .{ .tag = @enumFromInt(2421), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmins_vvvmvl - .{ .tag = @enumFromInt(2422), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmins_vvvvl - .{ .tag = @enumFromInt(2423), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkdeq_mvl - .{ .tag = @enumFromInt(2424), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkdeq_mvml - .{ .tag = @enumFromInt(2425), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkdeqnan_mvl - .{ .tag = @enumFromInt(2426), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkdeqnan_mvml - .{ .tag = @enumFromInt(2427), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkdge_mvl - .{ .tag = @enumFromInt(2428), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkdge_mvml - .{ .tag = @enumFromInt(2429), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkdgenan_mvl - .{ .tag = @enumFromInt(2430), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkdgenan_mvml - .{ .tag = @enumFromInt(2431), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkdgt_mvl - .{ .tag = @enumFromInt(2432), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkdgt_mvml - .{ .tag = @enumFromInt(2433), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkdgtnan_mvl - .{ .tag = @enumFromInt(2434), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkdgtnan_mvml - .{ .tag = @enumFromInt(2435), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkdle_mvl - .{ .tag = @enumFromInt(2436), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkdle_mvml - .{ .tag = @enumFromInt(2437), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkdlenan_mvl - .{ .tag = @enumFromInt(2438), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkdlenan_mvml - .{ .tag = @enumFromInt(2439), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkdlt_mvl - .{ .tag = @enumFromInt(2440), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkdlt_mvml - .{ .tag = @enumFromInt(2441), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkdltnan_mvl - .{ .tag = @enumFromInt(2442), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkdltnan_mvml - .{ .tag = @enumFromInt(2443), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkdnan_mvl - .{ .tag = @enumFromInt(2444), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkdnan_mvml - .{ .tag = @enumFromInt(2445), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkdne_mvl - .{ .tag = @enumFromInt(2446), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkdne_mvml - .{ .tag = @enumFromInt(2447), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkdnenan_mvl - .{ .tag = @enumFromInt(2448), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkdnenan_mvml - .{ .tag = @enumFromInt(2449), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkdnum_mvl - .{ .tag = @enumFromInt(2450), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkdnum_mvml - .{ .tag = @enumFromInt(2451), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmklaf_ml - .{ .tag = @enumFromInt(2452), .properties = .{ .param_str = "V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmklat_ml - .{ .tag = @enumFromInt(2453), .properties = .{ .param_str = "V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkleq_mvl - .{ .tag = @enumFromInt(2454), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkleq_mvml - .{ .tag = @enumFromInt(2455), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkleqnan_mvl - .{ .tag = @enumFromInt(2456), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkleqnan_mvml - .{ .tag = @enumFromInt(2457), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmklge_mvl - .{ .tag = @enumFromInt(2458), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmklge_mvml - .{ .tag = @enumFromInt(2459), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmklgenan_mvl - .{ .tag = @enumFromInt(2460), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmklgenan_mvml - .{ .tag = @enumFromInt(2461), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmklgt_mvl - .{ .tag = @enumFromInt(2462), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmklgt_mvml - .{ .tag = @enumFromInt(2463), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmklgtnan_mvl - .{ .tag = @enumFromInt(2464), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmklgtnan_mvml - .{ .tag = @enumFromInt(2465), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmklle_mvl - .{ .tag = @enumFromInt(2466), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmklle_mvml - .{ .tag = @enumFromInt(2467), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkllenan_mvl - .{ .tag = @enumFromInt(2468), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkllenan_mvml - .{ .tag = @enumFromInt(2469), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkllt_mvl - .{ .tag = @enumFromInt(2470), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkllt_mvml - .{ .tag = @enumFromInt(2471), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmklltnan_mvl - .{ .tag = @enumFromInt(2472), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmklltnan_mvml - .{ .tag = @enumFromInt(2473), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmklnan_mvl - .{ .tag = @enumFromInt(2474), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmklnan_mvml - .{ .tag = @enumFromInt(2475), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmklne_mvl - .{ .tag = @enumFromInt(2476), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmklne_mvml - .{ .tag = @enumFromInt(2477), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmklnenan_mvl - .{ .tag = @enumFromInt(2478), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmklnenan_mvml - .{ .tag = @enumFromInt(2479), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmklnum_mvl - .{ .tag = @enumFromInt(2480), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmklnum_mvml - .{ .tag = @enumFromInt(2481), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkseq_mvl - .{ .tag = @enumFromInt(2482), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkseq_mvml - .{ .tag = @enumFromInt(2483), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkseqnan_mvl - .{ .tag = @enumFromInt(2484), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkseqnan_mvml - .{ .tag = @enumFromInt(2485), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmksge_mvl - .{ .tag = @enumFromInt(2486), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmksge_mvml - .{ .tag = @enumFromInt(2487), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmksgenan_mvl - .{ .tag = @enumFromInt(2488), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmksgenan_mvml - .{ .tag = @enumFromInt(2489), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmksgt_mvl - .{ .tag = @enumFromInt(2490), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmksgt_mvml - .{ .tag = @enumFromInt(2491), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmksgtnan_mvl - .{ .tag = @enumFromInt(2492), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmksgtnan_mvml - .{ .tag = @enumFromInt(2493), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmksle_mvl - .{ .tag = @enumFromInt(2494), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmksle_mvml - .{ .tag = @enumFromInt(2495), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkslenan_mvl - .{ .tag = @enumFromInt(2496), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkslenan_mvml - .{ .tag = @enumFromInt(2497), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkslt_mvl - .{ .tag = @enumFromInt(2498), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkslt_mvml - .{ .tag = @enumFromInt(2499), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmksltnan_mvl - .{ .tag = @enumFromInt(2500), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmksltnan_mvml - .{ .tag = @enumFromInt(2501), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmksnan_mvl - .{ .tag = @enumFromInt(2502), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmksnan_mvml - .{ .tag = @enumFromInt(2503), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmksne_mvl - .{ .tag = @enumFromInt(2504), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmksne_mvml - .{ .tag = @enumFromInt(2505), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmksnenan_mvl - .{ .tag = @enumFromInt(2506), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmksnenan_mvml - .{ .tag = @enumFromInt(2507), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmksnum_mvl - .{ .tag = @enumFromInt(2508), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmksnum_mvml - .{ .tag = @enumFromInt(2509), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkweq_mvl - .{ .tag = @enumFromInt(2510), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkweq_mvml - .{ .tag = @enumFromInt(2511), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkweqnan_mvl - .{ .tag = @enumFromInt(2512), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkweqnan_mvml - .{ .tag = @enumFromInt(2513), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkwge_mvl - .{ .tag = @enumFromInt(2514), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkwge_mvml - .{ .tag = @enumFromInt(2515), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkwgenan_mvl - .{ .tag = @enumFromInt(2516), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkwgenan_mvml - .{ .tag = @enumFromInt(2517), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkwgt_mvl - .{ .tag = @enumFromInt(2518), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkwgt_mvml - .{ .tag = @enumFromInt(2519), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkwgtnan_mvl - .{ .tag = @enumFromInt(2520), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkwgtnan_mvml - .{ .tag = @enumFromInt(2521), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkwle_mvl - .{ .tag = @enumFromInt(2522), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkwle_mvml - .{ .tag = @enumFromInt(2523), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkwlenan_mvl - .{ .tag = @enumFromInt(2524), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkwlenan_mvml - .{ .tag = @enumFromInt(2525), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkwlt_mvl - .{ .tag = @enumFromInt(2526), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkwlt_mvml - .{ .tag = @enumFromInt(2527), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkwltnan_mvl - .{ .tag = @enumFromInt(2528), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkwltnan_mvml - .{ .tag = @enumFromInt(2529), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkwnan_mvl - .{ .tag = @enumFromInt(2530), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkwnan_mvml - .{ .tag = @enumFromInt(2531), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkwne_mvl - .{ .tag = @enumFromInt(2532), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkwne_mvml - .{ .tag = @enumFromInt(2533), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkwnenan_mvl - .{ .tag = @enumFromInt(2534), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkwnenan_mvml - .{ .tag = @enumFromInt(2535), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkwnum_mvl - .{ .tag = @enumFromInt(2536), .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmkwnum_mvml - .{ .tag = @enumFromInt(2537), .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmsbd_vsvvl - .{ .tag = @enumFromInt(2538), .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmsbd_vsvvmvl - .{ .tag = @enumFromInt(2539), .properties = .{ .param_str = "V256ddV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmsbd_vsvvvl - .{ .tag = @enumFromInt(2540), .properties = .{ .param_str = "V256ddV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmsbd_vvsvl - .{ .tag = @enumFromInt(2541), .properties = .{ .param_str = "V256dV256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmsbd_vvsvmvl - .{ .tag = @enumFromInt(2542), .properties = .{ .param_str = "V256dV256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmsbd_vvsvvl - .{ .tag = @enumFromInt(2543), .properties = .{ .param_str = "V256dV256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmsbd_vvvvl - .{ .tag = @enumFromInt(2544), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmsbd_vvvvmvl - .{ .tag = @enumFromInt(2545), .properties = .{ .param_str = "V256dV256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmsbd_vvvvvl - .{ .tag = @enumFromInt(2546), .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmsbs_vsvvl - .{ .tag = @enumFromInt(2547), .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmsbs_vsvvmvl - .{ .tag = @enumFromInt(2548), .properties = .{ .param_str = "V256dfV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmsbs_vsvvvl - .{ .tag = @enumFromInt(2549), .properties = .{ .param_str = "V256dfV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmsbs_vvsvl - .{ .tag = @enumFromInt(2550), .properties = .{ .param_str = "V256dV256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmsbs_vvsvmvl - .{ .tag = @enumFromInt(2551), .properties = .{ .param_str = "V256dV256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmsbs_vvsvvl - .{ .tag = @enumFromInt(2552), .properties = .{ .param_str = "V256dV256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmsbs_vvvvl - .{ .tag = @enumFromInt(2553), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmsbs_vvvvmvl - .{ .tag = @enumFromInt(2554), .properties = .{ .param_str = "V256dV256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmsbs_vvvvvl - .{ .tag = @enumFromInt(2555), .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmuld_vsvl - .{ .tag = @enumFromInt(2556), .properties = .{ .param_str = "V256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmuld_vsvmvl - .{ .tag = @enumFromInt(2557), .properties = .{ .param_str = "V256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmuld_vsvvl - .{ .tag = @enumFromInt(2558), .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmuld_vvvl - .{ .tag = @enumFromInt(2559), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmuld_vvvmvl - .{ .tag = @enumFromInt(2560), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmuld_vvvvl - .{ .tag = @enumFromInt(2561), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmuls_vsvl - .{ .tag = @enumFromInt(2562), .properties = .{ .param_str = "V256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmuls_vsvmvl - .{ .tag = @enumFromInt(2563), .properties = .{ .param_str = "V256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmuls_vsvvl - .{ .tag = @enumFromInt(2564), .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmuls_vvvl - .{ .tag = @enumFromInt(2565), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmuls_vvvmvl - .{ .tag = @enumFromInt(2566), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfmuls_vvvvl - .{ .tag = @enumFromInt(2567), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmadd_vsvvl - .{ .tag = @enumFromInt(2568), .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmadd_vsvvmvl - .{ .tag = @enumFromInt(2569), .properties = .{ .param_str = "V256ddV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmadd_vsvvvl - .{ .tag = @enumFromInt(2570), .properties = .{ .param_str = "V256ddV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmadd_vvsvl - .{ .tag = @enumFromInt(2571), .properties = .{ .param_str = "V256dV256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmadd_vvsvmvl - .{ .tag = @enumFromInt(2572), .properties = .{ .param_str = "V256dV256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmadd_vvsvvl - .{ .tag = @enumFromInt(2573), .properties = .{ .param_str = "V256dV256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmadd_vvvvl - .{ .tag = @enumFromInt(2574), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmadd_vvvvmvl - .{ .tag = @enumFromInt(2575), .properties = .{ .param_str = "V256dV256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmadd_vvvvvl - .{ .tag = @enumFromInt(2576), .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmads_vsvvl - .{ .tag = @enumFromInt(2577), .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmads_vsvvmvl - .{ .tag = @enumFromInt(2578), .properties = .{ .param_str = "V256dfV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmads_vsvvvl - .{ .tag = @enumFromInt(2579), .properties = .{ .param_str = "V256dfV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmads_vvsvl - .{ .tag = @enumFromInt(2580), .properties = .{ .param_str = "V256dV256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmads_vvsvmvl - .{ .tag = @enumFromInt(2581), .properties = .{ .param_str = "V256dV256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmads_vvsvvl - .{ .tag = @enumFromInt(2582), .properties = .{ .param_str = "V256dV256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmads_vvvvl - .{ .tag = @enumFromInt(2583), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmads_vvvvmvl - .{ .tag = @enumFromInt(2584), .properties = .{ .param_str = "V256dV256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmads_vvvvvl - .{ .tag = @enumFromInt(2585), .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmsbd_vsvvl - .{ .tag = @enumFromInt(2586), .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmsbd_vsvvmvl - .{ .tag = @enumFromInt(2587), .properties = .{ .param_str = "V256ddV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmsbd_vsvvvl - .{ .tag = @enumFromInt(2588), .properties = .{ .param_str = "V256ddV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmsbd_vvsvl - .{ .tag = @enumFromInt(2589), .properties = .{ .param_str = "V256dV256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmsbd_vvsvmvl - .{ .tag = @enumFromInt(2590), .properties = .{ .param_str = "V256dV256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmsbd_vvsvvl - .{ .tag = @enumFromInt(2591), .properties = .{ .param_str = "V256dV256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmsbd_vvvvl - .{ .tag = @enumFromInt(2592), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmsbd_vvvvmvl - .{ .tag = @enumFromInt(2593), .properties = .{ .param_str = "V256dV256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmsbd_vvvvvl - .{ .tag = @enumFromInt(2594), .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmsbs_vsvvl - .{ .tag = @enumFromInt(2595), .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmsbs_vsvvmvl - .{ .tag = @enumFromInt(2596), .properties = .{ .param_str = "V256dfV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmsbs_vsvvvl - .{ .tag = @enumFromInt(2597), .properties = .{ .param_str = "V256dfV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmsbs_vvsvl - .{ .tag = @enumFromInt(2598), .properties = .{ .param_str = "V256dV256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmsbs_vvsvmvl - .{ .tag = @enumFromInt(2599), .properties = .{ .param_str = "V256dV256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmsbs_vvsvvl - .{ .tag = @enumFromInt(2600), .properties = .{ .param_str = "V256dV256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmsbs_vvvvl - .{ .tag = @enumFromInt(2601), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmsbs_vvvvmvl - .{ .tag = @enumFromInt(2602), .properties = .{ .param_str = "V256dV256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfnmsbs_vvvvvl - .{ .tag = @enumFromInt(2603), .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfrmaxdfst_vvl - .{ .tag = @enumFromInt(2604), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfrmaxdfst_vvvl - .{ .tag = @enumFromInt(2605), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfrmaxdlst_vvl - .{ .tag = @enumFromInt(2606), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfrmaxdlst_vvvl - .{ .tag = @enumFromInt(2607), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfrmaxsfst_vvl - .{ .tag = @enumFromInt(2608), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfrmaxsfst_vvvl - .{ .tag = @enumFromInt(2609), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfrmaxslst_vvl - .{ .tag = @enumFromInt(2610), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfrmaxslst_vvvl - .{ .tag = @enumFromInt(2611), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfrmindfst_vvl - .{ .tag = @enumFromInt(2612), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfrmindfst_vvvl - .{ .tag = @enumFromInt(2613), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfrmindlst_vvl - .{ .tag = @enumFromInt(2614), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfrmindlst_vvvl - .{ .tag = @enumFromInt(2615), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfrminsfst_vvl - .{ .tag = @enumFromInt(2616), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfrminsfst_vvvl - .{ .tag = @enumFromInt(2617), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfrminslst_vvl - .{ .tag = @enumFromInt(2618), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfrminslst_vvvl - .{ .tag = @enumFromInt(2619), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfsqrtd_vvl - .{ .tag = @enumFromInt(2620), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfsqrtd_vvvl - .{ .tag = @enumFromInt(2621), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfsqrts_vvl - .{ .tag = @enumFromInt(2622), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfsqrts_vvvl - .{ .tag = @enumFromInt(2623), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfsubd_vsvl - .{ .tag = @enumFromInt(2624), .properties = .{ .param_str = "V256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfsubd_vsvmvl - .{ .tag = @enumFromInt(2625), .properties = .{ .param_str = "V256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfsubd_vsvvl - .{ .tag = @enumFromInt(2626), .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfsubd_vvvl - .{ .tag = @enumFromInt(2627), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfsubd_vvvmvl - .{ .tag = @enumFromInt(2628), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfsubd_vvvvl - .{ .tag = @enumFromInt(2629), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfsubs_vsvl - .{ .tag = @enumFromInt(2630), .properties = .{ .param_str = "V256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfsubs_vsvmvl - .{ .tag = @enumFromInt(2631), .properties = .{ .param_str = "V256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfsubs_vsvvl - .{ .tag = @enumFromInt(2632), .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfsubs_vvvl - .{ .tag = @enumFromInt(2633), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfsubs_vvvmvl - .{ .tag = @enumFromInt(2634), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfsubs_vvvvl - .{ .tag = @enumFromInt(2635), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfsumd_vvl - .{ .tag = @enumFromInt(2636), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfsumd_vvml - .{ .tag = @enumFromInt(2637), .properties = .{ .param_str = "V256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfsums_vvl - .{ .tag = @enumFromInt(2638), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vfsums_vvml - .{ .tag = @enumFromInt(2639), .properties = .{ .param_str = "V256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vgt_vvssl - .{ .tag = @enumFromInt(2640), .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vgt_vvssml - .{ .tag = @enumFromInt(2641), .properties = .{ .param_str = "V256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vgt_vvssmvl - .{ .tag = @enumFromInt(2642), .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vgt_vvssvl - .{ .tag = @enumFromInt(2643), .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vgtlsx_vvssl - .{ .tag = @enumFromInt(2644), .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vgtlsx_vvssml - .{ .tag = @enumFromInt(2645), .properties = .{ .param_str = "V256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vgtlsx_vvssmvl - .{ .tag = @enumFromInt(2646), .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vgtlsx_vvssvl - .{ .tag = @enumFromInt(2647), .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vgtlsxnc_vvssl - .{ .tag = @enumFromInt(2648), .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vgtlsxnc_vvssml - .{ .tag = @enumFromInt(2649), .properties = .{ .param_str = "V256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vgtlsxnc_vvssmvl - .{ .tag = @enumFromInt(2650), .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vgtlsxnc_vvssvl - .{ .tag = @enumFromInt(2651), .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vgtlzx_vvssl - .{ .tag = @enumFromInt(2652), .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vgtlzx_vvssml - .{ .tag = @enumFromInt(2653), .properties = .{ .param_str = "V256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vgtlzx_vvssmvl - .{ .tag = @enumFromInt(2654), .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vgtlzx_vvssvl - .{ .tag = @enumFromInt(2655), .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vgtlzxnc_vvssl - .{ .tag = @enumFromInt(2656), .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vgtlzxnc_vvssml - .{ .tag = @enumFromInt(2657), .properties = .{ .param_str = "V256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vgtlzxnc_vvssmvl - .{ .tag = @enumFromInt(2658), .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vgtlzxnc_vvssvl - .{ .tag = @enumFromInt(2659), .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vgtnc_vvssl - .{ .tag = @enumFromInt(2660), .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vgtnc_vvssml - .{ .tag = @enumFromInt(2661), .properties = .{ .param_str = "V256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vgtnc_vvssmvl - .{ .tag = @enumFromInt(2662), .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vgtnc_vvssvl - .{ .tag = @enumFromInt(2663), .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vgtu_vvssl - .{ .tag = @enumFromInt(2664), .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vgtu_vvssml - .{ .tag = @enumFromInt(2665), .properties = .{ .param_str = "V256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vgtu_vvssmvl - .{ .tag = @enumFromInt(2666), .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vgtu_vvssvl - .{ .tag = @enumFromInt(2667), .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vgtunc_vvssl - .{ .tag = @enumFromInt(2668), .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vgtunc_vvssml - .{ .tag = @enumFromInt(2669), .properties = .{ .param_str = "V256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vgtunc_vvssmvl - .{ .tag = @enumFromInt(2670), .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vgtunc_vvssvl - .{ .tag = @enumFromInt(2671), .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vld2d_vssl - .{ .tag = @enumFromInt(2672), .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vld2d_vssvl - .{ .tag = @enumFromInt(2673), .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vld2dnc_vssl - .{ .tag = @enumFromInt(2674), .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vld2dnc_vssvl - .{ .tag = @enumFromInt(2675), .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vld_vssl - .{ .tag = @enumFromInt(2676), .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vld_vssvl - .{ .tag = @enumFromInt(2677), .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vldl2dsx_vssl - .{ .tag = @enumFromInt(2678), .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vldl2dsx_vssvl - .{ .tag = @enumFromInt(2679), .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vldl2dsxnc_vssl - .{ .tag = @enumFromInt(2680), .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vldl2dsxnc_vssvl - .{ .tag = @enumFromInt(2681), .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vldl2dzx_vssl - .{ .tag = @enumFromInt(2682), .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vldl2dzx_vssvl - .{ .tag = @enumFromInt(2683), .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vldl2dzxnc_vssl - .{ .tag = @enumFromInt(2684), .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vldl2dzxnc_vssvl - .{ .tag = @enumFromInt(2685), .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vldlsx_vssl - .{ .tag = @enumFromInt(2686), .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vldlsx_vssvl - .{ .tag = @enumFromInt(2687), .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vldlsxnc_vssl - .{ .tag = @enumFromInt(2688), .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vldlsxnc_vssvl - .{ .tag = @enumFromInt(2689), .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vldlzx_vssl - .{ .tag = @enumFromInt(2690), .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vldlzx_vssvl - .{ .tag = @enumFromInt(2691), .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vldlzxnc_vssl - .{ .tag = @enumFromInt(2692), .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vldlzxnc_vssvl - .{ .tag = @enumFromInt(2693), .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vldnc_vssl - .{ .tag = @enumFromInt(2694), .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vldnc_vssvl - .{ .tag = @enumFromInt(2695), .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vldu2d_vssl - .{ .tag = @enumFromInt(2696), .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vldu2d_vssvl - .{ .tag = @enumFromInt(2697), .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vldu2dnc_vssl - .{ .tag = @enumFromInt(2698), .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vldu2dnc_vssvl - .{ .tag = @enumFromInt(2699), .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vldu_vssl - .{ .tag = @enumFromInt(2700), .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vldu_vssvl - .{ .tag = @enumFromInt(2701), .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vldunc_vssl - .{ .tag = @enumFromInt(2702), .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vldunc_vssvl - .{ .tag = @enumFromInt(2703), .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vldz_vvl - .{ .tag = @enumFromInt(2704), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vldz_vvmvl - .{ .tag = @enumFromInt(2705), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vldz_vvvl - .{ .tag = @enumFromInt(2706), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmaxsl_vsvl - .{ .tag = @enumFromInt(2707), .properties = .{ .param_str = "V256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmaxsl_vsvmvl - .{ .tag = @enumFromInt(2708), .properties = .{ .param_str = "V256dLiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmaxsl_vsvvl - .{ .tag = @enumFromInt(2709), .properties = .{ .param_str = "V256dLiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmaxsl_vvvl - .{ .tag = @enumFromInt(2710), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmaxsl_vvvmvl - .{ .tag = @enumFromInt(2711), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmaxsl_vvvvl - .{ .tag = @enumFromInt(2712), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmaxswsx_vsvl - .{ .tag = @enumFromInt(2713), .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmaxswsx_vsvmvl - .{ .tag = @enumFromInt(2714), .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmaxswsx_vsvvl - .{ .tag = @enumFromInt(2715), .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmaxswsx_vvvl - .{ .tag = @enumFromInt(2716), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmaxswsx_vvvmvl - .{ .tag = @enumFromInt(2717), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmaxswsx_vvvvl - .{ .tag = @enumFromInt(2718), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmaxswzx_vsvl - .{ .tag = @enumFromInt(2719), .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmaxswzx_vsvmvl - .{ .tag = @enumFromInt(2720), .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmaxswzx_vsvvl - .{ .tag = @enumFromInt(2721), .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmaxswzx_vvvl - .{ .tag = @enumFromInt(2722), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmaxswzx_vvvmvl - .{ .tag = @enumFromInt(2723), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmaxswzx_vvvvl - .{ .tag = @enumFromInt(2724), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vminsl_vsvl - .{ .tag = @enumFromInt(2725), .properties = .{ .param_str = "V256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vminsl_vsvmvl - .{ .tag = @enumFromInt(2726), .properties = .{ .param_str = "V256dLiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vminsl_vsvvl - .{ .tag = @enumFromInt(2727), .properties = .{ .param_str = "V256dLiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vminsl_vvvl - .{ .tag = @enumFromInt(2728), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vminsl_vvvmvl - .{ .tag = @enumFromInt(2729), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vminsl_vvvvl - .{ .tag = @enumFromInt(2730), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vminswsx_vsvl - .{ .tag = @enumFromInt(2731), .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vminswsx_vsvmvl - .{ .tag = @enumFromInt(2732), .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vminswsx_vsvvl - .{ .tag = @enumFromInt(2733), .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vminswsx_vvvl - .{ .tag = @enumFromInt(2734), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vminswsx_vvvmvl - .{ .tag = @enumFromInt(2735), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vminswsx_vvvvl - .{ .tag = @enumFromInt(2736), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vminswzx_vsvl - .{ .tag = @enumFromInt(2737), .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vminswzx_vsvmvl - .{ .tag = @enumFromInt(2738), .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vminswzx_vsvvl - .{ .tag = @enumFromInt(2739), .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vminswzx_vvvl - .{ .tag = @enumFromInt(2740), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vminswzx_vvvmvl - .{ .tag = @enumFromInt(2741), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vminswzx_vvvvl - .{ .tag = @enumFromInt(2742), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmrg_vsvml - .{ .tag = @enumFromInt(2743), .properties = .{ .param_str = "V256dLUiV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmrg_vsvmvl - .{ .tag = @enumFromInt(2744), .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmrg_vvvml - .{ .tag = @enumFromInt(2745), .properties = .{ .param_str = "V256dV256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmrg_vvvmvl - .{ .tag = @enumFromInt(2746), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmrgw_vsvMl - .{ .tag = @enumFromInt(2747), .properties = .{ .param_str = "V256dUiV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmrgw_vsvMvl - .{ .tag = @enumFromInt(2748), .properties = .{ .param_str = "V256dUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmrgw_vvvMl - .{ .tag = @enumFromInt(2749), .properties = .{ .param_str = "V256dV256dV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmrgw_vvvMvl - .{ .tag = @enumFromInt(2750), .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmulsl_vsvl - .{ .tag = @enumFromInt(2751), .properties = .{ .param_str = "V256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmulsl_vsvmvl - .{ .tag = @enumFromInt(2752), .properties = .{ .param_str = "V256dLiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmulsl_vsvvl - .{ .tag = @enumFromInt(2753), .properties = .{ .param_str = "V256dLiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmulsl_vvvl - .{ .tag = @enumFromInt(2754), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmulsl_vvvmvl - .{ .tag = @enumFromInt(2755), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmulsl_vvvvl - .{ .tag = @enumFromInt(2756), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmulslw_vsvl - .{ .tag = @enumFromInt(2757), .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmulslw_vsvvl - .{ .tag = @enumFromInt(2758), .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmulslw_vvvl - .{ .tag = @enumFromInt(2759), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmulslw_vvvvl - .{ .tag = @enumFromInt(2760), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmulswsx_vsvl - .{ .tag = @enumFromInt(2761), .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmulswsx_vsvmvl - .{ .tag = @enumFromInt(2762), .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmulswsx_vsvvl - .{ .tag = @enumFromInt(2763), .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmulswsx_vvvl - .{ .tag = @enumFromInt(2764), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmulswsx_vvvmvl - .{ .tag = @enumFromInt(2765), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmulswsx_vvvvl - .{ .tag = @enumFromInt(2766), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmulswzx_vsvl - .{ .tag = @enumFromInt(2767), .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmulswzx_vsvmvl - .{ .tag = @enumFromInt(2768), .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmulswzx_vsvvl - .{ .tag = @enumFromInt(2769), .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmulswzx_vvvl - .{ .tag = @enumFromInt(2770), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmulswzx_vvvmvl - .{ .tag = @enumFromInt(2771), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmulswzx_vvvvl - .{ .tag = @enumFromInt(2772), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmulul_vsvl - .{ .tag = @enumFromInt(2773), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmulul_vsvmvl - .{ .tag = @enumFromInt(2774), .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmulul_vsvvl - .{ .tag = @enumFromInt(2775), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmulul_vvvl - .{ .tag = @enumFromInt(2776), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmulul_vvvmvl - .{ .tag = @enumFromInt(2777), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmulul_vvvvl - .{ .tag = @enumFromInt(2778), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmuluw_vsvl - .{ .tag = @enumFromInt(2779), .properties = .{ .param_str = "V256dUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmuluw_vsvmvl - .{ .tag = @enumFromInt(2780), .properties = .{ .param_str = "V256dUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmuluw_vsvvl - .{ .tag = @enumFromInt(2781), .properties = .{ .param_str = "V256dUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmuluw_vvvl - .{ .tag = @enumFromInt(2782), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmuluw_vvvmvl - .{ .tag = @enumFromInt(2783), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmuluw_vvvvl - .{ .tag = @enumFromInt(2784), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmv_vsvl - .{ .tag = @enumFromInt(2785), .properties = .{ .param_str = "V256dUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmv_vsvmvl - .{ .tag = @enumFromInt(2786), .properties = .{ .param_str = "V256dUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vmv_vsvvl - .{ .tag = @enumFromInt(2787), .properties = .{ .param_str = "V256dUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vor_vsvl - .{ .tag = @enumFromInt(2788), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vor_vsvmvl - .{ .tag = @enumFromInt(2789), .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vor_vsvvl - .{ .tag = @enumFromInt(2790), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vor_vvvl - .{ .tag = @enumFromInt(2791), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vor_vvvmvl - .{ .tag = @enumFromInt(2792), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vor_vvvvl - .{ .tag = @enumFromInt(2793), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vpcnt_vvl - .{ .tag = @enumFromInt(2794), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vpcnt_vvmvl - .{ .tag = @enumFromInt(2795), .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vpcnt_vvvl - .{ .tag = @enumFromInt(2796), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrand_vvl - .{ .tag = @enumFromInt(2797), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrand_vvml - .{ .tag = @enumFromInt(2798), .properties = .{ .param_str = "V256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrcpd_vvl - .{ .tag = @enumFromInt(2799), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrcpd_vvvl - .{ .tag = @enumFromInt(2800), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrcps_vvl - .{ .tag = @enumFromInt(2801), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrcps_vvvl - .{ .tag = @enumFromInt(2802), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrmaxslfst_vvl - .{ .tag = @enumFromInt(2803), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrmaxslfst_vvvl - .{ .tag = @enumFromInt(2804), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrmaxsllst_vvl - .{ .tag = @enumFromInt(2805), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrmaxsllst_vvvl - .{ .tag = @enumFromInt(2806), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrmaxswfstsx_vvl - .{ .tag = @enumFromInt(2807), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrmaxswfstsx_vvvl - .{ .tag = @enumFromInt(2808), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrmaxswfstzx_vvl - .{ .tag = @enumFromInt(2809), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrmaxswfstzx_vvvl - .{ .tag = @enumFromInt(2810), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrmaxswlstsx_vvl - .{ .tag = @enumFromInt(2811), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrmaxswlstsx_vvvl - .{ .tag = @enumFromInt(2812), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrmaxswlstzx_vvl - .{ .tag = @enumFromInt(2813), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrmaxswlstzx_vvvl - .{ .tag = @enumFromInt(2814), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrminslfst_vvl - .{ .tag = @enumFromInt(2815), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrminslfst_vvvl - .{ .tag = @enumFromInt(2816), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrminsllst_vvl - .{ .tag = @enumFromInt(2817), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrminsllst_vvvl - .{ .tag = @enumFromInt(2818), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrminswfstsx_vvl - .{ .tag = @enumFromInt(2819), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrminswfstsx_vvvl - .{ .tag = @enumFromInt(2820), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrminswfstzx_vvl - .{ .tag = @enumFromInt(2821), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrminswfstzx_vvvl - .{ .tag = @enumFromInt(2822), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrminswlstsx_vvl - .{ .tag = @enumFromInt(2823), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrminswlstsx_vvvl - .{ .tag = @enumFromInt(2824), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrminswlstzx_vvl - .{ .tag = @enumFromInt(2825), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrminswlstzx_vvvl - .{ .tag = @enumFromInt(2826), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vror_vvl - .{ .tag = @enumFromInt(2827), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vror_vvml - .{ .tag = @enumFromInt(2828), .properties = .{ .param_str = "V256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrsqrtd_vvl - .{ .tag = @enumFromInt(2829), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrsqrtd_vvvl - .{ .tag = @enumFromInt(2830), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrsqrtdnex_vvl - .{ .tag = @enumFromInt(2831), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrsqrtdnex_vvvl - .{ .tag = @enumFromInt(2832), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrsqrts_vvl - .{ .tag = @enumFromInt(2833), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrsqrts_vvvl - .{ .tag = @enumFromInt(2834), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrsqrtsnex_vvl - .{ .tag = @enumFromInt(2835), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrsqrtsnex_vvvl - .{ .tag = @enumFromInt(2836), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrxor_vvl - .{ .tag = @enumFromInt(2837), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vrxor_vvml - .{ .tag = @enumFromInt(2838), .properties = .{ .param_str = "V256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsc_vvssl - .{ .tag = @enumFromInt(2839), .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsc_vvssml - .{ .tag = @enumFromInt(2840), .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vscl_vvssl - .{ .tag = @enumFromInt(2841), .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vscl_vvssml - .{ .tag = @enumFromInt(2842), .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsclnc_vvssl - .{ .tag = @enumFromInt(2843), .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsclnc_vvssml - .{ .tag = @enumFromInt(2844), .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsclncot_vvssl - .{ .tag = @enumFromInt(2845), .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsclncot_vvssml - .{ .tag = @enumFromInt(2846), .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsclot_vvssl - .{ .tag = @enumFromInt(2847), .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsclot_vvssml - .{ .tag = @enumFromInt(2848), .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vscnc_vvssl - .{ .tag = @enumFromInt(2849), .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vscnc_vvssml - .{ .tag = @enumFromInt(2850), .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vscncot_vvssl - .{ .tag = @enumFromInt(2851), .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vscncot_vvssml - .{ .tag = @enumFromInt(2852), .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vscot_vvssl - .{ .tag = @enumFromInt(2853), .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vscot_vvssml - .{ .tag = @enumFromInt(2854), .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vscu_vvssl - .{ .tag = @enumFromInt(2855), .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vscu_vvssml - .{ .tag = @enumFromInt(2856), .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vscunc_vvssl - .{ .tag = @enumFromInt(2857), .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vscunc_vvssml - .{ .tag = @enumFromInt(2858), .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vscuncot_vvssl - .{ .tag = @enumFromInt(2859), .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vscuncot_vvssml - .{ .tag = @enumFromInt(2860), .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vscuot_vvssl - .{ .tag = @enumFromInt(2861), .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vscuot_vvssml - .{ .tag = @enumFromInt(2862), .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vseq_vl - .{ .tag = @enumFromInt(2863), .properties = .{ .param_str = "V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vseq_vvl - .{ .tag = @enumFromInt(2864), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsfa_vvssl - .{ .tag = @enumFromInt(2865), .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsfa_vvssmvl - .{ .tag = @enumFromInt(2866), .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsfa_vvssvl - .{ .tag = @enumFromInt(2867), .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vshf_vvvsl - .{ .tag = @enumFromInt(2868), .properties = .{ .param_str = "V256dV256dV256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vshf_vvvsvl - .{ .tag = @enumFromInt(2869), .properties = .{ .param_str = "V256dV256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vslal_vvsl - .{ .tag = @enumFromInt(2870), .properties = .{ .param_str = "V256dV256dLiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vslal_vvsmvl - .{ .tag = @enumFromInt(2871), .properties = .{ .param_str = "V256dV256dLiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vslal_vvsvl - .{ .tag = @enumFromInt(2872), .properties = .{ .param_str = "V256dV256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vslal_vvvl - .{ .tag = @enumFromInt(2873), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vslal_vvvmvl - .{ .tag = @enumFromInt(2874), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vslal_vvvvl - .{ .tag = @enumFromInt(2875), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vslawsx_vvsl - .{ .tag = @enumFromInt(2876), .properties = .{ .param_str = "V256dV256diUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vslawsx_vvsmvl - .{ .tag = @enumFromInt(2877), .properties = .{ .param_str = "V256dV256diV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vslawsx_vvsvl - .{ .tag = @enumFromInt(2878), .properties = .{ .param_str = "V256dV256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vslawsx_vvvl - .{ .tag = @enumFromInt(2879), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vslawsx_vvvmvl - .{ .tag = @enumFromInt(2880), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vslawsx_vvvvl - .{ .tag = @enumFromInt(2881), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vslawzx_vvsl - .{ .tag = @enumFromInt(2882), .properties = .{ .param_str = "V256dV256diUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vslawzx_vvsmvl - .{ .tag = @enumFromInt(2883), .properties = .{ .param_str = "V256dV256diV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vslawzx_vvsvl - .{ .tag = @enumFromInt(2884), .properties = .{ .param_str = "V256dV256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vslawzx_vvvl - .{ .tag = @enumFromInt(2885), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vslawzx_vvvmvl - .{ .tag = @enumFromInt(2886), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vslawzx_vvvvl - .{ .tag = @enumFromInt(2887), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsll_vvsl - .{ .tag = @enumFromInt(2888), .properties = .{ .param_str = "V256dV256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsll_vvsmvl - .{ .tag = @enumFromInt(2889), .properties = .{ .param_str = "V256dV256dLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsll_vvsvl - .{ .tag = @enumFromInt(2890), .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsll_vvvl - .{ .tag = @enumFromInt(2891), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsll_vvvmvl - .{ .tag = @enumFromInt(2892), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsll_vvvvl - .{ .tag = @enumFromInt(2893), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsral_vvsl - .{ .tag = @enumFromInt(2894), .properties = .{ .param_str = "V256dV256dLiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsral_vvsmvl - .{ .tag = @enumFromInt(2895), .properties = .{ .param_str = "V256dV256dLiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsral_vvsvl - .{ .tag = @enumFromInt(2896), .properties = .{ .param_str = "V256dV256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsral_vvvl - .{ .tag = @enumFromInt(2897), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsral_vvvmvl - .{ .tag = @enumFromInt(2898), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsral_vvvvl - .{ .tag = @enumFromInt(2899), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsrawsx_vvsl - .{ .tag = @enumFromInt(2900), .properties = .{ .param_str = "V256dV256diUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsrawsx_vvsmvl - .{ .tag = @enumFromInt(2901), .properties = .{ .param_str = "V256dV256diV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsrawsx_vvsvl - .{ .tag = @enumFromInt(2902), .properties = .{ .param_str = "V256dV256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsrawsx_vvvl - .{ .tag = @enumFromInt(2903), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsrawsx_vvvmvl - .{ .tag = @enumFromInt(2904), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsrawsx_vvvvl - .{ .tag = @enumFromInt(2905), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsrawzx_vvsl - .{ .tag = @enumFromInt(2906), .properties = .{ .param_str = "V256dV256diUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsrawzx_vvsmvl - .{ .tag = @enumFromInt(2907), .properties = .{ .param_str = "V256dV256diV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsrawzx_vvsvl - .{ .tag = @enumFromInt(2908), .properties = .{ .param_str = "V256dV256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsrawzx_vvvl - .{ .tag = @enumFromInt(2909), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsrawzx_vvvmvl - .{ .tag = @enumFromInt(2910), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsrawzx_vvvvl - .{ .tag = @enumFromInt(2911), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsrl_vvsl - .{ .tag = @enumFromInt(2912), .properties = .{ .param_str = "V256dV256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsrl_vvsmvl - .{ .tag = @enumFromInt(2913), .properties = .{ .param_str = "V256dV256dLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsrl_vvsvl - .{ .tag = @enumFromInt(2914), .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsrl_vvvl - .{ .tag = @enumFromInt(2915), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsrl_vvvmvl - .{ .tag = @enumFromInt(2916), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsrl_vvvvl - .{ .tag = @enumFromInt(2917), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vst2d_vssl - .{ .tag = @enumFromInt(2918), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vst2d_vssml - .{ .tag = @enumFromInt(2919), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vst2dnc_vssl - .{ .tag = @enumFromInt(2920), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vst2dnc_vssml - .{ .tag = @enumFromInt(2921), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vst2dncot_vssl - .{ .tag = @enumFromInt(2922), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vst2dncot_vssml - .{ .tag = @enumFromInt(2923), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vst2dot_vssl - .{ .tag = @enumFromInt(2924), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vst2dot_vssml - .{ .tag = @enumFromInt(2925), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vst_vssl - .{ .tag = @enumFromInt(2926), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vst_vssml - .{ .tag = @enumFromInt(2927), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstl2d_vssl - .{ .tag = @enumFromInt(2928), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstl2d_vssml - .{ .tag = @enumFromInt(2929), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstl2dnc_vssl - .{ .tag = @enumFromInt(2930), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstl2dnc_vssml - .{ .tag = @enumFromInt(2931), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstl2dncot_vssl - .{ .tag = @enumFromInt(2932), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstl2dncot_vssml - .{ .tag = @enumFromInt(2933), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstl2dot_vssl - .{ .tag = @enumFromInt(2934), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstl2dot_vssml - .{ .tag = @enumFromInt(2935), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstl_vssl - .{ .tag = @enumFromInt(2936), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstl_vssml - .{ .tag = @enumFromInt(2937), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstlnc_vssl - .{ .tag = @enumFromInt(2938), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstlnc_vssml - .{ .tag = @enumFromInt(2939), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstlncot_vssl - .{ .tag = @enumFromInt(2940), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstlncot_vssml - .{ .tag = @enumFromInt(2941), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstlot_vssl - .{ .tag = @enumFromInt(2942), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstlot_vssml - .{ .tag = @enumFromInt(2943), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstnc_vssl - .{ .tag = @enumFromInt(2944), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstnc_vssml - .{ .tag = @enumFromInt(2945), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstncot_vssl - .{ .tag = @enumFromInt(2946), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstncot_vssml - .{ .tag = @enumFromInt(2947), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstot_vssl - .{ .tag = @enumFromInt(2948), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstot_vssml - .{ .tag = @enumFromInt(2949), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstu2d_vssl - .{ .tag = @enumFromInt(2950), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstu2d_vssml - .{ .tag = @enumFromInt(2951), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstu2dnc_vssl - .{ .tag = @enumFromInt(2952), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstu2dnc_vssml - .{ .tag = @enumFromInt(2953), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstu2dncot_vssl - .{ .tag = @enumFromInt(2954), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstu2dncot_vssml - .{ .tag = @enumFromInt(2955), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstu2dot_vssl - .{ .tag = @enumFromInt(2956), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstu2dot_vssml - .{ .tag = @enumFromInt(2957), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstu_vssl - .{ .tag = @enumFromInt(2958), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstu_vssml - .{ .tag = @enumFromInt(2959), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstunc_vssl - .{ .tag = @enumFromInt(2960), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstunc_vssml - .{ .tag = @enumFromInt(2961), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstuncot_vssl - .{ .tag = @enumFromInt(2962), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstuncot_vssml - .{ .tag = @enumFromInt(2963), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstuot_vssl - .{ .tag = @enumFromInt(2964), .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vstuot_vssml - .{ .tag = @enumFromInt(2965), .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsubsl_vsvl - .{ .tag = @enumFromInt(2966), .properties = .{ .param_str = "V256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsubsl_vsvmvl - .{ .tag = @enumFromInt(2967), .properties = .{ .param_str = "V256dLiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsubsl_vsvvl - .{ .tag = @enumFromInt(2968), .properties = .{ .param_str = "V256dLiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsubsl_vvvl - .{ .tag = @enumFromInt(2969), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsubsl_vvvmvl - .{ .tag = @enumFromInt(2970), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsubsl_vvvvl - .{ .tag = @enumFromInt(2971), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsubswsx_vsvl - .{ .tag = @enumFromInt(2972), .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsubswsx_vsvmvl - .{ .tag = @enumFromInt(2973), .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsubswsx_vsvvl - .{ .tag = @enumFromInt(2974), .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsubswsx_vvvl - .{ .tag = @enumFromInt(2975), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsubswsx_vvvmvl - .{ .tag = @enumFromInt(2976), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsubswsx_vvvvl - .{ .tag = @enumFromInt(2977), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsubswzx_vsvl - .{ .tag = @enumFromInt(2978), .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsubswzx_vsvmvl - .{ .tag = @enumFromInt(2979), .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsubswzx_vsvvl - .{ .tag = @enumFromInt(2980), .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsubswzx_vvvl - .{ .tag = @enumFromInt(2981), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsubswzx_vvvmvl - .{ .tag = @enumFromInt(2982), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsubswzx_vvvvl - .{ .tag = @enumFromInt(2983), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsubul_vsvl - .{ .tag = @enumFromInt(2984), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsubul_vsvmvl - .{ .tag = @enumFromInt(2985), .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsubul_vsvvl - .{ .tag = @enumFromInt(2986), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsubul_vvvl - .{ .tag = @enumFromInt(2987), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsubul_vvvmvl - .{ .tag = @enumFromInt(2988), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsubul_vvvvl - .{ .tag = @enumFromInt(2989), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsubuw_vsvl - .{ .tag = @enumFromInt(2990), .properties = .{ .param_str = "V256dUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsubuw_vsvmvl - .{ .tag = @enumFromInt(2991), .properties = .{ .param_str = "V256dUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsubuw_vsvvl - .{ .tag = @enumFromInt(2992), .properties = .{ .param_str = "V256dUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsubuw_vvvl - .{ .tag = @enumFromInt(2993), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsubuw_vvvmvl - .{ .tag = @enumFromInt(2994), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsubuw_vvvvl - .{ .tag = @enumFromInt(2995), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsuml_vvl - .{ .tag = @enumFromInt(2996), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsuml_vvml - .{ .tag = @enumFromInt(2997), .properties = .{ .param_str = "V256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsumwsx_vvl - .{ .tag = @enumFromInt(2998), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsumwsx_vvml - .{ .tag = @enumFromInt(2999), .properties = .{ .param_str = "V256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsumwzx_vvl - .{ .tag = @enumFromInt(3000), .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vsumwzx_vvml - .{ .tag = @enumFromInt(3001), .properties = .{ .param_str = "V256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vxor_vsvl - .{ .tag = @enumFromInt(3002), .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vxor_vsvmvl - .{ .tag = @enumFromInt(3003), .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vxor_vsvvl - .{ .tag = @enumFromInt(3004), .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vxor_vvvl - .{ .tag = @enumFromInt(3005), .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vxor_vvvmvl - .{ .tag = @enumFromInt(3006), .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_vxor_vvvvl - .{ .tag = @enumFromInt(3007), .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_xorm_MMM - .{ .tag = @enumFromInt(3008), .properties = .{ .param_str = "V512bV512bV512b", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_ve_vl_xorm_mmm - .{ .tag = @enumFromInt(3009), .properties = .{ .param_str = "V256bV256bV256b", .target_set = TargetSet.initOne(.vevl_gen) } }, - // __builtin_vfprintf - .{ .tag = @enumFromInt(3010), .properties = .{ .param_str = "iP*RcC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vprintf, .format_string_position = 1 } } }, - // __builtin_vfscanf - .{ .tag = @enumFromInt(3011), .properties = .{ .param_str = "iP*RcC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vscanf, .format_string_position = 1 } } }, - // __builtin_vprintf - .{ .tag = @enumFromInt(3012), .properties = .{ .param_str = "icC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vprintf } } }, - // __builtin_vscanf - .{ .tag = @enumFromInt(3013), .properties = .{ .param_str = "icC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vscanf } } }, - // __builtin_vsnprintf - .{ .tag = @enumFromInt(3014), .properties = .{ .param_str = "ic*RzcC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vprintf, .format_string_position = 2 } } }, - // __builtin_vsprintf - .{ .tag = @enumFromInt(3015), .properties = .{ .param_str = "ic*RcC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vprintf, .format_string_position = 1 } } }, - // __builtin_vsscanf - .{ .tag = @enumFromInt(3016), .properties = .{ .param_str = "icC*RcC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vscanf, .format_string_position = 1 } } }, - // __builtin_wasm_max_f32 - .{ .tag = @enumFromInt(3017), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, - // __builtin_wasm_max_f64 - .{ .tag = @enumFromInt(3018), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, - // __builtin_wasm_memory_grow - .{ .tag = @enumFromInt(3019), .properties = .{ .param_str = "zIiz", .target_set = TargetSet.initOne(.webassembly) } }, - // __builtin_wasm_memory_size - .{ .tag = @enumFromInt(3020), .properties = .{ .param_str = "zIi", .target_set = TargetSet.initOne(.webassembly) } }, - // __builtin_wasm_min_f32 - .{ .tag = @enumFromInt(3021), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, - // __builtin_wasm_min_f64 - .{ .tag = @enumFromInt(3022), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, - // __builtin_wasm_trunc_s_i32_f32 - .{ .tag = @enumFromInt(3023), .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, - // __builtin_wasm_trunc_s_i32_f64 - .{ .tag = @enumFromInt(3024), .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, - // __builtin_wasm_trunc_s_i64_f32 - .{ .tag = @enumFromInt(3025), .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, - // __builtin_wasm_trunc_s_i64_f64 - .{ .tag = @enumFromInt(3026), .properties = .{ .param_str = "LLid", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, - // __builtin_wasm_trunc_u_i32_f32 - .{ .tag = @enumFromInt(3027), .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, - // __builtin_wasm_trunc_u_i32_f64 - .{ .tag = @enumFromInt(3028), .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, - // __builtin_wasm_trunc_u_i64_f32 - .{ .tag = @enumFromInt(3029), .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, - // __builtin_wasm_trunc_u_i64_f64 - .{ .tag = @enumFromInt(3030), .properties = .{ .param_str = "LLid", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, - // __builtin_wcschr - .{ .tag = @enumFromInt(3031), .properties = .{ .param_str = "w*wC*w", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_wcscmp - .{ .tag = @enumFromInt(3032), .properties = .{ .param_str = "iwC*wC*", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_wcslen - .{ .tag = @enumFromInt(3033), .properties = .{ .param_str = "zwC*", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_wcsncmp - .{ .tag = @enumFromInt(3034), .properties = .{ .param_str = "iwC*wC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_wmemchr - .{ .tag = @enumFromInt(3035), .properties = .{ .param_str = "w*wC*wz", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_wmemcmp - .{ .tag = @enumFromInt(3036), .properties = .{ .param_str = "iwC*wC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_wmemcpy - .{ .tag = @enumFromInt(3037), .properties = .{ .param_str = "w*w*wC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __builtin_wmemmove - .{ .tag = @enumFromInt(3038), .properties = .{ .param_str = "w*w*wC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, - // __c11_atomic_compare_exchange_strong - .{ .tag = @enumFromInt(3039), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __c11_atomic_compare_exchange_weak - .{ .tag = @enumFromInt(3040), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __c11_atomic_exchange - .{ .tag = @enumFromInt(3041), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __c11_atomic_fetch_add - .{ .tag = @enumFromInt(3042), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __c11_atomic_fetch_and - .{ .tag = @enumFromInt(3043), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __c11_atomic_fetch_max - .{ .tag = @enumFromInt(3044), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __c11_atomic_fetch_min - .{ .tag = @enumFromInt(3045), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __c11_atomic_fetch_nand - .{ .tag = @enumFromInt(3046), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __c11_atomic_fetch_or - .{ .tag = @enumFromInt(3047), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __c11_atomic_fetch_sub - .{ .tag = @enumFromInt(3048), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __c11_atomic_fetch_xor - .{ .tag = @enumFromInt(3049), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __c11_atomic_init - .{ .tag = @enumFromInt(3050), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __c11_atomic_is_lock_free - .{ .tag = @enumFromInt(3051), .properties = .{ .param_str = "bz", .attributes = .{ .const_evaluable = true } } }, - // __c11_atomic_load - .{ .tag = @enumFromInt(3052), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __c11_atomic_signal_fence - .{ .tag = @enumFromInt(3053), .properties = .{ .param_str = "vi" } }, - // __c11_atomic_store - .{ .tag = @enumFromInt(3054), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __c11_atomic_thread_fence - .{ .tag = @enumFromInt(3055), .properties = .{ .param_str = "vi" } }, - // __clear_cache - .{ .tag = @enumFromInt(3056), .properties = .{ .param_str = "vv*v*", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, - // __cospi - .{ .tag = @enumFromInt(3057), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __cospif - .{ .tag = @enumFromInt(3058), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __debugbreak - .{ .tag = @enumFromInt(3059), .properties = .{ .param_str = "v", .language = .all_ms_languages } }, - // __dmb - .{ .tag = @enumFromInt(3060), .properties = .{ .param_str = "vUi", .language = .all_ms_languages, .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, - // __dsb - .{ .tag = @enumFromInt(3061), .properties = .{ .param_str = "vUi", .language = .all_ms_languages, .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, - // __emit - .{ .tag = @enumFromInt(3062), .properties = .{ .param_str = "vIUiC", .language = .all_ms_languages, .target_set = TargetSet.initOne(.arm) } }, - // __exception_code - .{ .tag = @enumFromInt(3063), .properties = .{ .param_str = "UNi", .language = .all_ms_languages } }, - // __exception_info - .{ .tag = @enumFromInt(3064), .properties = .{ .param_str = "v*", .language = .all_ms_languages } }, - // __exp10 - .{ .tag = @enumFromInt(3065), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __exp10f - .{ .tag = @enumFromInt(3066), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __fastfail - .{ .tag = @enumFromInt(3067), .properties = .{ .param_str = "vUi", .language = .all_ms_languages, .attributes = .{ .noreturn = true } } }, - // __finite - .{ .tag = @enumFromInt(3068), .properties = .{ .param_str = "id", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // __finitef - .{ .tag = @enumFromInt(3069), .properties = .{ .param_str = "if", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // __finitel - .{ .tag = @enumFromInt(3070), .properties = .{ .param_str = "iLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // __isb - .{ .tag = @enumFromInt(3071), .properties = .{ .param_str = "vUi", .language = .all_ms_languages, .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, - // __iso_volatile_load16 - .{ .tag = @enumFromInt(3072), .properties = .{ .param_str = "ssCD*", .language = .all_ms_languages } }, - // __iso_volatile_load32 - .{ .tag = @enumFromInt(3073), .properties = .{ .param_str = "iiCD*", .language = .all_ms_languages } }, - // __iso_volatile_load64 - .{ .tag = @enumFromInt(3074), .properties = .{ .param_str = "LLiLLiCD*", .language = .all_ms_languages } }, - // __iso_volatile_load8 - .{ .tag = @enumFromInt(3075), .properties = .{ .param_str = "ccCD*", .language = .all_ms_languages } }, - // __iso_volatile_store16 - .{ .tag = @enumFromInt(3076), .properties = .{ .param_str = "vsD*s", .language = .all_ms_languages } }, - // __iso_volatile_store32 - .{ .tag = @enumFromInt(3077), .properties = .{ .param_str = "viD*i", .language = .all_ms_languages } }, - // __iso_volatile_store64 - .{ .tag = @enumFromInt(3078), .properties = .{ .param_str = "vLLiD*LLi", .language = .all_ms_languages } }, - // __iso_volatile_store8 - .{ .tag = @enumFromInt(3079), .properties = .{ .param_str = "vcD*c", .language = .all_ms_languages } }, - // __ldrexd - .{ .tag = @enumFromInt(3080), .properties = .{ .param_str = "WiWiCD*", .language = .all_ms_languages, .target_set = TargetSet.initOne(.arm) } }, - // __lzcnt - .{ .tag = @enumFromInt(3081), .properties = .{ .param_str = "UiUi", .language = .all_ms_languages, .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __lzcnt16 - .{ .tag = @enumFromInt(3082), .properties = .{ .param_str = "UsUs", .language = .all_ms_languages, .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __lzcnt64 - .{ .tag = @enumFromInt(3083), .properties = .{ .param_str = "UWiUWi", .language = .all_ms_languages, .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __noop - .{ .tag = @enumFromInt(3084), .properties = .{ .param_str = "i.", .language = .all_ms_languages } }, - // __nvvm_add_rm_d - .{ .tag = @enumFromInt(3085), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_add_rm_f - .{ .tag = @enumFromInt(3086), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_add_rm_ftz_f - .{ .tag = @enumFromInt(3087), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_add_rn_d - .{ .tag = @enumFromInt(3088), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_add_rn_f - .{ .tag = @enumFromInt(3089), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_add_rn_ftz_f - .{ .tag = @enumFromInt(3090), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_add_rp_d - .{ .tag = @enumFromInt(3091), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_add_rp_f - .{ .tag = @enumFromInt(3092), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_add_rp_ftz_f - .{ .tag = @enumFromInt(3093), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_add_rz_d - .{ .tag = @enumFromInt(3094), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_add_rz_f - .{ .tag = @enumFromInt(3095), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_add_rz_ftz_f - .{ .tag = @enumFromInt(3096), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_add_gen_f - .{ .tag = @enumFromInt(3097), .properties = .{ .param_str = "ffD*f", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_add_gen_i - .{ .tag = @enumFromInt(3098), .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_add_gen_l - .{ .tag = @enumFromInt(3099), .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_add_gen_ll - .{ .tag = @enumFromInt(3100), .properties = .{ .param_str = "LLiLLiD*LLi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_and_gen_i - .{ .tag = @enumFromInt(3101), .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_and_gen_l - .{ .tag = @enumFromInt(3102), .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_and_gen_ll - .{ .tag = @enumFromInt(3103), .properties = .{ .param_str = "LLiLLiD*LLi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_cas_gen_i - .{ .tag = @enumFromInt(3104), .properties = .{ .param_str = "iiD*ii", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_cas_gen_l - .{ .tag = @enumFromInt(3105), .properties = .{ .param_str = "LiLiD*LiLi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_cas_gen_ll - .{ .tag = @enumFromInt(3106), .properties = .{ .param_str = "LLiLLiD*LLiLLi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_dec_gen_ui - .{ .tag = @enumFromInt(3107), .properties = .{ .param_str = "UiUiD*Ui", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_inc_gen_ui - .{ .tag = @enumFromInt(3108), .properties = .{ .param_str = "UiUiD*Ui", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_max_gen_i - .{ .tag = @enumFromInt(3109), .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_max_gen_l - .{ .tag = @enumFromInt(3110), .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_max_gen_ll - .{ .tag = @enumFromInt(3111), .properties = .{ .param_str = "LLiLLiD*LLi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_max_gen_ui - .{ .tag = @enumFromInt(3112), .properties = .{ .param_str = "UiUiD*Ui", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_max_gen_ul - .{ .tag = @enumFromInt(3113), .properties = .{ .param_str = "ULiULiD*ULi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_max_gen_ull - .{ .tag = @enumFromInt(3114), .properties = .{ .param_str = "ULLiULLiD*ULLi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_min_gen_i - .{ .tag = @enumFromInt(3115), .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_min_gen_l - .{ .tag = @enumFromInt(3116), .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_min_gen_ll - .{ .tag = @enumFromInt(3117), .properties = .{ .param_str = "LLiLLiD*LLi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_min_gen_ui - .{ .tag = @enumFromInt(3118), .properties = .{ .param_str = "UiUiD*Ui", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_min_gen_ul - .{ .tag = @enumFromInt(3119), .properties = .{ .param_str = "ULiULiD*ULi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_min_gen_ull - .{ .tag = @enumFromInt(3120), .properties = .{ .param_str = "ULLiULLiD*ULLi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_or_gen_i - .{ .tag = @enumFromInt(3121), .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_or_gen_l - .{ .tag = @enumFromInt(3122), .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_or_gen_ll - .{ .tag = @enumFromInt(3123), .properties = .{ .param_str = "LLiLLiD*LLi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_sub_gen_i - .{ .tag = @enumFromInt(3124), .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_sub_gen_l - .{ .tag = @enumFromInt(3125), .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_sub_gen_ll - .{ .tag = @enumFromInt(3126), .properties = .{ .param_str = "LLiLLiD*LLi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_xchg_gen_i - .{ .tag = @enumFromInt(3127), .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_xchg_gen_l - .{ .tag = @enumFromInt(3128), .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_xchg_gen_ll - .{ .tag = @enumFromInt(3129), .properties = .{ .param_str = "LLiLLiD*LLi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_xor_gen_i - .{ .tag = @enumFromInt(3130), .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_xor_gen_l - .{ .tag = @enumFromInt(3131), .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_atom_xor_gen_ll - .{ .tag = @enumFromInt(3132), .properties = .{ .param_str = "LLiLLiD*LLi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_bar0_and - .{ .tag = @enumFromInt(3133), .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_bar0_or - .{ .tag = @enumFromInt(3134), .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_bar0_popc - .{ .tag = @enumFromInt(3135), .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_bar_sync - .{ .tag = @enumFromInt(3136), .properties = .{ .param_str = "vi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_bitcast_d2ll - .{ .tag = @enumFromInt(3137), .properties = .{ .param_str = "LLid", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_bitcast_f2i - .{ .tag = @enumFromInt(3138), .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_bitcast_i2f - .{ .tag = @enumFromInt(3139), .properties = .{ .param_str = "fi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_bitcast_ll2d - .{ .tag = @enumFromInt(3140), .properties = .{ .param_str = "dLLi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ceil_d - .{ .tag = @enumFromInt(3141), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ceil_f - .{ .tag = @enumFromInt(3142), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ceil_ftz_f - .{ .tag = @enumFromInt(3143), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_compiler_error - .{ .tag = @enumFromInt(3144), .properties = .{ .param_str = "vcC*4", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_compiler_warn - .{ .tag = @enumFromInt(3145), .properties = .{ .param_str = "vcC*4", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_cos_approx_f - .{ .tag = @enumFromInt(3146), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_cos_approx_ftz_f - .{ .tag = @enumFromInt(3147), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_d2f_rm - .{ .tag = @enumFromInt(3148), .properties = .{ .param_str = "fd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_d2f_rm_ftz - .{ .tag = @enumFromInt(3149), .properties = .{ .param_str = "fd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_d2f_rn - .{ .tag = @enumFromInt(3150), .properties = .{ .param_str = "fd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_d2f_rn_ftz - .{ .tag = @enumFromInt(3151), .properties = .{ .param_str = "fd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_d2f_rp - .{ .tag = @enumFromInt(3152), .properties = .{ .param_str = "fd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_d2f_rp_ftz - .{ .tag = @enumFromInt(3153), .properties = .{ .param_str = "fd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_d2f_rz - .{ .tag = @enumFromInt(3154), .properties = .{ .param_str = "fd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_d2f_rz_ftz - .{ .tag = @enumFromInt(3155), .properties = .{ .param_str = "fd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_d2i_hi - .{ .tag = @enumFromInt(3156), .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_d2i_lo - .{ .tag = @enumFromInt(3157), .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_d2i_rm - .{ .tag = @enumFromInt(3158), .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_d2i_rn - .{ .tag = @enumFromInt(3159), .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_d2i_rp - .{ .tag = @enumFromInt(3160), .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_d2i_rz - .{ .tag = @enumFromInt(3161), .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_d2ll_rm - .{ .tag = @enumFromInt(3162), .properties = .{ .param_str = "LLid", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_d2ll_rn - .{ .tag = @enumFromInt(3163), .properties = .{ .param_str = "LLid", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_d2ll_rp - .{ .tag = @enumFromInt(3164), .properties = .{ .param_str = "LLid", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_d2ll_rz - .{ .tag = @enumFromInt(3165), .properties = .{ .param_str = "LLid", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_d2ui_rm - .{ .tag = @enumFromInt(3166), .properties = .{ .param_str = "Uid", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_d2ui_rn - .{ .tag = @enumFromInt(3167), .properties = .{ .param_str = "Uid", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_d2ui_rp - .{ .tag = @enumFromInt(3168), .properties = .{ .param_str = "Uid", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_d2ui_rz - .{ .tag = @enumFromInt(3169), .properties = .{ .param_str = "Uid", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_d2ull_rm - .{ .tag = @enumFromInt(3170), .properties = .{ .param_str = "ULLid", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_d2ull_rn - .{ .tag = @enumFromInt(3171), .properties = .{ .param_str = "ULLid", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_d2ull_rp - .{ .tag = @enumFromInt(3172), .properties = .{ .param_str = "ULLid", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_d2ull_rz - .{ .tag = @enumFromInt(3173), .properties = .{ .param_str = "ULLid", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_div_approx_f - .{ .tag = @enumFromInt(3174), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_div_approx_ftz_f - .{ .tag = @enumFromInt(3175), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_div_rm_d - .{ .tag = @enumFromInt(3176), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_div_rm_f - .{ .tag = @enumFromInt(3177), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_div_rm_ftz_f - .{ .tag = @enumFromInt(3178), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_div_rn_d - .{ .tag = @enumFromInt(3179), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_div_rn_f - .{ .tag = @enumFromInt(3180), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_div_rn_ftz_f - .{ .tag = @enumFromInt(3181), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_div_rp_d - .{ .tag = @enumFromInt(3182), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_div_rp_f - .{ .tag = @enumFromInt(3183), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_div_rp_ftz_f - .{ .tag = @enumFromInt(3184), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_div_rz_d - .{ .tag = @enumFromInt(3185), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_div_rz_f - .{ .tag = @enumFromInt(3186), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_div_rz_ftz_f - .{ .tag = @enumFromInt(3187), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ex2_approx_d - .{ .tag = @enumFromInt(3188), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ex2_approx_f - .{ .tag = @enumFromInt(3189), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ex2_approx_ftz_f - .{ .tag = @enumFromInt(3190), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2h_rn - .{ .tag = @enumFromInt(3191), .properties = .{ .param_str = "Usf", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2h_rn_ftz - .{ .tag = @enumFromInt(3192), .properties = .{ .param_str = "Usf", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2i_rm - .{ .tag = @enumFromInt(3193), .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2i_rm_ftz - .{ .tag = @enumFromInt(3194), .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2i_rn - .{ .tag = @enumFromInt(3195), .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2i_rn_ftz - .{ .tag = @enumFromInt(3196), .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2i_rp - .{ .tag = @enumFromInt(3197), .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2i_rp_ftz - .{ .tag = @enumFromInt(3198), .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2i_rz - .{ .tag = @enumFromInt(3199), .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2i_rz_ftz - .{ .tag = @enumFromInt(3200), .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2ll_rm - .{ .tag = @enumFromInt(3201), .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2ll_rm_ftz - .{ .tag = @enumFromInt(3202), .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2ll_rn - .{ .tag = @enumFromInt(3203), .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2ll_rn_ftz - .{ .tag = @enumFromInt(3204), .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2ll_rp - .{ .tag = @enumFromInt(3205), .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2ll_rp_ftz - .{ .tag = @enumFromInt(3206), .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2ll_rz - .{ .tag = @enumFromInt(3207), .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2ll_rz_ftz - .{ .tag = @enumFromInt(3208), .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2ui_rm - .{ .tag = @enumFromInt(3209), .properties = .{ .param_str = "Uif", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2ui_rm_ftz - .{ .tag = @enumFromInt(3210), .properties = .{ .param_str = "Uif", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2ui_rn - .{ .tag = @enumFromInt(3211), .properties = .{ .param_str = "Uif", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2ui_rn_ftz - .{ .tag = @enumFromInt(3212), .properties = .{ .param_str = "Uif", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2ui_rp - .{ .tag = @enumFromInt(3213), .properties = .{ .param_str = "Uif", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2ui_rp_ftz - .{ .tag = @enumFromInt(3214), .properties = .{ .param_str = "Uif", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2ui_rz - .{ .tag = @enumFromInt(3215), .properties = .{ .param_str = "Uif", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2ui_rz_ftz - .{ .tag = @enumFromInt(3216), .properties = .{ .param_str = "Uif", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2ull_rm - .{ .tag = @enumFromInt(3217), .properties = .{ .param_str = "ULLif", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2ull_rm_ftz - .{ .tag = @enumFromInt(3218), .properties = .{ .param_str = "ULLif", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2ull_rn - .{ .tag = @enumFromInt(3219), .properties = .{ .param_str = "ULLif", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2ull_rn_ftz - .{ .tag = @enumFromInt(3220), .properties = .{ .param_str = "ULLif", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2ull_rp - .{ .tag = @enumFromInt(3221), .properties = .{ .param_str = "ULLif", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2ull_rp_ftz - .{ .tag = @enumFromInt(3222), .properties = .{ .param_str = "ULLif", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2ull_rz - .{ .tag = @enumFromInt(3223), .properties = .{ .param_str = "ULLif", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_f2ull_rz_ftz - .{ .tag = @enumFromInt(3224), .properties = .{ .param_str = "ULLif", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_fabs_d - .{ .tag = @enumFromInt(3225), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_fabs_f - .{ .tag = @enumFromInt(3226), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_fabs_ftz_f - .{ .tag = @enumFromInt(3227), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_floor_d - .{ .tag = @enumFromInt(3228), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_floor_f - .{ .tag = @enumFromInt(3229), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_floor_ftz_f - .{ .tag = @enumFromInt(3230), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_fma_rm_d - .{ .tag = @enumFromInt(3231), .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_fma_rm_f - .{ .tag = @enumFromInt(3232), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_fma_rm_ftz_f - .{ .tag = @enumFromInt(3233), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_fma_rn_d - .{ .tag = @enumFromInt(3234), .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_fma_rn_f - .{ .tag = @enumFromInt(3235), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_fma_rn_ftz_f - .{ .tag = @enumFromInt(3236), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_fma_rp_d - .{ .tag = @enumFromInt(3237), .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_fma_rp_f - .{ .tag = @enumFromInt(3238), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_fma_rp_ftz_f - .{ .tag = @enumFromInt(3239), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_fma_rz_d - .{ .tag = @enumFromInt(3240), .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_fma_rz_f - .{ .tag = @enumFromInt(3241), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_fma_rz_ftz_f - .{ .tag = @enumFromInt(3242), .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_fmax_d - .{ .tag = @enumFromInt(3243), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_fmax_f - .{ .tag = @enumFromInt(3244), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_fmax_ftz_f - .{ .tag = @enumFromInt(3245), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_fmin_d - .{ .tag = @enumFromInt(3246), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_fmin_f - .{ .tag = @enumFromInt(3247), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_fmin_ftz_f - .{ .tag = @enumFromInt(3248), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_i2d_rm - .{ .tag = @enumFromInt(3249), .properties = .{ .param_str = "di", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_i2d_rn - .{ .tag = @enumFromInt(3250), .properties = .{ .param_str = "di", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_i2d_rp - .{ .tag = @enumFromInt(3251), .properties = .{ .param_str = "di", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_i2d_rz - .{ .tag = @enumFromInt(3252), .properties = .{ .param_str = "di", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_i2f_rm - .{ .tag = @enumFromInt(3253), .properties = .{ .param_str = "fi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_i2f_rn - .{ .tag = @enumFromInt(3254), .properties = .{ .param_str = "fi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_i2f_rp - .{ .tag = @enumFromInt(3255), .properties = .{ .param_str = "fi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_i2f_rz - .{ .tag = @enumFromInt(3256), .properties = .{ .param_str = "fi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_isspacep_const - .{ .tag = @enumFromInt(3257), .properties = .{ .param_str = "bvC*", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, - // __nvvm_isspacep_global - .{ .tag = @enumFromInt(3258), .properties = .{ .param_str = "bvC*", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, - // __nvvm_isspacep_local - .{ .tag = @enumFromInt(3259), .properties = .{ .param_str = "bvC*", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, - // __nvvm_isspacep_shared - .{ .tag = @enumFromInt(3260), .properties = .{ .param_str = "bvC*", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, - // __nvvm_ldg_c - .{ .tag = @enumFromInt(3261), .properties = .{ .param_str = "ccC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_c2 - .{ .tag = @enumFromInt(3262), .properties = .{ .param_str = "E2cE2cC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_c4 - .{ .tag = @enumFromInt(3263), .properties = .{ .param_str = "E4cE4cC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_d - .{ .tag = @enumFromInt(3264), .properties = .{ .param_str = "ddC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_d2 - .{ .tag = @enumFromInt(3265), .properties = .{ .param_str = "E2dE2dC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_f - .{ .tag = @enumFromInt(3266), .properties = .{ .param_str = "ffC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_f2 - .{ .tag = @enumFromInt(3267), .properties = .{ .param_str = "E2fE2fC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_f4 - .{ .tag = @enumFromInt(3268), .properties = .{ .param_str = "E4fE4fC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_h - .{ .tag = @enumFromInt(3269), .properties = .{ .param_str = "hhC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_h2 - .{ .tag = @enumFromInt(3270), .properties = .{ .param_str = "E2hE2hC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_i - .{ .tag = @enumFromInt(3271), .properties = .{ .param_str = "iiC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_i2 - .{ .tag = @enumFromInt(3272), .properties = .{ .param_str = "E2iE2iC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_i4 - .{ .tag = @enumFromInt(3273), .properties = .{ .param_str = "E4iE4iC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_l - .{ .tag = @enumFromInt(3274), .properties = .{ .param_str = "LiLiC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_l2 - .{ .tag = @enumFromInt(3275), .properties = .{ .param_str = "E2LiE2LiC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_ll - .{ .tag = @enumFromInt(3276), .properties = .{ .param_str = "LLiLLiC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_ll2 - .{ .tag = @enumFromInt(3277), .properties = .{ .param_str = "E2LLiE2LLiC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_s - .{ .tag = @enumFromInt(3278), .properties = .{ .param_str = "ssC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_s2 - .{ .tag = @enumFromInt(3279), .properties = .{ .param_str = "E2sE2sC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_s4 - .{ .tag = @enumFromInt(3280), .properties = .{ .param_str = "E4sE4sC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_sc - .{ .tag = @enumFromInt(3281), .properties = .{ .param_str = "ScScC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_sc2 - .{ .tag = @enumFromInt(3282), .properties = .{ .param_str = "E2ScE2ScC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_sc4 - .{ .tag = @enumFromInt(3283), .properties = .{ .param_str = "E4ScE4ScC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_uc - .{ .tag = @enumFromInt(3284), .properties = .{ .param_str = "UcUcC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_uc2 - .{ .tag = @enumFromInt(3285), .properties = .{ .param_str = "E2UcE2UcC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_uc4 - .{ .tag = @enumFromInt(3286), .properties = .{ .param_str = "E4UcE4UcC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_ui - .{ .tag = @enumFromInt(3287), .properties = .{ .param_str = "UiUiC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_ui2 - .{ .tag = @enumFromInt(3288), .properties = .{ .param_str = "E2UiE2UiC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_ui4 - .{ .tag = @enumFromInt(3289), .properties = .{ .param_str = "E4UiE4UiC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_ul - .{ .tag = @enumFromInt(3290), .properties = .{ .param_str = "ULiULiC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_ul2 - .{ .tag = @enumFromInt(3291), .properties = .{ .param_str = "E2ULiE2ULiC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_ull - .{ .tag = @enumFromInt(3292), .properties = .{ .param_str = "ULLiULLiC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_ull2 - .{ .tag = @enumFromInt(3293), .properties = .{ .param_str = "E2ULLiE2ULLiC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_us - .{ .tag = @enumFromInt(3294), .properties = .{ .param_str = "UsUsC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_us2 - .{ .tag = @enumFromInt(3295), .properties = .{ .param_str = "E2UsE2UsC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldg_us4 - .{ .tag = @enumFromInt(3296), .properties = .{ .param_str = "E4UsE4UsC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_c - .{ .tag = @enumFromInt(3297), .properties = .{ .param_str = "ccC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_c2 - .{ .tag = @enumFromInt(3298), .properties = .{ .param_str = "E2cE2cC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_c4 - .{ .tag = @enumFromInt(3299), .properties = .{ .param_str = "E4cE4cC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_d - .{ .tag = @enumFromInt(3300), .properties = .{ .param_str = "ddC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_d2 - .{ .tag = @enumFromInt(3301), .properties = .{ .param_str = "E2dE2dC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_f - .{ .tag = @enumFromInt(3302), .properties = .{ .param_str = "ffC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_f2 - .{ .tag = @enumFromInt(3303), .properties = .{ .param_str = "E2fE2fC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_f4 - .{ .tag = @enumFromInt(3304), .properties = .{ .param_str = "E4fE4fC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_h - .{ .tag = @enumFromInt(3305), .properties = .{ .param_str = "hhC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_h2 - .{ .tag = @enumFromInt(3306), .properties = .{ .param_str = "E2hE2hC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_i - .{ .tag = @enumFromInt(3307), .properties = .{ .param_str = "iiC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_i2 - .{ .tag = @enumFromInt(3308), .properties = .{ .param_str = "E2iE2iC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_i4 - .{ .tag = @enumFromInt(3309), .properties = .{ .param_str = "E4iE4iC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_l - .{ .tag = @enumFromInt(3310), .properties = .{ .param_str = "LiLiC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_l2 - .{ .tag = @enumFromInt(3311), .properties = .{ .param_str = "E2LiE2LiC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_ll - .{ .tag = @enumFromInt(3312), .properties = .{ .param_str = "LLiLLiC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_ll2 - .{ .tag = @enumFromInt(3313), .properties = .{ .param_str = "E2LLiE2LLiC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_s - .{ .tag = @enumFromInt(3314), .properties = .{ .param_str = "ssC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_s2 - .{ .tag = @enumFromInt(3315), .properties = .{ .param_str = "E2sE2sC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_s4 - .{ .tag = @enumFromInt(3316), .properties = .{ .param_str = "E4sE4sC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_sc - .{ .tag = @enumFromInt(3317), .properties = .{ .param_str = "ScScC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_sc2 - .{ .tag = @enumFromInt(3318), .properties = .{ .param_str = "E2ScE2ScC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_sc4 - .{ .tag = @enumFromInt(3319), .properties = .{ .param_str = "E4ScE4ScC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_uc - .{ .tag = @enumFromInt(3320), .properties = .{ .param_str = "UcUcC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_uc2 - .{ .tag = @enumFromInt(3321), .properties = .{ .param_str = "E2UcE2UcC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_uc4 - .{ .tag = @enumFromInt(3322), .properties = .{ .param_str = "E4UcE4UcC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_ui - .{ .tag = @enumFromInt(3323), .properties = .{ .param_str = "UiUiC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_ui2 - .{ .tag = @enumFromInt(3324), .properties = .{ .param_str = "E2UiE2UiC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_ui4 - .{ .tag = @enumFromInt(3325), .properties = .{ .param_str = "E4UiE4UiC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_ul - .{ .tag = @enumFromInt(3326), .properties = .{ .param_str = "ULiULiC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_ul2 - .{ .tag = @enumFromInt(3327), .properties = .{ .param_str = "E2ULiE2ULiC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_ull - .{ .tag = @enumFromInt(3328), .properties = .{ .param_str = "ULLiULLiC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_ull2 - .{ .tag = @enumFromInt(3329), .properties = .{ .param_str = "E2ULLiE2ULLiC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_us - .{ .tag = @enumFromInt(3330), .properties = .{ .param_str = "UsUsC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_us2 - .{ .tag = @enumFromInt(3331), .properties = .{ .param_str = "E2UsE2UsC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ldu_us4 - .{ .tag = @enumFromInt(3332), .properties = .{ .param_str = "E4UsE4UsC*", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_lg2_approx_d - .{ .tag = @enumFromInt(3333), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_lg2_approx_f - .{ .tag = @enumFromInt(3334), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_lg2_approx_ftz_f - .{ .tag = @enumFromInt(3335), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ll2d_rm - .{ .tag = @enumFromInt(3336), .properties = .{ .param_str = "dLLi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ll2d_rn - .{ .tag = @enumFromInt(3337), .properties = .{ .param_str = "dLLi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ll2d_rp - .{ .tag = @enumFromInt(3338), .properties = .{ .param_str = "dLLi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ll2d_rz - .{ .tag = @enumFromInt(3339), .properties = .{ .param_str = "dLLi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ll2f_rm - .{ .tag = @enumFromInt(3340), .properties = .{ .param_str = "fLLi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ll2f_rn - .{ .tag = @enumFromInt(3341), .properties = .{ .param_str = "fLLi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ll2f_rp - .{ .tag = @enumFromInt(3342), .properties = .{ .param_str = "fLLi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ll2f_rz - .{ .tag = @enumFromInt(3343), .properties = .{ .param_str = "fLLi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_lohi_i2d - .{ .tag = @enumFromInt(3344), .properties = .{ .param_str = "dii", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_membar_cta - .{ .tag = @enumFromInt(3345), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_membar_gl - .{ .tag = @enumFromInt(3346), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_membar_sys - .{ .tag = @enumFromInt(3347), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_memcpy - .{ .tag = @enumFromInt(3348), .properties = .{ .param_str = "vUc*Uc*zi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_memset - .{ .tag = @enumFromInt(3349), .properties = .{ .param_str = "vUc*Uczi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_mul24_i - .{ .tag = @enumFromInt(3350), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_mul24_ui - .{ .tag = @enumFromInt(3351), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_mul_rm_d - .{ .tag = @enumFromInt(3352), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_mul_rm_f - .{ .tag = @enumFromInt(3353), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_mul_rm_ftz_f - .{ .tag = @enumFromInt(3354), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_mul_rn_d - .{ .tag = @enumFromInt(3355), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_mul_rn_f - .{ .tag = @enumFromInt(3356), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_mul_rn_ftz_f - .{ .tag = @enumFromInt(3357), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_mul_rp_d - .{ .tag = @enumFromInt(3358), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_mul_rp_f - .{ .tag = @enumFromInt(3359), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_mul_rp_ftz_f - .{ .tag = @enumFromInt(3360), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_mul_rz_d - .{ .tag = @enumFromInt(3361), .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_mul_rz_f - .{ .tag = @enumFromInt(3362), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_mul_rz_ftz_f - .{ .tag = @enumFromInt(3363), .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_mulhi_i - .{ .tag = @enumFromInt(3364), .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_mulhi_ll - .{ .tag = @enumFromInt(3365), .properties = .{ .param_str = "LLiLLiLLi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_mulhi_ui - .{ .tag = @enumFromInt(3366), .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_mulhi_ull - .{ .tag = @enumFromInt(3367), .properties = .{ .param_str = "ULLiULLiULLi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_prmt - .{ .tag = @enumFromInt(3368), .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_rcp_approx_ftz_d - .{ .tag = @enumFromInt(3369), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_rcp_approx_ftz_f - .{ .tag = @enumFromInt(3370), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_rcp_rm_d - .{ .tag = @enumFromInt(3371), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_rcp_rm_f - .{ .tag = @enumFromInt(3372), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_rcp_rm_ftz_f - .{ .tag = @enumFromInt(3373), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_rcp_rn_d - .{ .tag = @enumFromInt(3374), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_rcp_rn_f - .{ .tag = @enumFromInt(3375), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_rcp_rn_ftz_f - .{ .tag = @enumFromInt(3376), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_rcp_rp_d - .{ .tag = @enumFromInt(3377), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_rcp_rp_f - .{ .tag = @enumFromInt(3378), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_rcp_rp_ftz_f - .{ .tag = @enumFromInt(3379), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_rcp_rz_d - .{ .tag = @enumFromInt(3380), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_rcp_rz_f - .{ .tag = @enumFromInt(3381), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_rcp_rz_ftz_f - .{ .tag = @enumFromInt(3382), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_read_ptx_sreg_clock - .{ .tag = @enumFromInt(3383), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_read_ptx_sreg_clock64 - .{ .tag = @enumFromInt(3384), .properties = .{ .param_str = "LLi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_read_ptx_sreg_ctaid_w - .{ .tag = @enumFromInt(3385), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, - // __nvvm_read_ptx_sreg_ctaid_x - .{ .tag = @enumFromInt(3386), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, - // __nvvm_read_ptx_sreg_ctaid_y - .{ .tag = @enumFromInt(3387), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, - // __nvvm_read_ptx_sreg_ctaid_z - .{ .tag = @enumFromInt(3388), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, - // __nvvm_read_ptx_sreg_gridid - .{ .tag = @enumFromInt(3389), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, - // __nvvm_read_ptx_sreg_laneid - .{ .tag = @enumFromInt(3390), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, - // __nvvm_read_ptx_sreg_lanemask_eq - .{ .tag = @enumFromInt(3391), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, - // __nvvm_read_ptx_sreg_lanemask_ge - .{ .tag = @enumFromInt(3392), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, - // __nvvm_read_ptx_sreg_lanemask_gt - .{ .tag = @enumFromInt(3393), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, - // __nvvm_read_ptx_sreg_lanemask_le - .{ .tag = @enumFromInt(3394), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, - // __nvvm_read_ptx_sreg_lanemask_lt - .{ .tag = @enumFromInt(3395), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, - // __nvvm_read_ptx_sreg_nctaid_w - .{ .tag = @enumFromInt(3396), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, - // __nvvm_read_ptx_sreg_nctaid_x - .{ .tag = @enumFromInt(3397), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, - // __nvvm_read_ptx_sreg_nctaid_y - .{ .tag = @enumFromInt(3398), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, - // __nvvm_read_ptx_sreg_nctaid_z - .{ .tag = @enumFromInt(3399), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, - // __nvvm_read_ptx_sreg_nsmid - .{ .tag = @enumFromInt(3400), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, - // __nvvm_read_ptx_sreg_ntid_w - .{ .tag = @enumFromInt(3401), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, - // __nvvm_read_ptx_sreg_ntid_x - .{ .tag = @enumFromInt(3402), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, - // __nvvm_read_ptx_sreg_ntid_y - .{ .tag = @enumFromInt(3403), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, - // __nvvm_read_ptx_sreg_ntid_z - .{ .tag = @enumFromInt(3404), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, - // __nvvm_read_ptx_sreg_nwarpid - .{ .tag = @enumFromInt(3405), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, - // __nvvm_read_ptx_sreg_pm0 - .{ .tag = @enumFromInt(3406), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_read_ptx_sreg_pm1 - .{ .tag = @enumFromInt(3407), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_read_ptx_sreg_pm2 - .{ .tag = @enumFromInt(3408), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_read_ptx_sreg_pm3 - .{ .tag = @enumFromInt(3409), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_read_ptx_sreg_smid - .{ .tag = @enumFromInt(3410), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, - // __nvvm_read_ptx_sreg_tid_w - .{ .tag = @enumFromInt(3411), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, - // __nvvm_read_ptx_sreg_tid_x - .{ .tag = @enumFromInt(3412), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, - // __nvvm_read_ptx_sreg_tid_y - .{ .tag = @enumFromInt(3413), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, - // __nvvm_read_ptx_sreg_tid_z - .{ .tag = @enumFromInt(3414), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, - // __nvvm_read_ptx_sreg_warpid - .{ .tag = @enumFromInt(3415), .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, - // __nvvm_round_d - .{ .tag = @enumFromInt(3416), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_round_f - .{ .tag = @enumFromInt(3417), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_round_ftz_f - .{ .tag = @enumFromInt(3418), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_rsqrt_approx_d - .{ .tag = @enumFromInt(3419), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_rsqrt_approx_f - .{ .tag = @enumFromInt(3420), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_rsqrt_approx_ftz_f - .{ .tag = @enumFromInt(3421), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_sad_i - .{ .tag = @enumFromInt(3422), .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_sad_ui - .{ .tag = @enumFromInt(3423), .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_saturate_d - .{ .tag = @enumFromInt(3424), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_saturate_f - .{ .tag = @enumFromInt(3425), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_saturate_ftz_f - .{ .tag = @enumFromInt(3426), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_shfl_bfly_f32 - .{ .tag = @enumFromInt(3427), .properties = .{ .param_str = "ffii", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_shfl_bfly_i32 - .{ .tag = @enumFromInt(3428), .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_shfl_down_f32 - .{ .tag = @enumFromInt(3429), .properties = .{ .param_str = "ffii", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_shfl_down_i32 - .{ .tag = @enumFromInt(3430), .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_shfl_idx_f32 - .{ .tag = @enumFromInt(3431), .properties = .{ .param_str = "ffii", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_shfl_idx_i32 - .{ .tag = @enumFromInt(3432), .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_shfl_up_f32 - .{ .tag = @enumFromInt(3433), .properties = .{ .param_str = "ffii", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_shfl_up_i32 - .{ .tag = @enumFromInt(3434), .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_sin_approx_f - .{ .tag = @enumFromInt(3435), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_sin_approx_ftz_f - .{ .tag = @enumFromInt(3436), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_sqrt_approx_f - .{ .tag = @enumFromInt(3437), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_sqrt_approx_ftz_f - .{ .tag = @enumFromInt(3438), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_sqrt_rm_d - .{ .tag = @enumFromInt(3439), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_sqrt_rm_f - .{ .tag = @enumFromInt(3440), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_sqrt_rm_ftz_f - .{ .tag = @enumFromInt(3441), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_sqrt_rn_d - .{ .tag = @enumFromInt(3442), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_sqrt_rn_f - .{ .tag = @enumFromInt(3443), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_sqrt_rn_ftz_f - .{ .tag = @enumFromInt(3444), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_sqrt_rp_d - .{ .tag = @enumFromInt(3445), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_sqrt_rp_f - .{ .tag = @enumFromInt(3446), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_sqrt_rp_ftz_f - .{ .tag = @enumFromInt(3447), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_sqrt_rz_d - .{ .tag = @enumFromInt(3448), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_sqrt_rz_f - .{ .tag = @enumFromInt(3449), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_sqrt_rz_ftz_f - .{ .tag = @enumFromInt(3450), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_trunc_d - .{ .tag = @enumFromInt(3451), .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_trunc_f - .{ .tag = @enumFromInt(3452), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_trunc_ftz_f - .{ .tag = @enumFromInt(3453), .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ui2d_rm - .{ .tag = @enumFromInt(3454), .properties = .{ .param_str = "dUi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ui2d_rn - .{ .tag = @enumFromInt(3455), .properties = .{ .param_str = "dUi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ui2d_rp - .{ .tag = @enumFromInt(3456), .properties = .{ .param_str = "dUi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ui2d_rz - .{ .tag = @enumFromInt(3457), .properties = .{ .param_str = "dUi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ui2f_rm - .{ .tag = @enumFromInt(3458), .properties = .{ .param_str = "fUi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ui2f_rn - .{ .tag = @enumFromInt(3459), .properties = .{ .param_str = "fUi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ui2f_rp - .{ .tag = @enumFromInt(3460), .properties = .{ .param_str = "fUi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ui2f_rz - .{ .tag = @enumFromInt(3461), .properties = .{ .param_str = "fUi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ull2d_rm - .{ .tag = @enumFromInt(3462), .properties = .{ .param_str = "dULLi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ull2d_rn - .{ .tag = @enumFromInt(3463), .properties = .{ .param_str = "dULLi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ull2d_rp - .{ .tag = @enumFromInt(3464), .properties = .{ .param_str = "dULLi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ull2d_rz - .{ .tag = @enumFromInt(3465), .properties = .{ .param_str = "dULLi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ull2f_rm - .{ .tag = @enumFromInt(3466), .properties = .{ .param_str = "fULLi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ull2f_rn - .{ .tag = @enumFromInt(3467), .properties = .{ .param_str = "fULLi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ull2f_rp - .{ .tag = @enumFromInt(3468), .properties = .{ .param_str = "fULLi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_ull2f_rz - .{ .tag = @enumFromInt(3469), .properties = .{ .param_str = "fULLi", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_vote_all - .{ .tag = @enumFromInt(3470), .properties = .{ .param_str = "bb", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_vote_any - .{ .tag = @enumFromInt(3471), .properties = .{ .param_str = "bb", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_vote_ballot - .{ .tag = @enumFromInt(3472), .properties = .{ .param_str = "Uib", .target_set = TargetSet.initOne(.nvptx) } }, - // __nvvm_vote_uni - .{ .tag = @enumFromInt(3473), .properties = .{ .param_str = "bb", .target_set = TargetSet.initOne(.nvptx) } }, - // __popcnt - .{ .tag = @enumFromInt(3474), .properties = .{ .param_str = "UiUi", .language = .all_ms_languages, .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __popcnt16 - .{ .tag = @enumFromInt(3475), .properties = .{ .param_str = "UsUs", .language = .all_ms_languages, .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __popcnt64 - .{ .tag = @enumFromInt(3476), .properties = .{ .param_str = "UWiUWi", .language = .all_ms_languages, .attributes = .{ .@"const" = true, .const_evaluable = true } } }, - // __rdtsc - .{ .tag = @enumFromInt(3477), .properties = .{ .param_str = "UOi", .target_set = TargetSet.initOne(.x86) } }, - // __sev - .{ .tag = @enumFromInt(3478), .properties = .{ .param_str = "v", .language = .all_ms_languages, .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, - // __sevl - .{ .tag = @enumFromInt(3479), .properties = .{ .param_str = "v", .language = .all_ms_languages, .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, - // __sigsetjmp - .{ .tag = @enumFromInt(3480), .properties = .{ .param_str = "iSJi", .header = .setjmp, .attributes = .{ .allow_type_mismatch = true, .lib_function_without_prefix = true, .returns_twice = true } } }, - // __sinpi - .{ .tag = @enumFromInt(3481), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __sinpif - .{ .tag = @enumFromInt(3482), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __sync_add_and_fetch - .{ .tag = @enumFromInt(3483), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_add_and_fetch_1 - .{ .tag = @enumFromInt(3484), .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_add_and_fetch_16 - .{ .tag = @enumFromInt(3485), .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_add_and_fetch_2 - .{ .tag = @enumFromInt(3486), .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_add_and_fetch_4 - .{ .tag = @enumFromInt(3487), .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_add_and_fetch_8 - .{ .tag = @enumFromInt(3488), .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_and_and_fetch - .{ .tag = @enumFromInt(3489), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_and_and_fetch_1 - .{ .tag = @enumFromInt(3490), .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_and_and_fetch_16 - .{ .tag = @enumFromInt(3491), .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_and_and_fetch_2 - .{ .tag = @enumFromInt(3492), .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_and_and_fetch_4 - .{ .tag = @enumFromInt(3493), .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_and_and_fetch_8 - .{ .tag = @enumFromInt(3494), .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_bool_compare_and_swap - .{ .tag = @enumFromInt(3495), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_bool_compare_and_swap_1 - .{ .tag = @enumFromInt(3496), .properties = .{ .param_str = "bcD*cc.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_bool_compare_and_swap_16 - .{ .tag = @enumFromInt(3497), .properties = .{ .param_str = "bLLLiD*LLLiLLLi.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_bool_compare_and_swap_2 - .{ .tag = @enumFromInt(3498), .properties = .{ .param_str = "bsD*ss.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_bool_compare_and_swap_4 - .{ .tag = @enumFromInt(3499), .properties = .{ .param_str = "biD*ii.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_bool_compare_and_swap_8 - .{ .tag = @enumFromInt(3500), .properties = .{ .param_str = "bLLiD*LLiLLi.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_add - .{ .tag = @enumFromInt(3501), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_add_1 - .{ .tag = @enumFromInt(3502), .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_add_16 - .{ .tag = @enumFromInt(3503), .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_add_2 - .{ .tag = @enumFromInt(3504), .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_add_4 - .{ .tag = @enumFromInt(3505), .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_add_8 - .{ .tag = @enumFromInt(3506), .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_and - .{ .tag = @enumFromInt(3507), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_and_1 - .{ .tag = @enumFromInt(3508), .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_and_16 - .{ .tag = @enumFromInt(3509), .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_and_2 - .{ .tag = @enumFromInt(3510), .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_and_4 - .{ .tag = @enumFromInt(3511), .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_and_8 - .{ .tag = @enumFromInt(3512), .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_max - .{ .tag = @enumFromInt(3513), .properties = .{ .param_str = "iiD*i" } }, - // __sync_fetch_and_min - .{ .tag = @enumFromInt(3514), .properties = .{ .param_str = "iiD*i" } }, - // __sync_fetch_and_nand - .{ .tag = @enumFromInt(3515), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_nand_1 - .{ .tag = @enumFromInt(3516), .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_nand_16 - .{ .tag = @enumFromInt(3517), .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_nand_2 - .{ .tag = @enumFromInt(3518), .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_nand_4 - .{ .tag = @enumFromInt(3519), .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_nand_8 - .{ .tag = @enumFromInt(3520), .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_or - .{ .tag = @enumFromInt(3521), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_or_1 - .{ .tag = @enumFromInt(3522), .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_or_16 - .{ .tag = @enumFromInt(3523), .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_or_2 - .{ .tag = @enumFromInt(3524), .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_or_4 - .{ .tag = @enumFromInt(3525), .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_or_8 - .{ .tag = @enumFromInt(3526), .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_sub - .{ .tag = @enumFromInt(3527), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_sub_1 - .{ .tag = @enumFromInt(3528), .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_sub_16 - .{ .tag = @enumFromInt(3529), .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_sub_2 - .{ .tag = @enumFromInt(3530), .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_sub_4 - .{ .tag = @enumFromInt(3531), .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_sub_8 - .{ .tag = @enumFromInt(3532), .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_umax - .{ .tag = @enumFromInt(3533), .properties = .{ .param_str = "UiUiD*Ui" } }, - // __sync_fetch_and_umin - .{ .tag = @enumFromInt(3534), .properties = .{ .param_str = "UiUiD*Ui" } }, - // __sync_fetch_and_xor - .{ .tag = @enumFromInt(3535), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_xor_1 - .{ .tag = @enumFromInt(3536), .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_xor_16 - .{ .tag = @enumFromInt(3537), .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_xor_2 - .{ .tag = @enumFromInt(3538), .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_xor_4 - .{ .tag = @enumFromInt(3539), .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_fetch_and_xor_8 - .{ .tag = @enumFromInt(3540), .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_lock_release - .{ .tag = @enumFromInt(3541), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_lock_release_1 - .{ .tag = @enumFromInt(3542), .properties = .{ .param_str = "vcD*.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_lock_release_16 - .{ .tag = @enumFromInt(3543), .properties = .{ .param_str = "vLLLiD*.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_lock_release_2 - .{ .tag = @enumFromInt(3544), .properties = .{ .param_str = "vsD*.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_lock_release_4 - .{ .tag = @enumFromInt(3545), .properties = .{ .param_str = "viD*.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_lock_release_8 - .{ .tag = @enumFromInt(3546), .properties = .{ .param_str = "vLLiD*.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_lock_test_and_set - .{ .tag = @enumFromInt(3547), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_lock_test_and_set_1 - .{ .tag = @enumFromInt(3548), .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_lock_test_and_set_16 - .{ .tag = @enumFromInt(3549), .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_lock_test_and_set_2 - .{ .tag = @enumFromInt(3550), .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_lock_test_and_set_4 - .{ .tag = @enumFromInt(3551), .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_lock_test_and_set_8 - .{ .tag = @enumFromInt(3552), .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_nand_and_fetch - .{ .tag = @enumFromInt(3553), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_nand_and_fetch_1 - .{ .tag = @enumFromInt(3554), .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_nand_and_fetch_16 - .{ .tag = @enumFromInt(3555), .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_nand_and_fetch_2 - .{ .tag = @enumFromInt(3556), .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_nand_and_fetch_4 - .{ .tag = @enumFromInt(3557), .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_nand_and_fetch_8 - .{ .tag = @enumFromInt(3558), .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_or_and_fetch - .{ .tag = @enumFromInt(3559), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_or_and_fetch_1 - .{ .tag = @enumFromInt(3560), .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_or_and_fetch_16 - .{ .tag = @enumFromInt(3561), .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_or_and_fetch_2 - .{ .tag = @enumFromInt(3562), .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_or_and_fetch_4 - .{ .tag = @enumFromInt(3563), .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_or_and_fetch_8 - .{ .tag = @enumFromInt(3564), .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_sub_and_fetch - .{ .tag = @enumFromInt(3565), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_sub_and_fetch_1 - .{ .tag = @enumFromInt(3566), .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_sub_and_fetch_16 - .{ .tag = @enumFromInt(3567), .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_sub_and_fetch_2 - .{ .tag = @enumFromInt(3568), .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_sub_and_fetch_4 - .{ .tag = @enumFromInt(3569), .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_sub_and_fetch_8 - .{ .tag = @enumFromInt(3570), .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_swap - .{ .tag = @enumFromInt(3571), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_swap_1 - .{ .tag = @enumFromInt(3572), .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_swap_16 - .{ .tag = @enumFromInt(3573), .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_swap_2 - .{ .tag = @enumFromInt(3574), .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_swap_4 - .{ .tag = @enumFromInt(3575), .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_swap_8 - .{ .tag = @enumFromInt(3576), .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_synchronize - .{ .tag = @enumFromInt(3577), .properties = .{ .param_str = "v" } }, - // __sync_val_compare_and_swap - .{ .tag = @enumFromInt(3578), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_val_compare_and_swap_1 - .{ .tag = @enumFromInt(3579), .properties = .{ .param_str = "ccD*cc.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_val_compare_and_swap_16 - .{ .tag = @enumFromInt(3580), .properties = .{ .param_str = "LLLiLLLiD*LLLiLLLi.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_val_compare_and_swap_2 - .{ .tag = @enumFromInt(3581), .properties = .{ .param_str = "ssD*ss.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_val_compare_and_swap_4 - .{ .tag = @enumFromInt(3582), .properties = .{ .param_str = "iiD*ii.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_val_compare_and_swap_8 - .{ .tag = @enumFromInt(3583), .properties = .{ .param_str = "LLiLLiD*LLiLLi.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_xor_and_fetch - .{ .tag = @enumFromInt(3584), .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_xor_and_fetch_1 - .{ .tag = @enumFromInt(3585), .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_xor_and_fetch_16 - .{ .tag = @enumFromInt(3586), .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_xor_and_fetch_2 - .{ .tag = @enumFromInt(3587), .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_xor_and_fetch_4 - .{ .tag = @enumFromInt(3588), .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, - // __sync_xor_and_fetch_8 - .{ .tag = @enumFromInt(3589), .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, - // __syncthreads - .{ .tag = @enumFromInt(3590), .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.nvptx) } }, - // __tanpi - .{ .tag = @enumFromInt(3591), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __tanpif - .{ .tag = @enumFromInt(3592), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // __va_start - .{ .tag = @enumFromInt(3593), .properties = .{ .param_str = "vc**.", .language = .all_ms_languages, .attributes = .{ .custom_typecheck = true } } }, - // __warn_memset_zero_len - .{ .tag = @enumFromInt(3594), .properties = .{ .param_str = "v", .attributes = .{ .pure = true } } }, - // __wfe - .{ .tag = @enumFromInt(3595), .properties = .{ .param_str = "v", .language = .all_ms_languages, .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, - // __wfi - .{ .tag = @enumFromInt(3596), .properties = .{ .param_str = "v", .language = .all_ms_languages, .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, - // __xray_customevent - .{ .tag = @enumFromInt(3597), .properties = .{ .param_str = "vcC*z" } }, - // __xray_typedevent - .{ .tag = @enumFromInt(3598), .properties = .{ .param_str = "vzcC*z" } }, - // __yield - .{ .tag = @enumFromInt(3599), .properties = .{ .param_str = "v", .language = .all_ms_languages, .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, - // _abnormal_termination - .{ .tag = @enumFromInt(3600), .properties = .{ .param_str = "i", .language = .all_ms_languages } }, - // _alloca - .{ .tag = @enumFromInt(3601), .properties = .{ .param_str = "v*z", .language = .all_ms_languages } }, - // _bittest - .{ .tag = @enumFromInt(3602), .properties = .{ .param_str = "UcNiC*Ni", .language = .all_ms_languages } }, - // _bittest64 - .{ .tag = @enumFromInt(3603), .properties = .{ .param_str = "UcWiC*Wi", .language = .all_ms_languages } }, - // _bittestandcomplement - .{ .tag = @enumFromInt(3604), .properties = .{ .param_str = "UcNi*Ni", .language = .all_ms_languages } }, - // _bittestandcomplement64 - .{ .tag = @enumFromInt(3605), .properties = .{ .param_str = "UcWi*Wi", .language = .all_ms_languages } }, - // _bittestandreset - .{ .tag = @enumFromInt(3606), .properties = .{ .param_str = "UcNi*Ni", .language = .all_ms_languages } }, - // _bittestandreset64 - .{ .tag = @enumFromInt(3607), .properties = .{ .param_str = "UcWi*Wi", .language = .all_ms_languages } }, - // _bittestandset - .{ .tag = @enumFromInt(3608), .properties = .{ .param_str = "UcNi*Ni", .language = .all_ms_languages } }, - // _bittestandset64 - .{ .tag = @enumFromInt(3609), .properties = .{ .param_str = "UcWi*Wi", .language = .all_ms_languages } }, - // _byteswap_uint64 - .{ .tag = @enumFromInt(3610), .properties = .{ .param_str = "ULLiULLi", .header = .stdlib, .language = .all_ms_languages, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // _byteswap_ulong - .{ .tag = @enumFromInt(3611), .properties = .{ .param_str = "UNiUNi", .header = .stdlib, .language = .all_ms_languages, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // _byteswap_ushort - .{ .tag = @enumFromInt(3612), .properties = .{ .param_str = "UsUs", .header = .stdlib, .language = .all_ms_languages, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // _exception_code - .{ .tag = @enumFromInt(3613), .properties = .{ .param_str = "UNi", .language = .all_ms_languages } }, - // _exception_info - .{ .tag = @enumFromInt(3614), .properties = .{ .param_str = "v*", .language = .all_ms_languages } }, - // _exit - .{ .tag = @enumFromInt(3615), .properties = .{ .param_str = "vi", .header = .unistd, .language = .all_gnu_languages, .attributes = .{ .noreturn = true, .lib_function_without_prefix = true } } }, - // _interlockedbittestandreset - .{ .tag = @enumFromInt(3616), .properties = .{ .param_str = "UcNiD*Ni", .language = .all_ms_languages } }, - // _interlockedbittestandreset64 - .{ .tag = @enumFromInt(3617), .properties = .{ .param_str = "UcWiD*Wi", .language = .all_ms_languages } }, - // _interlockedbittestandreset_acq - .{ .tag = @enumFromInt(3618), .properties = .{ .param_str = "UcNiD*Ni", .language = .all_ms_languages } }, - // _interlockedbittestandreset_nf - .{ .tag = @enumFromInt(3619), .properties = .{ .param_str = "UcNiD*Ni", .language = .all_ms_languages } }, - // _interlockedbittestandreset_rel - .{ .tag = @enumFromInt(3620), .properties = .{ .param_str = "UcNiD*Ni", .language = .all_ms_languages } }, - // _interlockedbittestandset - .{ .tag = @enumFromInt(3621), .properties = .{ .param_str = "UcNiD*Ni", .language = .all_ms_languages } }, - // _interlockedbittestandset64 - .{ .tag = @enumFromInt(3622), .properties = .{ .param_str = "UcWiD*Wi", .language = .all_ms_languages } }, - // _interlockedbittestandset_acq - .{ .tag = @enumFromInt(3623), .properties = .{ .param_str = "UcNiD*Ni", .language = .all_ms_languages } }, - // _interlockedbittestandset_nf - .{ .tag = @enumFromInt(3624), .properties = .{ .param_str = "UcNiD*Ni", .language = .all_ms_languages } }, - // _interlockedbittestandset_rel - .{ .tag = @enumFromInt(3625), .properties = .{ .param_str = "UcNiD*Ni", .language = .all_ms_languages } }, - // _longjmp - .{ .tag = @enumFromInt(3626), .properties = .{ .param_str = "vJi", .header = .setjmp, .language = .all_gnu_languages, .attributes = .{ .noreturn = true, .allow_type_mismatch = true, .lib_function_without_prefix = true } } }, - // _lrotl - .{ .tag = @enumFromInt(3627), .properties = .{ .param_str = "ULiULii", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, - // _lrotr - .{ .tag = @enumFromInt(3628), .properties = .{ .param_str = "ULiULii", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, - // _rotl - .{ .tag = @enumFromInt(3629), .properties = .{ .param_str = "UiUii", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, - // _rotl16 - .{ .tag = @enumFromInt(3630), .properties = .{ .param_str = "UsUsUc", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, - // _rotl64 - .{ .tag = @enumFromInt(3631), .properties = .{ .param_str = "UWiUWii", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, - // _rotl8 - .{ .tag = @enumFromInt(3632), .properties = .{ .param_str = "UcUcUc", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, - // _rotr - .{ .tag = @enumFromInt(3633), .properties = .{ .param_str = "UiUii", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, - // _rotr16 - .{ .tag = @enumFromInt(3634), .properties = .{ .param_str = "UsUsUc", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, - // _rotr64 - .{ .tag = @enumFromInt(3635), .properties = .{ .param_str = "UWiUWii", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, - // _rotr8 - .{ .tag = @enumFromInt(3636), .properties = .{ .param_str = "UcUcUc", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, - // _setjmp - .{ .tag = @enumFromInt(3637), .properties = .{ .param_str = "iJ", .header = .setjmp, .attributes = .{ .allow_type_mismatch = true, .lib_function_without_prefix = true, .returns_twice = true } } }, - // _setjmpex - .{ .tag = @enumFromInt(3638), .properties = .{ .param_str = "iJ", .header = .setjmpex, .language = .all_ms_languages, .attributes = .{ .allow_type_mismatch = true, .lib_function_without_prefix = true, .returns_twice = true } } }, - // abort - .{ .tag = @enumFromInt(3639), .properties = .{ .param_str = "v", .header = .stdlib, .attributes = .{ .noreturn = true, .lib_function_without_prefix = true } } }, - // abs - .{ .tag = @enumFromInt(3640), .properties = .{ .param_str = "ii", .header = .stdlib, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // acos - .{ .tag = @enumFromInt(3641), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // acosf - .{ .tag = @enumFromInt(3642), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // acosh - .{ .tag = @enumFromInt(3643), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // acoshf - .{ .tag = @enumFromInt(3644), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // acoshl - .{ .tag = @enumFromInt(3645), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // acosl - .{ .tag = @enumFromInt(3646), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // aligned_alloc - .{ .tag = @enumFromInt(3647), .properties = .{ .param_str = "v*zz", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, - // alloca - .{ .tag = @enumFromInt(3648), .properties = .{ .param_str = "v*z", .header = .stdlib, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, - // asin - .{ .tag = @enumFromInt(3649), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // asinf - .{ .tag = @enumFromInt(3650), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // asinh - .{ .tag = @enumFromInt(3651), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // asinhf - .{ .tag = @enumFromInt(3652), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // asinhl - .{ .tag = @enumFromInt(3653), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // asinl - .{ .tag = @enumFromInt(3654), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // atan - .{ .tag = @enumFromInt(3655), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // atan2 - .{ .tag = @enumFromInt(3656), .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // atan2f - .{ .tag = @enumFromInt(3657), .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // atan2l - .{ .tag = @enumFromInt(3658), .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // atanf - .{ .tag = @enumFromInt(3659), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // atanh - .{ .tag = @enumFromInt(3660), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // atanhf - .{ .tag = @enumFromInt(3661), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // atanhl - .{ .tag = @enumFromInt(3662), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // atanl - .{ .tag = @enumFromInt(3663), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // bcmp - .{ .tag = @enumFromInt(3664), .properties = .{ .param_str = "ivC*vC*z", .header = .strings, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, - // bcopy - .{ .tag = @enumFromInt(3665), .properties = .{ .param_str = "vvC*v*z", .header = .strings, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, - // bzero - .{ .tag = @enumFromInt(3666), .properties = .{ .param_str = "vv*z", .header = .strings, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, - // cabs - .{ .tag = @enumFromInt(3667), .properties = .{ .param_str = "dXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // cabsf - .{ .tag = @enumFromInt(3668), .properties = .{ .param_str = "fXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // cabsl - .{ .tag = @enumFromInt(3669), .properties = .{ .param_str = "LdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // cacos - .{ .tag = @enumFromInt(3670), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // cacosf - .{ .tag = @enumFromInt(3671), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // cacosh - .{ .tag = @enumFromInt(3672), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // cacoshf - .{ .tag = @enumFromInt(3673), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // cacoshl - .{ .tag = @enumFromInt(3674), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // cacosl - .{ .tag = @enumFromInt(3675), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // calloc - .{ .tag = @enumFromInt(3676), .properties = .{ .param_str = "v*zz", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, - // carg - .{ .tag = @enumFromInt(3677), .properties = .{ .param_str = "dXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // cargf - .{ .tag = @enumFromInt(3678), .properties = .{ .param_str = "fXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // cargl - .{ .tag = @enumFromInt(3679), .properties = .{ .param_str = "LdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // casin - .{ .tag = @enumFromInt(3680), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // casinf - .{ .tag = @enumFromInt(3681), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // casinh - .{ .tag = @enumFromInt(3682), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // casinhf - .{ .tag = @enumFromInt(3683), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // casinhl - .{ .tag = @enumFromInt(3684), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // casinl - .{ .tag = @enumFromInt(3685), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // catan - .{ .tag = @enumFromInt(3686), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // catanf - .{ .tag = @enumFromInt(3687), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // catanh - .{ .tag = @enumFromInt(3688), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // catanhf - .{ .tag = @enumFromInt(3689), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // catanhl - .{ .tag = @enumFromInt(3690), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // catanl - .{ .tag = @enumFromInt(3691), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // cbrt - .{ .tag = @enumFromInt(3692), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // cbrtf - .{ .tag = @enumFromInt(3693), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // cbrtl - .{ .tag = @enumFromInt(3694), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // ccos - .{ .tag = @enumFromInt(3695), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // ccosf - .{ .tag = @enumFromInt(3696), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // ccosh - .{ .tag = @enumFromInt(3697), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // ccoshf - .{ .tag = @enumFromInt(3698), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // ccoshl - .{ .tag = @enumFromInt(3699), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // ccosl - .{ .tag = @enumFromInt(3700), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // ceil - .{ .tag = @enumFromInt(3701), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // ceilf - .{ .tag = @enumFromInt(3702), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // ceill - .{ .tag = @enumFromInt(3703), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // cexp - .{ .tag = @enumFromInt(3704), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // cexpf - .{ .tag = @enumFromInt(3705), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // cexpl - .{ .tag = @enumFromInt(3706), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // cimag - .{ .tag = @enumFromInt(3707), .properties = .{ .param_str = "dXd", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // cimagf - .{ .tag = @enumFromInt(3708), .properties = .{ .param_str = "fXf", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // cimagl - .{ .tag = @enumFromInt(3709), .properties = .{ .param_str = "LdXLd", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // clog - .{ .tag = @enumFromInt(3710), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // clogf - .{ .tag = @enumFromInt(3711), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // clogl - .{ .tag = @enumFromInt(3712), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // conj - .{ .tag = @enumFromInt(3713), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // conjf - .{ .tag = @enumFromInt(3714), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // conjl - .{ .tag = @enumFromInt(3715), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // copysign - .{ .tag = @enumFromInt(3716), .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // copysignf - .{ .tag = @enumFromInt(3717), .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // copysignl - .{ .tag = @enumFromInt(3718), .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // cos - .{ .tag = @enumFromInt(3719), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // cosf - .{ .tag = @enumFromInt(3720), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // cosh - .{ .tag = @enumFromInt(3721), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // coshf - .{ .tag = @enumFromInt(3722), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // coshl - .{ .tag = @enumFromInt(3723), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // cosl - .{ .tag = @enumFromInt(3724), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // cpow - .{ .tag = @enumFromInt(3725), .properties = .{ .param_str = "XdXdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // cpowf - .{ .tag = @enumFromInt(3726), .properties = .{ .param_str = "XfXfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // cpowl - .{ .tag = @enumFromInt(3727), .properties = .{ .param_str = "XLdXLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // cproj - .{ .tag = @enumFromInt(3728), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // cprojf - .{ .tag = @enumFromInt(3729), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // cprojl - .{ .tag = @enumFromInt(3730), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // creal - .{ .tag = @enumFromInt(3731), .properties = .{ .param_str = "dXd", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // crealf - .{ .tag = @enumFromInt(3732), .properties = .{ .param_str = "fXf", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // creall - .{ .tag = @enumFromInt(3733), .properties = .{ .param_str = "LdXLd", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // csin - .{ .tag = @enumFromInt(3734), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // csinf - .{ .tag = @enumFromInt(3735), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // csinh - .{ .tag = @enumFromInt(3736), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // csinhf - .{ .tag = @enumFromInt(3737), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // csinhl - .{ .tag = @enumFromInt(3738), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // csinl - .{ .tag = @enumFromInt(3739), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // csqrt - .{ .tag = @enumFromInt(3740), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // csqrtf - .{ .tag = @enumFromInt(3741), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // csqrtl - .{ .tag = @enumFromInt(3742), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // ctan - .{ .tag = @enumFromInt(3743), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // ctanf - .{ .tag = @enumFromInt(3744), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // ctanh - .{ .tag = @enumFromInt(3745), .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // ctanhf - .{ .tag = @enumFromInt(3746), .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // ctanhl - .{ .tag = @enumFromInt(3747), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // ctanl - .{ .tag = @enumFromInt(3748), .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // erf - .{ .tag = @enumFromInt(3749), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // erfc - .{ .tag = @enumFromInt(3750), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // erfcf - .{ .tag = @enumFromInt(3751), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // erfcl - .{ .tag = @enumFromInt(3752), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // erff - .{ .tag = @enumFromInt(3753), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // erfl - .{ .tag = @enumFromInt(3754), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // exit - .{ .tag = @enumFromInt(3755), .properties = .{ .param_str = "vi", .header = .stdlib, .attributes = .{ .noreturn = true, .lib_function_without_prefix = true } } }, - // exp - .{ .tag = @enumFromInt(3756), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // exp2 - .{ .tag = @enumFromInt(3757), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // exp2f - .{ .tag = @enumFromInt(3758), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // exp2l - .{ .tag = @enumFromInt(3759), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // expf - .{ .tag = @enumFromInt(3760), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // expl - .{ .tag = @enumFromInt(3761), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // expm1 - .{ .tag = @enumFromInt(3762), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // expm1f - .{ .tag = @enumFromInt(3763), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // expm1l - .{ .tag = @enumFromInt(3764), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // fabs - .{ .tag = @enumFromInt(3765), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // fabsf - .{ .tag = @enumFromInt(3766), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // fabsl - .{ .tag = @enumFromInt(3767), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // fdim - .{ .tag = @enumFromInt(3768), .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // fdimf - .{ .tag = @enumFromInt(3769), .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // fdiml - .{ .tag = @enumFromInt(3770), .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // finite - .{ .tag = @enumFromInt(3771), .properties = .{ .param_str = "id", .header = .math, .language = .gnu_lang, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // finitef - .{ .tag = @enumFromInt(3772), .properties = .{ .param_str = "if", .header = .math, .language = .gnu_lang, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // finitel - .{ .tag = @enumFromInt(3773), .properties = .{ .param_str = "iLd", .header = .math, .language = .gnu_lang, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // floor - .{ .tag = @enumFromInt(3774), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // floorf - .{ .tag = @enumFromInt(3775), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // floorl - .{ .tag = @enumFromInt(3776), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // fma - .{ .tag = @enumFromInt(3777), .properties = .{ .param_str = "dddd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // fmaf - .{ .tag = @enumFromInt(3778), .properties = .{ .param_str = "ffff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // fmal - .{ .tag = @enumFromInt(3779), .properties = .{ .param_str = "LdLdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // fmax - .{ .tag = @enumFromInt(3780), .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // fmaxf - .{ .tag = @enumFromInt(3781), .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // fmaxl - .{ .tag = @enumFromInt(3782), .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // fmin - .{ .tag = @enumFromInt(3783), .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // fminf - .{ .tag = @enumFromInt(3784), .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // fminl - .{ .tag = @enumFromInt(3785), .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // fmod - .{ .tag = @enumFromInt(3786), .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // fmodf - .{ .tag = @enumFromInt(3787), .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // fmodl - .{ .tag = @enumFromInt(3788), .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // fopen - .{ .tag = @enumFromInt(3789), .properties = .{ .param_str = "P*cC*cC*", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true } } }, - // fprintf - .{ .tag = @enumFromInt(3790), .properties = .{ .param_str = "iP*cC*.", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .printf, .format_string_position = 1 } } }, - // fread - .{ .tag = @enumFromInt(3791), .properties = .{ .param_str = "zv*zzP*", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true } } }, - // free - .{ .tag = @enumFromInt(3792), .properties = .{ .param_str = "vv*", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, - // frexp - .{ .tag = @enumFromInt(3793), .properties = .{ .param_str = "ddi*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, - // frexpf - .{ .tag = @enumFromInt(3794), .properties = .{ .param_str = "ffi*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, - // frexpl - .{ .tag = @enumFromInt(3795), .properties = .{ .param_str = "LdLdi*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, - // fscanf - .{ .tag = @enumFromInt(3796), .properties = .{ .param_str = "iP*RcC*R.", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .scanf, .format_string_position = 1 } } }, - // fwrite - .{ .tag = @enumFromInt(3797), .properties = .{ .param_str = "zvC*zzP*", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true } } }, - // getcontext - .{ .tag = @enumFromInt(3798), .properties = .{ .param_str = "iK*", .header = .setjmp, .attributes = .{ .allow_type_mismatch = true, .lib_function_without_prefix = true, .returns_twice = true } } }, - // hypot - .{ .tag = @enumFromInt(3799), .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // hypotf - .{ .tag = @enumFromInt(3800), .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // hypotl - .{ .tag = @enumFromInt(3801), .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // ilogb - .{ .tag = @enumFromInt(3802), .properties = .{ .param_str = "id", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // ilogbf - .{ .tag = @enumFromInt(3803), .properties = .{ .param_str = "if", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // ilogbl - .{ .tag = @enumFromInt(3804), .properties = .{ .param_str = "iLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // index - .{ .tag = @enumFromInt(3805), .properties = .{ .param_str = "c*cC*i", .header = .strings, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, - // isalnum - .{ .tag = @enumFromInt(3806), .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, - // isalpha - .{ .tag = @enumFromInt(3807), .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, - // isblank - .{ .tag = @enumFromInt(3808), .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, - // iscntrl - .{ .tag = @enumFromInt(3809), .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, - // isdigit - .{ .tag = @enumFromInt(3810), .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, - // isgraph - .{ .tag = @enumFromInt(3811), .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, - // islower - .{ .tag = @enumFromInt(3812), .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, - // isprint - .{ .tag = @enumFromInt(3813), .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, - // ispunct - .{ .tag = @enumFromInt(3814), .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, - // isspace - .{ .tag = @enumFromInt(3815), .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, - // isupper - .{ .tag = @enumFromInt(3816), .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, - // isxdigit - .{ .tag = @enumFromInt(3817), .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, - // labs - .{ .tag = @enumFromInt(3818), .properties = .{ .param_str = "LiLi", .header = .stdlib, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // ldexp - .{ .tag = @enumFromInt(3819), .properties = .{ .param_str = "ddi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // ldexpf - .{ .tag = @enumFromInt(3820), .properties = .{ .param_str = "ffi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // ldexpl - .{ .tag = @enumFromInt(3821), .properties = .{ .param_str = "LdLdi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // lgamma - .{ .tag = @enumFromInt(3822), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, - // lgammaf - .{ .tag = @enumFromInt(3823), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, - // lgammal - .{ .tag = @enumFromInt(3824), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, - // llabs - .{ .tag = @enumFromInt(3825), .properties = .{ .param_str = "LLiLLi", .header = .stdlib, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // llrint - .{ .tag = @enumFromInt(3826), .properties = .{ .param_str = "LLid", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // llrintf - .{ .tag = @enumFromInt(3827), .properties = .{ .param_str = "LLif", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // llrintl - .{ .tag = @enumFromInt(3828), .properties = .{ .param_str = "LLiLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // llround - .{ .tag = @enumFromInt(3829), .properties = .{ .param_str = "LLid", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // llroundf - .{ .tag = @enumFromInt(3830), .properties = .{ .param_str = "LLif", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // llroundl - .{ .tag = @enumFromInt(3831), .properties = .{ .param_str = "LLiLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // log - .{ .tag = @enumFromInt(3832), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // log10 - .{ .tag = @enumFromInt(3833), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // log10f - .{ .tag = @enumFromInt(3834), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // log10l - .{ .tag = @enumFromInt(3835), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // log1p - .{ .tag = @enumFromInt(3836), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // log1pf - .{ .tag = @enumFromInt(3837), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // log1pl - .{ .tag = @enumFromInt(3838), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // log2 - .{ .tag = @enumFromInt(3839), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // log2f - .{ .tag = @enumFromInt(3840), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // log2l - .{ .tag = @enumFromInt(3841), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // logb - .{ .tag = @enumFromInt(3842), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // logbf - .{ .tag = @enumFromInt(3843), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // logbl - .{ .tag = @enumFromInt(3844), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // logf - .{ .tag = @enumFromInt(3845), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // logl - .{ .tag = @enumFromInt(3846), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // longjmp - .{ .tag = @enumFromInt(3847), .properties = .{ .param_str = "vJi", .header = .setjmp, .attributes = .{ .noreturn = true, .allow_type_mismatch = true, .lib_function_without_prefix = true } } }, - // lrint - .{ .tag = @enumFromInt(3848), .properties = .{ .param_str = "Lid", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // lrintf - .{ .tag = @enumFromInt(3849), .properties = .{ .param_str = "Lif", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // lrintl - .{ .tag = @enumFromInt(3850), .properties = .{ .param_str = "LiLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // lround - .{ .tag = @enumFromInt(3851), .properties = .{ .param_str = "Lid", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // lroundf - .{ .tag = @enumFromInt(3852), .properties = .{ .param_str = "Lif", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // lroundl - .{ .tag = @enumFromInt(3853), .properties = .{ .param_str = "LiLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // malloc - .{ .tag = @enumFromInt(3854), .properties = .{ .param_str = "v*z", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, - // memalign - .{ .tag = @enumFromInt(3855), .properties = .{ .param_str = "v*zz", .header = .malloc, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, - // memccpy - .{ .tag = @enumFromInt(3856), .properties = .{ .param_str = "v*v*vC*iz", .header = .string, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, - // memchr - .{ .tag = @enumFromInt(3857), .properties = .{ .param_str = "v*vC*iz", .header = .string, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, - // memcmp - .{ .tag = @enumFromInt(3858), .properties = .{ .param_str = "ivC*vC*z", .header = .string, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, - // memcpy - .{ .tag = @enumFromInt(3859), .properties = .{ .param_str = "v*v*vC*z", .header = .string, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, - // memmove - .{ .tag = @enumFromInt(3860), .properties = .{ .param_str = "v*v*vC*z", .header = .string, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, - // mempcpy - .{ .tag = @enumFromInt(3861), .properties = .{ .param_str = "v*v*vC*z", .header = .string, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, - // memset - .{ .tag = @enumFromInt(3862), .properties = .{ .param_str = "v*v*iz", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, - // modf - .{ .tag = @enumFromInt(3863), .properties = .{ .param_str = "ddd*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, - // modff - .{ .tag = @enumFromInt(3864), .properties = .{ .param_str = "fff*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, - // modfl - .{ .tag = @enumFromInt(3865), .properties = .{ .param_str = "LdLdLd*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, - // nan - .{ .tag = @enumFromInt(3866), .properties = .{ .param_str = "dcC*", .header = .math, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, - // nanf - .{ .tag = @enumFromInt(3867), .properties = .{ .param_str = "fcC*", .header = .math, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, - // nanl - .{ .tag = @enumFromInt(3868), .properties = .{ .param_str = "LdcC*", .header = .math, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, - // nearbyint - .{ .tag = @enumFromInt(3869), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // nearbyintf - .{ .tag = @enumFromInt(3870), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // nearbyintl - .{ .tag = @enumFromInt(3871), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // nextafter - .{ .tag = @enumFromInt(3872), .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // nextafterf - .{ .tag = @enumFromInt(3873), .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // nextafterl - .{ .tag = @enumFromInt(3874), .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // nexttoward - .{ .tag = @enumFromInt(3875), .properties = .{ .param_str = "ddLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // nexttowardf - .{ .tag = @enumFromInt(3876), .properties = .{ .param_str = "ffLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // nexttowardl - .{ .tag = @enumFromInt(3877), .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // pow - .{ .tag = @enumFromInt(3878), .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // powf - .{ .tag = @enumFromInt(3879), .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // powl - .{ .tag = @enumFromInt(3880), .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // printf - .{ .tag = @enumFromInt(3881), .properties = .{ .param_str = "icC*.", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .printf } } }, - // realloc - .{ .tag = @enumFromInt(3882), .properties = .{ .param_str = "v*v*z", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, - // remainder - .{ .tag = @enumFromInt(3883), .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // remainderf - .{ .tag = @enumFromInt(3884), .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // remainderl - .{ .tag = @enumFromInt(3885), .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // remquo - .{ .tag = @enumFromInt(3886), .properties = .{ .param_str = "dddi*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, - // remquof - .{ .tag = @enumFromInt(3887), .properties = .{ .param_str = "fffi*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, - // remquol - .{ .tag = @enumFromInt(3888), .properties = .{ .param_str = "LdLdLdi*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, - // rindex - .{ .tag = @enumFromInt(3889), .properties = .{ .param_str = "c*cC*i", .header = .strings, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, - // rint - .{ .tag = @enumFromInt(3890), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_fp_exceptions = true } } }, - // rintf - .{ .tag = @enumFromInt(3891), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_fp_exceptions = true } } }, - // rintl - .{ .tag = @enumFromInt(3892), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_fp_exceptions = true } } }, - // round - .{ .tag = @enumFromInt(3893), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // roundeven - .{ .tag = @enumFromInt(3894), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // roundevenf - .{ .tag = @enumFromInt(3895), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // roundevenl - .{ .tag = @enumFromInt(3896), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // roundf - .{ .tag = @enumFromInt(3897), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // roundl - .{ .tag = @enumFromInt(3898), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // savectx - .{ .tag = @enumFromInt(3899), .properties = .{ .param_str = "iJ", .header = .setjmp, .attributes = .{ .allow_type_mismatch = true, .lib_function_without_prefix = true, .returns_twice = true } } }, - // scalbln - .{ .tag = @enumFromInt(3900), .properties = .{ .param_str = "ddLi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // scalblnf - .{ .tag = @enumFromInt(3901), .properties = .{ .param_str = "ffLi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // scalblnl - .{ .tag = @enumFromInt(3902), .properties = .{ .param_str = "LdLdLi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // scalbn - .{ .tag = @enumFromInt(3903), .properties = .{ .param_str = "ddi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // scalbnf - .{ .tag = @enumFromInt(3904), .properties = .{ .param_str = "ffi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // scalbnl - .{ .tag = @enumFromInt(3905), .properties = .{ .param_str = "LdLdi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // scanf - .{ .tag = @enumFromInt(3906), .properties = .{ .param_str = "icC*R.", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .scanf } } }, - // setjmp - .{ .tag = @enumFromInt(3907), .properties = .{ .param_str = "iJ", .header = .setjmp, .attributes = .{ .allow_type_mismatch = true, .lib_function_without_prefix = true, .returns_twice = true } } }, - // siglongjmp - .{ .tag = @enumFromInt(3908), .properties = .{ .param_str = "vSJi", .header = .setjmp, .language = .all_gnu_languages, .attributes = .{ .noreturn = true, .allow_type_mismatch = true, .lib_function_without_prefix = true } } }, - // sigsetjmp - .{ .tag = @enumFromInt(3909), .properties = .{ .param_str = "iSJi", .header = .setjmp, .attributes = .{ .allow_type_mismatch = true, .lib_function_without_prefix = true, .returns_twice = true } } }, - // sin - .{ .tag = @enumFromInt(3910), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // sinf - .{ .tag = @enumFromInt(3911), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // sinh - .{ .tag = @enumFromInt(3912), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // sinhf - .{ .tag = @enumFromInt(3913), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // sinhl - .{ .tag = @enumFromInt(3914), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // sinl - .{ .tag = @enumFromInt(3915), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // snprintf - .{ .tag = @enumFromInt(3916), .properties = .{ .param_str = "ic*zcC*.", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .printf, .format_string_position = 2 } } }, - // sprintf - .{ .tag = @enumFromInt(3917), .properties = .{ .param_str = "ic*cC*.", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .printf, .format_string_position = 1 } } }, - // sqrt - .{ .tag = @enumFromInt(3918), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // sqrtf - .{ .tag = @enumFromInt(3919), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // sqrtl - .{ .tag = @enumFromInt(3920), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // sscanf - .{ .tag = @enumFromInt(3921), .properties = .{ .param_str = "icC*RcC*R.", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .scanf, .format_string_position = 1 } } }, - // stpcpy - .{ .tag = @enumFromInt(3922), .properties = .{ .param_str = "c*c*cC*", .header = .string, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, - // stpncpy - .{ .tag = @enumFromInt(3923), .properties = .{ .param_str = "c*c*cC*z", .header = .string, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, - // strcasecmp - .{ .tag = @enumFromInt(3924), .properties = .{ .param_str = "icC*cC*", .header = .strings, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, - // strcat - .{ .tag = @enumFromInt(3925), .properties = .{ .param_str = "c*c*cC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, - // strchr - .{ .tag = @enumFromInt(3926), .properties = .{ .param_str = "c*cC*i", .header = .string, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, - // strcmp - .{ .tag = @enumFromInt(3927), .properties = .{ .param_str = "icC*cC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, - // strcpy - .{ .tag = @enumFromInt(3928), .properties = .{ .param_str = "c*c*cC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, - // strcspn - .{ .tag = @enumFromInt(3929), .properties = .{ .param_str = "zcC*cC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, - // strdup - .{ .tag = @enumFromInt(3930), .properties = .{ .param_str = "c*cC*", .header = .string, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, - // strerror - .{ .tag = @enumFromInt(3931), .properties = .{ .param_str = "c*i", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, - // strlcat - .{ .tag = @enumFromInt(3932), .properties = .{ .param_str = "zc*cC*z", .header = .string, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, - // strlcpy - .{ .tag = @enumFromInt(3933), .properties = .{ .param_str = "zc*cC*z", .header = .string, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, - // strlen - .{ .tag = @enumFromInt(3934), .properties = .{ .param_str = "zcC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, - // strncasecmp - .{ .tag = @enumFromInt(3935), .properties = .{ .param_str = "icC*cC*z", .header = .strings, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, - // strncat - .{ .tag = @enumFromInt(3936), .properties = .{ .param_str = "c*c*cC*z", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, - // strncmp - .{ .tag = @enumFromInt(3937), .properties = .{ .param_str = "icC*cC*z", .header = .string, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, - // strncpy - .{ .tag = @enumFromInt(3938), .properties = .{ .param_str = "c*c*cC*z", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, - // strndup - .{ .tag = @enumFromInt(3939), .properties = .{ .param_str = "c*cC*z", .header = .string, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, - // strpbrk - .{ .tag = @enumFromInt(3940), .properties = .{ .param_str = "c*cC*cC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, - // strrchr - .{ .tag = @enumFromInt(3941), .properties = .{ .param_str = "c*cC*i", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, - // strspn - .{ .tag = @enumFromInt(3942), .properties = .{ .param_str = "zcC*cC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, - // strstr - .{ .tag = @enumFromInt(3943), .properties = .{ .param_str = "c*cC*cC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, - // strtod - .{ .tag = @enumFromInt(3944), .properties = .{ .param_str = "dcC*c**", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, - // strtof - .{ .tag = @enumFromInt(3945), .properties = .{ .param_str = "fcC*c**", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, - // strtok - .{ .tag = @enumFromInt(3946), .properties = .{ .param_str = "c*c*cC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, - // strtol - .{ .tag = @enumFromInt(3947), .properties = .{ .param_str = "LicC*c**i", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, - // strtold - .{ .tag = @enumFromInt(3948), .properties = .{ .param_str = "LdcC*c**", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, - // strtoll - .{ .tag = @enumFromInt(3949), .properties = .{ .param_str = "LLicC*c**i", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, - // strtoul - .{ .tag = @enumFromInt(3950), .properties = .{ .param_str = "ULicC*c**i", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, - // strtoull - .{ .tag = @enumFromInt(3951), .properties = .{ .param_str = "ULLicC*c**i", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, - // strxfrm - .{ .tag = @enumFromInt(3952), .properties = .{ .param_str = "zc*cC*z", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, - // tan - .{ .tag = @enumFromInt(3953), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // tanf - .{ .tag = @enumFromInt(3954), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // tanh - .{ .tag = @enumFromInt(3955), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // tanhf - .{ .tag = @enumFromInt(3956), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // tanhl - .{ .tag = @enumFromInt(3957), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // tanl - .{ .tag = @enumFromInt(3958), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // tgamma - .{ .tag = @enumFromInt(3959), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // tgammaf - .{ .tag = @enumFromInt(3960), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // tgammal - .{ .tag = @enumFromInt(3961), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, - // tolower - .{ .tag = @enumFromInt(3962), .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, - // toupper - .{ .tag = @enumFromInt(3963), .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, - // trunc - .{ .tag = @enumFromInt(3964), .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // truncf - .{ .tag = @enumFromInt(3965), .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // truncl - .{ .tag = @enumFromInt(3966), .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, - // va_copy - .{ .tag = @enumFromInt(3967), .properties = .{ .param_str = "vAA", .header = .stdarg, .attributes = .{ .lib_function_without_prefix = true } } }, - // va_end - .{ .tag = @enumFromInt(3968), .properties = .{ .param_str = "vA", .header = .stdarg, .attributes = .{ .lib_function_without_prefix = true } } }, - // va_start - .{ .tag = @enumFromInt(3969), .properties = .{ .param_str = "vA.", .header = .stdarg, .attributes = .{ .lib_function_without_prefix = true } } }, - // vfork - .{ .tag = @enumFromInt(3970), .properties = .{ .param_str = "p", .header = .unistd, .attributes = .{ .allow_type_mismatch = true, .lib_function_without_prefix = true, .returns_twice = true } } }, - // vfprintf - .{ .tag = @enumFromInt(3971), .properties = .{ .param_str = "iP*cC*a", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .vprintf, .format_string_position = 1 } } }, - // vfscanf - .{ .tag = @enumFromInt(3972), .properties = .{ .param_str = "iP*RcC*Ra", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .vscanf, .format_string_position = 1 } } }, - // vprintf - .{ .tag = @enumFromInt(3973), .properties = .{ .param_str = "icC*a", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .vprintf } } }, - // vscanf - .{ .tag = @enumFromInt(3974), .properties = .{ .param_str = "icC*Ra", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .vscanf } } }, - // vsnprintf - .{ .tag = @enumFromInt(3975), .properties = .{ .param_str = "ic*zcC*a", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .vprintf, .format_string_position = 2 } } }, - // vsprintf - .{ .tag = @enumFromInt(3976), .properties = .{ .param_str = "ic*cC*a", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .vprintf, .format_string_position = 1 } } }, - // vsscanf - .{ .tag = @enumFromInt(3977), .properties = .{ .param_str = "icC*RcC*Ra", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .vscanf, .format_string_position = 1 } } }, - // wcschr - .{ .tag = @enumFromInt(3978), .properties = .{ .param_str = "w*wC*w", .header = .wchar, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, - // wcscmp - .{ .tag = @enumFromInt(3979), .properties = .{ .param_str = "iwC*wC*", .header = .wchar, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, - // wcslen - .{ .tag = @enumFromInt(3980), .properties = .{ .param_str = "zwC*", .header = .wchar, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, - // wcsncmp - .{ .tag = @enumFromInt(3981), .properties = .{ .param_str = "iwC*wC*z", .header = .wchar, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, - // wmemchr - .{ .tag = @enumFromInt(3982), .properties = .{ .param_str = "w*wC*wz", .header = .wchar, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, - // wmemcmp - .{ .tag = @enumFromInt(3983), .properties = .{ .param_str = "iwC*wC*z", .header = .wchar, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, - // wmemcpy - .{ .tag = @enumFromInt(3984), .properties = .{ .param_str = "w*w*wC*z", .header = .wchar, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, - // wmemmove - .{ .tag = @enumFromInt(3985), .properties = .{ .param_str = "w*w*wC*z", .header = .wchar, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, + .{ .tag = ._Block_object_assign, .properties = .{ .param_str = "vv*vC*iC", .header = .blocks, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = ._Block_object_dispose, .properties = .{ .param_str = "vvC*iC", .header = .blocks, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = ._Exit, .properties = .{ .param_str = "vi", .header = .stdlib, .attributes = .{ .noreturn = true, .lib_function_without_prefix = true } } }, + .{ .tag = ._InterlockedAnd, .properties = .{ .param_str = "NiNiD*Ni", .language = .all_ms_languages } }, + .{ .tag = ._InterlockedAnd16, .properties = .{ .param_str = "ssD*s", .language = .all_ms_languages } }, + .{ .tag = ._InterlockedAnd8, .properties = .{ .param_str = "ccD*c", .language = .all_ms_languages } }, + .{ .tag = ._InterlockedCompareExchange, .properties = .{ .param_str = "NiNiD*NiNi", .language = .all_ms_languages } }, + .{ .tag = ._InterlockedCompareExchange16, .properties = .{ .param_str = "ssD*ss", .language = .all_ms_languages } }, + .{ .tag = ._InterlockedCompareExchange64, .properties = .{ .param_str = "LLiLLiD*LLiLLi", .language = .all_ms_languages } }, + .{ .tag = ._InterlockedCompareExchange8, .properties = .{ .param_str = "ccD*cc", .language = .all_ms_languages } }, + .{ .tag = ._InterlockedCompareExchangePointer, .properties = .{ .param_str = "v*v*D*v*v*", .language = .all_ms_languages } }, + .{ .tag = ._InterlockedCompareExchangePointer_nf, .properties = .{ .param_str = "v*v*D*v*v*", .language = .all_ms_languages } }, + .{ .tag = ._InterlockedDecrement, .properties = .{ .param_str = "NiNiD*", .language = .all_ms_languages } }, + .{ .tag = ._InterlockedDecrement16, .properties = .{ .param_str = "ssD*", .language = .all_ms_languages } }, + .{ .tag = ._InterlockedExchange, .properties = .{ .param_str = "NiNiD*Ni", .language = .all_ms_languages } }, + .{ .tag = ._InterlockedExchange16, .properties = .{ .param_str = "ssD*s", .language = .all_ms_languages } }, + .{ .tag = ._InterlockedExchange8, .properties = .{ .param_str = "ccD*c", .language = .all_ms_languages } }, + .{ .tag = ._InterlockedExchangeAdd, .properties = .{ .param_str = "NiNiD*Ni", .language = .all_ms_languages } }, + .{ .tag = ._InterlockedExchangeAdd16, .properties = .{ .param_str = "ssD*s", .language = .all_ms_languages } }, + .{ .tag = ._InterlockedExchangeAdd8, .properties = .{ .param_str = "ccD*c", .language = .all_ms_languages } }, + .{ .tag = ._InterlockedExchangePointer, .properties = .{ .param_str = "v*v*D*v*", .language = .all_ms_languages } }, + .{ .tag = ._InterlockedExchangeSub, .properties = .{ .param_str = "NiNiD*Ni", .language = .all_ms_languages } }, + .{ .tag = ._InterlockedExchangeSub16, .properties = .{ .param_str = "ssD*s", .language = .all_ms_languages } }, + .{ .tag = ._InterlockedExchangeSub8, .properties = .{ .param_str = "ccD*c", .language = .all_ms_languages } }, + .{ .tag = ._InterlockedIncrement, .properties = .{ .param_str = "NiNiD*", .language = .all_ms_languages } }, + .{ .tag = ._InterlockedIncrement16, .properties = .{ .param_str = "ssD*", .language = .all_ms_languages } }, + .{ .tag = ._InterlockedOr, .properties = .{ .param_str = "NiNiD*Ni", .language = .all_ms_languages } }, + .{ .tag = ._InterlockedOr16, .properties = .{ .param_str = "ssD*s", .language = .all_ms_languages } }, + .{ .tag = ._InterlockedOr8, .properties = .{ .param_str = "ccD*c", .language = .all_ms_languages } }, + .{ .tag = ._InterlockedXor, .properties = .{ .param_str = "NiNiD*Ni", .language = .all_ms_languages } }, + .{ .tag = ._InterlockedXor16, .properties = .{ .param_str = "ssD*s", .language = .all_ms_languages } }, + .{ .tag = ._InterlockedXor8, .properties = .{ .param_str = "ccD*c", .language = .all_ms_languages } }, + .{ .tag = ._MoveFromCoprocessor, .properties = .{ .param_str = "UiIUiIUiIUiIUiIUi", .language = .all_ms_languages, .target_set = TargetSet.initOne(.arm) } }, + .{ .tag = ._MoveFromCoprocessor2, .properties = .{ .param_str = "UiIUiIUiIUiIUiIUi", .language = .all_ms_languages, .target_set = TargetSet.initOne(.arm) } }, + .{ .tag = ._MoveToCoprocessor, .properties = .{ .param_str = "vUiIUiIUiIUiIUiIUi", .language = .all_ms_languages, .target_set = TargetSet.initOne(.arm) } }, + .{ .tag = ._MoveToCoprocessor2, .properties = .{ .param_str = "vUiIUiIUiIUiIUiIUi", .language = .all_ms_languages, .target_set = TargetSet.initOne(.arm) } }, + .{ .tag = ._ReturnAddress, .properties = .{ .param_str = "v*", .language = .all_ms_languages } }, + .{ .tag = .__GetExceptionInfo, .properties = .{ .param_str = "v*.", .language = .all_ms_languages, .attributes = .{ .custom_typecheck = true, .eval_args = false } } }, + .{ .tag = .__abnormal_termination, .properties = .{ .param_str = "i", .language = .all_ms_languages } }, + .{ .tag = .__annotation, .properties = .{ .param_str = "wC*.", .language = .all_ms_languages } }, + .{ .tag = .__arithmetic_fence, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true, .const_evaluable = true } } }, + .{ .tag = .__assume, .properties = .{ .param_str = "vb", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, + .{ .tag = .__atomic_add_fetch, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__atomic_always_lock_free, .properties = .{ .param_str = "bzvCD*", .attributes = .{ .const_evaluable = true } } }, + .{ .tag = .__atomic_and_fetch, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__atomic_clear, .properties = .{ .param_str = "vvD*i" } }, + .{ .tag = .__atomic_compare_exchange, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__atomic_compare_exchange_n, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__atomic_exchange, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__atomic_exchange_n, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__atomic_fetch_add, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__atomic_fetch_and, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__atomic_fetch_max, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__atomic_fetch_min, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__atomic_fetch_nand, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__atomic_fetch_or, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__atomic_fetch_sub, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__atomic_fetch_xor, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__atomic_is_lock_free, .properties = .{ .param_str = "bzvCD*", .attributes = .{ .const_evaluable = true } } }, + .{ .tag = .__atomic_load, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__atomic_load_n, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__atomic_max_fetch, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__atomic_min_fetch, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__atomic_nand_fetch, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__atomic_or_fetch, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__atomic_signal_fence, .properties = .{ .param_str = "vi" } }, + .{ .tag = .__atomic_store, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__atomic_store_n, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__atomic_sub_fetch, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__atomic_test_and_set, .properties = .{ .param_str = "bvD*i" } }, + .{ .tag = .__atomic_thread_fence, .properties = .{ .param_str = "vi" } }, + .{ .tag = .__atomic_xor_fetch, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__builtin___CFStringMakeConstantString, .properties = .{ .param_str = "FC*cC*", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin___NSStringMakeConstantString, .properties = .{ .param_str = "FC*cC*", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin___clear_cache, .properties = .{ .param_str = "vc*c*" } }, + .{ .tag = .__builtin___fprintf_chk, .properties = .{ .param_str = "iP*RicC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .printf, .format_string_position = 2 } } }, + .{ .tag = .__builtin___get_unsafe_stack_bottom, .properties = .{ .param_str = "v*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin___get_unsafe_stack_ptr, .properties = .{ .param_str = "v*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin___get_unsafe_stack_start, .properties = .{ .param_str = "v*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin___get_unsafe_stack_top, .properties = .{ .param_str = "v*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin___memccpy_chk, .properties = .{ .param_str = "v*v*vC*izz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin___memcpy_chk, .properties = .{ .param_str = "v*v*vC*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin___memmove_chk, .properties = .{ .param_str = "v*v*vC*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin___mempcpy_chk, .properties = .{ .param_str = "v*v*vC*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin___memset_chk, .properties = .{ .param_str = "v*v*izz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin___printf_chk, .properties = .{ .param_str = "iicC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .printf, .format_string_position = 1 } } }, + .{ .tag = .__builtin___snprintf_chk, .properties = .{ .param_str = "ic*RzizcC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .printf, .format_string_position = 4 } } }, + .{ .tag = .__builtin___sprintf_chk, .properties = .{ .param_str = "ic*RizcC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .printf, .format_string_position = 3 } } }, + .{ .tag = .__builtin___stpcpy_chk, .properties = .{ .param_str = "c*c*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin___stpncpy_chk, .properties = .{ .param_str = "c*c*cC*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin___strcat_chk, .properties = .{ .param_str = "c*c*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin___strcpy_chk, .properties = .{ .param_str = "c*c*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin___strlcat_chk, .properties = .{ .param_str = "zc*cC*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin___strlcpy_chk, .properties = .{ .param_str = "zc*cC*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin___strncat_chk, .properties = .{ .param_str = "c*c*cC*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin___strncpy_chk, .properties = .{ .param_str = "c*c*cC*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin___vfprintf_chk, .properties = .{ .param_str = "iP*RicC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vprintf, .format_string_position = 2 } } }, + .{ .tag = .__builtin___vprintf_chk, .properties = .{ .param_str = "iicC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vprintf, .format_string_position = 1 } } }, + .{ .tag = .__builtin___vsnprintf_chk, .properties = .{ .param_str = "ic*RzizcC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vprintf, .format_string_position = 4 } } }, + .{ .tag = .__builtin___vsprintf_chk, .properties = .{ .param_str = "ic*RizcC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vprintf, .format_string_position = 3 } } }, + .{ .tag = .__builtin_abort, .properties = .{ .param_str = "v", .attributes = .{ .noreturn = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_abs, .properties = .{ .param_str = "ii", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_acos, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_acosf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_acosf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_acosh, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_acoshf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_acoshf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_acoshl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_acosl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_add_overflow, .properties = .{ .param_str = "b.", .attributes = .{ .custom_typecheck = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_addc, .properties = .{ .param_str = "UiUiCUiCUiCUi*" } }, + .{ .tag = .__builtin_addcb, .properties = .{ .param_str = "UcUcCUcCUcCUc*" } }, + .{ .tag = .__builtin_addcl, .properties = .{ .param_str = "ULiULiCULiCULiCULi*" } }, + .{ .tag = .__builtin_addcll, .properties = .{ .param_str = "ULLiULLiCULLiCULLiCULLi*" } }, + .{ .tag = .__builtin_addcs, .properties = .{ .param_str = "UsUsCUsCUsCUs*" } }, + .{ .tag = .__builtin_align_down, .properties = .{ .param_str = "v*vC*z", .attributes = .{ .@"const" = true, .custom_typecheck = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_align_up, .properties = .{ .param_str = "v*vC*z", .attributes = .{ .@"const" = true, .custom_typecheck = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_alloca, .properties = .{ .param_str = "v*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_alloca_uninitialized, .properties = .{ .param_str = "v*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_alloca_with_align, .properties = .{ .param_str = "v*zIz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_alloca_with_align_uninitialized, .properties = .{ .param_str = "v*zIz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_amdgcn_alignbit, .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_alignbyte, .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_atomic_dec32, .properties = .{ .param_str = "UZiUZiD*UZiUicC*", .target_set = TargetSet.initOne(.amdgpu) } }, + .{ .tag = .__builtin_amdgcn_atomic_dec64, .properties = .{ .param_str = "UWiUWiD*UWiUicC*", .target_set = TargetSet.initOne(.amdgpu) } }, + .{ .tag = .__builtin_amdgcn_atomic_inc32, .properties = .{ .param_str = "UZiUZiD*UZiUicC*", .target_set = TargetSet.initOne(.amdgpu) } }, + .{ .tag = .__builtin_amdgcn_atomic_inc64, .properties = .{ .param_str = "UWiUWiD*UWiUicC*", .target_set = TargetSet.initOne(.amdgpu) } }, + .{ .tag = .__builtin_amdgcn_buffer_wbinvl1, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.amdgpu) } }, + .{ .tag = .__builtin_amdgcn_class, .properties = .{ .param_str = "bdi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_classf, .properties = .{ .param_str = "bfi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_cosf, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_cubeid, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_cubema, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_cubesc, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_cubetc, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_cvt_pk_i16, .properties = .{ .param_str = "E2sii", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_cvt_pk_u16, .properties = .{ .param_str = "E2UsUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_cvt_pk_u8_f32, .properties = .{ .param_str = "UifUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_cvt_pknorm_i16, .properties = .{ .param_str = "E2sff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_cvt_pknorm_u16, .properties = .{ .param_str = "E2Usff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_cvt_pkrtz, .properties = .{ .param_str = "E2hff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_dispatch_ptr, .properties = .{ .param_str = "v*4", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_div_fixup, .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_div_fixupf, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_div_fmas, .properties = .{ .param_str = "ddddb", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_div_fmasf, .properties = .{ .param_str = "ffffb", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_div_scale, .properties = .{ .param_str = "dddbb*", .target_set = TargetSet.initOne(.amdgpu) } }, + .{ .tag = .__builtin_amdgcn_div_scalef, .properties = .{ .param_str = "fffbb*", .target_set = TargetSet.initOne(.amdgpu) } }, + .{ .tag = .__builtin_amdgcn_ds_append, .properties = .{ .param_str = "ii*3", .target_set = TargetSet.initOne(.amdgpu) } }, + .{ .tag = .__builtin_amdgcn_ds_bpermute, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_ds_consume, .properties = .{ .param_str = "ii*3", .target_set = TargetSet.initOne(.amdgpu) } }, + .{ .tag = .__builtin_amdgcn_ds_faddf, .properties = .{ .param_str = "ff*3fIiIiIb", .target_set = TargetSet.initOne(.amdgpu) } }, + .{ .tag = .__builtin_amdgcn_ds_fmaxf, .properties = .{ .param_str = "ff*3fIiIiIb", .target_set = TargetSet.initOne(.amdgpu) } }, + .{ .tag = .__builtin_amdgcn_ds_fminf, .properties = .{ .param_str = "ff*3fIiIiIb", .target_set = TargetSet.initOne(.amdgpu) } }, + .{ .tag = .__builtin_amdgcn_ds_permute, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_ds_swizzle, .properties = .{ .param_str = "iiIi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_endpgm, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .noreturn = true } } }, + .{ .tag = .__builtin_amdgcn_exp2f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_fcmp, .properties = .{ .param_str = "WUiddIi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_fcmpf, .properties = .{ .param_str = "WUiffIi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_fence, .properties = .{ .param_str = "vUicC*", .target_set = TargetSet.initOne(.amdgpu) } }, + .{ .tag = .__builtin_amdgcn_fmed3f, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_fract, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_fractf, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_frexp_exp, .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_frexp_expf, .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_frexp_mant, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_frexp_mantf, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_grid_size_x, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_grid_size_y, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_grid_size_z, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_groupstaticsize, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu) } }, + .{ .tag = .__builtin_amdgcn_iglp_opt, .properties = .{ .param_str = "vIi", .target_set = TargetSet.initOne(.amdgpu) } }, + .{ .tag = .__builtin_amdgcn_implicitarg_ptr, .properties = .{ .param_str = "v*4", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_interp_mov, .properties = .{ .param_str = "fUiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_interp_p1, .properties = .{ .param_str = "ffUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_interp_p1_f16, .properties = .{ .param_str = "ffUiUibUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_interp_p2, .properties = .{ .param_str = "fffUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_interp_p2_f16, .properties = .{ .param_str = "hffUiUibUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_is_private, .properties = .{ .param_str = "bvC*0", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_is_shared, .properties = .{ .param_str = "bvC*0", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_kernarg_segment_ptr, .properties = .{ .param_str = "v*4", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_ldexp, .properties = .{ .param_str = "ddi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_ldexpf, .properties = .{ .param_str = "ffi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_lerp, .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_log_clampf, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_logf, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_mbcnt_hi, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_mbcnt_lo, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_mqsad_pk_u16_u8, .properties = .{ .param_str = "WUiWUiUiWUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_mqsad_u32_u8, .properties = .{ .param_str = "V4UiWUiUiV4Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_msad_u8, .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_qsad_pk_u16_u8, .properties = .{ .param_str = "WUiWUiUiWUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_queue_ptr, .properties = .{ .param_str = "v*4", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_rcp, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_rcpf, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_read_exec, .properties = .{ .param_str = "WUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_read_exec_hi, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_read_exec_lo, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_readfirstlane, .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_readlane, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_rsq, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_rsq_clamp, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_rsq_clampf, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_rsqf, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_s_barrier, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.amdgpu) } }, + .{ .tag = .__builtin_amdgcn_s_dcache_inv, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.amdgpu) } }, + .{ .tag = .__builtin_amdgcn_s_decperflevel, .properties = .{ .param_str = "vIi", .target_set = TargetSet.initOne(.amdgpu) } }, + .{ .tag = .__builtin_amdgcn_s_getpc, .properties = .{ .param_str = "WUi", .target_set = TargetSet.initOne(.amdgpu) } }, + .{ .tag = .__builtin_amdgcn_s_getreg, .properties = .{ .param_str = "UiIi", .target_set = TargetSet.initOne(.amdgpu) } }, + .{ .tag = .__builtin_amdgcn_s_incperflevel, .properties = .{ .param_str = "vIi", .target_set = TargetSet.initOne(.amdgpu) } }, + .{ .tag = .__builtin_amdgcn_s_sendmsg, .properties = .{ .param_str = "vIiUi", .target_set = TargetSet.initOne(.amdgpu) } }, + .{ .tag = .__builtin_amdgcn_s_sendmsghalt, .properties = .{ .param_str = "vIiUi", .target_set = TargetSet.initOne(.amdgpu) } }, + .{ .tag = .__builtin_amdgcn_s_setprio, .properties = .{ .param_str = "vIs", .target_set = TargetSet.initOne(.amdgpu) } }, + .{ .tag = .__builtin_amdgcn_s_setreg, .properties = .{ .param_str = "vIiUi", .target_set = TargetSet.initOne(.amdgpu) } }, + .{ .tag = .__builtin_amdgcn_s_sleep, .properties = .{ .param_str = "vIi", .target_set = TargetSet.initOne(.amdgpu) } }, + .{ .tag = .__builtin_amdgcn_s_waitcnt, .properties = .{ .param_str = "vIi", .target_set = TargetSet.initOne(.amdgpu) } }, + .{ .tag = .__builtin_amdgcn_sad_hi_u8, .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_sad_u16, .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_sad_u8, .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_sbfe, .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_sched_barrier, .properties = .{ .param_str = "vIi", .target_set = TargetSet.initOne(.amdgpu) } }, + .{ .tag = .__builtin_amdgcn_sched_group_barrier, .properties = .{ .param_str = "vIiIiIi", .target_set = TargetSet.initOne(.amdgpu) } }, + .{ .tag = .__builtin_amdgcn_sicmp, .properties = .{ .param_str = "WUiiiIi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_sicmpl, .properties = .{ .param_str = "WUiWiWiIi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_sinf, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_sqrt, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_sqrtf, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_trig_preop, .properties = .{ .param_str = "ddi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_trig_preopf, .properties = .{ .param_str = "ffi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_ubfe, .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_uicmp, .properties = .{ .param_str = "WUiUiUiIi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_uicmpl, .properties = .{ .param_str = "WUiWUiWUiIi", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_wave_barrier, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.amdgpu) } }, + .{ .tag = .__builtin_amdgcn_workgroup_id_x, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_workgroup_id_y, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_workgroup_id_z, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_workgroup_size_x, .properties = .{ .param_str = "Us", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_workgroup_size_y, .properties = .{ .param_str = "Us", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_workgroup_size_z, .properties = .{ .param_str = "Us", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_workitem_id_x, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_workitem_id_y, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_amdgcn_workitem_id_z, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_annotation, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__builtin_arm_cdp, .properties = .{ .param_str = "vUIiUIiUIiUIiUIiUIi", .target_set = TargetSet.initOne(.arm) } }, + .{ .tag = .__builtin_arm_cdp2, .properties = .{ .param_str = "vUIiUIiUIiUIiUIiUIi", .target_set = TargetSet.initOne(.arm) } }, + .{ .tag = .__builtin_arm_clrex, .properties = .{ .param_str = "v", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, + .{ .tag = .__builtin_arm_cls, .properties = .{ .param_str = "UiZUi", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_cls64, .properties = .{ .param_str = "UiWUi", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_clz, .properties = .{ .param_str = "UiZUi", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_clz64, .properties = .{ .param_str = "UiWUi", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_cmse_TT, .properties = .{ .param_str = "Uiv*", .target_set = TargetSet.initOne(.arm) } }, + .{ .tag = .__builtin_arm_cmse_TTA, .properties = .{ .param_str = "Uiv*", .target_set = TargetSet.initOne(.arm) } }, + .{ .tag = .__builtin_arm_cmse_TTAT, .properties = .{ .param_str = "Uiv*", .target_set = TargetSet.initOne(.arm) } }, + .{ .tag = .__builtin_arm_cmse_TTT, .properties = .{ .param_str = "Uiv*", .target_set = TargetSet.initOne(.arm) } }, + .{ .tag = .__builtin_arm_dbg, .properties = .{ .param_str = "vUi", .target_set = TargetSet.initOne(.arm) } }, + .{ .tag = .__builtin_arm_dmb, .properties = .{ .param_str = "vUi", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_dsb, .properties = .{ .param_str = "vUi", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_get_fpscr, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_isb, .properties = .{ .param_str = "vUi", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_ldaex, .properties = .{ .param_str = "v.", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__builtin_arm_ldc, .properties = .{ .param_str = "vUIiUIivC*", .target_set = TargetSet.initOne(.arm) } }, + .{ .tag = .__builtin_arm_ldc2, .properties = .{ .param_str = "vUIiUIivC*", .target_set = TargetSet.initOne(.arm) } }, + .{ .tag = .__builtin_arm_ldc2l, .properties = .{ .param_str = "vUIiUIivC*", .target_set = TargetSet.initOne(.arm) } }, + .{ .tag = .__builtin_arm_ldcl, .properties = .{ .param_str = "vUIiUIivC*", .target_set = TargetSet.initOne(.arm) } }, + .{ .tag = .__builtin_arm_ldrex, .properties = .{ .param_str = "v.", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__builtin_arm_ldrexd, .properties = .{ .param_str = "LLUiv*", .target_set = TargetSet.initOne(.arm) } }, + .{ .tag = .__builtin_arm_mcr, .properties = .{ .param_str = "vUIiUIiUiUIiUIiUIi", .target_set = TargetSet.initOne(.arm) } }, + .{ .tag = .__builtin_arm_mcr2, .properties = .{ .param_str = "vUIiUIiUiUIiUIiUIi", .target_set = TargetSet.initOne(.arm) } }, + .{ .tag = .__builtin_arm_mcrr, .properties = .{ .param_str = "vUIiUIiLLUiUIi", .target_set = TargetSet.initOne(.arm) } }, + .{ .tag = .__builtin_arm_mcrr2, .properties = .{ .param_str = "vUIiUIiLLUiUIi", .target_set = TargetSet.initOne(.arm) } }, + .{ .tag = .__builtin_arm_mrc, .properties = .{ .param_str = "UiUIiUIiUIiUIiUIi", .target_set = TargetSet.initOne(.arm) } }, + .{ .tag = .__builtin_arm_mrc2, .properties = .{ .param_str = "UiUIiUIiUIiUIiUIi", .target_set = TargetSet.initOne(.arm) } }, + .{ .tag = .__builtin_arm_mrrc, .properties = .{ .param_str = "LLUiUIiUIiUIi", .target_set = TargetSet.initOne(.arm) } }, + .{ .tag = .__builtin_arm_mrrc2, .properties = .{ .param_str = "LLUiUIiUIiUIi", .target_set = TargetSet.initOne(.arm) } }, + .{ .tag = .__builtin_arm_nop, .properties = .{ .param_str = "v", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, + .{ .tag = .__builtin_arm_prefetch, .properties = .{ .param_str = "!", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_qadd, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_qadd16, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_qadd8, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_qasx, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_qdbl, .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_qsax, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_qsub, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_qsub16, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_qsub8, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_rbit, .properties = .{ .param_str = "UiUi", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_rbit64, .properties = .{ .param_str = "WUiWUi", .target_set = TargetSet.initOne(.aarch64), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_rsr, .properties = .{ .param_str = "UicC*", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_rsr64, .properties = .{ .param_str = "!", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_rsrp, .properties = .{ .param_str = "v*cC*", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_sadd16, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_sadd8, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_sasx, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_sel, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_set_fpscr, .properties = .{ .param_str = "vUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_sev, .properties = .{ .param_str = "v", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, + .{ .tag = .__builtin_arm_sevl, .properties = .{ .param_str = "v", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, + .{ .tag = .__builtin_arm_shadd16, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_shadd8, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_shasx, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_shsax, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_shsub16, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_shsub8, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_smlabb, .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_smlabt, .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_smlad, .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_smladx, .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_smlald, .properties = .{ .param_str = "LLiiiLLi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_smlaldx, .properties = .{ .param_str = "LLiiiLLi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_smlatb, .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_smlatt, .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_smlawb, .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_smlawt, .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_smlsd, .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_smlsdx, .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_smlsld, .properties = .{ .param_str = "LLiiiLLi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_smlsldx, .properties = .{ .param_str = "LLiiiLLi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_smuad, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_smuadx, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_smulbb, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_smulbt, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_smultb, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_smultt, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_smulwb, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_smulwt, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_smusd, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_smusdx, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_ssat, .properties = .{ .param_str = "iiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_ssat16, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_ssax, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_ssub16, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_ssub8, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_stc, .properties = .{ .param_str = "vUIiUIiv*", .target_set = TargetSet.initOne(.arm) } }, + .{ .tag = .__builtin_arm_stc2, .properties = .{ .param_str = "vUIiUIiv*", .target_set = TargetSet.initOne(.arm) } }, + .{ .tag = .__builtin_arm_stc2l, .properties = .{ .param_str = "vUIiUIiv*", .target_set = TargetSet.initOne(.arm) } }, + .{ .tag = .__builtin_arm_stcl, .properties = .{ .param_str = "vUIiUIiv*", .target_set = TargetSet.initOne(.arm) } }, + .{ .tag = .__builtin_arm_stlex, .properties = .{ .param_str = "i.", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__builtin_arm_strex, .properties = .{ .param_str = "i.", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__builtin_arm_strexd, .properties = .{ .param_str = "iLLUiv*", .target_set = TargetSet.initOne(.arm) } }, + .{ .tag = .__builtin_arm_sxtab16, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_sxtb16, .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_tcancel, .properties = .{ .param_str = "vWUIi", .target_set = TargetSet.initOne(.aarch64) } }, + .{ .tag = .__builtin_arm_tcommit, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.aarch64) } }, + .{ .tag = .__builtin_arm_tstart, .properties = .{ .param_str = "WUi", .target_set = TargetSet.initOne(.aarch64), .attributes = .{ .returns_twice = true } } }, + .{ .tag = .__builtin_arm_ttest, .properties = .{ .param_str = "WUi", .target_set = TargetSet.initOne(.aarch64), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_uadd16, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_uadd8, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_uasx, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_uhadd16, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_uhadd8, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_uhasx, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_uhsax, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_uhsub16, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_uhsub8, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_uqadd16, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_uqadd8, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_uqasx, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_uqsax, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_uqsub16, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_uqsub8, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_usad8, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_usada8, .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_usat, .properties = .{ .param_str = "UiiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_usat16, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_usax, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_usub16, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_usub8, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_uxtab16, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_uxtb16, .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_vcvtr_d, .properties = .{ .param_str = "fdi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_vcvtr_f, .properties = .{ .param_str = "ffi", .target_set = TargetSet.initOne(.arm), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_wfe, .properties = .{ .param_str = "v", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, + .{ .tag = .__builtin_arm_wfi, .properties = .{ .param_str = "v", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, + .{ .tag = .__builtin_arm_wsr, .properties = .{ .param_str = "vcC*Ui", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_wsr64, .properties = .{ .param_str = "!", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_wsrp, .properties = .{ .param_str = "vcC*vC*", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_arm_yield, .properties = .{ .param_str = "v", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, + .{ .tag = .__builtin_asin, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_asinf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_asinf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_asinh, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_asinhf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_asinhf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_asinhl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_asinl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_assume, .properties = .{ .param_str = "vb", .attributes = .{ .const_evaluable = true } } }, + .{ .tag = .__builtin_assume_aligned, .properties = .{ .param_str = "v*vC*z.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_assume_separate_storage, .properties = .{ .param_str = "vvCD*vCD*", .attributes = .{ .const_evaluable = true } } }, + .{ .tag = .__builtin_atan, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_atan2, .properties = .{ .param_str = "ddd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_atan2f, .properties = .{ .param_str = "fff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_atan2f128, .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_atan2l, .properties = .{ .param_str = "LdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_atanf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_atanf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_atanh, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_atanhf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_atanhf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_atanhl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_atanl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_bcmp, .properties = .{ .param_str = "ivC*vC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_bcopy, .properties = .{ .param_str = "vvC*v*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_bitoffsetof, .properties = .{ .param_str = "z.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__builtin_bitrev, .properties = .{ .param_str = "UiUi", .target_set = TargetSet.initOne(.xcore), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_bitreverse16, .properties = .{ .param_str = "UsUs", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_bitreverse32, .properties = .{ .param_str = "UZiUZi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_bitreverse64, .properties = .{ .param_str = "UWiUWi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_bitreverse8, .properties = .{ .param_str = "UcUc", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_bswap16, .properties = .{ .param_str = "UsUs", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_bswap32, .properties = .{ .param_str = "UZiUZi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_bswap64, .properties = .{ .param_str = "UWiUWi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_bzero, .properties = .{ .param_str = "vv*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_cabs, .properties = .{ .param_str = "dXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_cabsf, .properties = .{ .param_str = "fXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_cabsl, .properties = .{ .param_str = "LdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_cacos, .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_cacosf, .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_cacosh, .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_cacoshf, .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_cacoshl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_cacosl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_call_with_static_chain, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__builtin_calloc, .properties = .{ .param_str = "v*zz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_canonicalize, .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_canonicalizef, .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_canonicalizef16, .properties = .{ .param_str = "hh", .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_canonicalizel, .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_carg, .properties = .{ .param_str = "dXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_cargf, .properties = .{ .param_str = "fXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_cargl, .properties = .{ .param_str = "LdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_casin, .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_casinf, .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_casinh, .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_casinhf, .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_casinhl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_casinl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_catan, .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_catanf, .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_catanh, .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_catanhf, .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_catanhl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_catanl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_cbrt, .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_cbrtf, .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_cbrtf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_cbrtl, .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_ccos, .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_ccosf, .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_ccosh, .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_ccoshf, .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_ccoshl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_ccosl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_ceil, .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_ceilf, .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_ceilf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_ceilf16, .properties = .{ .param_str = "hh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_ceill, .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_cexp, .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_cexpf, .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_cexpl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_char_memchr, .properties = .{ .param_str = "c*cC*iz", .attributes = .{ .const_evaluable = true } } }, + .{ .tag = .__builtin_choose_expr, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__builtin_cimag, .properties = .{ .param_str = "dXd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_cimagf, .properties = .{ .param_str = "fXf", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_cimagl, .properties = .{ .param_str = "LdXLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_classify_type, .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .eval_args = false, .const_evaluable = true } } }, + .{ .tag = .__builtin_clog, .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_clogf, .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_clogl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_clrsb, .properties = .{ .param_str = "ii", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_clrsbl, .properties = .{ .param_str = "iLi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_clrsbll, .properties = .{ .param_str = "iLLi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_clz, .properties = .{ .param_str = "iUi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_clzl, .properties = .{ .param_str = "iULi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_clzll, .properties = .{ .param_str = "iULLi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_clzs, .properties = .{ .param_str = "iUs", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_complex, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_conj, .properties = .{ .param_str = "XdXd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_conjf, .properties = .{ .param_str = "XfXf", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_conjl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_constant_p, .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .eval_args = false, .const_evaluable = true } } }, + .{ .tag = .__builtin_convertvector, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_copysign, .properties = .{ .param_str = "ddd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_copysignf, .properties = .{ .param_str = "fff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_copysignf128, .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_copysignf16, .properties = .{ .param_str = "hhh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_copysignl, .properties = .{ .param_str = "LdLdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_cos, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_cosf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_cosf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_cosf16, .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_cosh, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_coshf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_coshf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_coshl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_cosl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_cpow, .properties = .{ .param_str = "XdXdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_cpowf, .properties = .{ .param_str = "XfXfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_cpowl, .properties = .{ .param_str = "XLdXLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_cproj, .properties = .{ .param_str = "XdXd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_cprojf, .properties = .{ .param_str = "XfXf", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_cprojl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_cpu_init, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.x86) } }, + .{ .tag = .__builtin_cpu_is, .properties = .{ .param_str = "bcC*", .target_set = TargetSet.initOne(.x86), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_cpu_supports, .properties = .{ .param_str = "bcC*", .target_set = TargetSet.initOne(.x86), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_creal, .properties = .{ .param_str = "dXd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_crealf, .properties = .{ .param_str = "fXf", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_creall, .properties = .{ .param_str = "LdXLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_csin, .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_csinf, .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_csinh, .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_csinhf, .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_csinhl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_csinl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_csqrt, .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_csqrtf, .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_csqrtl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_ctan, .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_ctanf, .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_ctanh, .properties = .{ .param_str = "XdXd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_ctanhf, .properties = .{ .param_str = "XfXf", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_ctanhl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_ctanl, .properties = .{ .param_str = "XLdXLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_ctz, .properties = .{ .param_str = "iUi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_ctzl, .properties = .{ .param_str = "iULi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_ctzll, .properties = .{ .param_str = "iULLi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_ctzs, .properties = .{ .param_str = "iUs", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_dcbf, .properties = .{ .param_str = "vvC*", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_debugtrap, .properties = .{ .param_str = "v" } }, + .{ .tag = .__builtin_dump_struct, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__builtin_dwarf_cfa, .properties = .{ .param_str = "v*" } }, + .{ .tag = .__builtin_dwarf_sp_column, .properties = .{ .param_str = "Ui" } }, + .{ .tag = .__builtin_dynamic_object_size, .properties = .{ .param_str = "zvC*i", .attributes = .{ .eval_args = false, .const_evaluable = true } } }, + .{ .tag = .__builtin_eh_return, .properties = .{ .param_str = "vzv*", .attributes = .{ .noreturn = true } } }, + .{ .tag = .__builtin_eh_return_data_regno, .properties = .{ .param_str = "iIi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_elementwise_abs, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_elementwise_add_sat, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_elementwise_bitreverse, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_elementwise_canonicalize, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_elementwise_ceil, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_elementwise_copysign, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_elementwise_cos, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_elementwise_exp, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_elementwise_exp2, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_elementwise_floor, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_elementwise_fma, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_elementwise_log, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_elementwise_log10, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_elementwise_log2, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_elementwise_max, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_elementwise_min, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_elementwise_nearbyint, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_elementwise_pow, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_elementwise_rint, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_elementwise_round, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_elementwise_roundeven, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_elementwise_sin, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_elementwise_sqrt, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_elementwise_sub_sat, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_elementwise_trunc, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_erf, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_erfc, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_erfcf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_erfcf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_erfcl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_erff, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_erff128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_erfl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_exp, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_exp10, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_exp10f, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_exp10f128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_exp10f16, .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_exp10l, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_exp2, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_exp2f, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_exp2f128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_exp2f16, .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_exp2l, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_expect, .properties = .{ .param_str = "LiLiLi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_expect_with_probability, .properties = .{ .param_str = "LiLiLid", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_expf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_expf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_expf16, .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_expl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_expm1, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_expm1f, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_expm1f128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_expm1l, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_extend_pointer, .properties = .{ .param_str = "ULLiv*" } }, + .{ .tag = .__builtin_extract_return_addr, .properties = .{ .param_str = "v*v*" } }, + .{ .tag = .__builtin_fabs, .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_fabsf, .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_fabsf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_fabsf16, .properties = .{ .param_str = "hh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_fabsl, .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_fdim, .properties = .{ .param_str = "ddd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_fdimf, .properties = .{ .param_str = "fff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_fdimf128, .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_fdiml, .properties = .{ .param_str = "LdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_ffs, .properties = .{ .param_str = "ii", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_ffsl, .properties = .{ .param_str = "iLi", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_ffsll, .properties = .{ .param_str = "iLLi", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_floor, .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_floorf, .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_floorf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_floorf16, .properties = .{ .param_str = "hh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_floorl, .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_flt_rounds, .properties = .{ .param_str = "i" } }, + .{ .tag = .__builtin_fma, .properties = .{ .param_str = "dddd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_fmaf, .properties = .{ .param_str = "ffff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_fmaf128, .properties = .{ .param_str = "LLdLLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_fmaf16, .properties = .{ .param_str = "hhhh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_fmal, .properties = .{ .param_str = "LdLdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_fmax, .properties = .{ .param_str = "ddd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_fmaxf, .properties = .{ .param_str = "fff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_fmaxf128, .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_fmaxf16, .properties = .{ .param_str = "hhh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_fmaxl, .properties = .{ .param_str = "LdLdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_fmin, .properties = .{ .param_str = "ddd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_fminf, .properties = .{ .param_str = "fff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_fminf128, .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_fminf16, .properties = .{ .param_str = "hhh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_fminl, .properties = .{ .param_str = "LdLdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_fmod, .properties = .{ .param_str = "ddd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_fmodf, .properties = .{ .param_str = "fff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_fmodf128, .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_fmodf16, .properties = .{ .param_str = "hhh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_fmodl, .properties = .{ .param_str = "LdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_fpclassify, .properties = .{ .param_str = "iiiiii.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_fprintf, .properties = .{ .param_str = "iP*RcC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .printf, .format_string_position = 1 } } }, + .{ .tag = .__builtin_frame_address, .properties = .{ .param_str = "v*IUi" } }, + .{ .tag = .__builtin_free, .properties = .{ .param_str = "vv*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_frexp, .properties = .{ .param_str = "ddi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_frexpf, .properties = .{ .param_str = "ffi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_frexpf128, .properties = .{ .param_str = "LLdLLdi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_frexpf16, .properties = .{ .param_str = "hhi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_frexpl, .properties = .{ .param_str = "LdLdi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_frob_return_addr, .properties = .{ .param_str = "v*v*" } }, + .{ .tag = .__builtin_fscanf, .properties = .{ .param_str = "iP*RcC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .scanf, .format_string_position = 1 } } }, + .{ .tag = .__builtin_getid, .properties = .{ .param_str = "Si", .target_set = TargetSet.initOne(.xcore), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_getps, .properties = .{ .param_str = "UiUi", .target_set = TargetSet.initOne(.xcore) } }, + .{ .tag = .__builtin_huge_val, .properties = .{ .param_str = "d", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_huge_valf, .properties = .{ .param_str = "f", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_huge_valf128, .properties = .{ .param_str = "LLd", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_huge_valf16, .properties = .{ .param_str = "x", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_huge_vall, .properties = .{ .param_str = "Ld", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_hypot, .properties = .{ .param_str = "ddd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_hypotf, .properties = .{ .param_str = "fff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_hypotf128, .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_hypotl, .properties = .{ .param_str = "LdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_ia32_rdpmc, .properties = .{ .param_str = "UOii", .target_set = TargetSet.initOne(.x86) } }, + .{ .tag = .__builtin_ia32_rdtsc, .properties = .{ .param_str = "UOi", .target_set = TargetSet.initOne(.x86) } }, + .{ .tag = .__builtin_ia32_rdtscp, .properties = .{ .param_str = "UOiUi*", .target_set = TargetSet.initOne(.x86) } }, + .{ .tag = .__builtin_ilogb, .properties = .{ .param_str = "id", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_ilogbf, .properties = .{ .param_str = "if", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_ilogbf128, .properties = .{ .param_str = "iLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_ilogbl, .properties = .{ .param_str = "iLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_index, .properties = .{ .param_str = "c*cC*i", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_inf, .properties = .{ .param_str = "d", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_inff, .properties = .{ .param_str = "f", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_inff128, .properties = .{ .param_str = "LLd", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_inff16, .properties = .{ .param_str = "x", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_infl, .properties = .{ .param_str = "Ld", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_init_dwarf_reg_size_table, .properties = .{ .param_str = "vv*" } }, + .{ .tag = .__builtin_is_aligned, .properties = .{ .param_str = "bvC*z", .attributes = .{ .@"const" = true, .custom_typecheck = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_isfinite, .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_isfpclass, .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_isgreater, .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_isgreaterequal, .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_isinf, .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_isinf_sign, .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_isless, .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_islessequal, .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_islessgreater, .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_isnan, .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_isnormal, .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_isunordered, .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_labs, .properties = .{ .param_str = "LiLi", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_launder, .properties = .{ .param_str = "v*v*", .attributes = .{ .custom_typecheck = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_ldexp, .properties = .{ .param_str = "ddi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_ldexpf, .properties = .{ .param_str = "ffi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_ldexpf128, .properties = .{ .param_str = "LLdLLdi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_ldexpf16, .properties = .{ .param_str = "hhi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_ldexpl, .properties = .{ .param_str = "LdLdi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_lgamma, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_lgammaf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_lgammaf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_lgammal, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_llabs, .properties = .{ .param_str = "LLiLLi", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_llrint, .properties = .{ .param_str = "LLid", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_llrintf, .properties = .{ .param_str = "LLif", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_llrintf128, .properties = .{ .param_str = "LLiLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_llrintl, .properties = .{ .param_str = "LLiLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_llround, .properties = .{ .param_str = "LLid", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_llroundf, .properties = .{ .param_str = "LLif", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_llroundf128, .properties = .{ .param_str = "LLiLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_llroundl, .properties = .{ .param_str = "LLiLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_log, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_log10, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_log10f, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_log10f128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_log10f16, .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_log10l, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_log1p, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_log1pf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_log1pf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_log1pl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_log2, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_log2f, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_log2f128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_log2f16, .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_log2l, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_logb, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_logbf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_logbf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_logbl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_logf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_logf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_logf16, .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_logl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_longjmp, .properties = .{ .param_str = "vv**i", .attributes = .{ .noreturn = true } } }, + .{ .tag = .__builtin_lrint, .properties = .{ .param_str = "Lid", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_lrintf, .properties = .{ .param_str = "Lif", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_lrintf128, .properties = .{ .param_str = "LiLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_lrintl, .properties = .{ .param_str = "LiLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_lround, .properties = .{ .param_str = "Lid", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_lroundf, .properties = .{ .param_str = "Lif", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_lroundf128, .properties = .{ .param_str = "LiLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_lroundl, .properties = .{ .param_str = "LiLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_malloc, .properties = .{ .param_str = "v*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_matrix_column_major_load, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_matrix_column_major_store, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_matrix_transpose, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_memchr, .properties = .{ .param_str = "v*vC*iz", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_memcmp, .properties = .{ .param_str = "ivC*vC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_memcpy, .properties = .{ .param_str = "v*v*vC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_memcpy_inline, .properties = .{ .param_str = "vv*vC*Iz" } }, + .{ .tag = .__builtin_memmove, .properties = .{ .param_str = "v*v*vC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_mempcpy, .properties = .{ .param_str = "v*v*vC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_memset, .properties = .{ .param_str = "v*v*iz", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_memset_inline, .properties = .{ .param_str = "vv*iIz" } }, + .{ .tag = .__builtin_mips_absq_s_ph, .properties = .{ .param_str = "V2sV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_absq_s_qb, .properties = .{ .param_str = "V4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_absq_s_w, .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_addq_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_addq_s_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_addq_s_w, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_addqh_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_addqh_r_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_addqh_r_w, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_addqh_w, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_addsc, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_addu_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_addu_qb, .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_addu_s_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_addu_s_qb, .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_adduh_qb, .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_adduh_r_qb, .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_addwc, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_append, .properties = .{ .param_str = "iiiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_balign, .properties = .{ .param_str = "iiiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_bitrev, .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_bposge32, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_cmp_eq_ph, .properties = .{ .param_str = "vV2sV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_cmp_le_ph, .properties = .{ .param_str = "vV2sV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_cmp_lt_ph, .properties = .{ .param_str = "vV2sV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_cmpgdu_eq_qb, .properties = .{ .param_str = "iV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_cmpgdu_le_qb, .properties = .{ .param_str = "iV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_cmpgdu_lt_qb, .properties = .{ .param_str = "iV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_cmpgu_eq_qb, .properties = .{ .param_str = "iV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_cmpgu_le_qb, .properties = .{ .param_str = "iV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_cmpgu_lt_qb, .properties = .{ .param_str = "iV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_cmpu_eq_qb, .properties = .{ .param_str = "vV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_cmpu_le_qb, .properties = .{ .param_str = "vV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_cmpu_lt_qb, .properties = .{ .param_str = "vV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_dpa_w_ph, .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_dpaq_s_w_ph, .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_dpaq_sa_l_w, .properties = .{ .param_str = "LLiLLiii", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_dpaqx_s_w_ph, .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_dpaqx_sa_w_ph, .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_dpau_h_qbl, .properties = .{ .param_str = "LLiLLiV4ScV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_dpau_h_qbr, .properties = .{ .param_str = "LLiLLiV4ScV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_dpax_w_ph, .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_dps_w_ph, .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_dpsq_s_w_ph, .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_dpsq_sa_l_w, .properties = .{ .param_str = "LLiLLiii", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_dpsqx_s_w_ph, .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_dpsqx_sa_w_ph, .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_dpsu_h_qbl, .properties = .{ .param_str = "LLiLLiV4ScV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_dpsu_h_qbr, .properties = .{ .param_str = "LLiLLiV4ScV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_dpsx_w_ph, .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_extp, .properties = .{ .param_str = "iLLii", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_extpdp, .properties = .{ .param_str = "iLLii", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_extr_r_w, .properties = .{ .param_str = "iLLii", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_extr_rs_w, .properties = .{ .param_str = "iLLii", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_extr_s_h, .properties = .{ .param_str = "iLLii", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_extr_w, .properties = .{ .param_str = "iLLii", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_insv, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_lbux, .properties = .{ .param_str = "iv*i", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_lhx, .properties = .{ .param_str = "iv*i", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_lwx, .properties = .{ .param_str = "iv*i", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_madd, .properties = .{ .param_str = "LLiLLiii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_maddu, .properties = .{ .param_str = "LLiLLiUiUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_maq_s_w_phl, .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_maq_s_w_phr, .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_maq_sa_w_phl, .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_maq_sa_w_phr, .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_modsub, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_msub, .properties = .{ .param_str = "LLiLLiii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_msubu, .properties = .{ .param_str = "LLiLLiUiUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_mthlip, .properties = .{ .param_str = "LLiLLii", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_mul_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_mul_s_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_muleq_s_w_phl, .properties = .{ .param_str = "iV2sV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_muleq_s_w_phr, .properties = .{ .param_str = "iV2sV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_muleu_s_ph_qbl, .properties = .{ .param_str = "V2sV4ScV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_muleu_s_ph_qbr, .properties = .{ .param_str = "V2sV4ScV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_mulq_rs_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_mulq_rs_w, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_mulq_s_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_mulq_s_w, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_mulsa_w_ph, .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_mulsaq_s_w_ph, .properties = .{ .param_str = "LLiLLiV2sV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_mult, .properties = .{ .param_str = "LLiii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_multu, .properties = .{ .param_str = "LLiUiUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_packrl_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_pick_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_pick_qb, .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_preceq_w_phl, .properties = .{ .param_str = "iV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_preceq_w_phr, .properties = .{ .param_str = "iV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_precequ_ph_qbl, .properties = .{ .param_str = "V2sV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_precequ_ph_qbla, .properties = .{ .param_str = "V2sV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_precequ_ph_qbr, .properties = .{ .param_str = "V2sV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_precequ_ph_qbra, .properties = .{ .param_str = "V2sV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_preceu_ph_qbl, .properties = .{ .param_str = "V2sV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_preceu_ph_qbla, .properties = .{ .param_str = "V2sV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_preceu_ph_qbr, .properties = .{ .param_str = "V2sV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_preceu_ph_qbra, .properties = .{ .param_str = "V2sV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_precr_qb_ph, .properties = .{ .param_str = "V4ScV2sV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_precr_sra_ph_w, .properties = .{ .param_str = "V2siiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_precr_sra_r_ph_w, .properties = .{ .param_str = "V2siiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_precrq_ph_w, .properties = .{ .param_str = "V2sii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_precrq_qb_ph, .properties = .{ .param_str = "V4ScV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_precrq_rs_ph_w, .properties = .{ .param_str = "V2sii", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_precrqu_s_qb_ph, .properties = .{ .param_str = "V4ScV2sV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_prepend, .properties = .{ .param_str = "iiiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_raddu_w_qb, .properties = .{ .param_str = "iV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_rddsp, .properties = .{ .param_str = "iIi", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_repl_ph, .properties = .{ .param_str = "V2si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_repl_qb, .properties = .{ .param_str = "V4Sci", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_shilo, .properties = .{ .param_str = "LLiLLii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_shll_ph, .properties = .{ .param_str = "V2sV2si", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_shll_qb, .properties = .{ .param_str = "V4ScV4Sci", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_shll_s_ph, .properties = .{ .param_str = "V2sV2si", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_shll_s_w, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_shra_ph, .properties = .{ .param_str = "V2sV2si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_shra_qb, .properties = .{ .param_str = "V4ScV4Sci", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_shra_r_ph, .properties = .{ .param_str = "V2sV2si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_shra_r_qb, .properties = .{ .param_str = "V4ScV4Sci", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_shra_r_w, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_shrl_ph, .properties = .{ .param_str = "V2sV2si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_shrl_qb, .properties = .{ .param_str = "V4ScV4Sci", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_subq_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_subq_s_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_subq_s_w, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_subqh_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_subqh_r_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_subqh_r_w, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_subqh_w, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_subu_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_subu_qb, .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_subu_s_ph, .properties = .{ .param_str = "V2sV2sV2s", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_subu_s_qb, .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_mips_subuh_qb, .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_subuh_r_qb, .properties = .{ .param_str = "V4ScV4ScV4Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mips_wrdsp, .properties = .{ .param_str = "viIi", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_modf, .properties = .{ .param_str = "ddd*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_modff, .properties = .{ .param_str = "fff*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_modff128, .properties = .{ .param_str = "LLdLLdLLd*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_modfl, .properties = .{ .param_str = "LdLdLd*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_msa_add_a_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_add_a_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_add_a_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_add_a_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_adds_a_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_adds_a_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_adds_a_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_adds_a_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_adds_s_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_adds_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_adds_s_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_adds_s_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_adds_u_b, .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_adds_u_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_adds_u_h, .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_adds_u_w, .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_addv_b, .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_addv_d, .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_addv_h, .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_addv_w, .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_addvi_b, .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_addvi_d, .properties = .{ .param_str = "V2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_addvi_h, .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_addvi_w, .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_and_v, .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_andi_b, .properties = .{ .param_str = "V16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_asub_s_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_asub_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_asub_s_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_asub_s_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_asub_u_b, .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_asub_u_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_asub_u_h, .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_asub_u_w, .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ave_s_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ave_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ave_s_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ave_s_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ave_u_b, .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ave_u_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ave_u_h, .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ave_u_w, .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_aver_s_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_aver_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_aver_s_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_aver_s_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_aver_u_b, .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_aver_u_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_aver_u_h, .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_aver_u_w, .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bclr_b, .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bclr_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bclr_h, .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bclr_w, .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bclri_b, .properties = .{ .param_str = "V16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bclri_d, .properties = .{ .param_str = "V2ULLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bclri_h, .properties = .{ .param_str = "V8UsV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bclri_w, .properties = .{ .param_str = "V4UiV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_binsl_b, .properties = .{ .param_str = "V16UcV16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_binsl_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_binsl_h, .properties = .{ .param_str = "V8UsV8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_binsl_w, .properties = .{ .param_str = "V4UiV4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_binsli_b, .properties = .{ .param_str = "V16UcV16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_binsli_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_binsli_h, .properties = .{ .param_str = "V8UsV8UsV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_binsli_w, .properties = .{ .param_str = "V4UiV4UiV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_binsr_b, .properties = .{ .param_str = "V16UcV16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_binsr_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_binsr_h, .properties = .{ .param_str = "V8UsV8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_binsr_w, .properties = .{ .param_str = "V4UiV4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_binsri_b, .properties = .{ .param_str = "V16UcV16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_binsri_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_binsri_h, .properties = .{ .param_str = "V8UsV8UsV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_binsri_w, .properties = .{ .param_str = "V4UiV4UiV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bmnz_v, .properties = .{ .param_str = "V16UcV16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bmnzi_b, .properties = .{ .param_str = "V16UcV16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bmz_v, .properties = .{ .param_str = "V16UcV16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bmzi_b, .properties = .{ .param_str = "V16UcV16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bneg_b, .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bneg_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bneg_h, .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bneg_w, .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bnegi_b, .properties = .{ .param_str = "V16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bnegi_d, .properties = .{ .param_str = "V2ULLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bnegi_h, .properties = .{ .param_str = "V8UsV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bnegi_w, .properties = .{ .param_str = "V4UiV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bnz_b, .properties = .{ .param_str = "iV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bnz_d, .properties = .{ .param_str = "iV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bnz_h, .properties = .{ .param_str = "iV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bnz_v, .properties = .{ .param_str = "iV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bnz_w, .properties = .{ .param_str = "iV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bsel_v, .properties = .{ .param_str = "V16UcV16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bseli_b, .properties = .{ .param_str = "V16UcV16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bset_b, .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bset_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bset_h, .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bset_w, .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bseti_b, .properties = .{ .param_str = "V16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bseti_d, .properties = .{ .param_str = "V2ULLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bseti_h, .properties = .{ .param_str = "V8UsV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bseti_w, .properties = .{ .param_str = "V4UiV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bz_b, .properties = .{ .param_str = "iV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bz_d, .properties = .{ .param_str = "iV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bz_h, .properties = .{ .param_str = "iV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bz_v, .properties = .{ .param_str = "iV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_bz_w, .properties = .{ .param_str = "iV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ceq_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ceq_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ceq_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ceq_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ceqi_b, .properties = .{ .param_str = "V16ScV16ScISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ceqi_d, .properties = .{ .param_str = "V2SLLiV2SLLiISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ceqi_h, .properties = .{ .param_str = "V8SsV8SsISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ceqi_w, .properties = .{ .param_str = "V4SiV4SiISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_cfcmsa, .properties = .{ .param_str = "iIi", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_msa_cle_s_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_cle_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_cle_s_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_cle_s_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_cle_u_b, .properties = .{ .param_str = "V16ScV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_cle_u_d, .properties = .{ .param_str = "V2SLLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_cle_u_h, .properties = .{ .param_str = "V8SsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_cle_u_w, .properties = .{ .param_str = "V4SiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_clei_s_b, .properties = .{ .param_str = "V16ScV16ScISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_clei_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_clei_s_h, .properties = .{ .param_str = "V8SsV8SsISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_clei_s_w, .properties = .{ .param_str = "V4SiV4SiISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_clei_u_b, .properties = .{ .param_str = "V16ScV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_clei_u_d, .properties = .{ .param_str = "V2SLLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_clei_u_h, .properties = .{ .param_str = "V8SsV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_clei_u_w, .properties = .{ .param_str = "V4SiV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_clt_s_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_clt_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_clt_s_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_clt_s_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_clt_u_b, .properties = .{ .param_str = "V16ScV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_clt_u_d, .properties = .{ .param_str = "V2SLLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_clt_u_h, .properties = .{ .param_str = "V8SsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_clt_u_w, .properties = .{ .param_str = "V4SiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_clti_s_b, .properties = .{ .param_str = "V16ScV16ScISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_clti_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_clti_s_h, .properties = .{ .param_str = "V8SsV8SsISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_clti_s_w, .properties = .{ .param_str = "V4SiV4SiISi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_clti_u_b, .properties = .{ .param_str = "V16ScV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_clti_u_d, .properties = .{ .param_str = "V2SLLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_clti_u_h, .properties = .{ .param_str = "V8SsV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_clti_u_w, .properties = .{ .param_str = "V4SiV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_copy_s_b, .properties = .{ .param_str = "iV16ScIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_copy_s_d, .properties = .{ .param_str = "LLiV2SLLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_copy_s_h, .properties = .{ .param_str = "iV8SsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_copy_s_w, .properties = .{ .param_str = "iV4SiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_copy_u_b, .properties = .{ .param_str = "iV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_copy_u_d, .properties = .{ .param_str = "LLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_copy_u_h, .properties = .{ .param_str = "iV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_copy_u_w, .properties = .{ .param_str = "iV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ctcmsa, .properties = .{ .param_str = "vIii", .target_set = TargetSet.initOne(.mips) } }, + .{ .tag = .__builtin_msa_div_s_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_div_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_div_s_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_div_s_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_div_u_b, .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_div_u_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_div_u_h, .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_div_u_w, .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_dotp_s_d, .properties = .{ .param_str = "V2SLLiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_dotp_s_h, .properties = .{ .param_str = "V8SsV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_dotp_s_w, .properties = .{ .param_str = "V4SiV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_dotp_u_d, .properties = .{ .param_str = "V2ULLiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_dotp_u_h, .properties = .{ .param_str = "V8UsV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_dotp_u_w, .properties = .{ .param_str = "V4UiV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_dpadd_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_dpadd_s_h, .properties = .{ .param_str = "V8SsV8SsV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_dpadd_s_w, .properties = .{ .param_str = "V4SiV4SiV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_dpadd_u_d, .properties = .{ .param_str = "V2ULLiV2ULLiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_dpadd_u_h, .properties = .{ .param_str = "V8UsV8UsV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_dpadd_u_w, .properties = .{ .param_str = "V4UiV4UiV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_dpsub_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_dpsub_s_h, .properties = .{ .param_str = "V8SsV8SsV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_dpsub_s_w, .properties = .{ .param_str = "V4SiV4SiV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_dpsub_u_d, .properties = .{ .param_str = "V2ULLiV2ULLiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_dpsub_u_h, .properties = .{ .param_str = "V8UsV8UsV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_dpsub_u_w, .properties = .{ .param_str = "V4UiV4UiV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fadd_d, .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fadd_w, .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fcaf_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fcaf_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fceq_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fceq_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fclass_d, .properties = .{ .param_str = "V2LLiV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fclass_w, .properties = .{ .param_str = "V4iV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fcle_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fcle_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fclt_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fclt_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fcne_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fcne_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fcor_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fcor_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fcueq_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fcueq_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fcule_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fcule_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fcult_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fcult_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fcun_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fcun_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fcune_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fcune_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fdiv_d, .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fdiv_w, .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fexdo_h, .properties = .{ .param_str = "V8hV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fexdo_w, .properties = .{ .param_str = "V4fV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fexp2_d, .properties = .{ .param_str = "V2dV2dV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fexp2_w, .properties = .{ .param_str = "V4fV4fV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fexupl_d, .properties = .{ .param_str = "V2dV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fexupl_w, .properties = .{ .param_str = "V4fV8h", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fexupr_d, .properties = .{ .param_str = "V2dV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fexupr_w, .properties = .{ .param_str = "V4fV8h", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ffint_s_d, .properties = .{ .param_str = "V2dV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ffint_s_w, .properties = .{ .param_str = "V4fV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ffint_u_d, .properties = .{ .param_str = "V2dV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ffint_u_w, .properties = .{ .param_str = "V4fV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ffql_d, .properties = .{ .param_str = "V2dV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ffql_w, .properties = .{ .param_str = "V4fV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ffqr_d, .properties = .{ .param_str = "V2dV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ffqr_w, .properties = .{ .param_str = "V4fV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fill_b, .properties = .{ .param_str = "V16Sci", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fill_d, .properties = .{ .param_str = "V2SLLiLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fill_h, .properties = .{ .param_str = "V8Ssi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fill_w, .properties = .{ .param_str = "V4Sii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_flog2_d, .properties = .{ .param_str = "V2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_flog2_w, .properties = .{ .param_str = "V4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fmadd_d, .properties = .{ .param_str = "V2dV2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fmadd_w, .properties = .{ .param_str = "V4fV4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fmax_a_d, .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fmax_a_w, .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fmax_d, .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fmax_w, .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fmin_a_d, .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fmin_a_w, .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fmin_d, .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fmin_w, .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fmsub_d, .properties = .{ .param_str = "V2dV2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fmsub_w, .properties = .{ .param_str = "V4fV4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fmul_d, .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fmul_w, .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_frcp_d, .properties = .{ .param_str = "V2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_frcp_w, .properties = .{ .param_str = "V4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_frint_d, .properties = .{ .param_str = "V2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_frint_w, .properties = .{ .param_str = "V4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_frsqrt_d, .properties = .{ .param_str = "V2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_frsqrt_w, .properties = .{ .param_str = "V4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fsaf_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fsaf_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fseq_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fseq_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fsle_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fsle_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fslt_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fslt_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fsne_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fsne_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fsor_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fsor_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fsqrt_d, .properties = .{ .param_str = "V2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fsqrt_w, .properties = .{ .param_str = "V4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fsub_d, .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fsub_w, .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fsueq_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fsueq_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fsule_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fsule_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fsult_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fsult_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fsun_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fsun_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fsune_d, .properties = .{ .param_str = "V2LLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_fsune_w, .properties = .{ .param_str = "V4iV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ftint_s_d, .properties = .{ .param_str = "V2SLLiV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ftint_s_w, .properties = .{ .param_str = "V4SiV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ftint_u_d, .properties = .{ .param_str = "V2ULLiV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ftint_u_w, .properties = .{ .param_str = "V4UiV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ftq_h, .properties = .{ .param_str = "V4UiV4fV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ftq_w, .properties = .{ .param_str = "V2ULLiV2dV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ftrunc_s_d, .properties = .{ .param_str = "V2SLLiV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ftrunc_s_w, .properties = .{ .param_str = "V4SiV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ftrunc_u_d, .properties = .{ .param_str = "V2ULLiV2d", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ftrunc_u_w, .properties = .{ .param_str = "V4UiV4f", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_hadd_s_d, .properties = .{ .param_str = "V2SLLiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_hadd_s_h, .properties = .{ .param_str = "V8SsV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_hadd_s_w, .properties = .{ .param_str = "V4SiV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_hadd_u_d, .properties = .{ .param_str = "V2ULLiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_hadd_u_h, .properties = .{ .param_str = "V8UsV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_hadd_u_w, .properties = .{ .param_str = "V4UiV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_hsub_s_d, .properties = .{ .param_str = "V2SLLiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_hsub_s_h, .properties = .{ .param_str = "V8SsV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_hsub_s_w, .properties = .{ .param_str = "V4SiV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_hsub_u_d, .properties = .{ .param_str = "V2ULLiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_hsub_u_h, .properties = .{ .param_str = "V8UsV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_hsub_u_w, .properties = .{ .param_str = "V4UiV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ilvev_b, .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ilvev_d, .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ilvev_h, .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ilvev_w, .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ilvl_b, .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ilvl_d, .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ilvl_h, .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ilvl_w, .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ilvod_b, .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ilvod_d, .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ilvod_h, .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ilvod_w, .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ilvr_b, .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ilvr_d, .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ilvr_h, .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ilvr_w, .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_insert_b, .properties = .{ .param_str = "V16ScV16ScIUii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_insert_d, .properties = .{ .param_str = "V2SLLiV2SLLiIUiLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_insert_h, .properties = .{ .param_str = "V8SsV8SsIUii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_insert_w, .properties = .{ .param_str = "V4SiV4SiIUii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_insve_b, .properties = .{ .param_str = "V16ScV16ScIUiV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_insve_d, .properties = .{ .param_str = "V2SLLiV2SLLiIUiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_insve_h, .properties = .{ .param_str = "V8SsV8SsIUiV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_insve_w, .properties = .{ .param_str = "V4SiV4SiIUiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ld_b, .properties = .{ .param_str = "V16Scv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ld_d, .properties = .{ .param_str = "V2SLLiv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ld_h, .properties = .{ .param_str = "V8Ssv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ld_w, .properties = .{ .param_str = "V4Siv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ldi_b, .properties = .{ .param_str = "V16cIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ldi_d, .properties = .{ .param_str = "V2LLiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ldi_h, .properties = .{ .param_str = "V8sIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ldi_w, .properties = .{ .param_str = "V4iIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ldr_d, .properties = .{ .param_str = "V2SLLiv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ldr_w, .properties = .{ .param_str = "V4Siv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_madd_q_h, .properties = .{ .param_str = "V8SsV8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_madd_q_w, .properties = .{ .param_str = "V4SiV4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_maddr_q_h, .properties = .{ .param_str = "V8SsV8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_maddr_q_w, .properties = .{ .param_str = "V4SiV4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_maddv_b, .properties = .{ .param_str = "V16ScV16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_maddv_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_maddv_h, .properties = .{ .param_str = "V8SsV8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_maddv_w, .properties = .{ .param_str = "V4SiV4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_max_a_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_max_a_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_max_a_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_max_a_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_max_s_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_max_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_max_s_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_max_s_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_max_u_b, .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_max_u_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_max_u_h, .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_max_u_w, .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_maxi_s_b, .properties = .{ .param_str = "V16ScV16ScIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_maxi_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_maxi_s_h, .properties = .{ .param_str = "V8SsV8SsIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_maxi_s_w, .properties = .{ .param_str = "V4SiV4SiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_maxi_u_b, .properties = .{ .param_str = "V16UcV16UcIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_maxi_u_d, .properties = .{ .param_str = "V2ULLiV2ULLiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_maxi_u_h, .properties = .{ .param_str = "V8UsV8UsIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_maxi_u_w, .properties = .{ .param_str = "V4UiV4UiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_min_a_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_min_a_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_min_a_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_min_a_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_min_s_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_min_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_min_s_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_min_s_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_min_u_b, .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_min_u_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_min_u_h, .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_min_u_w, .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_mini_s_b, .properties = .{ .param_str = "V16ScV16ScIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_mini_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_mini_s_h, .properties = .{ .param_str = "V8SsV8SsIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_mini_s_w, .properties = .{ .param_str = "V4SiV4SiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_mini_u_b, .properties = .{ .param_str = "V16UcV16UcIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_mini_u_d, .properties = .{ .param_str = "V2ULLiV2ULLiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_mini_u_h, .properties = .{ .param_str = "V8UsV8UsIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_mini_u_w, .properties = .{ .param_str = "V4UiV4UiIi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_mod_s_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_mod_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_mod_s_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_mod_s_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_mod_u_b, .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_mod_u_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_mod_u_h, .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_mod_u_w, .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_move_v, .properties = .{ .param_str = "V16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_msub_q_h, .properties = .{ .param_str = "V8SsV8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_msub_q_w, .properties = .{ .param_str = "V4SiV4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_msubr_q_h, .properties = .{ .param_str = "V8SsV8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_msubr_q_w, .properties = .{ .param_str = "V4SiV4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_msubv_b, .properties = .{ .param_str = "V16ScV16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_msubv_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_msubv_h, .properties = .{ .param_str = "V8SsV8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_msubv_w, .properties = .{ .param_str = "V4SiV4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_mul_q_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_mul_q_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_mulr_q_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_mulr_q_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_mulv_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_mulv_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_mulv_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_mulv_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_nloc_b, .properties = .{ .param_str = "V16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_nloc_d, .properties = .{ .param_str = "V2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_nloc_h, .properties = .{ .param_str = "V8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_nloc_w, .properties = .{ .param_str = "V4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_nlzc_b, .properties = .{ .param_str = "V16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_nlzc_d, .properties = .{ .param_str = "V2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_nlzc_h, .properties = .{ .param_str = "V8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_nlzc_w, .properties = .{ .param_str = "V4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_nor_v, .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_nori_b, .properties = .{ .param_str = "V16UcV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_or_v, .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_ori_b, .properties = .{ .param_str = "V16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_pckev_b, .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_pckev_d, .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_pckev_h, .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_pckev_w, .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_pckod_b, .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_pckod_d, .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_pckod_h, .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_pckod_w, .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_pcnt_b, .properties = .{ .param_str = "V16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_pcnt_d, .properties = .{ .param_str = "V2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_pcnt_h, .properties = .{ .param_str = "V8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_pcnt_w, .properties = .{ .param_str = "V4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_sat_s_b, .properties = .{ .param_str = "V16ScV16ScIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_sat_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_sat_s_h, .properties = .{ .param_str = "V8SsV8SsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_sat_s_w, .properties = .{ .param_str = "V4SiV4SiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_sat_u_b, .properties = .{ .param_str = "V16UcV16UcIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_sat_u_d, .properties = .{ .param_str = "V2ULLiV2ULLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_sat_u_h, .properties = .{ .param_str = "V8UsV8UsIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_sat_u_w, .properties = .{ .param_str = "V4UiV4UiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_shf_b, .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_shf_h, .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_shf_w, .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_sld_b, .properties = .{ .param_str = "V16cV16cV16cUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_sld_d, .properties = .{ .param_str = "V2LLiV2LLiV2LLiUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_sld_h, .properties = .{ .param_str = "V8sV8sV8sUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_sld_w, .properties = .{ .param_str = "V4iV4iV4iUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_sldi_b, .properties = .{ .param_str = "V16cV16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_sldi_d, .properties = .{ .param_str = "V2LLiV2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_sldi_h, .properties = .{ .param_str = "V8sV8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_sldi_w, .properties = .{ .param_str = "V4iV4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_sll_b, .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_sll_d, .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_sll_h, .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_sll_w, .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_slli_b, .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_slli_d, .properties = .{ .param_str = "V2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_slli_h, .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_slli_w, .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_splat_b, .properties = .{ .param_str = "V16cV16cUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_splat_d, .properties = .{ .param_str = "V2LLiV2LLiUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_splat_h, .properties = .{ .param_str = "V8sV8sUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_splat_w, .properties = .{ .param_str = "V4iV4iUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_splati_b, .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_splati_d, .properties = .{ .param_str = "V2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_splati_h, .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_splati_w, .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_sra_b, .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_sra_d, .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_sra_h, .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_sra_w, .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_srai_b, .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_srai_d, .properties = .{ .param_str = "V2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_srai_h, .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_srai_w, .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_srar_b, .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_srar_d, .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_srar_h, .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_srar_w, .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_srari_b, .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_srari_d, .properties = .{ .param_str = "V2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_srari_h, .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_srari_w, .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_srl_b, .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_srl_d, .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_srl_h, .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_srl_w, .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_srli_b, .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_srli_d, .properties = .{ .param_str = "V2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_srli_h, .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_srli_w, .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_srlr_b, .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_srlr_d, .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_srlr_h, .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_srlr_w, .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_srlri_b, .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_srlri_d, .properties = .{ .param_str = "V2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_srlri_h, .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_srlri_w, .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_st_b, .properties = .{ .param_str = "vV16Scv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_st_d, .properties = .{ .param_str = "vV2SLLiv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_st_h, .properties = .{ .param_str = "vV8Ssv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_st_w, .properties = .{ .param_str = "vV4Siv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_str_d, .properties = .{ .param_str = "vV2SLLiv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_str_w, .properties = .{ .param_str = "vV4Siv*Ii", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_subs_s_b, .properties = .{ .param_str = "V16ScV16ScV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_subs_s_d, .properties = .{ .param_str = "V2SLLiV2SLLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_subs_s_h, .properties = .{ .param_str = "V8SsV8SsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_subs_s_w, .properties = .{ .param_str = "V4SiV4SiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_subs_u_b, .properties = .{ .param_str = "V16UcV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_subs_u_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_subs_u_h, .properties = .{ .param_str = "V8UsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_subs_u_w, .properties = .{ .param_str = "V4UiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_subsus_u_b, .properties = .{ .param_str = "V16UcV16UcV16Sc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_subsus_u_d, .properties = .{ .param_str = "V2ULLiV2ULLiV2SLLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_subsus_u_h, .properties = .{ .param_str = "V8UsV8UsV8Ss", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_subsus_u_w, .properties = .{ .param_str = "V4UiV4UiV4Si", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_subsuu_s_b, .properties = .{ .param_str = "V16ScV16UcV16Uc", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_subsuu_s_d, .properties = .{ .param_str = "V2SLLiV2ULLiV2ULLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_subsuu_s_h, .properties = .{ .param_str = "V8SsV8UsV8Us", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_subsuu_s_w, .properties = .{ .param_str = "V4SiV4UiV4Ui", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_subv_b, .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_subv_d, .properties = .{ .param_str = "V2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_subv_h, .properties = .{ .param_str = "V8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_subv_w, .properties = .{ .param_str = "V4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_subvi_b, .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_subvi_d, .properties = .{ .param_str = "V2LLiV2LLiIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_subvi_h, .properties = .{ .param_str = "V8sV8sIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_subvi_w, .properties = .{ .param_str = "V4iV4iIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_vshf_b, .properties = .{ .param_str = "V16cV16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_vshf_d, .properties = .{ .param_str = "V2LLiV2LLiV2LLiV2LLi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_vshf_h, .properties = .{ .param_str = "V8sV8sV8sV8s", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_vshf_w, .properties = .{ .param_str = "V4iV4iV4iV4i", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_xor_v, .properties = .{ .param_str = "V16cV16cV16c", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_msa_xori_b, .properties = .{ .param_str = "V16cV16cIUi", .target_set = TargetSet.initOne(.mips), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_mul_overflow, .properties = .{ .param_str = "b.", .attributes = .{ .custom_typecheck = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_nan, .properties = .{ .param_str = "dcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_nanf, .properties = .{ .param_str = "fcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_nanf128, .properties = .{ .param_str = "LLdcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_nanf16, .properties = .{ .param_str = "xcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_nanl, .properties = .{ .param_str = "LdcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_nans, .properties = .{ .param_str = "dcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_nansf, .properties = .{ .param_str = "fcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_nansf128, .properties = .{ .param_str = "LLdcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_nansf16, .properties = .{ .param_str = "xcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_nansl, .properties = .{ .param_str = "LdcC*", .attributes = .{ .pure = true, .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_nearbyint, .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_nearbyintf, .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_nearbyintf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_nearbyintl, .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_nextafter, .properties = .{ .param_str = "ddd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_nextafterf, .properties = .{ .param_str = "fff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_nextafterf128, .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_nextafterl, .properties = .{ .param_str = "LdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_nexttoward, .properties = .{ .param_str = "ddLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_nexttowardf, .properties = .{ .param_str = "ffLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_nexttowardf128, .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_nexttowardl, .properties = .{ .param_str = "LdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_nondeterministic_value, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__builtin_nontemporal_load, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__builtin_nontemporal_store, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__builtin_objc_memmove_collectable, .properties = .{ .param_str = "v*v*vC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_object_size, .properties = .{ .param_str = "zvC*i", .attributes = .{ .eval_args = false, .const_evaluable = true } } }, + .{ .tag = .__builtin_offsetof, .properties = .{ .param_str = "z.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__builtin_operator_delete, .properties = .{ .param_str = "vv*", .attributes = .{ .custom_typecheck = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_operator_new, .properties = .{ .param_str = "v*z", .attributes = .{ .@"const" = true, .custom_typecheck = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_os_log_format, .properties = .{ .param_str = "v*v*cC*.", .attributes = .{ .custom_typecheck = true, .format_kind = .printf } } }, + .{ .tag = .__builtin_os_log_format_buffer_size, .properties = .{ .param_str = "zcC*.", .attributes = .{ .custom_typecheck = true, .format_kind = .printf, .eval_args = false, .const_evaluable = true } } }, + .{ .tag = .__builtin_pack_longdouble, .properties = .{ .param_str = "Lddd", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_parity, .properties = .{ .param_str = "iUi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_parityl, .properties = .{ .param_str = "iULi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_parityll, .properties = .{ .param_str = "iULLi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_popcount, .properties = .{ .param_str = "iUi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_popcountl, .properties = .{ .param_str = "iULi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_popcountll, .properties = .{ .param_str = "iULLi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_pow, .properties = .{ .param_str = "ddd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_powf, .properties = .{ .param_str = "fff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_powf128, .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_powf16, .properties = .{ .param_str = "hhh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_powi, .properties = .{ .param_str = "ddi", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_powif, .properties = .{ .param_str = "ffi", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_powil, .properties = .{ .param_str = "LdLdi", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_powl, .properties = .{ .param_str = "LdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_ppc_alignx, .properties = .{ .param_str = "vIivC*", .target_set = TargetSet.initOne(.ppc), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_ppc_cmpb, .properties = .{ .param_str = "LLiLLiLLi", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_compare_and_swap, .properties = .{ .param_str = "iiD*i*i", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_compare_and_swaplp, .properties = .{ .param_str = "iLiD*Li*Li", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_dcbfl, .properties = .{ .param_str = "vvC*", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_dcbflp, .properties = .{ .param_str = "vvC*", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_dcbst, .properties = .{ .param_str = "vvC*", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_dcbt, .properties = .{ .param_str = "vv*", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_dcbtst, .properties = .{ .param_str = "vv*", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_dcbtstt, .properties = .{ .param_str = "vv*", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_dcbtt, .properties = .{ .param_str = "vv*", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_dcbz, .properties = .{ .param_str = "vv*", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_eieio, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_fcfid, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_fcfud, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_fctid, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_fctidz, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_fctiw, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_fctiwz, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_fctudz, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_fctuwz, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_fetch_and_add, .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_fetch_and_addlp, .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_fetch_and_and, .properties = .{ .param_str = "UiUiD*Ui", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_fetch_and_andlp, .properties = .{ .param_str = "ULiULiD*ULi", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_fetch_and_or, .properties = .{ .param_str = "UiUiD*Ui", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_fetch_and_orlp, .properties = .{ .param_str = "ULiULiD*ULi", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_fetch_and_swap, .properties = .{ .param_str = "UiUiD*Ui", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_fetch_and_swaplp, .properties = .{ .param_str = "ULiULiD*ULi", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_fmsub, .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_fmsubs, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_fnabs, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_fnabss, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_fnmadd, .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_fnmadds, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_fnmsub, .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_fnmsubs, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_fre, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_fres, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_fric, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_frim, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_frims, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_frin, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_frins, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_frip, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_frips, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_friz, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_frizs, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_frsqrte, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_frsqrtes, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_fsel, .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_fsels, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_fsqrt, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_fsqrts, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_get_timebase, .properties = .{ .param_str = "ULLi", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_iospace_eieio, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_iospace_lwsync, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_iospace_sync, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_isync, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_ldarx, .properties = .{ .param_str = "LiLiD*", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_load2r, .properties = .{ .param_str = "UsUs*", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_load4r, .properties = .{ .param_str = "UiUi*", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_lwarx, .properties = .{ .param_str = "iiD*", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_lwsync, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_maxfe, .properties = .{ .param_str = "LdLdLdLd.", .target_set = TargetSet.initOne(.ppc), .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__builtin_ppc_maxfl, .properties = .{ .param_str = "dddd.", .target_set = TargetSet.initOne(.ppc), .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__builtin_ppc_maxfs, .properties = .{ .param_str = "ffff.", .target_set = TargetSet.initOne(.ppc), .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__builtin_ppc_mfmsr, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_mfspr, .properties = .{ .param_str = "ULiIi", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_mftbu, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_minfe, .properties = .{ .param_str = "LdLdLdLd.", .target_set = TargetSet.initOne(.ppc), .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__builtin_ppc_minfl, .properties = .{ .param_str = "dddd.", .target_set = TargetSet.initOne(.ppc), .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__builtin_ppc_minfs, .properties = .{ .param_str = "ffff.", .target_set = TargetSet.initOne(.ppc), .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__builtin_ppc_mtfsb0, .properties = .{ .param_str = "vUIi", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_mtfsb1, .properties = .{ .param_str = "vUIi", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_mtfsf, .properties = .{ .param_str = "vUIiUi", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_mtfsfi, .properties = .{ .param_str = "vUIiUIi", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_mtmsr, .properties = .{ .param_str = "vUi", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_mtspr, .properties = .{ .param_str = "vIiULi", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_mulhd, .properties = .{ .param_str = "LLiLiLi", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_mulhdu, .properties = .{ .param_str = "ULLiULiULi", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_mulhw, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_mulhwu, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_popcntb, .properties = .{ .param_str = "ULiULi", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_poppar4, .properties = .{ .param_str = "iUi", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_poppar8, .properties = .{ .param_str = "iULLi", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_rdlam, .properties = .{ .param_str = "UWiUWiUWiUWIi", .target_set = TargetSet.initOne(.ppc), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_ppc_recipdivd, .properties = .{ .param_str = "V2dV2dV2d", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_recipdivf, .properties = .{ .param_str = "V4fV4fV4f", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_rldimi, .properties = .{ .param_str = "ULLiULLiULLiIUiIULLi", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_rlwimi, .properties = .{ .param_str = "UiUiUiIUiIUi", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_rlwnm, .properties = .{ .param_str = "UiUiUiIUi", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_rsqrtd, .properties = .{ .param_str = "V2dV2d", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_rsqrtf, .properties = .{ .param_str = "V4fV4f", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_stdcx, .properties = .{ .param_str = "iLiD*Li", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_stfiw, .properties = .{ .param_str = "viC*d", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_store2r, .properties = .{ .param_str = "vUiUs*", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_store4r, .properties = .{ .param_str = "vUiUi*", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_stwcx, .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_swdiv, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_swdiv_nochk, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_swdivs, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_swdivs_nochk, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_sync, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_tdw, .properties = .{ .param_str = "vLLiLLiIUi", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_trap, .properties = .{ .param_str = "vi", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_trapd, .properties = .{ .param_str = "vLi", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_ppc_tw, .properties = .{ .param_str = "viiIUi", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_prefetch, .properties = .{ .param_str = "vvC*.", .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_preserve_access_index, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__builtin_printf, .properties = .{ .param_str = "icC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .printf } } }, + .{ .tag = .__builtin_ptx_get_image_channel_data_typei_, .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__builtin_ptx_get_image_channel_orderi_, .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__builtin_ptx_get_image_depthi_, .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__builtin_ptx_get_image_heighti_, .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__builtin_ptx_get_image_widthi_, .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__builtin_ptx_read_image2Dff_, .properties = .{ .param_str = "V4fiiff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__builtin_ptx_read_image2Dfi_, .properties = .{ .param_str = "V4fiiii", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__builtin_ptx_read_image2Dif_, .properties = .{ .param_str = "V4iiiff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__builtin_ptx_read_image2Dii_, .properties = .{ .param_str = "V4iiiii", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__builtin_ptx_read_image3Dff_, .properties = .{ .param_str = "V4fiiffff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__builtin_ptx_read_image3Dfi_, .properties = .{ .param_str = "V4fiiiiii", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__builtin_ptx_read_image3Dif_, .properties = .{ .param_str = "V4iiiffff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__builtin_ptx_read_image3Dii_, .properties = .{ .param_str = "V4iiiiiii", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__builtin_ptx_write_image2Df_, .properties = .{ .param_str = "viiiffff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__builtin_ptx_write_image2Di_, .properties = .{ .param_str = "viiiiiii", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__builtin_ptx_write_image2Dui_, .properties = .{ .param_str = "viiiUiUiUiUi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__builtin_r600_implicitarg_ptr, .properties = .{ .param_str = "Uc*7", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_r600_read_tgid_x, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_r600_read_tgid_y, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_r600_read_tgid_z, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_r600_read_tidig_x, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_r600_read_tidig_y, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_r600_read_tidig_z, .properties = .{ .param_str = "Ui", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_r600_recipsqrt_ieee, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_r600_recipsqrt_ieeef, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.amdgpu), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_readcyclecounter, .properties = .{ .param_str = "ULLi" } }, + .{ .tag = .__builtin_readflm, .properties = .{ .param_str = "d", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_realloc, .properties = .{ .param_str = "v*v*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_reduce_add, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_reduce_and, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_reduce_max, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_reduce_min, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_reduce_mul, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_reduce_or, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_reduce_xor, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_remainder, .properties = .{ .param_str = "ddd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_remainderf, .properties = .{ .param_str = "fff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_remainderf128, .properties = .{ .param_str = "LLdLLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_remainderl, .properties = .{ .param_str = "LdLdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_remquo, .properties = .{ .param_str = "dddi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_remquof, .properties = .{ .param_str = "fffi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_remquof128, .properties = .{ .param_str = "LLdLLdLLdi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_remquol, .properties = .{ .param_str = "LdLdLdi*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_return_address, .properties = .{ .param_str = "v*IUi" } }, + .{ .tag = .__builtin_rindex, .properties = .{ .param_str = "c*cC*i", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_rint, .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_rintf, .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_rintf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_rintf16, .properties = .{ .param_str = "hh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_rintl, .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_rotateleft16, .properties = .{ .param_str = "UsUsUs", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_rotateleft32, .properties = .{ .param_str = "UZiUZiUZi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_rotateleft64, .properties = .{ .param_str = "UWiUWiUWi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_rotateleft8, .properties = .{ .param_str = "UcUcUc", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_rotateright16, .properties = .{ .param_str = "UsUsUs", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_rotateright32, .properties = .{ .param_str = "UZiUZiUZi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_rotateright64, .properties = .{ .param_str = "UWiUWiUWi", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_rotateright8, .properties = .{ .param_str = "UcUcUc", .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_round, .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_roundeven, .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_roundevenf, .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_roundevenf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_roundevenf16, .properties = .{ .param_str = "hh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_roundevenl, .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_roundf, .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_roundf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_roundf16, .properties = .{ .param_str = "hh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_roundl, .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_sadd_overflow, .properties = .{ .param_str = "bSiCSiCSi*", .attributes = .{ .const_evaluable = true } } }, + .{ .tag = .__builtin_saddl_overflow, .properties = .{ .param_str = "bSLiCSLiCSLi*", .attributes = .{ .const_evaluable = true } } }, + .{ .tag = .__builtin_saddll_overflow, .properties = .{ .param_str = "bSLLiCSLLiCSLLi*", .attributes = .{ .const_evaluable = true } } }, + .{ .tag = .__builtin_scalbln, .properties = .{ .param_str = "ddLi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_scalblnf, .properties = .{ .param_str = "ffLi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_scalblnf128, .properties = .{ .param_str = "LLdLLdLi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_scalblnl, .properties = .{ .param_str = "LdLdLi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_scalbn, .properties = .{ .param_str = "ddi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_scalbnf, .properties = .{ .param_str = "ffi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_scalbnf128, .properties = .{ .param_str = "LLdLLdi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_scalbnl, .properties = .{ .param_str = "LdLdi", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_scanf, .properties = .{ .param_str = "icC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .scanf } } }, + .{ .tag = .__builtin_set_flt_rounds, .properties = .{ .param_str = "vi" } }, + .{ .tag = .__builtin_setflm, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_setjmp, .properties = .{ .param_str = "iv**", .attributes = .{ .returns_twice = true } } }, + .{ .tag = .__builtin_setps, .properties = .{ .param_str = "vUiUi", .target_set = TargetSet.initOne(.xcore) } }, + .{ .tag = .__builtin_setrnd, .properties = .{ .param_str = "di", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_shufflevector, .properties = .{ .param_str = "v.", .attributes = .{ .@"const" = true, .custom_typecheck = true } } }, + .{ .tag = .__builtin_signbit, .properties = .{ .param_str = "i.", .attributes = .{ .@"const" = true, .custom_typecheck = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_signbitf, .properties = .{ .param_str = "if", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_signbitl, .properties = .{ .param_str = "iLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_sin, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_sinf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_sinf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_sinf16, .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_sinh, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_sinhf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_sinhf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_sinhl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_sinl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_smul_overflow, .properties = .{ .param_str = "bSiCSiCSi*", .attributes = .{ .const_evaluable = true } } }, + .{ .tag = .__builtin_smull_overflow, .properties = .{ .param_str = "bSLiCSLiCSLi*", .attributes = .{ .const_evaluable = true } } }, + .{ .tag = .__builtin_smulll_overflow, .properties = .{ .param_str = "bSLLiCSLLiCSLLi*", .attributes = .{ .const_evaluable = true } } }, + .{ .tag = .__builtin_snprintf, .properties = .{ .param_str = "ic*RzcC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .printf, .format_string_position = 2 } } }, + .{ .tag = .__builtin_sponentry, .properties = .{ .param_str = "v*", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_sprintf, .properties = .{ .param_str = "ic*RcC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .printf, .format_string_position = 1 } } }, + .{ .tag = .__builtin_sqrt, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_sqrtf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_sqrtf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_sqrtf16, .properties = .{ .param_str = "hh", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_sqrtl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_sscanf, .properties = .{ .param_str = "icC*RcC*R.", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .scanf, .format_string_position = 1 } } }, + .{ .tag = .__builtin_ssub_overflow, .properties = .{ .param_str = "bSiCSiCSi*", .attributes = .{ .const_evaluable = true } } }, + .{ .tag = .__builtin_ssubl_overflow, .properties = .{ .param_str = "bSLiCSLiCSLi*", .attributes = .{ .const_evaluable = true } } }, + .{ .tag = .__builtin_ssubll_overflow, .properties = .{ .param_str = "bSLLiCSLLiCSLLi*", .attributes = .{ .const_evaluable = true } } }, + .{ .tag = .__builtin_stdarg_start, .properties = .{ .param_str = "vA.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__builtin_stpcpy, .properties = .{ .param_str = "c*c*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_stpncpy, .properties = .{ .param_str = "c*c*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_strcasecmp, .properties = .{ .param_str = "icC*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_strcat, .properties = .{ .param_str = "c*c*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_strchr, .properties = .{ .param_str = "c*cC*i", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_strcmp, .properties = .{ .param_str = "icC*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_strcpy, .properties = .{ .param_str = "c*c*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_strcspn, .properties = .{ .param_str = "zcC*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_strdup, .properties = .{ .param_str = "c*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_strlen, .properties = .{ .param_str = "zcC*", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_strncasecmp, .properties = .{ .param_str = "icC*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_strncat, .properties = .{ .param_str = "c*c*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_strncmp, .properties = .{ .param_str = "icC*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_strncpy, .properties = .{ .param_str = "c*c*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_strndup, .properties = .{ .param_str = "c*cC*z", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_strpbrk, .properties = .{ .param_str = "c*cC*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_strrchr, .properties = .{ .param_str = "c*cC*i", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_strspn, .properties = .{ .param_str = "zcC*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_strstr, .properties = .{ .param_str = "c*cC*cC*", .attributes = .{ .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_sub_overflow, .properties = .{ .param_str = "b.", .attributes = .{ .custom_typecheck = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_subc, .properties = .{ .param_str = "UiUiCUiCUiCUi*" } }, + .{ .tag = .__builtin_subcb, .properties = .{ .param_str = "UcUcCUcCUcCUc*" } }, + .{ .tag = .__builtin_subcl, .properties = .{ .param_str = "ULiULiCULiCULiCULi*" } }, + .{ .tag = .__builtin_subcll, .properties = .{ .param_str = "ULLiULLiCULLiCULLiCULLi*" } }, + .{ .tag = .__builtin_subcs, .properties = .{ .param_str = "UsUsCUsCUsCUs*" } }, + .{ .tag = .__builtin_tan, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_tanf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_tanf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_tanh, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_tanhf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_tanhf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_tanhl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_tanl, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_tgamma, .properties = .{ .param_str = "dd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_tgammaf, .properties = .{ .param_str = "ff", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_tgammaf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_tgammal, .properties = .{ .param_str = "LdLd", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__builtin_thread_pointer, .properties = .{ .param_str = "v*", .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_trap, .properties = .{ .param_str = "v", .attributes = .{ .noreturn = true } } }, + .{ .tag = .__builtin_trunc, .properties = .{ .param_str = "dd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_truncf, .properties = .{ .param_str = "ff", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_truncf128, .properties = .{ .param_str = "LLdLLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_truncf16, .properties = .{ .param_str = "hh", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_truncl, .properties = .{ .param_str = "LdLd", .attributes = .{ .@"const" = true, .lib_function_with_builtin_prefix = true } } }, + .{ .tag = .__builtin_types_compatible_p, .properties = .{ .param_str = "i.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__builtin_uadd_overflow, .properties = .{ .param_str = "bUiCUiCUi*", .attributes = .{ .const_evaluable = true } } }, + .{ .tag = .__builtin_uaddl_overflow, .properties = .{ .param_str = "bULiCULiCULi*", .attributes = .{ .const_evaluable = true } } }, + .{ .tag = .__builtin_uaddll_overflow, .properties = .{ .param_str = "bULLiCULLiCULLi*", .attributes = .{ .const_evaluable = true } } }, + .{ .tag = .__builtin_umul_overflow, .properties = .{ .param_str = "bUiCUiCUi*", .attributes = .{ .const_evaluable = true } } }, + .{ .tag = .__builtin_umull_overflow, .properties = .{ .param_str = "bULiCULiCULi*", .attributes = .{ .const_evaluable = true } } }, + .{ .tag = .__builtin_umulll_overflow, .properties = .{ .param_str = "bULLiCULLiCULLi*", .attributes = .{ .const_evaluable = true } } }, + .{ .tag = .__builtin_unpack_longdouble, .properties = .{ .param_str = "dLdIi", .target_set = TargetSet.initOne(.ppc) } }, + .{ .tag = .__builtin_unpredictable, .properties = .{ .param_str = "LiLi", .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_unreachable, .properties = .{ .param_str = "v", .attributes = .{ .noreturn = true } } }, + .{ .tag = .__builtin_unwind_init, .properties = .{ .param_str = "v" } }, + .{ .tag = .__builtin_usub_overflow, .properties = .{ .param_str = "bUiCUiCUi*", .attributes = .{ .const_evaluable = true } } }, + .{ .tag = .__builtin_usubl_overflow, .properties = .{ .param_str = "bULiCULiCULi*", .attributes = .{ .const_evaluable = true } } }, + .{ .tag = .__builtin_usubll_overflow, .properties = .{ .param_str = "bULLiCULLiCULLi*", .attributes = .{ .const_evaluable = true } } }, + .{ .tag = .__builtin_va_arg, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__builtin_va_copy, .properties = .{ .param_str = "vAA" } }, + .{ .tag = .__builtin_va_end, .properties = .{ .param_str = "vA" } }, + .{ .tag = .__builtin_va_start, .properties = .{ .param_str = "vA.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__builtin_ve_vl_andm_MMM, .properties = .{ .param_str = "V512bV512bV512b", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_andm_mmm, .properties = .{ .param_str = "V256bV256bV256b", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_eqvm_MMM, .properties = .{ .param_str = "V512bV512bV512b", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_eqvm_mmm, .properties = .{ .param_str = "V256bV256bV256b", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_extract_vm512l, .properties = .{ .param_str = "V256bV512b", .target_set = TargetSet.initOne(.ve) } }, + .{ .tag = .__builtin_ve_vl_extract_vm512u, .properties = .{ .param_str = "V256bV512b", .target_set = TargetSet.initOne(.ve) } }, + .{ .tag = .__builtin_ve_vl_fencec_s, .properties = .{ .param_str = "vUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_fencei, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_fencem_s, .properties = .{ .param_str = "vUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_fidcr_sss, .properties = .{ .param_str = "LUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_insert_vm512l, .properties = .{ .param_str = "V512bV512bV256b", .target_set = TargetSet.initOne(.ve) } }, + .{ .tag = .__builtin_ve_vl_insert_vm512u, .properties = .{ .param_str = "V512bV512bV256b", .target_set = TargetSet.initOne(.ve) } }, + .{ .tag = .__builtin_ve_vl_lcr_sss, .properties = .{ .param_str = "LUiLUiLUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_lsv_vvss, .properties = .{ .param_str = "V256dV256dUiLUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_lvm_MMss, .properties = .{ .param_str = "V512bV512bLUiLUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_lvm_mmss, .properties = .{ .param_str = "V256bV256bLUiLUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_lvsd_svs, .properties = .{ .param_str = "dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_lvsl_svs, .properties = .{ .param_str = "LUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_lvss_svs, .properties = .{ .param_str = "fV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_lzvm_sml, .properties = .{ .param_str = "LUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_negm_MM, .properties = .{ .param_str = "V512bV512b", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_negm_mm, .properties = .{ .param_str = "V256bV256b", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_nndm_MMM, .properties = .{ .param_str = "V512bV512bV512b", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_nndm_mmm, .properties = .{ .param_str = "V256bV256bV256b", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_orm_MMM, .properties = .{ .param_str = "V512bV512bV512b", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_orm_mmm, .properties = .{ .param_str = "V256bV256bV256b", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pack_f32a, .properties = .{ .param_str = "ULifC*", .target_set = TargetSet.initOne(.ve) } }, + .{ .tag = .__builtin_ve_vl_pack_f32p, .properties = .{ .param_str = "ULifC*fC*", .target_set = TargetSet.initOne(.ve) } }, + .{ .tag = .__builtin_ve_vl_pcvm_sml, .properties = .{ .param_str = "LUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pfchv_ssl, .properties = .{ .param_str = "vLivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pfchvnc_ssl, .properties = .{ .param_str = "vLivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvadds_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvadds_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvadds_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvadds_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvadds_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvadds_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvaddu_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvaddu_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvaddu_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvaddu_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvaddu_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvaddu_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvand_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvand_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvand_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvand_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvand_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvand_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvbrd_vsMvl, .properties = .{ .param_str = "V256dLUiV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvbrd_vsl, .properties = .{ .param_str = "V256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvbrd_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvbrv_vvMvl, .properties = .{ .param_str = "V256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvbrv_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvbrv_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvbrvlo_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvbrvlo_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvbrvlo_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvbrvup_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvbrvup_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvbrvup_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvcmps_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvcmps_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvcmps_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvcmps_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvcmps_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvcmps_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvcmpu_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvcmpu_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvcmpu_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvcmpu_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvcmpu_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvcmpu_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvcvtsw_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvcvtsw_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvcvtws_vvMvl, .properties = .{ .param_str = "V256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvcvtws_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvcvtws_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvcvtwsrz_vvMvl, .properties = .{ .param_str = "V256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvcvtwsrz_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvcvtwsrz_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pveqv_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pveqv_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pveqv_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pveqv_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pveqv_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pveqv_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfadd_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfadd_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfadd_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfadd_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfadd_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfadd_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfcmp_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfcmp_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfcmp_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfcmp_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfcmp_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfcmp_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmad_vsvvMvl, .properties = .{ .param_str = "V256dLUiV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmad_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmad_vsvvvl, .properties = .{ .param_str = "V256dLUiV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmad_vvsvMvl, .properties = .{ .param_str = "V256dV256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmad_vvsvl, .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmad_vvsvvl, .properties = .{ .param_str = "V256dV256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmad_vvvvMvl, .properties = .{ .param_str = "V256dV256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmad_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmad_vvvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmax_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmax_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmax_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmax_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmax_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmax_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmin_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmin_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmin_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmin_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmin_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmin_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkaf_Ml, .properties = .{ .param_str = "V512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkat_Ml, .properties = .{ .param_str = "V512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkseq_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkseq_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkseqnan_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkseqnan_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksge_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksge_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksgenan_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksgenan_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksgt_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksgt_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksgtnan_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksgtnan_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksle_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksle_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkslenan_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkslenan_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksloeq_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksloeq_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksloeqnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksloeqnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksloge_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksloge_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkslogenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkslogenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkslogt_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkslogt_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkslogtnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkslogtnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkslole_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkslole_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkslolenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkslolenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkslolt_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkslolt_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksloltnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksloltnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkslonan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkslonan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkslone_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkslone_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkslonenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkslonenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkslonum_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkslonum_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkslt_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkslt_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksltnan_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksltnan_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksnan_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksnan_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksne_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksne_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksnenan_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksnenan_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksnum_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksnum_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksupeq_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksupeq_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksupeqnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksupeqnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksupge_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksupge_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksupgenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksupgenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksupgt_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksupgt_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksupgtnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksupgtnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksuple_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksuple_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksuplenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksuplenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksuplt_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksuplt_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksupltnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksupltnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksupnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksupnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksupne_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksupne_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksupnenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksupnenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksupnum_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmksupnum_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkweq_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkweq_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkweqnan_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkweqnan_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwge_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwge_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwgenan_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwgenan_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwgt_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwgt_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwgtnan_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwgtnan_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwle_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwle_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwlenan_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwlenan_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwloeq_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwloeq_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwloeqnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwloeqnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwloge_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwloge_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwlogenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwlogenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwlogt_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwlogt_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwlogtnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwlogtnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwlole_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwlole_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwlolenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwlolenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwlolt_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwlolt_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwloltnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwloltnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwlonan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwlonan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwlone_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwlone_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwlonenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwlonenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwlonum_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwlonum_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwlt_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwlt_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwltnan_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwltnan_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwnan_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwnan_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwne_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwne_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwnenan_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwnenan_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwnum_MvMl, .properties = .{ .param_str = "V512bV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwnum_Mvl, .properties = .{ .param_str = "V512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwupeq_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwupeq_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwupeqnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwupeqnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwupge_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwupge_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwupgenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwupgenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwupgt_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwupgt_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwupgtnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwupgtnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwuple_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwuple_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwuplenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwuplenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwuplt_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwuplt_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwupltnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwupltnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwupnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwupnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwupne_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwupne_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwupnenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwupnenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwupnum_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmkwupnum_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmsb_vsvvMvl, .properties = .{ .param_str = "V256dLUiV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmsb_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmsb_vsvvvl, .properties = .{ .param_str = "V256dLUiV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmsb_vvsvMvl, .properties = .{ .param_str = "V256dV256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmsb_vvsvl, .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmsb_vvsvvl, .properties = .{ .param_str = "V256dV256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmsb_vvvvMvl, .properties = .{ .param_str = "V256dV256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmsb_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmsb_vvvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmul_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmul_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmul_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmul_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmul_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfmul_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfnmad_vsvvMvl, .properties = .{ .param_str = "V256dLUiV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfnmad_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfnmad_vsvvvl, .properties = .{ .param_str = "V256dLUiV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfnmad_vvsvMvl, .properties = .{ .param_str = "V256dV256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfnmad_vvsvl, .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfnmad_vvsvvl, .properties = .{ .param_str = "V256dV256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfnmad_vvvvMvl, .properties = .{ .param_str = "V256dV256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfnmad_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfnmad_vvvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfnmsb_vsvvMvl, .properties = .{ .param_str = "V256dLUiV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfnmsb_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfnmsb_vsvvvl, .properties = .{ .param_str = "V256dLUiV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfnmsb_vvsvMvl, .properties = .{ .param_str = "V256dV256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfnmsb_vvsvl, .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfnmsb_vvsvvl, .properties = .{ .param_str = "V256dV256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfnmsb_vvvvMvl, .properties = .{ .param_str = "V256dV256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfnmsb_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfnmsb_vvvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfsub_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfsub_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfsub_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfsub_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfsub_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvfsub_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvldz_vvMvl, .properties = .{ .param_str = "V256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvldz_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvldz_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvldzlo_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvldzlo_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvldzlo_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvldzup_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvldzup_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvldzup_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvmaxs_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvmaxs_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvmaxs_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvmaxs_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvmaxs_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvmaxs_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvmins_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvmins_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvmins_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvmins_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvmins_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvmins_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvor_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvor_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvor_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvor_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvor_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvor_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvpcnt_vvMvl, .properties = .{ .param_str = "V256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvpcnt_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvpcnt_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvpcntlo_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvpcntlo_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvpcntlo_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvpcntup_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvpcntup_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvpcntup_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvrcp_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvrcp_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvrsqrt_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvrsqrt_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvrsqrtnex_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvrsqrtnex_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvseq_vl, .properties = .{ .param_str = "V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvseq_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvseqlo_vl, .properties = .{ .param_str = "V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvseqlo_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsequp_vl, .properties = .{ .param_str = "V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsequp_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsla_vvsMvl, .properties = .{ .param_str = "V256dV256dLUiV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsla_vvsl, .properties = .{ .param_str = "V256dV256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsla_vvsvl, .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsla_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsla_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsla_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsll_vvsMvl, .properties = .{ .param_str = "V256dV256dLUiV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsll_vvsl, .properties = .{ .param_str = "V256dV256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsll_vvsvl, .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsll_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsll_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsll_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsra_vvsMvl, .properties = .{ .param_str = "V256dV256dLUiV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsra_vvsl, .properties = .{ .param_str = "V256dV256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsra_vvsvl, .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsra_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsra_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsra_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsrl_vvsMvl, .properties = .{ .param_str = "V256dV256dLUiV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsrl_vvsl, .properties = .{ .param_str = "V256dV256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsrl_vvsvl, .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsrl_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsrl_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsrl_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsubs_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsubs_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsubs_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsubs_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsubs_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsubs_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsubu_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsubu_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsubu_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsubu_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsubu_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvsubu_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvxor_vsvMvl, .properties = .{ .param_str = "V256dLUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvxor_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvxor_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvxor_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvxor_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_pvxor_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_scr_sss, .properties = .{ .param_str = "vLUiLUiLUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_svm_sMs, .properties = .{ .param_str = "LUiV512bLUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_svm_sms, .properties = .{ .param_str = "LUiV256bLUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_svob, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_tovm_sml, .properties = .{ .param_str = "LUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_tscr_ssss, .properties = .{ .param_str = "LUiLUiLUiLUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vaddsl_vsvl, .properties = .{ .param_str = "V256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vaddsl_vsvmvl, .properties = .{ .param_str = "V256dLiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vaddsl_vsvvl, .properties = .{ .param_str = "V256dLiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vaddsl_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vaddsl_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vaddsl_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vaddswsx_vsvl, .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vaddswsx_vsvmvl, .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vaddswsx_vsvvl, .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vaddswsx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vaddswsx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vaddswsx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vaddswzx_vsvl, .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vaddswzx_vsvmvl, .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vaddswzx_vsvvl, .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vaddswzx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vaddswzx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vaddswzx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vaddul_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vaddul_vsvmvl, .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vaddul_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vaddul_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vaddul_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vaddul_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vadduw_vsvl, .properties = .{ .param_str = "V256dUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vadduw_vsvmvl, .properties = .{ .param_str = "V256dUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vadduw_vsvvl, .properties = .{ .param_str = "V256dUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vadduw_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vadduw_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vadduw_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vand_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vand_vsvmvl, .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vand_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vand_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vand_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vand_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vbrdd_vsl, .properties = .{ .param_str = "V256ddUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vbrdd_vsmvl, .properties = .{ .param_str = "V256ddV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vbrdd_vsvl, .properties = .{ .param_str = "V256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vbrdl_vsl, .properties = .{ .param_str = "V256dLiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vbrdl_vsmvl, .properties = .{ .param_str = "V256dLiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vbrdl_vsvl, .properties = .{ .param_str = "V256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vbrds_vsl, .properties = .{ .param_str = "V256dfUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vbrds_vsmvl, .properties = .{ .param_str = "V256dfV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vbrds_vsvl, .properties = .{ .param_str = "V256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vbrdw_vsl, .properties = .{ .param_str = "V256diUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vbrdw_vsmvl, .properties = .{ .param_str = "V256diV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vbrdw_vsvl, .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vbrv_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vbrv_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vbrv_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcmpsl_vsvl, .properties = .{ .param_str = "V256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcmpsl_vsvmvl, .properties = .{ .param_str = "V256dLiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcmpsl_vsvvl, .properties = .{ .param_str = "V256dLiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcmpsl_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcmpsl_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcmpsl_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcmpswsx_vsvl, .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcmpswsx_vsvmvl, .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcmpswsx_vsvvl, .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcmpswsx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcmpswsx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcmpswsx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcmpswzx_vsvl, .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcmpswzx_vsvmvl, .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcmpswzx_vsvvl, .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcmpswzx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcmpswzx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcmpswzx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcmpul_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcmpul_vsvmvl, .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcmpul_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcmpul_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcmpul_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcmpul_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcmpuw_vsvl, .properties = .{ .param_str = "V256dUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcmpuw_vsvmvl, .properties = .{ .param_str = "V256dUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcmpuw_vsvvl, .properties = .{ .param_str = "V256dUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcmpuw_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcmpuw_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcmpuw_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcp_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtdl_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtdl_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtds_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtds_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtdw_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtdw_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtld_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtld_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtld_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtldrz_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtldrz_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtldrz_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtsd_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtsd_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtsw_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtsw_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtwdsx_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtwdsx_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtwdsx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtwdsxrz_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtwdsxrz_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtwdsxrz_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtwdzx_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtwdzx_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtwdzx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtwdzxrz_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtwdzxrz_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtwdzxrz_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtwssx_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtwssx_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtwssx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtwssxrz_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtwssxrz_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtwssxrz_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtwszx_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtwszx_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtwszx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtwszxrz_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtwszxrz_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vcvtwszxrz_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivsl_vsvl, .properties = .{ .param_str = "V256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivsl_vsvmvl, .properties = .{ .param_str = "V256dLiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivsl_vsvvl, .properties = .{ .param_str = "V256dLiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivsl_vvsl, .properties = .{ .param_str = "V256dV256dLiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivsl_vvsmvl, .properties = .{ .param_str = "V256dV256dLiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivsl_vvsvl, .properties = .{ .param_str = "V256dV256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivsl_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivsl_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivsl_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivswsx_vsvl, .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivswsx_vsvmvl, .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivswsx_vsvvl, .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivswsx_vvsl, .properties = .{ .param_str = "V256dV256diUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivswsx_vvsmvl, .properties = .{ .param_str = "V256dV256diV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivswsx_vvsvl, .properties = .{ .param_str = "V256dV256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivswsx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivswsx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivswsx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivswzx_vsvl, .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivswzx_vsvmvl, .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivswzx_vsvvl, .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivswzx_vvsl, .properties = .{ .param_str = "V256dV256diUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivswzx_vvsmvl, .properties = .{ .param_str = "V256dV256diV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivswzx_vvsvl, .properties = .{ .param_str = "V256dV256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivswzx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivswzx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivswzx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivul_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivul_vsvmvl, .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivul_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivul_vvsl, .properties = .{ .param_str = "V256dV256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivul_vvsmvl, .properties = .{ .param_str = "V256dV256dLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivul_vvsvl, .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivul_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivul_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivul_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivuw_vsvl, .properties = .{ .param_str = "V256dUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivuw_vsvmvl, .properties = .{ .param_str = "V256dUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivuw_vsvvl, .properties = .{ .param_str = "V256dUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivuw_vvsl, .properties = .{ .param_str = "V256dV256dUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivuw_vvsmvl, .properties = .{ .param_str = "V256dV256dUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivuw_vvsvl, .properties = .{ .param_str = "V256dV256dUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivuw_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivuw_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vdivuw_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_veqv_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_veqv_vsvmvl, .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_veqv_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_veqv_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_veqv_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_veqv_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vex_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfaddd_vsvl, .properties = .{ .param_str = "V256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfaddd_vsvmvl, .properties = .{ .param_str = "V256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfaddd_vsvvl, .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfaddd_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfaddd_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfaddd_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfadds_vsvl, .properties = .{ .param_str = "V256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfadds_vsvmvl, .properties = .{ .param_str = "V256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfadds_vsvvl, .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfadds_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfadds_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfadds_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfcmpd_vsvl, .properties = .{ .param_str = "V256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfcmpd_vsvmvl, .properties = .{ .param_str = "V256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfcmpd_vsvvl, .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfcmpd_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfcmpd_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfcmpd_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfcmps_vsvl, .properties = .{ .param_str = "V256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfcmps_vsvmvl, .properties = .{ .param_str = "V256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfcmps_vsvvl, .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfcmps_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfcmps_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfcmps_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfdivd_vsvl, .properties = .{ .param_str = "V256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfdivd_vsvmvl, .properties = .{ .param_str = "V256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfdivd_vsvvl, .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfdivd_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfdivd_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfdivd_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfdivs_vsvl, .properties = .{ .param_str = "V256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfdivs_vsvmvl, .properties = .{ .param_str = "V256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfdivs_vsvvl, .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfdivs_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfdivs_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfdivs_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmadd_vsvvl, .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmadd_vsvvmvl, .properties = .{ .param_str = "V256ddV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmadd_vsvvvl, .properties = .{ .param_str = "V256ddV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmadd_vvsvl, .properties = .{ .param_str = "V256dV256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmadd_vvsvmvl, .properties = .{ .param_str = "V256dV256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmadd_vvsvvl, .properties = .{ .param_str = "V256dV256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmadd_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmadd_vvvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmadd_vvvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmads_vsvvl, .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmads_vsvvmvl, .properties = .{ .param_str = "V256dfV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmads_vsvvvl, .properties = .{ .param_str = "V256dfV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmads_vvsvl, .properties = .{ .param_str = "V256dV256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmads_vvsvmvl, .properties = .{ .param_str = "V256dV256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmads_vvsvvl, .properties = .{ .param_str = "V256dV256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmads_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmads_vvvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmads_vvvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmaxd_vsvl, .properties = .{ .param_str = "V256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmaxd_vsvmvl, .properties = .{ .param_str = "V256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmaxd_vsvvl, .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmaxd_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmaxd_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmaxd_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmaxs_vsvl, .properties = .{ .param_str = "V256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmaxs_vsvmvl, .properties = .{ .param_str = "V256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmaxs_vsvvl, .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmaxs_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmaxs_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmaxs_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmind_vsvl, .properties = .{ .param_str = "V256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmind_vsvmvl, .properties = .{ .param_str = "V256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmind_vsvvl, .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmind_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmind_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmind_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmins_vsvl, .properties = .{ .param_str = "V256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmins_vsvmvl, .properties = .{ .param_str = "V256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmins_vsvvl, .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmins_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmins_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmins_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkdeq_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkdeq_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkdeqnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkdeqnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkdge_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkdge_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkdgenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkdgenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkdgt_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkdgt_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkdgtnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkdgtnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkdle_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkdle_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkdlenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkdlenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkdlt_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkdlt_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkdltnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkdltnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkdnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkdnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkdne_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkdne_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkdnenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkdnenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkdnum_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkdnum_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmklaf_ml, .properties = .{ .param_str = "V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmklat_ml, .properties = .{ .param_str = "V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkleq_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkleq_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkleqnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkleqnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmklge_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmklge_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmklgenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmklgenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmklgt_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmklgt_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmklgtnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmklgtnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmklle_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmklle_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkllenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkllenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkllt_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkllt_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmklltnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmklltnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmklnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmklnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmklne_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmklne_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmklnenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmklnenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmklnum_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmklnum_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkseq_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkseq_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkseqnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkseqnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmksge_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmksge_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmksgenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmksgenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmksgt_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmksgt_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmksgtnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmksgtnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmksle_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmksle_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkslenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkslenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkslt_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkslt_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmksltnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmksltnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmksnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmksnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmksne_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmksne_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmksnenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmksnenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmksnum_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmksnum_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkweq_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkweq_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkweqnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkweqnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkwge_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkwge_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkwgenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkwgenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkwgt_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkwgt_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkwgtnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkwgtnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkwle_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkwle_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkwlenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkwlenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkwlt_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkwlt_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkwltnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkwltnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkwnan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkwnan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkwne_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkwne_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkwnenan_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkwnenan_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkwnum_mvl, .properties = .{ .param_str = "V256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmkwnum_mvml, .properties = .{ .param_str = "V256bV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmsbd_vsvvl, .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmsbd_vsvvmvl, .properties = .{ .param_str = "V256ddV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmsbd_vsvvvl, .properties = .{ .param_str = "V256ddV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmsbd_vvsvl, .properties = .{ .param_str = "V256dV256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmsbd_vvsvmvl, .properties = .{ .param_str = "V256dV256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmsbd_vvsvvl, .properties = .{ .param_str = "V256dV256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmsbd_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmsbd_vvvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmsbd_vvvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmsbs_vsvvl, .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmsbs_vsvvmvl, .properties = .{ .param_str = "V256dfV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmsbs_vsvvvl, .properties = .{ .param_str = "V256dfV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmsbs_vvsvl, .properties = .{ .param_str = "V256dV256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmsbs_vvsvmvl, .properties = .{ .param_str = "V256dV256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmsbs_vvsvvl, .properties = .{ .param_str = "V256dV256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmsbs_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmsbs_vvvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmsbs_vvvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmuld_vsvl, .properties = .{ .param_str = "V256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmuld_vsvmvl, .properties = .{ .param_str = "V256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmuld_vsvvl, .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmuld_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmuld_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmuld_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmuls_vsvl, .properties = .{ .param_str = "V256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmuls_vsvmvl, .properties = .{ .param_str = "V256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmuls_vsvvl, .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmuls_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmuls_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfmuls_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmadd_vsvvl, .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmadd_vsvvmvl, .properties = .{ .param_str = "V256ddV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmadd_vsvvvl, .properties = .{ .param_str = "V256ddV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmadd_vvsvl, .properties = .{ .param_str = "V256dV256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmadd_vvsvmvl, .properties = .{ .param_str = "V256dV256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmadd_vvsvvl, .properties = .{ .param_str = "V256dV256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmadd_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmadd_vvvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmadd_vvvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmads_vsvvl, .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmads_vsvvmvl, .properties = .{ .param_str = "V256dfV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmads_vsvvvl, .properties = .{ .param_str = "V256dfV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmads_vvsvl, .properties = .{ .param_str = "V256dV256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmads_vvsvmvl, .properties = .{ .param_str = "V256dV256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmads_vvsvvl, .properties = .{ .param_str = "V256dV256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmads_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmads_vvvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmads_vvvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmsbd_vsvvl, .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmsbd_vsvvmvl, .properties = .{ .param_str = "V256ddV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmsbd_vsvvvl, .properties = .{ .param_str = "V256ddV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmsbd_vvsvl, .properties = .{ .param_str = "V256dV256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmsbd_vvsvmvl, .properties = .{ .param_str = "V256dV256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmsbd_vvsvvl, .properties = .{ .param_str = "V256dV256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmsbd_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmsbd_vvvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmsbd_vvvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmsbs_vsvvl, .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmsbs_vsvvmvl, .properties = .{ .param_str = "V256dfV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmsbs_vsvvvl, .properties = .{ .param_str = "V256dfV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmsbs_vvsvl, .properties = .{ .param_str = "V256dV256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmsbs_vvsvmvl, .properties = .{ .param_str = "V256dV256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmsbs_vvsvvl, .properties = .{ .param_str = "V256dV256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmsbs_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmsbs_vvvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfnmsbs_vvvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfrmaxdfst_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfrmaxdfst_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfrmaxdlst_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfrmaxdlst_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfrmaxsfst_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfrmaxsfst_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfrmaxslst_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfrmaxslst_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfrmindfst_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfrmindfst_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfrmindlst_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfrmindlst_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfrminsfst_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfrminsfst_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfrminslst_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfrminslst_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfsqrtd_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfsqrtd_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfsqrts_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfsqrts_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfsubd_vsvl, .properties = .{ .param_str = "V256ddV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfsubd_vsvmvl, .properties = .{ .param_str = "V256ddV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfsubd_vsvvl, .properties = .{ .param_str = "V256ddV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfsubd_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfsubd_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfsubd_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfsubs_vsvl, .properties = .{ .param_str = "V256dfV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfsubs_vsvmvl, .properties = .{ .param_str = "V256dfV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfsubs_vsvvl, .properties = .{ .param_str = "V256dfV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfsubs_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfsubs_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfsubs_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfsumd_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfsumd_vvml, .properties = .{ .param_str = "V256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfsums_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vfsums_vvml, .properties = .{ .param_str = "V256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vgt_vvssl, .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vgt_vvssml, .properties = .{ .param_str = "V256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vgt_vvssmvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vgt_vvssvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vgtlsx_vvssl, .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vgtlsx_vvssml, .properties = .{ .param_str = "V256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vgtlsx_vvssmvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vgtlsx_vvssvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vgtlsxnc_vvssl, .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vgtlsxnc_vvssml, .properties = .{ .param_str = "V256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vgtlsxnc_vvssmvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vgtlsxnc_vvssvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vgtlzx_vvssl, .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vgtlzx_vvssml, .properties = .{ .param_str = "V256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vgtlzx_vvssmvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vgtlzx_vvssvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vgtlzxnc_vvssl, .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vgtlzxnc_vvssml, .properties = .{ .param_str = "V256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vgtlzxnc_vvssmvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vgtlzxnc_vvssvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vgtnc_vvssl, .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vgtnc_vvssml, .properties = .{ .param_str = "V256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vgtnc_vvssmvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vgtnc_vvssvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vgtu_vvssl, .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vgtu_vvssml, .properties = .{ .param_str = "V256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vgtu_vvssmvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vgtu_vvssvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vgtunc_vvssl, .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vgtunc_vvssml, .properties = .{ .param_str = "V256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vgtunc_vvssmvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vgtunc_vvssvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vld2d_vssl, .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vld2d_vssvl, .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vld2dnc_vssl, .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vld2dnc_vssvl, .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vld_vssl, .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vld_vssvl, .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vldl2dsx_vssl, .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vldl2dsx_vssvl, .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vldl2dsxnc_vssl, .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vldl2dsxnc_vssvl, .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vldl2dzx_vssl, .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vldl2dzx_vssvl, .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vldl2dzxnc_vssl, .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vldl2dzxnc_vssvl, .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vldlsx_vssl, .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vldlsx_vssvl, .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vldlsxnc_vssl, .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vldlsxnc_vssvl, .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vldlzx_vssl, .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vldlzx_vssvl, .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vldlzxnc_vssl, .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vldlzxnc_vssvl, .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vldnc_vssl, .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vldnc_vssvl, .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vldu2d_vssl, .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vldu2d_vssvl, .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vldu2dnc_vssl, .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vldu2dnc_vssvl, .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vldu_vssl, .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vldu_vssvl, .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vldunc_vssl, .properties = .{ .param_str = "V256dLUivC*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vldunc_vssvl, .properties = .{ .param_str = "V256dLUivC*V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vldz_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vldz_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vldz_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmaxsl_vsvl, .properties = .{ .param_str = "V256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmaxsl_vsvmvl, .properties = .{ .param_str = "V256dLiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmaxsl_vsvvl, .properties = .{ .param_str = "V256dLiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmaxsl_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmaxsl_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmaxsl_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmaxswsx_vsvl, .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmaxswsx_vsvmvl, .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmaxswsx_vsvvl, .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmaxswsx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmaxswsx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmaxswsx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmaxswzx_vsvl, .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmaxswzx_vsvmvl, .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmaxswzx_vsvvl, .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmaxswzx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmaxswzx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmaxswzx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vminsl_vsvl, .properties = .{ .param_str = "V256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vminsl_vsvmvl, .properties = .{ .param_str = "V256dLiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vminsl_vsvvl, .properties = .{ .param_str = "V256dLiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vminsl_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vminsl_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vminsl_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vminswsx_vsvl, .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vminswsx_vsvmvl, .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vminswsx_vsvvl, .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vminswsx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vminswsx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vminswsx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vminswzx_vsvl, .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vminswzx_vsvmvl, .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vminswzx_vsvvl, .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vminswzx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vminswzx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vminswzx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmrg_vsvml, .properties = .{ .param_str = "V256dLUiV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmrg_vsvmvl, .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmrg_vvvml, .properties = .{ .param_str = "V256dV256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmrg_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmrgw_vsvMl, .properties = .{ .param_str = "V256dUiV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmrgw_vsvMvl, .properties = .{ .param_str = "V256dUiV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmrgw_vvvMl, .properties = .{ .param_str = "V256dV256dV256dV512bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmrgw_vvvMvl, .properties = .{ .param_str = "V256dV256dV256dV512bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmulsl_vsvl, .properties = .{ .param_str = "V256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmulsl_vsvmvl, .properties = .{ .param_str = "V256dLiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmulsl_vsvvl, .properties = .{ .param_str = "V256dLiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmulsl_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmulsl_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmulsl_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmulslw_vsvl, .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmulslw_vsvvl, .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmulslw_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmulslw_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmulswsx_vsvl, .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmulswsx_vsvmvl, .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmulswsx_vsvvl, .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmulswsx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmulswsx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmulswsx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmulswzx_vsvl, .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmulswzx_vsvmvl, .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmulswzx_vsvvl, .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmulswzx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmulswzx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmulswzx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmulul_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmulul_vsvmvl, .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmulul_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmulul_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmulul_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmulul_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmuluw_vsvl, .properties = .{ .param_str = "V256dUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmuluw_vsvmvl, .properties = .{ .param_str = "V256dUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmuluw_vsvvl, .properties = .{ .param_str = "V256dUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmuluw_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmuluw_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmuluw_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmv_vsvl, .properties = .{ .param_str = "V256dUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmv_vsvmvl, .properties = .{ .param_str = "V256dUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vmv_vsvvl, .properties = .{ .param_str = "V256dUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vor_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vor_vsvmvl, .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vor_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vor_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vor_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vor_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vpcnt_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vpcnt_vvmvl, .properties = .{ .param_str = "V256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vpcnt_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrand_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrand_vvml, .properties = .{ .param_str = "V256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrcpd_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrcpd_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrcps_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrcps_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrmaxslfst_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrmaxslfst_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrmaxsllst_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrmaxsllst_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrmaxswfstsx_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrmaxswfstsx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrmaxswfstzx_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrmaxswfstzx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrmaxswlstsx_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrmaxswlstsx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrmaxswlstzx_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrmaxswlstzx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrminslfst_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrminslfst_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrminsllst_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrminsllst_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrminswfstsx_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrminswfstsx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrminswfstzx_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrminswfstzx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrminswlstsx_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrminswlstsx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrminswlstzx_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrminswlstzx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vror_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vror_vvml, .properties = .{ .param_str = "V256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrsqrtd_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrsqrtd_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrsqrtdnex_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrsqrtdnex_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrsqrts_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrsqrts_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrsqrtsnex_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrsqrtsnex_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrxor_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vrxor_vvml, .properties = .{ .param_str = "V256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsc_vvssl, .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsc_vvssml, .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vscl_vvssl, .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vscl_vvssml, .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsclnc_vvssl, .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsclnc_vvssml, .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsclncot_vvssl, .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsclncot_vvssml, .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsclot_vvssl, .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsclot_vvssml, .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vscnc_vvssl, .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vscnc_vvssml, .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vscncot_vvssl, .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vscncot_vvssml, .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vscot_vvssl, .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vscot_vvssml, .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vscu_vvssl, .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vscu_vvssml, .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vscunc_vvssl, .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vscunc_vvssml, .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vscuncot_vvssl, .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vscuncot_vvssml, .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vscuot_vvssl, .properties = .{ .param_str = "vV256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vscuot_vvssml, .properties = .{ .param_str = "vV256dV256dLUiLUiV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vseq_vl, .properties = .{ .param_str = "V256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vseq_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsfa_vvssl, .properties = .{ .param_str = "V256dV256dLUiLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsfa_vvssmvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsfa_vvssvl, .properties = .{ .param_str = "V256dV256dLUiLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vshf_vvvsl, .properties = .{ .param_str = "V256dV256dV256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vshf_vvvsvl, .properties = .{ .param_str = "V256dV256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vslal_vvsl, .properties = .{ .param_str = "V256dV256dLiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vslal_vvsmvl, .properties = .{ .param_str = "V256dV256dLiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vslal_vvsvl, .properties = .{ .param_str = "V256dV256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vslal_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vslal_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vslal_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vslawsx_vvsl, .properties = .{ .param_str = "V256dV256diUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vslawsx_vvsmvl, .properties = .{ .param_str = "V256dV256diV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vslawsx_vvsvl, .properties = .{ .param_str = "V256dV256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vslawsx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vslawsx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vslawsx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vslawzx_vvsl, .properties = .{ .param_str = "V256dV256diUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vslawzx_vvsmvl, .properties = .{ .param_str = "V256dV256diV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vslawzx_vvsvl, .properties = .{ .param_str = "V256dV256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vslawzx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vslawzx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vslawzx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsll_vvsl, .properties = .{ .param_str = "V256dV256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsll_vvsmvl, .properties = .{ .param_str = "V256dV256dLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsll_vvsvl, .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsll_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsll_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsll_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsral_vvsl, .properties = .{ .param_str = "V256dV256dLiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsral_vvsmvl, .properties = .{ .param_str = "V256dV256dLiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsral_vvsvl, .properties = .{ .param_str = "V256dV256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsral_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsral_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsral_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsrawsx_vvsl, .properties = .{ .param_str = "V256dV256diUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsrawsx_vvsmvl, .properties = .{ .param_str = "V256dV256diV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsrawsx_vvsvl, .properties = .{ .param_str = "V256dV256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsrawsx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsrawsx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsrawsx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsrawzx_vvsl, .properties = .{ .param_str = "V256dV256diUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsrawzx_vvsmvl, .properties = .{ .param_str = "V256dV256diV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsrawzx_vvsvl, .properties = .{ .param_str = "V256dV256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsrawzx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsrawzx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsrawzx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsrl_vvsl, .properties = .{ .param_str = "V256dV256dLUiUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsrl_vvsmvl, .properties = .{ .param_str = "V256dV256dLUiV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsrl_vvsvl, .properties = .{ .param_str = "V256dV256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsrl_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsrl_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsrl_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vst2d_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vst2d_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vst2dnc_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vst2dnc_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vst2dncot_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vst2dncot_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vst2dot_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vst2dot_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vst_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vst_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstl2d_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstl2d_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstl2dnc_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstl2dnc_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstl2dncot_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstl2dncot_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstl2dot_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstl2dot_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstl_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstl_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstlnc_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstlnc_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstlncot_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstlncot_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstlot_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstlot_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstnc_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstnc_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstncot_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstncot_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstot_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstot_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstu2d_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstu2d_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstu2dnc_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstu2dnc_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstu2dncot_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstu2dncot_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstu2dot_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstu2dot_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstu_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstu_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstunc_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstunc_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstuncot_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstuncot_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstuot_vssl, .properties = .{ .param_str = "vV256dLUiv*Ui", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vstuot_vssml, .properties = .{ .param_str = "vV256dLUiv*V256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsubsl_vsvl, .properties = .{ .param_str = "V256dLiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsubsl_vsvmvl, .properties = .{ .param_str = "V256dLiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsubsl_vsvvl, .properties = .{ .param_str = "V256dLiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsubsl_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsubsl_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsubsl_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsubswsx_vsvl, .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsubswsx_vsvmvl, .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsubswsx_vsvvl, .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsubswsx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsubswsx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsubswsx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsubswzx_vsvl, .properties = .{ .param_str = "V256diV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsubswzx_vsvmvl, .properties = .{ .param_str = "V256diV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsubswzx_vsvvl, .properties = .{ .param_str = "V256diV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsubswzx_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsubswzx_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsubswzx_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsubul_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsubul_vsvmvl, .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsubul_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsubul_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsubul_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsubul_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsubuw_vsvl, .properties = .{ .param_str = "V256dUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsubuw_vsvmvl, .properties = .{ .param_str = "V256dUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsubuw_vsvvl, .properties = .{ .param_str = "V256dUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsubuw_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsubuw_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsubuw_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsuml_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsuml_vvml, .properties = .{ .param_str = "V256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsumwsx_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsumwsx_vvml, .properties = .{ .param_str = "V256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsumwzx_vvl, .properties = .{ .param_str = "V256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vsumwzx_vvml, .properties = .{ .param_str = "V256dV256dV256bUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vxor_vsvl, .properties = .{ .param_str = "V256dLUiV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vxor_vsvmvl, .properties = .{ .param_str = "V256dLUiV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vxor_vsvvl, .properties = .{ .param_str = "V256dLUiV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vxor_vvvl, .properties = .{ .param_str = "V256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vxor_vvvmvl, .properties = .{ .param_str = "V256dV256dV256dV256bV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_vxor_vvvvl, .properties = .{ .param_str = "V256dV256dV256dV256dUi", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_xorm_MMM, .properties = .{ .param_str = "V512bV512bV512b", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_ve_vl_xorm_mmm, .properties = .{ .param_str = "V256bV256bV256b", .target_set = TargetSet.initOne(.vevl_gen) } }, + .{ .tag = .__builtin_vfprintf, .properties = .{ .param_str = "iP*RcC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vprintf, .format_string_position = 1 } } }, + .{ .tag = .__builtin_vfscanf, .properties = .{ .param_str = "iP*RcC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vscanf, .format_string_position = 1 } } }, + .{ .tag = .__builtin_vprintf, .properties = .{ .param_str = "icC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vprintf } } }, + .{ .tag = .__builtin_vscanf, .properties = .{ .param_str = "icC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vscanf } } }, + .{ .tag = .__builtin_vsnprintf, .properties = .{ .param_str = "ic*RzcC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vprintf, .format_string_position = 2 } } }, + .{ .tag = .__builtin_vsprintf, .properties = .{ .param_str = "ic*RcC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vprintf, .format_string_position = 1 } } }, + .{ .tag = .__builtin_vsscanf, .properties = .{ .param_str = "icC*RcC*Ra", .attributes = .{ .lib_function_with_builtin_prefix = true, .format_kind = .vscanf, .format_string_position = 1 } } }, + .{ .tag = .__builtin_wasm_max_f32, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_wasm_max_f64, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_wasm_memory_grow, .properties = .{ .param_str = "zIiz", .target_set = TargetSet.initOne(.webassembly) } }, + .{ .tag = .__builtin_wasm_memory_size, .properties = .{ .param_str = "zIi", .target_set = TargetSet.initOne(.webassembly) } }, + .{ .tag = .__builtin_wasm_min_f32, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_wasm_min_f64, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_wasm_trunc_s_i32_f32, .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_wasm_trunc_s_i32_f64, .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_wasm_trunc_s_i64_f32, .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_wasm_trunc_s_i64_f64, .properties = .{ .param_str = "LLid", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_wasm_trunc_u_i32_f32, .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_wasm_trunc_u_i32_f64, .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_wasm_trunc_u_i64_f32, .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_wasm_trunc_u_i64_f64, .properties = .{ .param_str = "LLid", .target_set = TargetSet.initOne(.webassembly), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__builtin_wcschr, .properties = .{ .param_str = "w*wC*w", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_wcscmp, .properties = .{ .param_str = "iwC*wC*", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_wcslen, .properties = .{ .param_str = "zwC*", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_wcsncmp, .properties = .{ .param_str = "iwC*wC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_wmemchr, .properties = .{ .param_str = "w*wC*wz", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_wmemcmp, .properties = .{ .param_str = "iwC*wC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_wmemcpy, .properties = .{ .param_str = "w*w*wC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__builtin_wmemmove, .properties = .{ .param_str = "w*w*wC*z", .attributes = .{ .lib_function_with_builtin_prefix = true, .const_evaluable = true } } }, + .{ .tag = .__c11_atomic_compare_exchange_strong, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__c11_atomic_compare_exchange_weak, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__c11_atomic_exchange, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__c11_atomic_fetch_add, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__c11_atomic_fetch_and, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__c11_atomic_fetch_max, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__c11_atomic_fetch_min, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__c11_atomic_fetch_nand, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__c11_atomic_fetch_or, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__c11_atomic_fetch_sub, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__c11_atomic_fetch_xor, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__c11_atomic_init, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__c11_atomic_is_lock_free, .properties = .{ .param_str = "bz", .attributes = .{ .const_evaluable = true } } }, + .{ .tag = .__c11_atomic_load, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__c11_atomic_signal_fence, .properties = .{ .param_str = "vi" } }, + .{ .tag = .__c11_atomic_store, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__c11_atomic_thread_fence, .properties = .{ .param_str = "vi" } }, + .{ .tag = .__clear_cache, .properties = .{ .param_str = "vv*v*", .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, + .{ .tag = .__cospi, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__cospif, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__debugbreak, .properties = .{ .param_str = "v", .language = .all_ms_languages } }, + .{ .tag = .__dmb, .properties = .{ .param_str = "vUi", .language = .all_ms_languages, .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__dsb, .properties = .{ .param_str = "vUi", .language = .all_ms_languages, .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__emit, .properties = .{ .param_str = "vIUiC", .language = .all_ms_languages, .target_set = TargetSet.initOne(.arm) } }, + .{ .tag = .__exception_code, .properties = .{ .param_str = "UNi", .language = .all_ms_languages } }, + .{ .tag = .__exception_info, .properties = .{ .param_str = "v*", .language = .all_ms_languages } }, + .{ .tag = .__exp10, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__exp10f, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__fastfail, .properties = .{ .param_str = "vUi", .language = .all_ms_languages, .attributes = .{ .noreturn = true } } }, + .{ .tag = .__finite, .properties = .{ .param_str = "id", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .__finitef, .properties = .{ .param_str = "if", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .__finitel, .properties = .{ .param_str = "iLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .__isb, .properties = .{ .param_str = "vUi", .language = .all_ms_languages, .target_set = TargetSet.initMany(&.{ .aarch64, .arm }), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__iso_volatile_load16, .properties = .{ .param_str = "ssCD*", .language = .all_ms_languages } }, + .{ .tag = .__iso_volatile_load32, .properties = .{ .param_str = "iiCD*", .language = .all_ms_languages } }, + .{ .tag = .__iso_volatile_load64, .properties = .{ .param_str = "LLiLLiCD*", .language = .all_ms_languages } }, + .{ .tag = .__iso_volatile_load8, .properties = .{ .param_str = "ccCD*", .language = .all_ms_languages } }, + .{ .tag = .__iso_volatile_store16, .properties = .{ .param_str = "vsD*s", .language = .all_ms_languages } }, + .{ .tag = .__iso_volatile_store32, .properties = .{ .param_str = "viD*i", .language = .all_ms_languages } }, + .{ .tag = .__iso_volatile_store64, .properties = .{ .param_str = "vLLiD*LLi", .language = .all_ms_languages } }, + .{ .tag = .__iso_volatile_store8, .properties = .{ .param_str = "vcD*c", .language = .all_ms_languages } }, + .{ .tag = .__ldrexd, .properties = .{ .param_str = "WiWiCD*", .language = .all_ms_languages, .target_set = TargetSet.initOne(.arm) } }, + .{ .tag = .__lzcnt, .properties = .{ .param_str = "UiUi", .language = .all_ms_languages, .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__lzcnt16, .properties = .{ .param_str = "UsUs", .language = .all_ms_languages, .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__lzcnt64, .properties = .{ .param_str = "UWiUWi", .language = .all_ms_languages, .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__noop, .properties = .{ .param_str = "i.", .language = .all_ms_languages } }, + .{ .tag = .__nvvm_add_rm_d, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_add_rm_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_add_rm_ftz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_add_rn_d, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_add_rn_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_add_rn_ftz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_add_rp_d, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_add_rp_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_add_rp_ftz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_add_rz_d, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_add_rz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_add_rz_ftz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_add_gen_f, .properties = .{ .param_str = "ffD*f", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_add_gen_i, .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_add_gen_l, .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_add_gen_ll, .properties = .{ .param_str = "LLiLLiD*LLi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_and_gen_i, .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_and_gen_l, .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_and_gen_ll, .properties = .{ .param_str = "LLiLLiD*LLi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_cas_gen_i, .properties = .{ .param_str = "iiD*ii", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_cas_gen_l, .properties = .{ .param_str = "LiLiD*LiLi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_cas_gen_ll, .properties = .{ .param_str = "LLiLLiD*LLiLLi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_dec_gen_ui, .properties = .{ .param_str = "UiUiD*Ui", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_inc_gen_ui, .properties = .{ .param_str = "UiUiD*Ui", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_max_gen_i, .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_max_gen_l, .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_max_gen_ll, .properties = .{ .param_str = "LLiLLiD*LLi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_max_gen_ui, .properties = .{ .param_str = "UiUiD*Ui", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_max_gen_ul, .properties = .{ .param_str = "ULiULiD*ULi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_max_gen_ull, .properties = .{ .param_str = "ULLiULLiD*ULLi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_min_gen_i, .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_min_gen_l, .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_min_gen_ll, .properties = .{ .param_str = "LLiLLiD*LLi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_min_gen_ui, .properties = .{ .param_str = "UiUiD*Ui", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_min_gen_ul, .properties = .{ .param_str = "ULiULiD*ULi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_min_gen_ull, .properties = .{ .param_str = "ULLiULLiD*ULLi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_or_gen_i, .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_or_gen_l, .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_or_gen_ll, .properties = .{ .param_str = "LLiLLiD*LLi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_sub_gen_i, .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_sub_gen_l, .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_sub_gen_ll, .properties = .{ .param_str = "LLiLLiD*LLi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_xchg_gen_i, .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_xchg_gen_l, .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_xchg_gen_ll, .properties = .{ .param_str = "LLiLLiD*LLi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_xor_gen_i, .properties = .{ .param_str = "iiD*i", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_xor_gen_l, .properties = .{ .param_str = "LiLiD*Li", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_atom_xor_gen_ll, .properties = .{ .param_str = "LLiLLiD*LLi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_bar0_and, .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_bar0_or, .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_bar0_popc, .properties = .{ .param_str = "ii", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_bar_sync, .properties = .{ .param_str = "vi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_bitcast_d2ll, .properties = .{ .param_str = "LLid", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_bitcast_f2i, .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_bitcast_i2f, .properties = .{ .param_str = "fi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_bitcast_ll2d, .properties = .{ .param_str = "dLLi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ceil_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ceil_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ceil_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_compiler_error, .properties = .{ .param_str = "vcC*4", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_compiler_warn, .properties = .{ .param_str = "vcC*4", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_cos_approx_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_cos_approx_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_d2f_rm, .properties = .{ .param_str = "fd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_d2f_rm_ftz, .properties = .{ .param_str = "fd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_d2f_rn, .properties = .{ .param_str = "fd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_d2f_rn_ftz, .properties = .{ .param_str = "fd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_d2f_rp, .properties = .{ .param_str = "fd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_d2f_rp_ftz, .properties = .{ .param_str = "fd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_d2f_rz, .properties = .{ .param_str = "fd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_d2f_rz_ftz, .properties = .{ .param_str = "fd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_d2i_hi, .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_d2i_lo, .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_d2i_rm, .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_d2i_rn, .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_d2i_rp, .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_d2i_rz, .properties = .{ .param_str = "id", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_d2ll_rm, .properties = .{ .param_str = "LLid", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_d2ll_rn, .properties = .{ .param_str = "LLid", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_d2ll_rp, .properties = .{ .param_str = "LLid", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_d2ll_rz, .properties = .{ .param_str = "LLid", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_d2ui_rm, .properties = .{ .param_str = "Uid", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_d2ui_rn, .properties = .{ .param_str = "Uid", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_d2ui_rp, .properties = .{ .param_str = "Uid", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_d2ui_rz, .properties = .{ .param_str = "Uid", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_d2ull_rm, .properties = .{ .param_str = "ULLid", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_d2ull_rn, .properties = .{ .param_str = "ULLid", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_d2ull_rp, .properties = .{ .param_str = "ULLid", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_d2ull_rz, .properties = .{ .param_str = "ULLid", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_div_approx_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_div_approx_ftz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_div_rm_d, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_div_rm_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_div_rm_ftz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_div_rn_d, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_div_rn_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_div_rn_ftz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_div_rp_d, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_div_rp_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_div_rp_ftz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_div_rz_d, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_div_rz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_div_rz_ftz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ex2_approx_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ex2_approx_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ex2_approx_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2h_rn, .properties = .{ .param_str = "Usf", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2h_rn_ftz, .properties = .{ .param_str = "Usf", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2i_rm, .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2i_rm_ftz, .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2i_rn, .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2i_rn_ftz, .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2i_rp, .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2i_rp_ftz, .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2i_rz, .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2i_rz_ftz, .properties = .{ .param_str = "if", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2ll_rm, .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2ll_rm_ftz, .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2ll_rn, .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2ll_rn_ftz, .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2ll_rp, .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2ll_rp_ftz, .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2ll_rz, .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2ll_rz_ftz, .properties = .{ .param_str = "LLif", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2ui_rm, .properties = .{ .param_str = "Uif", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2ui_rm_ftz, .properties = .{ .param_str = "Uif", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2ui_rn, .properties = .{ .param_str = "Uif", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2ui_rn_ftz, .properties = .{ .param_str = "Uif", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2ui_rp, .properties = .{ .param_str = "Uif", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2ui_rp_ftz, .properties = .{ .param_str = "Uif", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2ui_rz, .properties = .{ .param_str = "Uif", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2ui_rz_ftz, .properties = .{ .param_str = "Uif", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2ull_rm, .properties = .{ .param_str = "ULLif", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2ull_rm_ftz, .properties = .{ .param_str = "ULLif", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2ull_rn, .properties = .{ .param_str = "ULLif", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2ull_rn_ftz, .properties = .{ .param_str = "ULLif", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2ull_rp, .properties = .{ .param_str = "ULLif", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2ull_rp_ftz, .properties = .{ .param_str = "ULLif", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2ull_rz, .properties = .{ .param_str = "ULLif", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_f2ull_rz_ftz, .properties = .{ .param_str = "ULLif", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_fabs_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_fabs_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_fabs_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_floor_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_floor_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_floor_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_fma_rm_d, .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_fma_rm_f, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_fma_rm_ftz_f, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_fma_rn_d, .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_fma_rn_f, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_fma_rn_ftz_f, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_fma_rp_d, .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_fma_rp_f, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_fma_rp_ftz_f, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_fma_rz_d, .properties = .{ .param_str = "dddd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_fma_rz_f, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_fma_rz_ftz_f, .properties = .{ .param_str = "ffff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_fmax_d, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_fmax_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_fmax_ftz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_fmin_d, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_fmin_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_fmin_ftz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_i2d_rm, .properties = .{ .param_str = "di", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_i2d_rn, .properties = .{ .param_str = "di", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_i2d_rp, .properties = .{ .param_str = "di", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_i2d_rz, .properties = .{ .param_str = "di", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_i2f_rm, .properties = .{ .param_str = "fi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_i2f_rn, .properties = .{ .param_str = "fi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_i2f_rp, .properties = .{ .param_str = "fi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_i2f_rz, .properties = .{ .param_str = "fi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_isspacep_const, .properties = .{ .param_str = "bvC*", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__nvvm_isspacep_global, .properties = .{ .param_str = "bvC*", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__nvvm_isspacep_local, .properties = .{ .param_str = "bvC*", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__nvvm_isspacep_shared, .properties = .{ .param_str = "bvC*", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__nvvm_ldg_c, .properties = .{ .param_str = "ccC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_c2, .properties = .{ .param_str = "E2cE2cC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_c4, .properties = .{ .param_str = "E4cE4cC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_d, .properties = .{ .param_str = "ddC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_d2, .properties = .{ .param_str = "E2dE2dC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_f, .properties = .{ .param_str = "ffC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_f2, .properties = .{ .param_str = "E2fE2fC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_f4, .properties = .{ .param_str = "E4fE4fC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_h, .properties = .{ .param_str = "hhC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_h2, .properties = .{ .param_str = "E2hE2hC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_i, .properties = .{ .param_str = "iiC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_i2, .properties = .{ .param_str = "E2iE2iC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_i4, .properties = .{ .param_str = "E4iE4iC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_l, .properties = .{ .param_str = "LiLiC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_l2, .properties = .{ .param_str = "E2LiE2LiC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_ll, .properties = .{ .param_str = "LLiLLiC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_ll2, .properties = .{ .param_str = "E2LLiE2LLiC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_s, .properties = .{ .param_str = "ssC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_s2, .properties = .{ .param_str = "E2sE2sC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_s4, .properties = .{ .param_str = "E4sE4sC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_sc, .properties = .{ .param_str = "ScScC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_sc2, .properties = .{ .param_str = "E2ScE2ScC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_sc4, .properties = .{ .param_str = "E4ScE4ScC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_uc, .properties = .{ .param_str = "UcUcC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_uc2, .properties = .{ .param_str = "E2UcE2UcC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_uc4, .properties = .{ .param_str = "E4UcE4UcC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_ui, .properties = .{ .param_str = "UiUiC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_ui2, .properties = .{ .param_str = "E2UiE2UiC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_ui4, .properties = .{ .param_str = "E4UiE4UiC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_ul, .properties = .{ .param_str = "ULiULiC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_ul2, .properties = .{ .param_str = "E2ULiE2ULiC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_ull, .properties = .{ .param_str = "ULLiULLiC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_ull2, .properties = .{ .param_str = "E2ULLiE2ULLiC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_us, .properties = .{ .param_str = "UsUsC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_us2, .properties = .{ .param_str = "E2UsE2UsC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldg_us4, .properties = .{ .param_str = "E4UsE4UsC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_c, .properties = .{ .param_str = "ccC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_c2, .properties = .{ .param_str = "E2cE2cC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_c4, .properties = .{ .param_str = "E4cE4cC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_d, .properties = .{ .param_str = "ddC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_d2, .properties = .{ .param_str = "E2dE2dC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_f, .properties = .{ .param_str = "ffC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_f2, .properties = .{ .param_str = "E2fE2fC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_f4, .properties = .{ .param_str = "E4fE4fC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_h, .properties = .{ .param_str = "hhC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_h2, .properties = .{ .param_str = "E2hE2hC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_i, .properties = .{ .param_str = "iiC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_i2, .properties = .{ .param_str = "E2iE2iC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_i4, .properties = .{ .param_str = "E4iE4iC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_l, .properties = .{ .param_str = "LiLiC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_l2, .properties = .{ .param_str = "E2LiE2LiC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_ll, .properties = .{ .param_str = "LLiLLiC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_ll2, .properties = .{ .param_str = "E2LLiE2LLiC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_s, .properties = .{ .param_str = "ssC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_s2, .properties = .{ .param_str = "E2sE2sC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_s4, .properties = .{ .param_str = "E4sE4sC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_sc, .properties = .{ .param_str = "ScScC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_sc2, .properties = .{ .param_str = "E2ScE2ScC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_sc4, .properties = .{ .param_str = "E4ScE4ScC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_uc, .properties = .{ .param_str = "UcUcC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_uc2, .properties = .{ .param_str = "E2UcE2UcC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_uc4, .properties = .{ .param_str = "E4UcE4UcC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_ui, .properties = .{ .param_str = "UiUiC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_ui2, .properties = .{ .param_str = "E2UiE2UiC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_ui4, .properties = .{ .param_str = "E4UiE4UiC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_ul, .properties = .{ .param_str = "ULiULiC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_ul2, .properties = .{ .param_str = "E2ULiE2ULiC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_ull, .properties = .{ .param_str = "ULLiULLiC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_ull2, .properties = .{ .param_str = "E2ULLiE2ULLiC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_us, .properties = .{ .param_str = "UsUsC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_us2, .properties = .{ .param_str = "E2UsE2UsC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ldu_us4, .properties = .{ .param_str = "E4UsE4UsC*", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_lg2_approx_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_lg2_approx_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_lg2_approx_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ll2d_rm, .properties = .{ .param_str = "dLLi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ll2d_rn, .properties = .{ .param_str = "dLLi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ll2d_rp, .properties = .{ .param_str = "dLLi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ll2d_rz, .properties = .{ .param_str = "dLLi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ll2f_rm, .properties = .{ .param_str = "fLLi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ll2f_rn, .properties = .{ .param_str = "fLLi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ll2f_rp, .properties = .{ .param_str = "fLLi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ll2f_rz, .properties = .{ .param_str = "fLLi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_lohi_i2d, .properties = .{ .param_str = "dii", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_membar_cta, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_membar_gl, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_membar_sys, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_memcpy, .properties = .{ .param_str = "vUc*Uc*zi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_memset, .properties = .{ .param_str = "vUc*Uczi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_mul24_i, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_mul24_ui, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_mul_rm_d, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_mul_rm_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_mul_rm_ftz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_mul_rn_d, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_mul_rn_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_mul_rn_ftz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_mul_rp_d, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_mul_rp_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_mul_rp_ftz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_mul_rz_d, .properties = .{ .param_str = "ddd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_mul_rz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_mul_rz_ftz_f, .properties = .{ .param_str = "fff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_mulhi_i, .properties = .{ .param_str = "iii", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_mulhi_ll, .properties = .{ .param_str = "LLiLLiLLi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_mulhi_ui, .properties = .{ .param_str = "UiUiUi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_mulhi_ull, .properties = .{ .param_str = "ULLiULLiULLi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_prmt, .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_rcp_approx_ftz_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_rcp_approx_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_rcp_rm_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_rcp_rm_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_rcp_rm_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_rcp_rn_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_rcp_rn_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_rcp_rn_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_rcp_rp_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_rcp_rp_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_rcp_rp_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_rcp_rz_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_rcp_rz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_rcp_rz_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_read_ptx_sreg_clock, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_read_ptx_sreg_clock64, .properties = .{ .param_str = "LLi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_read_ptx_sreg_ctaid_w, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__nvvm_read_ptx_sreg_ctaid_x, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__nvvm_read_ptx_sreg_ctaid_y, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__nvvm_read_ptx_sreg_ctaid_z, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__nvvm_read_ptx_sreg_gridid, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__nvvm_read_ptx_sreg_laneid, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__nvvm_read_ptx_sreg_lanemask_eq, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__nvvm_read_ptx_sreg_lanemask_ge, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__nvvm_read_ptx_sreg_lanemask_gt, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__nvvm_read_ptx_sreg_lanemask_le, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__nvvm_read_ptx_sreg_lanemask_lt, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__nvvm_read_ptx_sreg_nctaid_w, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__nvvm_read_ptx_sreg_nctaid_x, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__nvvm_read_ptx_sreg_nctaid_y, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__nvvm_read_ptx_sreg_nctaid_z, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__nvvm_read_ptx_sreg_nsmid, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__nvvm_read_ptx_sreg_ntid_w, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__nvvm_read_ptx_sreg_ntid_x, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__nvvm_read_ptx_sreg_ntid_y, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__nvvm_read_ptx_sreg_ntid_z, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__nvvm_read_ptx_sreg_nwarpid, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__nvvm_read_ptx_sreg_pm0, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_read_ptx_sreg_pm1, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_read_ptx_sreg_pm2, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_read_ptx_sreg_pm3, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_read_ptx_sreg_smid, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__nvvm_read_ptx_sreg_tid_w, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__nvvm_read_ptx_sreg_tid_x, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__nvvm_read_ptx_sreg_tid_y, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__nvvm_read_ptx_sreg_tid_z, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__nvvm_read_ptx_sreg_warpid, .properties = .{ .param_str = "i", .target_set = TargetSet.initOne(.nvptx), .attributes = .{ .@"const" = true } } }, + .{ .tag = .__nvvm_round_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_round_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_round_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_rsqrt_approx_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_rsqrt_approx_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_rsqrt_approx_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_sad_i, .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_sad_ui, .properties = .{ .param_str = "UiUiUiUi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_saturate_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_saturate_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_saturate_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_shfl_bfly_f32, .properties = .{ .param_str = "ffii", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_shfl_bfly_i32, .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_shfl_down_f32, .properties = .{ .param_str = "ffii", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_shfl_down_i32, .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_shfl_idx_f32, .properties = .{ .param_str = "ffii", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_shfl_idx_i32, .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_shfl_up_f32, .properties = .{ .param_str = "ffii", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_shfl_up_i32, .properties = .{ .param_str = "iiii", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_sin_approx_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_sin_approx_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_sqrt_approx_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_sqrt_approx_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_sqrt_rm_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_sqrt_rm_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_sqrt_rm_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_sqrt_rn_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_sqrt_rn_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_sqrt_rn_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_sqrt_rp_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_sqrt_rp_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_sqrt_rp_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_sqrt_rz_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_sqrt_rz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_sqrt_rz_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_trunc_d, .properties = .{ .param_str = "dd", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_trunc_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_trunc_ftz_f, .properties = .{ .param_str = "ff", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ui2d_rm, .properties = .{ .param_str = "dUi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ui2d_rn, .properties = .{ .param_str = "dUi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ui2d_rp, .properties = .{ .param_str = "dUi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ui2d_rz, .properties = .{ .param_str = "dUi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ui2f_rm, .properties = .{ .param_str = "fUi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ui2f_rn, .properties = .{ .param_str = "fUi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ui2f_rp, .properties = .{ .param_str = "fUi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ui2f_rz, .properties = .{ .param_str = "fUi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ull2d_rm, .properties = .{ .param_str = "dULLi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ull2d_rn, .properties = .{ .param_str = "dULLi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ull2d_rp, .properties = .{ .param_str = "dULLi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ull2d_rz, .properties = .{ .param_str = "dULLi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ull2f_rm, .properties = .{ .param_str = "fULLi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ull2f_rn, .properties = .{ .param_str = "fULLi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ull2f_rp, .properties = .{ .param_str = "fULLi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_ull2f_rz, .properties = .{ .param_str = "fULLi", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_vote_all, .properties = .{ .param_str = "bb", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_vote_any, .properties = .{ .param_str = "bb", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_vote_ballot, .properties = .{ .param_str = "Uib", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__nvvm_vote_uni, .properties = .{ .param_str = "bb", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__popcnt, .properties = .{ .param_str = "UiUi", .language = .all_ms_languages, .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__popcnt16, .properties = .{ .param_str = "UsUs", .language = .all_ms_languages, .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__popcnt64, .properties = .{ .param_str = "UWiUWi", .language = .all_ms_languages, .attributes = .{ .@"const" = true, .const_evaluable = true } } }, + .{ .tag = .__rdtsc, .properties = .{ .param_str = "UOi", .target_set = TargetSet.initOne(.x86) } }, + .{ .tag = .__sev, .properties = .{ .param_str = "v", .language = .all_ms_languages, .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, + .{ .tag = .__sevl, .properties = .{ .param_str = "v", .language = .all_ms_languages, .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, + .{ .tag = .__sigsetjmp, .properties = .{ .param_str = "iSJi", .header = .setjmp, .attributes = .{ .allow_type_mismatch = true, .lib_function_without_prefix = true, .returns_twice = true } } }, + .{ .tag = .__sinpi, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__sinpif, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__sync_add_and_fetch, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_add_and_fetch_1, .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_add_and_fetch_16, .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_add_and_fetch_2, .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_add_and_fetch_4, .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_add_and_fetch_8, .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_and_and_fetch, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_and_and_fetch_1, .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_and_and_fetch_16, .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_and_and_fetch_2, .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_and_and_fetch_4, .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_and_and_fetch_8, .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_bool_compare_and_swap, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_bool_compare_and_swap_1, .properties = .{ .param_str = "bcD*cc.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_bool_compare_and_swap_16, .properties = .{ .param_str = "bLLLiD*LLLiLLLi.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_bool_compare_and_swap_2, .properties = .{ .param_str = "bsD*ss.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_bool_compare_and_swap_4, .properties = .{ .param_str = "biD*ii.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_bool_compare_and_swap_8, .properties = .{ .param_str = "bLLiD*LLiLLi.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_add, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_add_1, .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_add_16, .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_add_2, .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_add_4, .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_add_8, .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_and, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_and_1, .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_and_16, .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_and_2, .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_and_4, .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_and_8, .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_max, .properties = .{ .param_str = "iiD*i" } }, + .{ .tag = .__sync_fetch_and_min, .properties = .{ .param_str = "iiD*i" } }, + .{ .tag = .__sync_fetch_and_nand, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_nand_1, .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_nand_16, .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_nand_2, .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_nand_4, .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_nand_8, .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_or, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_or_1, .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_or_16, .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_or_2, .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_or_4, .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_or_8, .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_sub, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_sub_1, .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_sub_16, .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_sub_2, .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_sub_4, .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_sub_8, .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_umax, .properties = .{ .param_str = "UiUiD*Ui" } }, + .{ .tag = .__sync_fetch_and_umin, .properties = .{ .param_str = "UiUiD*Ui" } }, + .{ .tag = .__sync_fetch_and_xor, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_xor_1, .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_xor_16, .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_xor_2, .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_xor_4, .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_fetch_and_xor_8, .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_lock_release, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_lock_release_1, .properties = .{ .param_str = "vcD*.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_lock_release_16, .properties = .{ .param_str = "vLLLiD*.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_lock_release_2, .properties = .{ .param_str = "vsD*.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_lock_release_4, .properties = .{ .param_str = "viD*.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_lock_release_8, .properties = .{ .param_str = "vLLiD*.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_lock_test_and_set, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_lock_test_and_set_1, .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_lock_test_and_set_16, .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_lock_test_and_set_2, .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_lock_test_and_set_4, .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_lock_test_and_set_8, .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_nand_and_fetch, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_nand_and_fetch_1, .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_nand_and_fetch_16, .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_nand_and_fetch_2, .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_nand_and_fetch_4, .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_nand_and_fetch_8, .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_or_and_fetch, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_or_and_fetch_1, .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_or_and_fetch_16, .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_or_and_fetch_2, .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_or_and_fetch_4, .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_or_and_fetch_8, .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_sub_and_fetch, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_sub_and_fetch_1, .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_sub_and_fetch_16, .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_sub_and_fetch_2, .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_sub_and_fetch_4, .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_sub_and_fetch_8, .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_swap, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_swap_1, .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_swap_16, .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_swap_2, .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_swap_4, .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_swap_8, .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_synchronize, .properties = .{ .param_str = "v" } }, + .{ .tag = .__sync_val_compare_and_swap, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_val_compare_and_swap_1, .properties = .{ .param_str = "ccD*cc.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_val_compare_and_swap_16, .properties = .{ .param_str = "LLLiLLLiD*LLLiLLLi.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_val_compare_and_swap_2, .properties = .{ .param_str = "ssD*ss.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_val_compare_and_swap_4, .properties = .{ .param_str = "iiD*ii.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_val_compare_and_swap_8, .properties = .{ .param_str = "LLiLLiD*LLiLLi.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_xor_and_fetch, .properties = .{ .param_str = "v.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_xor_and_fetch_1, .properties = .{ .param_str = "ccD*c.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_xor_and_fetch_16, .properties = .{ .param_str = "LLLiLLLiD*LLLi.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_xor_and_fetch_2, .properties = .{ .param_str = "ssD*s.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_xor_and_fetch_4, .properties = .{ .param_str = "iiD*i.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__sync_xor_and_fetch_8, .properties = .{ .param_str = "LLiLLiD*LLi.", .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__syncthreads, .properties = .{ .param_str = "v", .target_set = TargetSet.initOne(.nvptx) } }, + .{ .tag = .__tanpi, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__tanpif, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .__va_start, .properties = .{ .param_str = "vc**.", .language = .all_ms_languages, .attributes = .{ .custom_typecheck = true } } }, + .{ .tag = .__warn_memset_zero_len, .properties = .{ .param_str = "v", .attributes = .{ .pure = true } } }, + .{ .tag = .__wfe, .properties = .{ .param_str = "v", .language = .all_ms_languages, .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, + .{ .tag = .__wfi, .properties = .{ .param_str = "v", .language = .all_ms_languages, .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, + .{ .tag = .__xray_customevent, .properties = .{ .param_str = "vcC*z" } }, + .{ .tag = .__xray_typedevent, .properties = .{ .param_str = "vzcC*z" } }, + .{ .tag = .__yield, .properties = .{ .param_str = "v", .language = .all_ms_languages, .target_set = TargetSet.initMany(&.{ .aarch64, .arm }) } }, + .{ .tag = ._abnormal_termination, .properties = .{ .param_str = "i", .language = .all_ms_languages } }, + .{ .tag = ._alloca, .properties = .{ .param_str = "v*z", .language = .all_ms_languages } }, + .{ .tag = ._bittest, .properties = .{ .param_str = "UcNiC*Ni", .language = .all_ms_languages } }, + .{ .tag = ._bittest64, .properties = .{ .param_str = "UcWiC*Wi", .language = .all_ms_languages } }, + .{ .tag = ._bittestandcomplement, .properties = .{ .param_str = "UcNi*Ni", .language = .all_ms_languages } }, + .{ .tag = ._bittestandcomplement64, .properties = .{ .param_str = "UcWi*Wi", .language = .all_ms_languages } }, + .{ .tag = ._bittestandreset, .properties = .{ .param_str = "UcNi*Ni", .language = .all_ms_languages } }, + .{ .tag = ._bittestandreset64, .properties = .{ .param_str = "UcWi*Wi", .language = .all_ms_languages } }, + .{ .tag = ._bittestandset, .properties = .{ .param_str = "UcNi*Ni", .language = .all_ms_languages } }, + .{ .tag = ._bittestandset64, .properties = .{ .param_str = "UcWi*Wi", .language = .all_ms_languages } }, + .{ .tag = ._byteswap_uint64, .properties = .{ .param_str = "ULLiULLi", .header = .stdlib, .language = .all_ms_languages, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = ._byteswap_ulong, .properties = .{ .param_str = "UNiUNi", .header = .stdlib, .language = .all_ms_languages, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = ._byteswap_ushort, .properties = .{ .param_str = "UsUs", .header = .stdlib, .language = .all_ms_languages, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = ._exception_code, .properties = .{ .param_str = "UNi", .language = .all_ms_languages } }, + .{ .tag = ._exception_info, .properties = .{ .param_str = "v*", .language = .all_ms_languages } }, + .{ .tag = ._exit, .properties = .{ .param_str = "vi", .header = .unistd, .language = .all_gnu_languages, .attributes = .{ .noreturn = true, .lib_function_without_prefix = true } } }, + .{ .tag = ._interlockedbittestandreset, .properties = .{ .param_str = "UcNiD*Ni", .language = .all_ms_languages } }, + .{ .tag = ._interlockedbittestandreset64, .properties = .{ .param_str = "UcWiD*Wi", .language = .all_ms_languages } }, + .{ .tag = ._interlockedbittestandreset_acq, .properties = .{ .param_str = "UcNiD*Ni", .language = .all_ms_languages } }, + .{ .tag = ._interlockedbittestandreset_nf, .properties = .{ .param_str = "UcNiD*Ni", .language = .all_ms_languages } }, + .{ .tag = ._interlockedbittestandreset_rel, .properties = .{ .param_str = "UcNiD*Ni", .language = .all_ms_languages } }, + .{ .tag = ._interlockedbittestandset, .properties = .{ .param_str = "UcNiD*Ni", .language = .all_ms_languages } }, + .{ .tag = ._interlockedbittestandset64, .properties = .{ .param_str = "UcWiD*Wi", .language = .all_ms_languages } }, + .{ .tag = ._interlockedbittestandset_acq, .properties = .{ .param_str = "UcNiD*Ni", .language = .all_ms_languages } }, + .{ .tag = ._interlockedbittestandset_nf, .properties = .{ .param_str = "UcNiD*Ni", .language = .all_ms_languages } }, + .{ .tag = ._interlockedbittestandset_rel, .properties = .{ .param_str = "UcNiD*Ni", .language = .all_ms_languages } }, + .{ .tag = ._longjmp, .properties = .{ .param_str = "vJi", .header = .setjmp, .language = .all_gnu_languages, .attributes = .{ .noreturn = true, .allow_type_mismatch = true, .lib_function_without_prefix = true } } }, + .{ .tag = ._lrotl, .properties = .{ .param_str = "ULiULii", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, + .{ .tag = ._lrotr, .properties = .{ .param_str = "ULiULii", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, + .{ .tag = ._rotl, .properties = .{ .param_str = "UiUii", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, + .{ .tag = ._rotl16, .properties = .{ .param_str = "UsUsUc", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, + .{ .tag = ._rotl64, .properties = .{ .param_str = "UWiUWii", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, + .{ .tag = ._rotl8, .properties = .{ .param_str = "UcUcUc", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, + .{ .tag = ._rotr, .properties = .{ .param_str = "UiUii", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, + .{ .tag = ._rotr16, .properties = .{ .param_str = "UsUsUc", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, + .{ .tag = ._rotr64, .properties = .{ .param_str = "UWiUWii", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, + .{ .tag = ._rotr8, .properties = .{ .param_str = "UcUcUc", .language = .all_ms_languages, .attributes = .{ .const_evaluable = true } } }, + .{ .tag = ._setjmp, .properties = .{ .param_str = "iJ", .header = .setjmp, .attributes = .{ .allow_type_mismatch = true, .lib_function_without_prefix = true, .returns_twice = true } } }, + .{ .tag = ._setjmpex, .properties = .{ .param_str = "iJ", .header = .setjmpex, .language = .all_ms_languages, .attributes = .{ .allow_type_mismatch = true, .lib_function_without_prefix = true, .returns_twice = true } } }, + .{ .tag = .abort, .properties = .{ .param_str = "v", .header = .stdlib, .attributes = .{ .noreturn = true, .lib_function_without_prefix = true } } }, + .{ .tag = .abs, .properties = .{ .param_str = "ii", .header = .stdlib, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .acos, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .acosf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .acosh, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .acoshf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .acoshl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .acosl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .aligned_alloc, .properties = .{ .param_str = "v*zz", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .alloca, .properties = .{ .param_str = "v*z", .header = .stdlib, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .asin, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .asinf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .asinh, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .asinhf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .asinhl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .asinl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .atan, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .atan2, .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .atan2f, .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .atan2l, .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .atanf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .atanh, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .atanhf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .atanhl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .atanl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .bcmp, .properties = .{ .param_str = "ivC*vC*z", .header = .strings, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, + .{ .tag = .bcopy, .properties = .{ .param_str = "vvC*v*z", .header = .strings, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .bzero, .properties = .{ .param_str = "vv*z", .header = .strings, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .cabs, .properties = .{ .param_str = "dXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .cabsf, .properties = .{ .param_str = "fXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .cabsl, .properties = .{ .param_str = "LdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .cacos, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .cacosf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .cacosh, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .cacoshf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .cacoshl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .cacosl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .calloc, .properties = .{ .param_str = "v*zz", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .carg, .properties = .{ .param_str = "dXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .cargf, .properties = .{ .param_str = "fXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .cargl, .properties = .{ .param_str = "LdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .casin, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .casinf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .casinh, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .casinhf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .casinhl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .casinl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .catan, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .catanf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .catanh, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .catanhf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .catanhl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .catanl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .cbrt, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .cbrtf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .cbrtl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .ccos, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .ccosf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .ccosh, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .ccoshf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .ccoshl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .ccosl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .ceil, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .ceilf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .ceill, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .cexp, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .cexpf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .cexpl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .cimag, .properties = .{ .param_str = "dXd", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .cimagf, .properties = .{ .param_str = "fXf", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .cimagl, .properties = .{ .param_str = "LdXLd", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .clog, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .clogf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .clogl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .conj, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .conjf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .conjl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .copysign, .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .copysignf, .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .copysignl, .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .cos, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .cosf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .cosh, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .coshf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .coshl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .cosl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .cpow, .properties = .{ .param_str = "XdXdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .cpowf, .properties = .{ .param_str = "XfXfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .cpowl, .properties = .{ .param_str = "XLdXLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .cproj, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .cprojf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .cprojl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .creal, .properties = .{ .param_str = "dXd", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .crealf, .properties = .{ .param_str = "fXf", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .creall, .properties = .{ .param_str = "LdXLd", .header = .complex, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .csin, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .csinf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .csinh, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .csinhf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .csinhl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .csinl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .csqrt, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .csqrtf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .csqrtl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .ctan, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .ctanf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .ctanh, .properties = .{ .param_str = "XdXd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .ctanhf, .properties = .{ .param_str = "XfXf", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .ctanhl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .ctanl, .properties = .{ .param_str = "XLdXLd", .header = .complex, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .erf, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .erfc, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .erfcf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .erfcl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .erff, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .erfl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .exit, .properties = .{ .param_str = "vi", .header = .stdlib, .attributes = .{ .noreturn = true, .lib_function_without_prefix = true } } }, + .{ .tag = .exp, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .exp2, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .exp2f, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .exp2l, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .expf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .expl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .expm1, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .expm1f, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .expm1l, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .fabs, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .fabsf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .fabsl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .fdim, .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .fdimf, .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .fdiml, .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .finite, .properties = .{ .param_str = "id", .header = .math, .language = .gnu_lang, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .finitef, .properties = .{ .param_str = "if", .header = .math, .language = .gnu_lang, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .finitel, .properties = .{ .param_str = "iLd", .header = .math, .language = .gnu_lang, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .floor, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .floorf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .floorl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .fma, .properties = .{ .param_str = "dddd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .fmaf, .properties = .{ .param_str = "ffff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .fmal, .properties = .{ .param_str = "LdLdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .fmax, .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .fmaxf, .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .fmaxl, .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .fmin, .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .fminf, .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .fminl, .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .fmod, .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .fmodf, .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .fmodl, .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .fopen, .properties = .{ .param_str = "P*cC*cC*", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .fprintf, .properties = .{ .param_str = "iP*cC*.", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .printf, .format_string_position = 1 } } }, + .{ .tag = .fread, .properties = .{ .param_str = "zv*zzP*", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .free, .properties = .{ .param_str = "vv*", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .frexp, .properties = .{ .param_str = "ddi*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .frexpf, .properties = .{ .param_str = "ffi*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .frexpl, .properties = .{ .param_str = "LdLdi*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .fscanf, .properties = .{ .param_str = "iP*RcC*R.", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .scanf, .format_string_position = 1 } } }, + .{ .tag = .fwrite, .properties = .{ .param_str = "zvC*zzP*", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .getcontext, .properties = .{ .param_str = "iK*", .header = .setjmp, .attributes = .{ .allow_type_mismatch = true, .lib_function_without_prefix = true, .returns_twice = true } } }, + .{ .tag = .hypot, .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .hypotf, .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .hypotl, .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .ilogb, .properties = .{ .param_str = "id", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .ilogbf, .properties = .{ .param_str = "if", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .ilogbl, .properties = .{ .param_str = "iLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .index, .properties = .{ .param_str = "c*cC*i", .header = .strings, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .isalnum, .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, + .{ .tag = .isalpha, .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, + .{ .tag = .isblank, .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, + .{ .tag = .iscntrl, .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, + .{ .tag = .isdigit, .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, + .{ .tag = .isgraph, .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, + .{ .tag = .islower, .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, + .{ .tag = .isprint, .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, + .{ .tag = .ispunct, .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, + .{ .tag = .isspace, .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, + .{ .tag = .isupper, .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, + .{ .tag = .isxdigit, .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, + .{ .tag = .labs, .properties = .{ .param_str = "LiLi", .header = .stdlib, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .ldexp, .properties = .{ .param_str = "ddi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .ldexpf, .properties = .{ .param_str = "ffi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .ldexpl, .properties = .{ .param_str = "LdLdi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .lgamma, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .lgammaf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .lgammal, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .llabs, .properties = .{ .param_str = "LLiLLi", .header = .stdlib, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .llrint, .properties = .{ .param_str = "LLid", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .llrintf, .properties = .{ .param_str = "LLif", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .llrintl, .properties = .{ .param_str = "LLiLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .llround, .properties = .{ .param_str = "LLid", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .llroundf, .properties = .{ .param_str = "LLif", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .llroundl, .properties = .{ .param_str = "LLiLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .log, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .log10, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .log10f, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .log10l, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .log1p, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .log1pf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .log1pl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .log2, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .log2f, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .log2l, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .logb, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .logbf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .logbl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .logf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .logl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .longjmp, .properties = .{ .param_str = "vJi", .header = .setjmp, .attributes = .{ .noreturn = true, .allow_type_mismatch = true, .lib_function_without_prefix = true } } }, + .{ .tag = .lrint, .properties = .{ .param_str = "Lid", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .lrintf, .properties = .{ .param_str = "Lif", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .lrintl, .properties = .{ .param_str = "LiLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .lround, .properties = .{ .param_str = "Lid", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .lroundf, .properties = .{ .param_str = "Lif", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .lroundl, .properties = .{ .param_str = "LiLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .malloc, .properties = .{ .param_str = "v*z", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .memalign, .properties = .{ .param_str = "v*zz", .header = .malloc, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .memccpy, .properties = .{ .param_str = "v*v*vC*iz", .header = .string, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .memchr, .properties = .{ .param_str = "v*vC*iz", .header = .string, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, + .{ .tag = .memcmp, .properties = .{ .param_str = "ivC*vC*z", .header = .string, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, + .{ .tag = .memcpy, .properties = .{ .param_str = "v*v*vC*z", .header = .string, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, + .{ .tag = .memmove, .properties = .{ .param_str = "v*v*vC*z", .header = .string, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, + .{ .tag = .mempcpy, .properties = .{ .param_str = "v*v*vC*z", .header = .string, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .memset, .properties = .{ .param_str = "v*v*iz", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .modf, .properties = .{ .param_str = "ddd*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .modff, .properties = .{ .param_str = "fff*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .modfl, .properties = .{ .param_str = "LdLdLd*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .nan, .properties = .{ .param_str = "dcC*", .header = .math, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, + .{ .tag = .nanf, .properties = .{ .param_str = "fcC*", .header = .math, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, + .{ .tag = .nanl, .properties = .{ .param_str = "LdcC*", .header = .math, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, + .{ .tag = .nearbyint, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .nearbyintf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .nearbyintl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .nextafter, .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .nextafterf, .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .nextafterl, .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .nexttoward, .properties = .{ .param_str = "ddLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .nexttowardf, .properties = .{ .param_str = "ffLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .nexttowardl, .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .pow, .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .powf, .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .powl, .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .printf, .properties = .{ .param_str = "icC*.", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .printf } } }, + .{ .tag = .realloc, .properties = .{ .param_str = "v*v*z", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .remainder, .properties = .{ .param_str = "ddd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .remainderf, .properties = .{ .param_str = "fff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .remainderl, .properties = .{ .param_str = "LdLdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .remquo, .properties = .{ .param_str = "dddi*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .remquof, .properties = .{ .param_str = "fffi*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .remquol, .properties = .{ .param_str = "LdLdLdi*", .header = .math, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .rindex, .properties = .{ .param_str = "c*cC*i", .header = .strings, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .rint, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_fp_exceptions = true } } }, + .{ .tag = .rintf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_fp_exceptions = true } } }, + .{ .tag = .rintl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_fp_exceptions = true } } }, + .{ .tag = .round, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .roundeven, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .roundevenf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .roundevenl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .roundf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .roundl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .savectx, .properties = .{ .param_str = "iJ", .header = .setjmp, .attributes = .{ .allow_type_mismatch = true, .lib_function_without_prefix = true, .returns_twice = true } } }, + .{ .tag = .scalbln, .properties = .{ .param_str = "ddLi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .scalblnf, .properties = .{ .param_str = "ffLi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .scalblnl, .properties = .{ .param_str = "LdLdLi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .scalbn, .properties = .{ .param_str = "ddi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .scalbnf, .properties = .{ .param_str = "ffi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .scalbnl, .properties = .{ .param_str = "LdLdi", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .scanf, .properties = .{ .param_str = "icC*R.", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .scanf } } }, + .{ .tag = .setjmp, .properties = .{ .param_str = "iJ", .header = .setjmp, .attributes = .{ .allow_type_mismatch = true, .lib_function_without_prefix = true, .returns_twice = true } } }, + .{ .tag = .siglongjmp, .properties = .{ .param_str = "vSJi", .header = .setjmp, .language = .all_gnu_languages, .attributes = .{ .noreturn = true, .allow_type_mismatch = true, .lib_function_without_prefix = true } } }, + .{ .tag = .sigsetjmp, .properties = .{ .param_str = "iSJi", .header = .setjmp, .attributes = .{ .allow_type_mismatch = true, .lib_function_without_prefix = true, .returns_twice = true } } }, + .{ .tag = .sin, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .sinf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .sinh, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .sinhf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .sinhl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .sinl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .snprintf, .properties = .{ .param_str = "ic*zcC*.", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .printf, .format_string_position = 2 } } }, + .{ .tag = .sprintf, .properties = .{ .param_str = "ic*cC*.", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .printf, .format_string_position = 1 } } }, + .{ .tag = .sqrt, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .sqrtf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .sqrtl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .sscanf, .properties = .{ .param_str = "icC*RcC*R.", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .scanf, .format_string_position = 1 } } }, + .{ .tag = .stpcpy, .properties = .{ .param_str = "c*c*cC*", .header = .string, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .stpncpy, .properties = .{ .param_str = "c*c*cC*z", .header = .string, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .strcasecmp, .properties = .{ .param_str = "icC*cC*", .header = .strings, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .strcat, .properties = .{ .param_str = "c*c*cC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .strchr, .properties = .{ .param_str = "c*cC*i", .header = .string, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, + .{ .tag = .strcmp, .properties = .{ .param_str = "icC*cC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, + .{ .tag = .strcpy, .properties = .{ .param_str = "c*c*cC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .strcspn, .properties = .{ .param_str = "zcC*cC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .strdup, .properties = .{ .param_str = "c*cC*", .header = .string, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .strerror, .properties = .{ .param_str = "c*i", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .strlcat, .properties = .{ .param_str = "zc*cC*z", .header = .string, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .strlcpy, .properties = .{ .param_str = "zc*cC*z", .header = .string, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .strlen, .properties = .{ .param_str = "zcC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, + .{ .tag = .strncasecmp, .properties = .{ .param_str = "icC*cC*z", .header = .strings, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .strncat, .properties = .{ .param_str = "c*c*cC*z", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .strncmp, .properties = .{ .param_str = "icC*cC*z", .header = .string, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, + .{ .tag = .strncpy, .properties = .{ .param_str = "c*c*cC*z", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .strndup, .properties = .{ .param_str = "c*cC*z", .header = .string, .language = .all_gnu_languages, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .strpbrk, .properties = .{ .param_str = "c*cC*cC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .strrchr, .properties = .{ .param_str = "c*cC*i", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .strspn, .properties = .{ .param_str = "zcC*cC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .strstr, .properties = .{ .param_str = "c*cC*cC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .strtod, .properties = .{ .param_str = "dcC*c**", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .strtof, .properties = .{ .param_str = "fcC*c**", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .strtok, .properties = .{ .param_str = "c*c*cC*", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .strtol, .properties = .{ .param_str = "LicC*c**i", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .strtold, .properties = .{ .param_str = "LdcC*c**", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .strtoll, .properties = .{ .param_str = "LLicC*c**i", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .strtoul, .properties = .{ .param_str = "ULicC*c**i", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .strtoull, .properties = .{ .param_str = "ULLicC*c**i", .header = .stdlib, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .strxfrm, .properties = .{ .param_str = "zc*cC*z", .header = .string, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .tan, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .tanf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .tanh, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .tanhf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .tanhl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .tanl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .tgamma, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .tgammaf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .tgammal, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .lib_function_without_prefix = true, .const_without_errno_and_fp_exceptions = true } } }, + .{ .tag = .tolower, .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, + .{ .tag = .toupper, .properties = .{ .param_str = "ii", .header = .ctype, .attributes = .{ .pure = true, .lib_function_without_prefix = true } } }, + .{ .tag = .trunc, .properties = .{ .param_str = "dd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .truncf, .properties = .{ .param_str = "ff", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .truncl, .properties = .{ .param_str = "LdLd", .header = .math, .attributes = .{ .@"const" = true, .lib_function_without_prefix = true } } }, + .{ .tag = .va_copy, .properties = .{ .param_str = "vAA", .header = .stdarg, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .va_end, .properties = .{ .param_str = "vA", .header = .stdarg, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .va_start, .properties = .{ .param_str = "vA.", .header = .stdarg, .attributes = .{ .lib_function_without_prefix = true } } }, + .{ .tag = .vfork, .properties = .{ .param_str = "p", .header = .unistd, .attributes = .{ .allow_type_mismatch = true, .lib_function_without_prefix = true, .returns_twice = true } } }, + .{ .tag = .vfprintf, .properties = .{ .param_str = "iP*cC*a", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .vprintf, .format_string_position = 1 } } }, + .{ .tag = .vfscanf, .properties = .{ .param_str = "iP*RcC*Ra", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .vscanf, .format_string_position = 1 } } }, + .{ .tag = .vprintf, .properties = .{ .param_str = "icC*a", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .vprintf } } }, + .{ .tag = .vscanf, .properties = .{ .param_str = "icC*Ra", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .vscanf } } }, + .{ .tag = .vsnprintf, .properties = .{ .param_str = "ic*zcC*a", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .vprintf, .format_string_position = 2 } } }, + .{ .tag = .vsprintf, .properties = .{ .param_str = "ic*cC*a", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .vprintf, .format_string_position = 1 } } }, + .{ .tag = .vsscanf, .properties = .{ .param_str = "icC*RcC*Ra", .header = .stdio, .attributes = .{ .lib_function_without_prefix = true, .format_kind = .vscanf, .format_string_position = 1 } } }, + .{ .tag = .wcschr, .properties = .{ .param_str = "w*wC*w", .header = .wchar, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, + .{ .tag = .wcscmp, .properties = .{ .param_str = "iwC*wC*", .header = .wchar, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, + .{ .tag = .wcslen, .properties = .{ .param_str = "zwC*", .header = .wchar, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, + .{ .tag = .wcsncmp, .properties = .{ .param_str = "iwC*wC*z", .header = .wchar, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, + .{ .tag = .wmemchr, .properties = .{ .param_str = "w*wC*wz", .header = .wchar, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, + .{ .tag = .wmemcmp, .properties = .{ .param_str = "iwC*wC*z", .header = .wchar, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, + .{ .tag = .wmemcpy, .properties = .{ .param_str = "w*w*wC*z", .header = .wchar, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, + .{ .tag = .wmemmove, .properties = .{ .param_str = "w*w*wC*z", .header = .wchar, .attributes = .{ .lib_function_without_prefix = true, .const_evaluable = true } } }, }; }; }; diff --git a/lib/compiler/aro/aro/Builtins/eval.zig b/lib/compiler/aro/aro/Builtins/eval.zig index 008da152d4a9..b04046ec1021 100644 --- a/lib/compiler/aro/aro/Builtins/eval.zig +++ b/lib/compiler/aro/aro/Builtins/eval.zig @@ -5,8 +5,9 @@ const Builtins = @import("../Builtins.zig"); const Builtin = Builtins.Builtin; const Parser = @import("../Parser.zig"); const Tree = @import("../Tree.zig"); -const NodeIndex = Tree.NodeIndex; -const Type = @import("../Type.zig"); +const TypeStore = @import("../TypeStore.zig"); +const Type = TypeStore.Type; +const QualType = TypeStore.QualType; const Value = @import("../Value.zig"); fn makeNan(comptime T: type, str: []const u8) T { @@ -22,22 +23,22 @@ fn makeNan(comptime T: type, str: []const u8) T { return @bitCast(@as(UnsignedSameSize, bits) | @as(UnsignedSameSize, @bitCast(std.math.nan(T)))); } -pub fn eval(tag: Builtin.Tag, p: *Parser, args: []const NodeIndex) !Value { +pub fn eval(tag: Builtin.Tag, p: *Parser, args: []const Tree.Node.Index) !Value { const builtin = Builtin.fromTag(tag); if (!builtin.properties.attributes.const_evaluable) return .{}; switch (tag) { - Builtin.tagFromName("__builtin_inff").?, - Builtin.tagFromName("__builtin_inf").?, - Builtin.tagFromName("__builtin_infl").?, + .__builtin_inff, + .__builtin_inf, + .__builtin_infl, => { - const ty: Type = switch (tag) { - Builtin.tagFromName("__builtin_inff").? => .{ .specifier = .float }, - Builtin.tagFromName("__builtin_inf").? => .{ .specifier = .double }, - Builtin.tagFromName("__builtin_infl").? => .{ .specifier = .long_double }, + const qt: QualType = switch (tag) { + .__builtin_inff => .float, + .__builtin_inf => .double, + .__builtin_infl => .long_double, else => unreachable, }; - const f: Interner.Key.Float = switch (ty.bitSizeof(p.comp).?) { + const f: Interner.Key.Float = switch (qt.bitSizeof(p.comp)) { 32 => .{ .f32 = std.math.inf(f32) }, 64 => .{ .f64 = std.math.inf(f64) }, 80 => .{ .f80 = std.math.inf(f80) }, @@ -46,14 +47,14 @@ pub fn eval(tag: Builtin.Tag, p: *Parser, args: []const NodeIndex) !Value { }; return Value.intern(p.comp, .{ .float = f }); }, - Builtin.tagFromName("__builtin_isinf").? => blk: { + .__builtin_isinf => blk: { if (args.len == 0) break :blk; - const val = p.value_map.get(args[0]) orelse break :blk; + const val = p.tree.value_map.get(args[0]) orelse break :blk; return Value.fromBool(val.isInf(p.comp)); }, - Builtin.tagFromName("__builtin_isinf_sign").? => blk: { + .__builtin_isinf_sign => blk: { if (args.len == 0) break :blk; - const val = p.value_map.get(args[0]) orelse break :blk; + const val = p.tree.value_map.get(args[0]) orelse break :blk; switch (val.isInfSign(p.comp)) { .unknown => {}, .finite => return Value.zero, @@ -61,17 +62,17 @@ pub fn eval(tag: Builtin.Tag, p: *Parser, args: []const NodeIndex) !Value { .negative => return Value.int(@as(i64, -1), p.comp), } }, - Builtin.tagFromName("__builtin_isnan").? => blk: { + .__builtin_isnan => blk: { if (args.len == 0) break :blk; - const val = p.value_map.get(args[0]) orelse break :blk; + const val = p.tree.value_map.get(args[0]) orelse break :blk; return Value.fromBool(val.isNan(p.comp)); }, - Builtin.tagFromName("__builtin_nan").? => blk: { + .__builtin_nan => blk: { if (args.len == 0) break :blk; const val = p.getDecayedStringLiteral(args[0]) orelse break :blk; const bytes = p.comp.interner.get(val.ref()).bytes; - const f: Interner.Key.Float = switch ((Type{ .specifier = .double }).bitSizeof(p.comp).?) { + const f: Interner.Key.Float = switch (Type.Float.double.bits(p.comp)) { 32 => .{ .f32 = makeNan(f32, bytes) }, 64 => .{ .f64 = makeNan(f64, bytes) }, 80 => .{ .f80 = makeNan(f80, bytes) }, diff --git a/lib/compiler/aro/aro/CodeGen.zig b/lib/compiler/aro/aro/CodeGen.zig index bfffb4117eea..9145d38a8805 100644 --- a/lib/compiler/aro/aro/CodeGen.zig +++ b/lib/compiler/aro/aro/CodeGen.zig @@ -1,18 +1,19 @@ const std = @import("std"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; + const backend = @import("../backend.zig"); const Interner = backend.Interner; const Ir = backend.Ir; +const Builder = Ir.Builder; + const Builtins = @import("Builtins.zig"); const Builtin = Builtins.Builtin; const Compilation = @import("Compilation.zig"); -const Builder = Ir.Builder; -const StrInt = @import("StringInterner.zig"); -const StringId = StrInt.StringId; +const StringId = @import("StringInterner.zig").StringId; const Tree = @import("Tree.zig"); -const NodeIndex = Tree.NodeIndex; -const Type = @import("Type.zig"); +const Node = Tree.Node; +const QualType = @import("TypeStore.zig").QualType; const Value = @import("Value.zig"); const WipSwitch = struct { @@ -35,18 +36,15 @@ const Error = Compilation.Error; const CodeGen = @This(); -tree: Tree, +tree: *const Tree, comp: *Compilation, builder: Builder, -node_tag: []const Tree.Tag, -node_data: []const Tree.Node.Data, -node_ty: []const Type, wip_switch: *WipSwitch = undefined, -symbols: std.ArrayListUnmanaged(Symbol) = .empty, -ret_nodes: std.ArrayListUnmanaged(Ir.Inst.Phi.Input) = .empty, -phi_nodes: std.ArrayListUnmanaged(Ir.Inst.Phi.Input) = .empty, -record_elem_buf: std.ArrayListUnmanaged(Interner.Ref) = .empty, -record_cache: std.AutoHashMapUnmanaged(*Type.Record, Interner.Ref) = .empty, +symbols: std.ArrayList(Symbol) = .empty, +ret_nodes: std.ArrayList(Ir.Inst.Phi.Input) = .empty, +phi_nodes: std.ArrayList(Ir.Inst.Phi.Input) = .empty, +record_elem_buf: std.ArrayList(Interner.Ref) = .empty, +record_cache: std.AutoHashMapUnmanaged(QualType, Interner.Ref) = .empty, cond_dummy_ty: ?Interner.Ref = null, bool_invert: bool = false, bool_end_label: Ir.Ref = .none, @@ -54,19 +52,22 @@ cond_dummy_ref: Ir.Ref = undefined, continue_label: Ir.Ref = undefined, break_label: Ir.Ref = undefined, return_label: Ir.Ref = undefined, +compound_assign_dummy: ?Ir.Ref = null, fn fail(c: *CodeGen, comptime fmt: []const u8, args: anytype) error{ FatalError, OutOfMemory } { - try c.comp.diagnostics.list.append(c.comp.gpa, .{ - .tag = .cli_error, - .kind = .@"fatal error", - .extra = .{ .str = try std.fmt.allocPrint(c.comp.diagnostics.arena.allocator(), fmt, args) }, - }); + var sf = std.heap.stackFallback(1024, c.comp.gpa); + const allocator = sf.get(); + var buf: std.ArrayList(u8) = .empty; + defer buf.deinit(allocator); + + try buf.print(allocator, fmt, args); + try c.comp.diagnostics.add(.{ .text = buf.items, .kind = .@"fatal error", .location = null }); return error.FatalError; } -pub fn genIr(tree: Tree) Compilation.Error!Ir { +pub fn genIr(tree: *const Tree) Compilation.Error!Ir { const gpa = tree.comp.gpa; - var c = CodeGen{ + var c: CodeGen = .{ .builder = .{ .gpa = tree.comp.gpa, .interner = &tree.comp.interner, @@ -74,9 +75,6 @@ pub fn genIr(tree: Tree) Compilation.Error!Ir { }, .tree = tree, .comp = tree.comp, - .node_tag = tree.nodes.items(.tag), - .node_data = tree.nodes.items(.data), - .node_ty = tree.nodes.items(.ty), }; defer c.symbols.deinit(gpa); defer c.ret_nodes.deinit(gpa); @@ -85,44 +83,31 @@ pub fn genIr(tree: Tree) Compilation.Error!Ir { defer c.record_cache.deinit(gpa); defer c.builder.deinit(); - const node_tags = tree.nodes.items(.tag); - for (tree.root_decls) |decl| { + for (tree.root_decls.items) |decl| { c.builder.arena.deinit(); c.builder.arena = std.heap.ArenaAllocator.init(gpa); - switch (node_tags[@intFromEnum(decl)]) { + switch (decl.get(c.tree)) { + .empty_decl, .static_assert, .typedef, - .struct_decl_two, - .union_decl_two, - .enum_decl_two, .struct_decl, .union_decl, .enum_decl, + .struct_forward_decl, + .union_forward_decl, + .enum_forward_decl, => {}, - .fn_proto, - .static_fn_proto, - .inline_fn_proto, - .inline_static_fn_proto, - .extern_var, - .threadlocal_extern_var, - => {}, - - .fn_def, - .static_fn_def, - .inline_fn_def, - .inline_static_fn_def, - => c.genFn(decl) catch |err| switch (err) { - error.FatalError => return error.FatalError, - error.OutOfMemory => return error.OutOfMemory, + .function => |function| { + if (function.body == null) continue; + c.genFn(function) catch |err| switch (err) { + error.FatalError => return error.FatalError, + error.OutOfMemory => return error.OutOfMemory, + }; }, - .@"var", - .static_var, - .threadlocal_var, - .threadlocal_static_var, - => c.genVar(decl) catch |err| switch (err) { + .variable => |variable| c.genVar(variable) catch |err| switch (err) { error.FatalError => return error.FatalError, error.OutOfMemory => return error.OutOfMemory, }, @@ -132,70 +117,78 @@ pub fn genIr(tree: Tree) Compilation.Error!Ir { return c.builder.finish(); } -fn genType(c: *CodeGen, base_ty: Type) !Interner.Ref { - var key: Interner.Key = undefined; - const ty = base_ty.canonicalize(.standard); - switch (ty.specifier) { +fn genType(c: *CodeGen, qt: QualType) !Interner.Ref { + const base = qt.base(c.comp); + const key: Interner.Key = switch (base.type) { .void => return .void, .bool => return .i1, - .@"struct" => { - if (c.record_cache.get(ty.data.record)) |some| return some; + .@"struct" => |record| { + if (c.record_cache.get(base.qt.unqualified())) |some| return some; const elem_buf_top = c.record_elem_buf.items.len; defer c.record_elem_buf.items.len = elem_buf_top; - for (ty.data.record.fields) |field| { - if (!field.isRegularField()) { + for (record.fields) |field| { + if (field.bit_width != .null) { return c.fail("TODO lower struct bitfields", .{}); } // TODO handle padding bits - const field_ref = try c.genType(field.ty); + const field_ref = try c.genType(field.qt); try c.record_elem_buf.append(c.builder.gpa, field_ref); } - return c.builder.interner.put(c.builder.gpa, .{ + const recrd_ty = try c.builder.interner.put(c.builder.gpa, .{ .record_ty = c.record_elem_buf.items[elem_buf_top..], }); + try c.record_cache.put(c.comp.gpa, base.qt.unqualified(), recrd_ty); + return recrd_ty; }, .@"union" => { return c.fail("TODO lower union types", .{}); }, - else => {}, - } - if (ty.isPtr()) return .ptr; - if (ty.isFunc()) return .func; - if (!ty.isReal()) return c.fail("TODO lower complex types", .{}); - if (ty.isInt()) { - const bits = ty.bitSizeof(c.comp).?; - key = .{ .int_ty = @intCast(bits) }; - } else if (ty.isFloat()) { - const bits = ty.bitSizeof(c.comp).?; - key = .{ .float_ty = @intCast(bits) }; - } else if (ty.isArray()) { - const elem = try c.genType(ty.elemType()); - key = .{ .array_ty = .{ .child = elem, .len = ty.arrayLen().? } }; - } else if (ty.specifier == .vector) { - const elem = try c.genType(ty.elemType()); - key = .{ .vector_ty = .{ .child = elem, .len = @intCast(ty.data.array.len) } }; - } else if (ty.is(.nullptr_t)) { - return c.fail("TODO lower nullptr_t", .{}); - } + .pointer => return .ptr, + .func => return .func, + .complex => return c.fail("TODO lower complex types", .{}), + .atomic => return c.fail("TODO lower atomic types", .{}), + .@"enum" => |@"enum"| return c.genType(@"enum".tag.?), + .int => |int| .{ .int_ty = int.bits(c.comp) }, + .bit_int => |bit_int| .{ .int_ty = bit_int.bits }, + .float => |float| .{ .float_ty = float.bits(c.comp) }, + .array => |array| blk: { + switch (array.len) { + .fixed, .static => |len| { + const elem = try c.genType(array.elem); + break :blk .{ .array_ty = .{ .child = elem, .len = len } }; + }, + .variable, .unspecified_variable => return c.fail("TODO VLAs", .{}), + .incomplete => unreachable, + } + }, + .vector => |vector| blk: { + const elem = try c.genType(vector.elem); + break :blk .{ .vector_ty = .{ .child = elem, .len = vector.len } }; + }, + .nullptr_t => { + return c.fail("TODO lower nullptr_t", .{}); + }, + .attributed, .typeof, .typedef => unreachable, + }; return c.builder.interner.put(c.builder.gpa, key); } -fn genFn(c: *CodeGen, decl: NodeIndex) Error!void { - const name = c.tree.tokSlice(c.node_data[@intFromEnum(decl)].decl.name); - const func_ty = c.node_ty[@intFromEnum(decl)].canonicalize(.standard); +fn genFn(c: *CodeGen, function: Node.Function) Error!void { + const name = c.tree.tokSlice(function.name_tok); + const func_ty = function.qt.base(c.comp).type.func; c.ret_nodes.items.len = 0; try c.builder.startFn(); - for (func_ty.data.func.params) |param| { + for (func_ty.params) |param| { // TODO handle calling convention here - const arg = try c.builder.addArg(try c.genType(param.ty)); + const arg = try c.builder.addArg(try c.genType(param.qt)); - const size: u32 = @intCast(param.ty.sizeof(c.comp).?); // TODO add error in parser - const @"align" = param.ty.alignof(c.comp); + const size: u32 = @intCast(param.qt.sizeof(c.comp)); // TODO add error in parser + const @"align" = param.qt.alignof(c.comp); const alloc = try c.builder.addAlloc(size, @"align"); try c.builder.addStore(alloc, arg); try c.symbols.append(c.comp.gpa, .{ .name = param.name, .val = alloc }); @@ -203,7 +196,7 @@ fn genFn(c: *CodeGen, decl: NodeIndex) Error!void { // Generate body c.return_label = try c.builder.makeLabel("return"); - try c.genStmt(c.node_data[@intFromEnum(decl)].decl.node); + try c.genStmt(function.body.?); // Relocate returns if (c.ret_nodes.items.len == 0) { @@ -213,19 +206,19 @@ fn genFn(c: *CodeGen, decl: NodeIndex) Error!void { _ = try c.builder.addInst(.ret, .{ .un = c.ret_nodes.items[0].value }, .noreturn); } else { try c.builder.startBlock(c.return_label); - const phi = try c.builder.addPhi(c.ret_nodes.items, try c.genType(func_ty.returnType())); + const phi = try c.builder.addPhi(c.ret_nodes.items, try c.genType(func_ty.return_type)); _ = try c.builder.addInst(.ret, .{ .un = phi }, .noreturn); } try c.builder.finishFn(name); } -fn addUn(c: *CodeGen, tag: Ir.Inst.Tag, operand: Ir.Ref, ty: Type) !Ir.Ref { - return c.builder.addInst(tag, .{ .un = operand }, try c.genType(ty)); +fn addUn(c: *CodeGen, tag: Ir.Inst.Tag, operand: Ir.Ref, qt: QualType) !Ir.Ref { + return c.builder.addInst(tag, .{ .un = operand }, try c.genType(qt)); } -fn addBin(c: *CodeGen, tag: Ir.Inst.Tag, lhs: Ir.Ref, rhs: Ir.Ref, ty: Type) !Ir.Ref { - return c.builder.addInst(tag, .{ .bin = .{ .lhs = lhs, .rhs = rhs } }, try c.genType(ty)); +fn addBin(c: *CodeGen, tag: Ir.Inst.Tag, lhs: Ir.Ref, rhs: Ir.Ref, qt: QualType) !Ir.Ref { + return c.builder.addInst(tag, .{ .bin = .{ .lhs = lhs, .rhs = rhs } }, try c.genType(qt)); } fn addBranch(c: *CodeGen, cond: Ir.Ref, true_label: Ir.Ref, false_label: Ir.Ref) !void { @@ -247,18 +240,16 @@ fn addBoolPhi(c: *CodeGen, value: bool) !void { try c.phi_nodes.append(c.comp.gpa, .{ .label = c.builder.current_label, .value = val }); } -fn genStmt(c: *CodeGen, node: NodeIndex) Error!void { +fn genStmt(c: *CodeGen, node: Node.Index) Error!void { _ = try c.genExpr(node); } -fn genExpr(c: *CodeGen, node: NodeIndex) Error!Ir.Ref { - std.debug.assert(node != .none); - const ty = c.node_ty[@intFromEnum(node)]; - if (c.tree.value_map.get(node)) |val| { - return c.builder.addConstant(val.ref(), try c.genType(ty)); +fn genExpr(c: *CodeGen, node_index: Node.Index) Error!Ir.Ref { + if (c.tree.value_map.get(node_index)) |val| { + return c.builder.addConstant(val.ref(), try c.genType(node_index.qt(c.tree))); } - const data = c.node_data[@intFromEnum(node)]; - switch (c.node_tag[@intFromEnum(node)]) { + const node = node_index.get(c.tree); + switch (node) { .enumeration_ref, .bool_literal, .int_literal, @@ -268,96 +259,74 @@ fn genExpr(c: *CodeGen, node: NodeIndex) Error!Ir.Ref { .string_literal_expr, .alignof_expr, => unreachable, // These should have an entry in value_map. - .fn_def, - .static_fn_def, - .inline_fn_def, - .inline_static_fn_def, - .invalid, - .threadlocal_var, - => unreachable, .static_assert, - .fn_proto, - .static_fn_proto, - .inline_fn_proto, - .inline_static_fn_proto, - .extern_var, - .threadlocal_extern_var, + .function, .typedef, - .struct_decl_two, - .union_decl_two, - .enum_decl_two, .struct_decl, .union_decl, .enum_decl, - .enum_field_decl, - .record_field_decl, - .indirect_record_field_decl, + .enum_field, + .record_field, .struct_forward_decl, .union_forward_decl, .enum_forward_decl, .null_stmt, => {}, - .static_var, - .implicit_static_var, - .threadlocal_static_var, - => try c.genVar(node), // TODO - .@"var" => { - const size: u32 = @intCast(ty.sizeof(c.comp).?); // TODO add error in parser - const @"align" = ty.alignof(c.comp); + .variable => |variable| { + if (variable.storage_class == .@"extern" or variable.storage_class == .static) { + try c.genVar(variable); + return .none; + } + const size: u32 = @intCast(variable.qt.sizeof(c.comp)); // TODO add error in parser + const @"align" = variable.qt.alignof(c.comp); const alloc = try c.builder.addAlloc(size, @"align"); - const name = try StrInt.intern(c.comp, c.tree.tokSlice(data.decl.name)); + const name = try c.comp.internString(c.tree.tokSlice(variable.name_tok)); try c.symbols.append(c.comp.gpa, .{ .name = name, .val = alloc }); - if (data.decl.node != .none) { - try c.genInitializer(alloc, ty, data.decl.node); + if (variable.initializer) |init| { + try c.genInitializer(alloc, variable.qt, init); } }, - .labeled_stmt => { + .labeled_stmt => |labeled| { const label = try c.builder.makeLabel("label"); try c.builder.startBlock(label); - try c.genStmt(data.decl.node); + try c.genStmt(labeled.body); }, - .compound_stmt_two => { + .compound_stmt => |compound| { const old_sym_len = c.symbols.items.len; c.symbols.items.len = old_sym_len; - if (data.bin.lhs != .none) try c.genStmt(data.bin.lhs); - if (data.bin.rhs != .none) try c.genStmt(data.bin.rhs); + for (compound.body) |stmt| try c.genStmt(stmt); }, - .compound_stmt => { - const old_sym_len = c.symbols.items.len; - c.symbols.items.len = old_sym_len; - - for (c.tree.data[data.range.start..data.range.end]) |stmt| try c.genStmt(stmt); - }, - .if_then_else_stmt => { + .if_stmt => |@"if"| { const then_label = try c.builder.makeLabel("if.then"); + + const else_body = @"if".else_body orelse { + const end_label = try c.builder.makeLabel("if.end"); + try c.genBoolExpr(@"if".cond, then_label, end_label); + + try c.builder.startBlock(then_label); + try c.genStmt(@"if".then_body); + try c.builder.startBlock(end_label); + return .none; + }; + const else_label = try c.builder.makeLabel("if.else"); const end_label = try c.builder.makeLabel("if.end"); - try c.genBoolExpr(data.if3.cond, then_label, else_label); + try c.genBoolExpr(@"if".cond, then_label, else_label); try c.builder.startBlock(then_label); - try c.genStmt(c.tree.data[data.if3.body]); // then + try c.genStmt(@"if".then_body); try c.builder.addJump(end_label); try c.builder.startBlock(else_label); - try c.genStmt(c.tree.data[data.if3.body + 1]); // else + try c.genStmt(else_body); try c.builder.startBlock(end_label); }, - .if_then_stmt => { - const then_label = try c.builder.makeLabel("if.then"); - const end_label = try c.builder.makeLabel("if.end"); - - try c.genBoolExpr(data.bin.lhs, then_label, end_label); - - try c.builder.startBlock(then_label); - try c.genStmt(data.bin.rhs); // then - try c.builder.startBlock(end_label); - }, - .switch_stmt => { + .switch_stmt => |@"switch"| { var wip_switch = WipSwitch{ - .size = c.node_ty[@intFromEnum(data.bin.lhs)].sizeof(c.comp).?, + .size = @"switch".cond.qt(c.tree).sizeof(c.comp), }; defer wip_switch.cases.deinit(c.builder.gpa); @@ -370,11 +339,11 @@ fn genExpr(c: *CodeGen, node: NodeIndex) Error!Ir.Ref { const end_ref = try c.builder.makeLabel("switch.end"); c.break_label = end_ref; - const cond = try c.genExpr(data.bin.lhs); + const cond = try c.genExpr(@"switch".cond); const switch_index = c.builder.instructions.len; _ = try c.builder.addInst(.@"switch", undefined, .noreturn); - try c.genStmt(data.bin.rhs); // body + try c.genStmt(@"switch".body); const default_ref = wip_switch.default orelse end_ref; try c.builder.startBlock(end_ref); @@ -390,23 +359,24 @@ fn genExpr(c: *CodeGen, node: NodeIndex) Error!Ir.Ref { }; c.builder.instructions.items(.data)[switch_index] = .{ .@"switch" = switch_data }; }, - .case_stmt => { - const val = c.tree.value_map.get(data.bin.lhs).?; + .case_stmt => |case| { + if (case.end != null) return c.fail("TODO CodeGen.genStmt case range\n", .{}); + const val = c.tree.value_map.get(case.start).?; const label = try c.builder.makeLabel("case"); try c.builder.startBlock(label); try c.wip_switch.cases.append(c.builder.gpa, .{ .val = val.ref(), .label = label, }); - try c.genStmt(data.bin.rhs); + try c.genStmt(case.body); }, - .default_stmt => { - const default = try c.builder.makeLabel("default"); - try c.builder.startBlock(default); - c.wip_switch.default = default; - try c.genStmt(data.un); + .default_stmt => |default| { + const default_label = try c.builder.makeLabel("default"); + try c.builder.startBlock(default_label); + c.wip_switch.default = default_label; + try c.genStmt(default.body); }, - .while_stmt => { + .while_stmt => |@"while"| { const old_break_label = c.break_label; defer c.break_label = old_break_label; @@ -421,14 +391,14 @@ fn genExpr(c: *CodeGen, node: NodeIndex) Error!Ir.Ref { c.break_label = end_label; try c.builder.startBlock(cond_label); - try c.genBoolExpr(data.bin.lhs, then_label, end_label); + try c.genBoolExpr(@"while".cond, then_label, end_label); try c.builder.startBlock(then_label); - try c.genStmt(data.bin.rhs); + try c.genStmt(@"while".body); try c.builder.addJump(cond_label); try c.builder.startBlock(end_label); }, - .do_while_stmt => { + .do_while_stmt => |do_while| { const old_break_label = c.break_label; defer c.break_label = old_break_label; @@ -443,70 +413,45 @@ fn genExpr(c: *CodeGen, node: NodeIndex) Error!Ir.Ref { c.break_label = end_label; try c.builder.startBlock(then_label); - try c.genStmt(data.bin.rhs); + try c.genStmt(do_while.body); try c.builder.startBlock(cond_label); - try c.genBoolExpr(data.bin.lhs, then_label, end_label); + try c.genBoolExpr(do_while.cond, then_label, end_label); try c.builder.startBlock(end_label); }, - .for_decl_stmt => { + .for_stmt => |@"for"| { const old_break_label = c.break_label; defer c.break_label = old_break_label; const old_continue_label = c.continue_label; defer c.continue_label = old_continue_label; - const for_decl = data.forDecl(&c.tree); - for (for_decl.decls) |decl| try c.genStmt(decl); - - const then_label = try c.builder.makeLabel("for.then"); - var cond_label = then_label; - const cont_label = try c.builder.makeLabel("for.cont"); - const end_label = try c.builder.makeLabel("for.end"); - - c.continue_label = cont_label; - c.break_label = end_label; - - if (for_decl.cond != .none) { - cond_label = try c.builder.makeLabel("for.cond"); - try c.builder.startBlock(cond_label); - try c.genBoolExpr(for_decl.cond, then_label, end_label); - } - try c.builder.startBlock(then_label); - try c.genStmt(for_decl.body); - if (for_decl.incr != .none) { - _ = try c.genExpr(for_decl.incr); + switch (@"for".init) { + .decls => |decls| { + for (decls) |decl| try c.genStmt(decl); + }, + .expr => |maybe_init| { + if (maybe_init) |init| _ = try c.genExpr(init); + }, } - try c.builder.addJump(cond_label); - try c.builder.startBlock(end_label); - }, - .forever_stmt => { - const old_break_label = c.break_label; - defer c.break_label = old_break_label; - - const old_continue_label = c.continue_label; - defer c.continue_label = old_continue_label; - - const then_label = try c.builder.makeLabel("for.then"); - const end_label = try c.builder.makeLabel("for.end"); - c.continue_label = then_label; - c.break_label = end_label; + const cond = @"for".cond orelse { + const then_label = try c.builder.makeLabel("for.then"); + const end_label = try c.builder.makeLabel("for.end"); - try c.builder.startBlock(then_label); - try c.genStmt(data.un); - try c.builder.startBlock(end_label); - }, - .for_stmt => { - const old_break_label = c.break_label; - defer c.break_label = old_break_label; + c.continue_label = then_label; + c.break_label = end_label; - const old_continue_label = c.continue_label; - defer c.continue_label = old_continue_label; - - const for_stmt = data.forStmt(&c.tree); - if (for_stmt.init != .none) _ = try c.genExpr(for_stmt.init); + try c.builder.startBlock(then_label); + try c.genStmt(@"for".body); + if (@"for".incr) |incr| { + _ = try c.genExpr(incr); + } + try c.builder.addJump(then_label); + try c.builder.startBlock(end_label); + return .none; + }; const then_label = try c.builder.makeLabel("for.then"); var cond_label = then_label; @@ -516,212 +461,213 @@ fn genExpr(c: *CodeGen, node: NodeIndex) Error!Ir.Ref { c.continue_label = cont_label; c.break_label = end_label; - if (for_stmt.cond != .none) { - cond_label = try c.builder.makeLabel("for.cond"); - try c.builder.startBlock(cond_label); - try c.genBoolExpr(for_stmt.cond, then_label, end_label); - } + cond_label = try c.builder.makeLabel("for.cond"); + + try c.builder.startBlock(cond_label); + try c.genBoolExpr(cond, then_label, end_label); + try c.builder.startBlock(then_label); - try c.genStmt(for_stmt.body); - if (for_stmt.incr != .none) { - _ = try c.genExpr(for_stmt.incr); + try c.genStmt(@"for".body); + if (@"for".incr) |incr| { + _ = try c.genExpr(incr); } try c.builder.addJump(cond_label); try c.builder.startBlock(end_label); }, .continue_stmt => try c.builder.addJump(c.continue_label), .break_stmt => try c.builder.addJump(c.break_label), - .return_stmt => { - if (data.un != .none) { - const operand = try c.genExpr(data.un); - try c.ret_nodes.append(c.comp.gpa, .{ .value = operand, .label = c.builder.current_label }); + .return_stmt => |@"return"| { + switch (@"return".operand) { + .expr => |expr| { + const operand = try c.genExpr(expr); + try c.ret_nodes.append(c.comp.gpa, .{ .value = operand, .label = c.builder.current_label }); + }, + .none => {}, + .implicit => |zeroes| { + if (zeroes) { + const operand = try c.builder.addConstant(.zero, try c.genType(@"return".return_qt)); + try c.ret_nodes.append(c.comp.gpa, .{ .value = operand, .label = c.builder.current_label }); + } + // No need to emit a jump since an implicit return_stmt is always the last statement. + return .none; + }, } try c.builder.addJump(c.return_label); }, - .implicit_return => { - if (data.return_zero) { - const operand = try c.builder.addConstant(.zero, try c.genType(ty)); - try c.ret_nodes.append(c.comp.gpa, .{ .value = operand, .label = c.builder.current_label }); - } - // No need to emit a jump since implicit_return is always the last instruction. - }, - .case_range_stmt, .goto_stmt, .computed_goto_stmt, .nullptr_literal, - => return c.fail("TODO CodeGen.genStmt {}\n", .{c.node_tag[@intFromEnum(node)]}), - .comma_expr => { - _ = try c.genExpr(data.bin.lhs); - return c.genExpr(data.bin.rhs); - }, - .assign_expr => { - const rhs = try c.genExpr(data.bin.rhs); - const lhs = try c.genLval(data.bin.lhs); + => return c.fail("TODO CodeGen.genStmt {s}\n", .{@tagName(node)}), + .comma_expr => |bin| { + _ = try c.genExpr(bin.lhs); + return c.genExpr(bin.rhs); + }, + .assign_expr => |bin| { + const rhs = try c.genExpr(bin.rhs); + const lhs = try c.genLval(bin.lhs); try c.builder.addStore(lhs, rhs); return rhs; }, - .mul_assign_expr => return c.genCompoundAssign(node, .mul), - .div_assign_expr => return c.genCompoundAssign(node, .div), - .mod_assign_expr => return c.genCompoundAssign(node, .mod), - .add_assign_expr => return c.genCompoundAssign(node, .add), - .sub_assign_expr => return c.genCompoundAssign(node, .sub), - .shl_assign_expr => return c.genCompoundAssign(node, .bit_shl), - .shr_assign_expr => return c.genCompoundAssign(node, .bit_shr), - .bit_and_assign_expr => return c.genCompoundAssign(node, .bit_and), - .bit_xor_assign_expr => return c.genCompoundAssign(node, .bit_xor), - .bit_or_assign_expr => return c.genCompoundAssign(node, .bit_or), - .bit_or_expr => return c.genBinOp(node, .bit_or), - .bit_xor_expr => return c.genBinOp(node, .bit_xor), - .bit_and_expr => return c.genBinOp(node, .bit_and), - .equal_expr => { - const cmp = try c.genComparison(node, .cmp_eq); - return c.addUn(.zext, cmp, ty); - }, - .not_equal_expr => { - const cmp = try c.genComparison(node, .cmp_ne); - return c.addUn(.zext, cmp, ty); - }, - .less_than_expr => { - const cmp = try c.genComparison(node, .cmp_lt); - return c.addUn(.zext, cmp, ty); - }, - .less_than_equal_expr => { - const cmp = try c.genComparison(node, .cmp_lte); - return c.addUn(.zext, cmp, ty); - }, - .greater_than_expr => { - const cmp = try c.genComparison(node, .cmp_gt); - return c.addUn(.zext, cmp, ty); - }, - .greater_than_equal_expr => { - const cmp = try c.genComparison(node, .cmp_gte); - return c.addUn(.zext, cmp, ty); - }, - .shl_expr => return c.genBinOp(node, .bit_shl), - .shr_expr => return c.genBinOp(node, .bit_shr), - .add_expr => { - if (ty.isPtr()) { - const lhs_ty = c.node_ty[@intFromEnum(data.bin.lhs)]; - if (lhs_ty.isPtr()) { - const ptr = try c.genExpr(data.bin.lhs); - const offset = try c.genExpr(data.bin.rhs); - const offset_ty = c.node_ty[@intFromEnum(data.bin.rhs)]; - return c.genPtrArithmetic(ptr, offset, offset_ty, ty); + .mul_assign_expr => |bin| return c.genCompoundAssign(bin), + .div_assign_expr => |bin| return c.genCompoundAssign(bin), + .mod_assign_expr => |bin| return c.genCompoundAssign(bin), + .add_assign_expr => |bin| return c.genCompoundAssign(bin), + .sub_assign_expr => |bin| return c.genCompoundAssign(bin), + .shl_assign_expr => |bin| return c.genCompoundAssign(bin), + .shr_assign_expr => |bin| return c.genCompoundAssign(bin), + .bit_and_assign_expr => |bin| return c.genCompoundAssign(bin), + .bit_xor_assign_expr => |bin| return c.genCompoundAssign(bin), + .bit_or_assign_expr => |bin| return c.genCompoundAssign(bin), + .bit_or_expr => |bin| return c.genBinOp(bin, .bit_or), + .bit_xor_expr => |bin| return c.genBinOp(bin, .bit_xor), + .bit_and_expr => |bin| return c.genBinOp(bin, .bit_and), + .equal_expr => |bin| { + const cmp = try c.genComparison(bin, .cmp_eq); + return c.addUn(.zext, cmp, bin.qt); + }, + .not_equal_expr => |bin| { + const cmp = try c.genComparison(bin, .cmp_ne); + return c.addUn(.zext, cmp, bin.qt); + }, + .less_than_expr => |bin| { + const cmp = try c.genComparison(bin, .cmp_lt); + return c.addUn(.zext, cmp, bin.qt); + }, + .less_than_equal_expr => |bin| { + const cmp = try c.genComparison(bin, .cmp_lte); + return c.addUn(.zext, cmp, bin.qt); + }, + .greater_than_expr => |bin| { + const cmp = try c.genComparison(bin, .cmp_gt); + return c.addUn(.zext, cmp, bin.qt); + }, + .greater_than_equal_expr => |bin| { + const cmp = try c.genComparison(bin, .cmp_gte); + return c.addUn(.zext, cmp, bin.qt); + }, + .shl_expr => |bin| return c.genBinOp(bin, .bit_shl), + .shr_expr => |bin| return c.genBinOp(bin, .bit_shr), + .add_expr => |bin| { + if (bin.qt.is(c.comp, .pointer)) { + const lhs_qt = bin.lhs.qt(c.tree); + if (lhs_qt.is(c.comp, .pointer)) { + const ptr = try c.genExpr(bin.lhs); + const offset = try c.genExpr(bin.rhs); + return c.genPtrArithmetic(ptr, offset, bin.rhs.qt(c.tree), bin.qt); } else { - const offset = try c.genExpr(data.bin.lhs); - const ptr = try c.genExpr(data.bin.rhs); - const offset_ty = lhs_ty; - return c.genPtrArithmetic(ptr, offset, offset_ty, ty); + const offset = try c.genExpr(bin.lhs); + const ptr = try c.genExpr(bin.rhs); + const offset_ty = lhs_qt; + return c.genPtrArithmetic(ptr, offset, offset_ty, bin.qt); } } - return c.genBinOp(node, .add); + return c.genBinOp(bin, .add); }, - .sub_expr => { - if (ty.isPtr()) { - const ptr = try c.genExpr(data.bin.lhs); - const offset = try c.genExpr(data.bin.rhs); - const offset_ty = c.node_ty[@intFromEnum(data.bin.rhs)]; - return c.genPtrArithmetic(ptr, offset, offset_ty, ty); + .sub_expr => |bin| { + if (bin.qt.is(c.comp, .pointer)) { + const ptr = try c.genExpr(bin.lhs); + const offset = try c.genExpr(bin.rhs); + return c.genPtrArithmetic(ptr, offset, bin.rhs.qt(c.tree), bin.qt); } - return c.genBinOp(node, .sub); - }, - .mul_expr => return c.genBinOp(node, .mul), - .div_expr => return c.genBinOp(node, .div), - .mod_expr => return c.genBinOp(node, .mod), - .addr_of_expr => return try c.genLval(data.un), - .deref_expr => { - const un_data = c.node_data[@intFromEnum(data.un)]; - if (c.node_tag[@intFromEnum(data.un)] == .implicit_cast and un_data.cast.kind == .function_to_pointer) { - return c.genExpr(data.un); + return c.genBinOp(bin, .sub); + }, + .mul_expr => |bin| return c.genBinOp(bin, .mul), + .div_expr => |bin| return c.genBinOp(bin, .div), + .mod_expr => |bin| return c.genBinOp(bin, .mod), + .addr_of_expr => |un| return try c.genLval(un.operand), + .deref_expr => |un| { + const operand_node = un.operand.get(c.tree); + if (operand_node == .cast and operand_node.cast.kind == .function_to_pointer) { + return c.genExpr(un.operand); } - const operand = try c.genLval(data.un); - return c.addUn(.load, operand, ty); - }, - .plus_expr => return c.genExpr(data.un), - .negate_expr => { - const zero = try c.builder.addConstant(.zero, try c.genType(ty)); - const operand = try c.genExpr(data.un); - return c.addBin(.sub, zero, operand, ty); - }, - .bit_not_expr => { - const operand = try c.genExpr(data.un); - return c.addUn(.bit_not, operand, ty); - }, - .bool_not_expr => { - const zero = try c.builder.addConstant(.zero, try c.genType(ty)); - const operand = try c.genExpr(data.un); - return c.addBin(.cmp_ne, zero, operand, ty); - }, - .pre_inc_expr => { - const operand = try c.genLval(data.un); - const val = try c.addUn(.load, operand, ty); - const one = try c.builder.addConstant(.one, try c.genType(ty)); - const plus_one = try c.addBin(.add, val, one, ty); + const operand = try c.genLval(un.operand); + return c.addUn(.load, operand, un.qt); + }, + .plus_expr => |un| return c.genExpr(un.operand), + .negate_expr => |un| { + const zero = try c.builder.addConstant(.zero, try c.genType(un.qt)); + const operand = try c.genExpr(un.operand); + return c.addBin(.sub, zero, operand, un.qt); + }, + .bit_not_expr => |un| { + const operand = try c.genExpr(un.operand); + return c.addUn(.bit_not, operand, un.qt); + }, + .bool_not_expr => |un| { + const zero = try c.builder.addConstant(.zero, try c.genType(un.qt)); + const operand = try c.genExpr(un.operand); + return c.addBin(.cmp_ne, zero, operand, un.qt); + }, + .pre_inc_expr => |un| { + const operand = try c.genLval(un.operand); + const val = try c.addUn(.load, operand, un.qt); + const one = try c.builder.addConstant(.one, try c.genType(un.qt)); + const plus_one = try c.addBin(.add, val, one, un.qt); try c.builder.addStore(operand, plus_one); return plus_one; }, - .pre_dec_expr => { - const operand = try c.genLval(data.un); - const val = try c.addUn(.load, operand, ty); - const one = try c.builder.addConstant(.one, try c.genType(ty)); - const plus_one = try c.addBin(.sub, val, one, ty); + .pre_dec_expr => |un| { + const operand = try c.genLval(un.operand); + const val = try c.addUn(.load, operand, un.qt); + const one = try c.builder.addConstant(.one, try c.genType(un.qt)); + const plus_one = try c.addBin(.sub, val, one, un.qt); try c.builder.addStore(operand, plus_one); return plus_one; }, - .post_inc_expr => { - const operand = try c.genLval(data.un); - const val = try c.addUn(.load, operand, ty); - const one = try c.builder.addConstant(.one, try c.genType(ty)); - const plus_one = try c.addBin(.add, val, one, ty); + .post_inc_expr => |un| { + const operand = try c.genLval(un.operand); + const val = try c.addUn(.load, operand, un.qt); + const one = try c.builder.addConstant(.one, try c.genType(un.qt)); + const plus_one = try c.addBin(.add, val, one, un.qt); try c.builder.addStore(operand, plus_one); return val; }, - .post_dec_expr => { - const operand = try c.genLval(data.un); - const val = try c.addUn(.load, operand, ty); - const one = try c.builder.addConstant(.one, try c.genType(ty)); - const plus_one = try c.addBin(.sub, val, one, ty); + .post_dec_expr => |un| { + const operand = try c.genLval(un.operand); + const val = try c.addUn(.load, operand, un.qt); + const one = try c.builder.addConstant(.one, try c.genType(un.qt)); + const plus_one = try c.addBin(.sub, val, one, un.qt); try c.builder.addStore(operand, plus_one); return val; }, - .paren_expr => return c.genExpr(data.un), + .paren_expr => |un| return c.genExpr(un.operand), .decl_ref_expr => unreachable, // Lval expression. - .explicit_cast, .implicit_cast => switch (data.cast.kind) { - .no_op => return c.genExpr(data.cast.operand), + .cast => |cast| switch (cast.kind) { + .no_op => return c.genExpr(cast.operand), .to_void => { - _ = try c.genExpr(data.cast.operand); + _ = try c.genExpr(cast.operand); return .none; }, .lval_to_rval => { - const operand = try c.genLval(data.cast.operand); - return c.addUn(.load, operand, ty); + const operand = try c.genLval(cast.operand); + return c.addUn(.load, operand, cast.qt); }, .function_to_pointer, .array_to_pointer => { - return c.genLval(data.cast.operand); + return c.genLval(cast.operand); }, .int_cast => { - const operand = try c.genExpr(data.cast.operand); - const src_ty = c.node_ty[@intFromEnum(data.cast.operand)]; - const src_bits = src_ty.bitSizeof(c.comp).?; - const dest_bits = ty.bitSizeof(c.comp).?; + const operand = try c.genExpr(cast.operand); + const src_qt = cast.operand.qt(c.tree); + const src_bits = src_qt.bitSizeof(c.comp); + const dest_bits = cast.qt.bitSizeof(c.comp); if (src_bits == dest_bits) { return operand; } else if (src_bits < dest_bits) { - if (src_ty.isUnsignedInt(c.comp)) - return c.addUn(.zext, operand, ty) + if (src_qt.signedness(c.comp) == .unsigned) + return c.addUn(.zext, operand, cast.qt) else - return c.addUn(.sext, operand, ty); + return c.addUn(.sext, operand, cast.qt); } else { - return c.addUn(.trunc, operand, ty); + return c.addUn(.trunc, operand, cast.qt); } }, .bool_to_int => { - const operand = try c.genExpr(data.cast.operand); - return c.addUn(.zext, operand, ty); + const operand = try c.genExpr(cast.operand); + return c.addUn(.zext, operand, cast.qt); }, .pointer_to_bool, .int_to_bool, .float_to_bool => { - const lhs = try c.genExpr(data.cast.operand); - const rhs = try c.builder.addConstant(.zero, try c.genType(c.node_ty[@intFromEnum(node)])); + const lhs = try c.genExpr(cast.operand); + const rhs = try c.builder.addConstant(.zero, try c.genType(cast.qt)); return c.builder.addInst(.cmp_ne, .{ .bin = .{ .lhs = lhs, .rhs = rhs } }, .i1); }, .bitcast, @@ -743,40 +689,42 @@ fn genExpr(c: *CodeGen, node: NodeIndex) Error!Ir.Ref { .null_to_pointer, .union_cast, .vector_splat, - => return c.fail("TODO CodeGen gen CastKind {}\n", .{data.cast.kind}), + .atomic_to_non_atomic, + .non_atomic_to_atomic, + => return c.fail("TODO CodeGen gen CastKind {}\n", .{cast.kind}), }, - .binary_cond_expr => { - if (c.tree.value_map.get(data.if3.cond)) |cond| { + .binary_cond_expr => |conditional| { + if (c.tree.value_map.get(conditional.cond)) |cond| { if (cond.toBool(c.comp)) { - c.cond_dummy_ref = try c.genExpr(data.if3.cond); - return c.genExpr(c.tree.data[data.if3.body]); // then + c.cond_dummy_ref = try c.genExpr(conditional.cond); + return c.genExpr(conditional.then_expr); } else { - return c.genExpr(c.tree.data[data.if3.body + 1]); // else + return c.genExpr(conditional.else_expr); } } const then_label = try c.builder.makeLabel("ternary.then"); const else_label = try c.builder.makeLabel("ternary.else"); const end_label = try c.builder.makeLabel("ternary.end"); - const cond_ty = c.node_ty[@intFromEnum(data.if3.cond)]; + const cond_qt = conditional.cond.qt(c.tree); { const old_cond_dummy_ty = c.cond_dummy_ty; defer c.cond_dummy_ty = old_cond_dummy_ty; - c.cond_dummy_ty = try c.genType(cond_ty); + c.cond_dummy_ty = try c.genType(cond_qt); - try c.genBoolExpr(data.if3.cond, then_label, else_label); + try c.genBoolExpr(conditional.cond, then_label, else_label); } try c.builder.startBlock(then_label); if (c.builder.instructions.items(.ty)[@intFromEnum(c.cond_dummy_ref)] == .i1) { - c.cond_dummy_ref = try c.addUn(.zext, c.cond_dummy_ref, cond_ty); + c.cond_dummy_ref = try c.addUn(.zext, c.cond_dummy_ref, cond_qt); } - const then_val = try c.genExpr(c.tree.data[data.if3.body]); // then + const then_val = try c.genExpr(conditional.then_expr); try c.builder.addJump(end_label); const then_exit = c.builder.current_label; try c.builder.startBlock(else_label); - const else_val = try c.genExpr(c.tree.data[data.if3.body + 1]); // else + const else_val = try c.genExpr(conditional.else_expr); const else_exit = c.builder.current_label; try c.builder.startBlock(end_label); @@ -785,15 +733,15 @@ fn genExpr(c: *CodeGen, node: NodeIndex) Error!Ir.Ref { .{ .value = then_val, .label = then_exit }, .{ .value = else_val, .label = else_exit }, }; - return c.builder.addPhi(&phi_buf, try c.genType(ty)); + return c.builder.addPhi(&phi_buf, try c.genType(conditional.qt)); }, .cond_dummy_expr => return c.cond_dummy_ref, - .cond_expr => { - if (c.tree.value_map.get(data.if3.cond)) |cond| { + .cond_expr => |conditional| { + if (c.tree.value_map.get(conditional.cond)) |cond| { if (cond.toBool(c.comp)) { - return c.genExpr(c.tree.data[data.if3.body]); // then + return c.genExpr(conditional.then_expr); } else { - return c.genExpr(c.tree.data[data.if3.body + 1]); // else + return c.genExpr(conditional.else_expr); } } @@ -801,15 +749,15 @@ fn genExpr(c: *CodeGen, node: NodeIndex) Error!Ir.Ref { const else_label = try c.builder.makeLabel("ternary.else"); const end_label = try c.builder.makeLabel("ternary.end"); - try c.genBoolExpr(data.if3.cond, then_label, else_label); + try c.genBoolExpr(conditional.cond, then_label, else_label); try c.builder.startBlock(then_label); - const then_val = try c.genExpr(c.tree.data[data.if3.body]); // then + const then_val = try c.genExpr(conditional.then_expr); try c.builder.addJump(end_label); const then_exit = c.builder.current_label; try c.builder.startBlock(else_label); - const else_val = try c.genExpr(c.tree.data[data.if3.body + 1]); // else + const else_val = try c.genExpr(conditional.else_expr); const else_exit = c.builder.current_label; try c.builder.startBlock(end_label); @@ -818,22 +766,15 @@ fn genExpr(c: *CodeGen, node: NodeIndex) Error!Ir.Ref { .{ .value = then_val, .label = then_exit }, .{ .value = else_val, .label = else_exit }, }; - return c.builder.addPhi(&phi_buf, try c.genType(ty)); - }, - .call_expr_one => if (data.bin.rhs == .none) { - return c.genCall(data.bin.lhs, &.{}, ty); - } else { - return c.genCall(data.bin.lhs, &.{data.bin.rhs}, ty); - }, - .call_expr => { - return c.genCall(c.tree.data[data.range.start], c.tree.data[data.range.start + 1 .. data.range.end], ty); + return c.builder.addPhi(&phi_buf, try c.genType(conditional.qt)); }, - .bool_or_expr => { - if (c.tree.value_map.get(data.bin.lhs)) |lhs| { + .call_expr => |call| return c.genCall(call), + .bool_or_expr => |bin| { + if (c.tree.value_map.get(bin.lhs)) |lhs| { if (!lhs.toBool(c.comp)) { - return c.builder.addConstant(.one, try c.genType(ty)); + return c.builder.addConstant(.one, try c.genType(bin.qt)); } - return c.genExpr(data.bin.rhs); + return c.genExpr(bin.rhs); } const false_label = try c.builder.makeLabel("bool_false"); @@ -846,22 +787,22 @@ fn genExpr(c: *CodeGen, node: NodeIndex) Error!Ir.Ref { const phi_nodes_top = c.phi_nodes.items.len; defer c.phi_nodes.items.len = phi_nodes_top; - try c.genBoolExpr(data.bin.lhs, exit_label, false_label); + try c.genBoolExpr(bin.lhs, exit_label, false_label); try c.builder.startBlock(false_label); - try c.genBoolExpr(data.bin.rhs, exit_label, exit_label); + try c.genBoolExpr(bin.rhs, exit_label, exit_label); try c.builder.startBlock(exit_label); const phi = try c.builder.addPhi(c.phi_nodes.items[phi_nodes_top..], .i1); - return c.addUn(.zext, phi, ty); + return c.addUn(.zext, phi, bin.qt); }, - .bool_and_expr => { - if (c.tree.value_map.get(data.bin.lhs)) |lhs| { + .bool_and_expr => |bin| { + if (c.tree.value_map.get(bin.lhs)) |lhs| { if (!lhs.toBool(c.comp)) { - return c.builder.addConstant(.zero, try c.genType(ty)); + return c.builder.addConstant(.zero, try c.genType(bin.qt)); } - return c.genExpr(data.bin.rhs); + return c.genExpr(bin.rhs); } const true_label = try c.builder.makeLabel("bool_true"); @@ -874,102 +815,73 @@ fn genExpr(c: *CodeGen, node: NodeIndex) Error!Ir.Ref { const phi_nodes_top = c.phi_nodes.items.len; defer c.phi_nodes.items.len = phi_nodes_top; - try c.genBoolExpr(data.bin.lhs, true_label, exit_label); + try c.genBoolExpr(bin.lhs, true_label, exit_label); try c.builder.startBlock(true_label); - try c.genBoolExpr(data.bin.rhs, exit_label, exit_label); + try c.genBoolExpr(bin.rhs, exit_label, exit_label); try c.builder.startBlock(exit_label); const phi = try c.builder.addPhi(c.phi_nodes.items[phi_nodes_top..], .i1); - return c.addUn(.zext, phi, ty); + return c.addUn(.zext, phi, bin.qt); }, - .builtin_choose_expr => { - const cond = c.tree.value_map.get(data.if3.cond).?; + .builtin_choose_expr => |conditional| { + const cond = c.tree.value_map.get(conditional.cond).?; if (cond.toBool(c.comp)) { - return c.genExpr(c.tree.data[data.if3.body]); + return c.genExpr(conditional.then_expr); } else { - return c.genExpr(c.tree.data[data.if3.body + 1]); + return c.genExpr(conditional.else_expr); } }, - .generic_expr_one => { - const index = @intFromEnum(data.bin.rhs); - switch (c.node_tag[index]) { - .generic_association_expr, .generic_default_expr => { - return c.genExpr(c.node_data[index].un); + .generic_expr => |generic| { + const chosen = generic.chosen.get(c.tree); + switch (chosen) { + .generic_association_expr => |assoc| { + return c.genExpr(assoc.expr); }, - else => unreachable, - } - }, - .generic_expr => { - const index = @intFromEnum(c.tree.data[data.range.start + 1]); - switch (c.node_tag[index]) { - .generic_association_expr, .generic_default_expr => { - return c.genExpr(c.node_data[index].un); + .generic_default_expr => |default| { + return c.genExpr(default.expr); }, else => unreachable, } }, .generic_association_expr, .generic_default_expr => unreachable, - .stmt_expr => switch (c.node_tag[@intFromEnum(data.un)]) { - .compound_stmt_two => { - const old_sym_len = c.symbols.items.len; - c.symbols.items.len = old_sym_len; - - const stmt_data = c.node_data[@intFromEnum(data.un)]; - if (stmt_data.bin.rhs == .none) return c.genExpr(stmt_data.bin.lhs); - try c.genStmt(stmt_data.bin.lhs); - return c.genExpr(stmt_data.bin.rhs); - }, - .compound_stmt => { - const old_sym_len = c.symbols.items.len; - c.symbols.items.len = old_sym_len; + .stmt_expr => |un| { + const compound_stmt = un.operand.get(c.tree).compound_stmt; - const stmt_data = c.node_data[@intFromEnum(data.un)]; - for (c.tree.data[stmt_data.range.start .. stmt_data.range.end - 1]) |stmt| try c.genStmt(stmt); - return c.genExpr(c.tree.data[stmt_data.range.end]); - }, - else => unreachable, - }, - .builtin_call_expr_one => { - const name = c.tree.tokSlice(data.decl.name); - const builtin = c.comp.builtins.lookup(name).builtin; - if (data.decl.node == .none) { - return c.genBuiltinCall(builtin, &.{}, ty); - } else { - return c.genBuiltinCall(builtin, &.{data.decl.node}, ty); - } + const old_sym_len = c.symbols.items.len; + c.symbols.items.len = old_sym_len; + + for (compound_stmt.body[0..compound_stmt.body.len -| 1]) |stmt| try c.genStmt(stmt); + return c.genExpr(compound_stmt.body[compound_stmt.body.len - 1]); }, - .builtin_call_expr => { - const name_node_idx = c.tree.data[data.range.start]; - const name = c.tree.tokSlice(@intFromEnum(name_node_idx)); + .builtin_call_expr => |call| { + const name = c.tree.tokSlice(call.builtin_tok); const builtin = c.comp.builtins.lookup(name).builtin; - return c.genBuiltinCall(builtin, c.tree.data[data.range.start + 1 .. data.range.end], ty); + return c.genBuiltinCall(builtin, call.args, call.qt); }, .addr_of_label, .imag_expr, .real_expr, .sizeof_expr, - .special_builtin_call_one, - => return c.fail("TODO CodeGen.genExpr {}\n", .{c.node_tag[@intFromEnum(node)]}), + => return c.fail("TODO CodeGen.genExpr {s}\n", .{@tagName(node)}), else => unreachable, // Not an expression. } return .none; } -fn genLval(c: *CodeGen, node: NodeIndex) Error!Ir.Ref { - std.debug.assert(node != .none); - assert(c.tree.isLval(node)); - const data = c.node_data[@intFromEnum(node)]; - switch (c.node_tag[@intFromEnum(node)]) { +fn genLval(c: *CodeGen, node_index: Node.Index) Error!Ir.Ref { + assert(c.tree.isLval(node_index)); + const node = node_index.get(c.tree); + switch (node) { .string_literal_expr => { - const val = c.tree.value_map.get(node).?; + const val = c.tree.value_map.get(node_index).?; return c.builder.addConstant(val.ref(), .ptr); }, - .paren_expr => return c.genLval(data.un), - .decl_ref_expr => { - const slice = c.tree.tokSlice(data.decl_ref); - const name = try StrInt.intern(c.comp, slice); + .paren_expr => |un| return c.genLval(un.operand), + .decl_ref_expr => |decl_ref| { + const slice = c.tree.tokSlice(decl_ref.name_tok); + const name = try c.comp.internString(slice); var i = c.symbols.items.len; while (i > 0) { i -= 1; @@ -983,160 +895,159 @@ fn genLval(c: *CodeGen, node: NodeIndex) Error!Ir.Ref { try c.builder.instructions.append(c.builder.gpa, .{ .tag = .symbol, .data = .{ .label = duped_name }, .ty = .ptr }); return ref; }, - .deref_expr => return c.genExpr(data.un), - .compound_literal_expr => { - const ty = c.node_ty[@intFromEnum(node)]; - const size: u32 = @intCast(ty.sizeof(c.comp).?); // TODO add error in parser - const @"align" = ty.alignof(c.comp); + .deref_expr => |un| return c.genExpr(un.operand), + .compound_literal_expr => |literal| { + if (literal.storage_class == .static or literal.thread_local) { + return c.fail("TODO CodeGen.compound_literal_expr static or thread_local\n", .{}); + } + const size: u32 = @intCast(literal.qt.sizeof(c.comp)); // TODO add error in parser + const @"align" = literal.qt.alignof(c.comp); const alloc = try c.builder.addAlloc(size, @"align"); - try c.genInitializer(alloc, ty, data.un); + try c.genInitializer(alloc, literal.qt, literal.initializer); return alloc; }, - .builtin_choose_expr => { - const cond = c.tree.value_map.get(data.if3.cond).?; + .builtin_choose_expr => |conditional| { + const cond = c.tree.value_map.get(conditional.cond).?; if (cond.toBool(c.comp)) { - return c.genLval(c.tree.data[data.if3.body]); + return c.genLval(conditional.then_expr); } else { - return c.genLval(c.tree.data[data.if3.body + 1]); + return c.genLval(conditional.else_expr); } }, + .compound_assign_dummy_expr => { + return c.compound_assign_dummy.?; + }, .member_access_expr, .member_access_ptr_expr, .array_access_expr, - .static_compound_literal_expr, - .thread_local_compound_literal_expr, - .static_thread_local_compound_literal_expr, - => return c.fail("TODO CodeGen.genLval {}\n", .{c.node_tag[@intFromEnum(node)]}), + => return c.fail("TODO CodeGen.genLval {s}\n", .{@tagName(node)}), else => unreachable, // Not an lval expression. } } -fn genBoolExpr(c: *CodeGen, base: NodeIndex, true_label: Ir.Ref, false_label: Ir.Ref) Error!void { +fn genBoolExpr(c: *CodeGen, base: Node.Index, true_label: Ir.Ref, false_label: Ir.Ref) Error!void { var node = base; - while (true) switch (c.node_tag[@intFromEnum(node)]) { - .paren_expr => { - node = c.node_data[@intFromEnum(node)].un; - }, + while (true) switch (node.get(c.tree)) { + .paren_expr => |un| node = un.operand, else => break, }; - const data = c.node_data[@intFromEnum(node)]; - switch (c.node_tag[@intFromEnum(node)]) { - .bool_or_expr => { - if (c.tree.value_map.get(data.bin.lhs)) |lhs| { + switch (node.get(c.tree)) { + .bool_or_expr => |bin| { + if (c.tree.value_map.get(bin.lhs)) |lhs| { if (lhs.toBool(c.comp)) { if (true_label == c.bool_end_label) { return c.addBoolPhi(!c.bool_invert); } return c.builder.addJump(true_label); } - return c.genBoolExpr(data.bin.rhs, true_label, false_label); + return c.genBoolExpr(bin.rhs, true_label, false_label); } const new_false_label = try c.builder.makeLabel("bool_false"); - try c.genBoolExpr(data.bin.lhs, true_label, new_false_label); + try c.genBoolExpr(bin.lhs, true_label, new_false_label); try c.builder.startBlock(new_false_label); if (c.cond_dummy_ty) |ty| c.cond_dummy_ref = try c.builder.addConstant(.one, ty); - return c.genBoolExpr(data.bin.rhs, true_label, false_label); + return c.genBoolExpr(bin.rhs, true_label, false_label); }, - .bool_and_expr => { - if (c.tree.value_map.get(data.bin.lhs)) |lhs| { + .bool_and_expr => |bin| { + if (c.tree.value_map.get(bin.lhs)) |lhs| { if (!lhs.toBool(c.comp)) { if (false_label == c.bool_end_label) { return c.addBoolPhi(c.bool_invert); } return c.builder.addJump(false_label); } - return c.genBoolExpr(data.bin.rhs, true_label, false_label); + return c.genBoolExpr(bin.rhs, true_label, false_label); } const new_true_label = try c.builder.makeLabel("bool_true"); - try c.genBoolExpr(data.bin.lhs, new_true_label, false_label); + try c.genBoolExpr(bin.lhs, new_true_label, false_label); try c.builder.startBlock(new_true_label); if (c.cond_dummy_ty) |ty| c.cond_dummy_ref = try c.builder.addConstant(.one, ty); - return c.genBoolExpr(data.bin.rhs, true_label, false_label); + return c.genBoolExpr(bin.rhs, true_label, false_label); }, - .bool_not_expr => { + .bool_not_expr => |un| { c.bool_invert = !c.bool_invert; defer c.bool_invert = !c.bool_invert; if (c.cond_dummy_ty) |ty| c.cond_dummy_ref = try c.builder.addConstant(.zero, ty); - return c.genBoolExpr(data.un, false_label, true_label); + return c.genBoolExpr(un.operand, false_label, true_label); }, - .equal_expr => { - const cmp = try c.genComparison(node, .cmp_eq); + .equal_expr => |bin| { + const cmp = try c.genComparison(bin, .cmp_eq); if (c.cond_dummy_ty != null) c.cond_dummy_ref = cmp; return c.addBranch(cmp, true_label, false_label); }, - .not_equal_expr => { - const cmp = try c.genComparison(node, .cmp_ne); + .not_equal_expr => |bin| { + const cmp = try c.genComparison(bin, .cmp_ne); if (c.cond_dummy_ty != null) c.cond_dummy_ref = cmp; return c.addBranch(cmp, true_label, false_label); }, - .less_than_expr => { - const cmp = try c.genComparison(node, .cmp_lt); + .less_than_expr => |bin| { + const cmp = try c.genComparison(bin, .cmp_lt); if (c.cond_dummy_ty != null) c.cond_dummy_ref = cmp; return c.addBranch(cmp, true_label, false_label); }, - .less_than_equal_expr => { - const cmp = try c.genComparison(node, .cmp_lte); + .less_than_equal_expr => |bin| { + const cmp = try c.genComparison(bin, .cmp_lte); if (c.cond_dummy_ty != null) c.cond_dummy_ref = cmp; return c.addBranch(cmp, true_label, false_label); }, - .greater_than_expr => { - const cmp = try c.genComparison(node, .cmp_gt); + .greater_than_expr => |bin| { + const cmp = try c.genComparison(bin, .cmp_gt); if (c.cond_dummy_ty != null) c.cond_dummy_ref = cmp; return c.addBranch(cmp, true_label, false_label); }, - .greater_than_equal_expr => { - const cmp = try c.genComparison(node, .cmp_gte); + .greater_than_equal_expr => |bin| { + const cmp = try c.genComparison(bin, .cmp_gte); if (c.cond_dummy_ty != null) c.cond_dummy_ref = cmp; return c.addBranch(cmp, true_label, false_label); }, - .explicit_cast, .implicit_cast => switch (data.cast.kind) { + .cast => |cast| switch (cast.kind) { .bool_to_int => { - const operand = try c.genExpr(data.cast.operand); + const operand = try c.genExpr(cast.operand); if (c.cond_dummy_ty != null) c.cond_dummy_ref = operand; return c.addBranch(operand, true_label, false_label); }, else => {}, }, - .binary_cond_expr => { - if (c.tree.value_map.get(data.if3.cond)) |cond| { + .binary_cond_expr => |conditional| { + if (c.tree.value_map.get(conditional.cond)) |cond| { if (cond.toBool(c.comp)) { - return c.genBoolExpr(c.tree.data[data.if3.body], true_label, false_label); // then + return c.genBoolExpr(conditional.then_expr, true_label, false_label); } else { - return c.genBoolExpr(c.tree.data[data.if3.body + 1], true_label, false_label); // else + return c.genBoolExpr(conditional.else_expr, true_label, false_label); } } const new_false_label = try c.builder.makeLabel("ternary.else"); - try c.genBoolExpr(data.if3.cond, true_label, new_false_label); + try c.genBoolExpr(conditional.cond, true_label, new_false_label); try c.builder.startBlock(new_false_label); if (c.cond_dummy_ty) |ty| c.cond_dummy_ref = try c.builder.addConstant(.one, ty); - return c.genBoolExpr(c.tree.data[data.if3.body + 1], true_label, false_label); // else + return c.genBoolExpr(conditional.else_expr, true_label, false_label); }, - .cond_expr => { - if (c.tree.value_map.get(data.if3.cond)) |cond| { + .cond_expr => |conditional| { + if (c.tree.value_map.get(conditional.cond)) |cond| { if (cond.toBool(c.comp)) { - return c.genBoolExpr(c.tree.data[data.if3.body], true_label, false_label); // then + return c.genBoolExpr(conditional.then_expr, true_label, false_label); } else { - return c.genBoolExpr(c.tree.data[data.if3.body + 1], true_label, false_label); // else + return c.genBoolExpr(conditional.else_expr, true_label, false_label); } } const new_true_label = try c.builder.makeLabel("ternary.then"); const new_false_label = try c.builder.makeLabel("ternary.else"); - try c.genBoolExpr(data.if3.cond, new_true_label, new_false_label); + try c.genBoolExpr(conditional.cond, new_true_label, new_false_label); try c.builder.startBlock(new_true_label); - try c.genBoolExpr(c.tree.data[data.if3.body], true_label, false_label); // then + try c.genBoolExpr(conditional.then_expr, true_label, false_label); try c.builder.startBlock(new_false_label); if (c.cond_dummy_ty) |ty| c.cond_dummy_ref = try c.builder.addConstant(.one, ty); - return c.genBoolExpr(c.tree.data[data.if3.body + 1], true_label, false_label); // else + return c.genBoolExpr(conditional.else_expr, true_label, false_label); }, else => {}, } @@ -1157,46 +1068,43 @@ fn genBoolExpr(c: *CodeGen, base: NodeIndex, true_label: Ir.Ref, false_label: Ir // Assume int operand. const lhs = try c.genExpr(node); - const rhs = try c.builder.addConstant(.zero, try c.genType(c.node_ty[@intFromEnum(node)])); + const rhs = try c.builder.addConstant(.zero, try c.genType(node.qt(c.tree))); const cmp = try c.builder.addInst(.cmp_ne, .{ .bin = .{ .lhs = lhs, .rhs = rhs } }, .i1); if (c.cond_dummy_ty != null) c.cond_dummy_ref = cmp; try c.addBranch(cmp, true_label, false_label); } -fn genBuiltinCall(c: *CodeGen, builtin: Builtin, arg_nodes: []const NodeIndex, ty: Type) Error!Ir.Ref { +fn genBuiltinCall(c: *CodeGen, builtin: Builtin, arg_nodes: []const Node.Index, qt: QualType) Error!Ir.Ref { _ = arg_nodes; - _ = ty; + _ = qt; return c.fail("TODO CodeGen.genBuiltinCall {s}\n", .{Builtin.nameFromTag(builtin.tag).span()}); } -fn genCall(c: *CodeGen, fn_node: NodeIndex, arg_nodes: []const NodeIndex, ty: Type) Error!Ir.Ref { +fn genCall(c: *CodeGen, call: Node.Call) Error!Ir.Ref { // Detect direct calls. const fn_ref = blk: { - const data = c.node_data[@intFromEnum(fn_node)]; - if (c.node_tag[@intFromEnum(fn_node)] != .implicit_cast or data.cast.kind != .function_to_pointer) { - break :blk try c.genExpr(fn_node); + const callee = call.callee.get(c.tree); + if (callee != .cast or callee.cast.kind != .function_to_pointer) { + break :blk try c.genExpr(call.callee); } - var cur = @intFromEnum(data.cast.operand); - while (true) switch (c.node_tag[cur]) { - .paren_expr, .addr_of_expr, .deref_expr => { - cur = @intFromEnum(c.node_data[cur].un); - }, - .implicit_cast => { - const cast = c.node_data[cur].cast; + var cur = callee.cast.operand; + while (true) switch (cur.get(c.tree)) { + .paren_expr, .addr_of_expr, .deref_expr => |un| cur = un.operand, + .cast => |cast| { if (cast.kind != .function_to_pointer) { - break :blk try c.genExpr(fn_node); + break :blk try c.genExpr(call.callee); } - cur = @intFromEnum(cast.operand); + cur = cast.operand; }, - .decl_ref_expr => { - const slice = c.tree.tokSlice(c.node_data[cur].decl_ref); - const name = try StrInt.intern(c.comp, slice); + .decl_ref_expr => |decl_ref| { + const slice = c.tree.tokSlice(decl_ref.name_tok); + const name = try c.comp.internString(slice); var i = c.symbols.items.len; while (i > 0) { i -= 1; if (c.symbols.items[i].name == name) { - break :blk try c.genExpr(fn_node); + break :blk try c.genExpr(call.callee); } } @@ -1205,56 +1113,55 @@ fn genCall(c: *CodeGen, fn_node: NodeIndex, arg_nodes: []const NodeIndex, ty: Ty try c.builder.instructions.append(c.builder.gpa, .{ .tag = .symbol, .data = .{ .label = duped_name }, .ty = .ptr }); break :blk ref; }, - else => break :blk try c.genExpr(fn_node), + else => break :blk try c.genExpr(call.callee), }; }; - const args = try c.builder.arena.allocator().alloc(Ir.Ref, arg_nodes.len); - for (arg_nodes, args) |node, *arg| { + const args = try c.builder.arena.allocator().alloc(Ir.Ref, call.args.len); + for (call.args, args) |node, *arg| { // TODO handle calling convention here arg.* = try c.genExpr(node); } // TODO handle variadic call - const call = try c.builder.arena.allocator().create(Ir.Inst.Call); - call.* = .{ + const call_inst = try c.builder.arena.allocator().create(Ir.Inst.Call); + call_inst.* = .{ .func = fn_ref, .args_len = @intCast(args.len), .args_ptr = args.ptr, }; - return c.builder.addInst(.call, .{ .call = call }, try c.genType(ty)); + return c.builder.addInst(.call, .{ .call = call_inst }, try c.genType(call.qt)); } -fn genCompoundAssign(c: *CodeGen, node: NodeIndex, tag: Ir.Inst.Tag) Error!Ir.Ref { - const bin = c.node_data[@intFromEnum(node)].bin; - const ty = c.node_ty[@intFromEnum(node)]; - const rhs = try c.genExpr(bin.rhs); +fn genCompoundAssign(c: *CodeGen, bin: Node.Binary) Error!Ir.Ref { const lhs = try c.genLval(bin.lhs); - const res = try c.addBin(tag, lhs, rhs, ty); - try c.builder.addStore(lhs, res); - return res; + + const old_dummy = c.compound_assign_dummy; + defer c.compound_assign_dummy = old_dummy; + c.compound_assign_dummy = lhs; + + const rhs = try c.genExpr(bin.rhs); + try c.builder.addStore(lhs, rhs); + return rhs; } -fn genBinOp(c: *CodeGen, node: NodeIndex, tag: Ir.Inst.Tag) Error!Ir.Ref { - const bin = c.node_data[@intFromEnum(node)].bin; - const ty = c.node_ty[@intFromEnum(node)]; +fn genBinOp(c: *CodeGen, bin: Node.Binary, tag: Ir.Inst.Tag) Error!Ir.Ref { const lhs = try c.genExpr(bin.lhs); const rhs = try c.genExpr(bin.rhs); - return c.addBin(tag, lhs, rhs, ty); + return c.addBin(tag, lhs, rhs, bin.qt); } -fn genComparison(c: *CodeGen, node: NodeIndex, tag: Ir.Inst.Tag) Error!Ir.Ref { - const bin = c.node_data[@intFromEnum(node)].bin; +fn genComparison(c: *CodeGen, bin: Node.Binary, tag: Ir.Inst.Tag) Error!Ir.Ref { const lhs = try c.genExpr(bin.lhs); const rhs = try c.genExpr(bin.rhs); return c.builder.addInst(tag, .{ .bin = .{ .lhs = lhs, .rhs = rhs } }, .i1); } -fn genPtrArithmetic(c: *CodeGen, ptr: Ir.Ref, offset: Ir.Ref, offset_ty: Type, ty: Type) Error!Ir.Ref { +fn genPtrArithmetic(c: *CodeGen, ptr: Ir.Ref, offset: Ir.Ref, offset_ty: QualType, qt: QualType) Error!Ir.Ref { // TODO consider adding a getelemptr instruction - const size = ty.elemType().sizeof(c.comp).?; + const size = qt.childType(c.comp).sizeof(c.comp); if (size == 1) { - return c.builder.addInst(.add, .{ .bin = .{ .lhs = ptr, .rhs = offset } }, try c.genType(ty)); + return c.builder.addInst(.add, .{ .bin = .{ .lhs = ptr, .rhs = offset } }, try c.genType(qt)); } const size_inst = try c.builder.addConstant((try Value.int(size, c.comp)).ref(), try c.genType(offset_ty)); @@ -1262,21 +1169,19 @@ fn genPtrArithmetic(c: *CodeGen, ptr: Ir.Ref, offset: Ir.Ref, offset_ty: Type, t return c.addBin(.add, ptr, offset_inst, offset_ty); } -fn genInitializer(c: *CodeGen, ptr: Ir.Ref, dest_ty: Type, initializer: NodeIndex) Error!void { - std.debug.assert(initializer != .none); - switch (c.node_tag[@intFromEnum(initializer)]) { - .array_init_expr_two, +fn genInitializer(c: *CodeGen, ptr: Ir.Ref, dest_ty: QualType, initializer: Node.Index) Error!void { + const node = initializer.get(c.tree); + switch (node) { .array_init_expr, - .struct_init_expr_two, .struct_init_expr, .union_init_expr, .array_filler_expr, .default_init_expr, - => return c.fail("TODO CodeGen.genInitializer {}\n", .{c.node_tag[@intFromEnum(initializer)]}), + => return c.fail("TODO CodeGen.genInitializer {s}\n", .{@tagName(node)}), .string_literal_expr => { const val = c.tree.value_map.get(initializer).?; const str_ptr = try c.builder.addConstant(val.ref(), .ptr); - if (dest_ty.isArray()) { + if (dest_ty.is(c.comp, .array)) { return c.fail("TODO memcpy\n", .{}); } else { try c.builder.addStore(ptr, str_ptr); @@ -1289,7 +1194,7 @@ fn genInitializer(c: *CodeGen, ptr: Ir.Ref, dest_ty: Type, initializer: NodeInde } } -fn genVar(c: *CodeGen, decl: NodeIndex) Error!void { +fn genVar(c: *CodeGen, decl: Node.Variable) Error!void { _ = decl; return c.fail("TODO CodeGen.genVar\n", .{}); } diff --git a/lib/compiler/aro/aro/Compilation.zig b/lib/compiler/aro/aro/Compilation.zig index 77d60a1e9d6e..f63fe567145d 100644 --- a/lib/compiler/aro/aro/Compilation.zig +++ b/lib/compiler/aro/aro/Compilation.zig @@ -1,26 +1,34 @@ const std = @import("std"); -const Allocator = mem.Allocator; const assert = std.debug.assert; const EpochSeconds = std.time.epoch.EpochSeconds; const mem = std.mem; -const Interner = @import("../backend.zig").Interner; +const Allocator = mem.Allocator; + +const backend = @import("../backend.zig"); +const Interner = backend.Interner; +const CodeGenOptions = backend.CodeGenOptions; + const Builtins = @import("Builtins.zig"); const Builtin = Builtins.Builtin; const Diagnostics = @import("Diagnostics.zig"); +const DepFile = @import("DepFile.zig"); const LangOpts = @import("LangOpts.zig"); -const Source = @import("Source.zig"); -const Tokenizer = @import("Tokenizer.zig"); -const Token = Tokenizer.Token; -const Type = @import("Type.zig"); const Pragma = @import("Pragma.zig"); -const StrInt = @import("StringInterner.zig"); const record_layout = @import("record_layout.zig"); +const Source = @import("Source.zig"); +const StringInterner = @import("StringInterner.zig"); const target_util = @import("target.zig"); +const Tokenizer = @import("Tokenizer.zig"); +const Token = Tokenizer.Token; +const TypeStore = @import("TypeStore.zig"); +const Type = TypeStore.Type; +const QualType = TypeStore.QualType; pub const Error = error{ /// A fatal error has ocurred and compilation has stopped. FatalError, } || Allocator.Error; +pub const AddSourceError = Error || error{FileTooBig}; pub const bit_int_max_bits = std.math.maxInt(u16); const path_buf_stack_limit = 1024; @@ -52,9 +60,20 @@ pub const Environment = struct { /// TODO: not implemented yet c_include_path: ?[]const u8 = null, - /// UNIX timestamp to be used instead of the current date and time in the __DATE__ and __TIME__ macros + /// UNIX timestamp to be used instead of the current date and time in the __DATE__ and __TIME__ macros, and instead of the + /// file modification time in the __TIMESTAMP__ macro source_date_epoch: ?[]const u8 = null, + pub const SourceEpoch = union(enum) { + /// Represents system time when aro is invoked; used for __DATE__ and __TIME__ macros + system: u64, + /// Represents a user-provided time (typically via the SOURCE_DATE_EPOCH environment variable) + /// used for __DATE__, __TIME__, and __TIMESTAMP__ + provided: u64, + + pub const default: @This() = .{ .provided = 0 }; + }; + /// Load all of the environment variables using the std.process API. Do not use if using Aro as a shared library on Linux without libc /// See https://github.com/ziglang/zig/issues/4524 pub fn loadAll(allocator: std.mem.Allocator) !Environment { @@ -85,68 +104,74 @@ pub const Environment = struct { } self.* = undefined; } + + pub fn sourceEpoch(self: *const Environment) !SourceEpoch { + const max_timestamp = 253402300799; // Dec 31 9999 23:59:59 + + if (self.source_date_epoch) |epoch| { + const parsed = std.fmt.parseInt(u64, epoch, 10) catch return error.InvalidEpoch; + if (parsed > max_timestamp) return error.InvalidEpoch; + return .{ .provided = parsed }; + } else { + const timestamp = std.math.cast(u64, std.time.timestamp()) orelse return error.InvalidEpoch; + return .{ .system = std.math.clamp(timestamp, 0, max_timestamp) }; + } + } }; const Compilation = @This(); gpa: Allocator, -diagnostics: Diagnostics, +/// Allocations in this arena live all the way until `Compilation.deinit`. +arena: Allocator, +diagnostics: *Diagnostics, +code_gen_options: CodeGenOptions = .default, environment: Environment = .{}, sources: std.StringArrayHashMapUnmanaged(Source) = .empty, -include_dirs: std.ArrayListUnmanaged([]const u8) = .empty, -system_include_dirs: std.ArrayListUnmanaged([]const u8) = .empty, +/// Allocated into `gpa`, but keys are externally managed. +include_dirs: std.ArrayList([]const u8) = .empty, +/// Allocated into `gpa`, but keys are externally managed. +system_include_dirs: std.ArrayList([]const u8) = .empty, +/// Allocated into `gpa`, but keys are externally managed. +after_include_dirs: std.ArrayList([]const u8) = .empty, +/// Allocated into `gpa`, but keys are externally managed. +framework_dirs: std.ArrayList([]const u8) = .empty, +/// Allocated into `gpa`, but keys are externally managed. +system_framework_dirs: std.ArrayList([]const u8) = .empty, +/// Allocated into `gpa`, but keys are externally managed. +embed_dirs: std.ArrayList([]const u8) = .empty, target: std.Target = @import("builtin").target, +cmodel: std.builtin.CodeModel = .default, pragma_handlers: std.StringArrayHashMapUnmanaged(*Pragma) = .empty, langopts: LangOpts = .{}, -generated_buf: std.ArrayListUnmanaged(u8) = .empty, +generated_buf: std.ArrayList(u8) = .empty, builtins: Builtins = .{}, -types: struct { - wchar: Type = undefined, - uint_least16_t: Type = undefined, - uint_least32_t: Type = undefined, - ptrdiff: Type = undefined, - size: Type = undefined, - va_list: Type = undefined, - pid_t: Type = undefined, - ns_constant_string: struct { - ty: Type = undefined, - record: Type.Record = undefined, - fields: [4]Type.Record.Field = undefined, - int_ty: Type = .{ .specifier = .int, .qual = .{ .@"const" = true } }, - char_ty: Type = .{ .specifier = .char, .qual = .{ .@"const" = true } }, - } = .{}, - file: Type = .{ .specifier = .invalid }, - jmp_buf: Type = .{ .specifier = .invalid }, - sigjmp_buf: Type = .{ .specifier = .invalid }, - ucontext_t: Type = .{ .specifier = .invalid }, - intmax: Type = .{ .specifier = .invalid }, - intptr: Type = .{ .specifier = .invalid }, - int16: Type = .{ .specifier = .invalid }, - int64: Type = .{ .specifier = .invalid }, -} = .{}, -string_interner: StrInt = .{}, +string_interner: StringInterner = .{}, interner: Interner = .{}, +type_store: TypeStore = .{}, /// If this is not null, the directory containing the specified Source will be searched for includes /// Used by MS extensions which allow searching for includes relative to the directory of the main source file. ms_cwd_source_id: ?Source.Id = null, cwd: std.fs.Dir, -pub fn init(gpa: Allocator, cwd: std.fs.Dir) Compilation { +pub fn init(gpa: Allocator, arena: Allocator, diagnostics: *Diagnostics, cwd: std.fs.Dir) Compilation { return .{ .gpa = gpa, - .diagnostics = Diagnostics.init(gpa), + .arena = arena, + .diagnostics = diagnostics, .cwd = cwd, }; } /// Initialize Compilation with default environment, /// pragma handlers and emulation mode set to target. -pub fn initDefault(gpa: Allocator, cwd: std.fs.Dir) !Compilation { +pub fn initDefault(gpa: Allocator, arena: Allocator, diagnostics: *Diagnostics, cwd: std.fs.Dir) !Compilation { var comp: Compilation = .{ .gpa = gpa, + .arena = arena, + .diagnostics = diagnostics, .environment = try Environment.loadAll(gpa), - .diagnostics = Diagnostics.init(gpa), .cwd = cwd, }; errdefer comp.deinit(); @@ -156,82 +181,34 @@ pub fn initDefault(gpa: Allocator, cwd: std.fs.Dir) !Compilation { } pub fn deinit(comp: *Compilation) void { + const gpa = comp.gpa; for (comp.pragma_handlers.values()) |pragma| { pragma.deinit(pragma, comp); } for (comp.sources.values()) |source| { - comp.gpa.free(source.path); - comp.gpa.free(source.buf); - comp.gpa.free(source.splice_locs); + gpa.free(source.path); + gpa.free(source.buf); + gpa.free(source.splice_locs); } - comp.sources.deinit(comp.gpa); - comp.diagnostics.deinit(); - comp.include_dirs.deinit(comp.gpa); - for (comp.system_include_dirs.items) |path| comp.gpa.free(path); - comp.system_include_dirs.deinit(comp.gpa); - comp.pragma_handlers.deinit(comp.gpa); - comp.generated_buf.deinit(comp.gpa); - comp.builtins.deinit(comp.gpa); - comp.string_interner.deinit(comp.gpa); - comp.interner.deinit(comp.gpa); - comp.environment.deinit(comp.gpa); -} - -pub fn getSourceEpoch(self: *const Compilation, max: i64) !?i64 { - const provided = self.environment.source_date_epoch orelse return null; - const parsed = std.fmt.parseInt(i64, provided, 10) catch return error.InvalidEpoch; - if (parsed < 0 or parsed > max) return error.InvalidEpoch; - return parsed; + comp.sources.deinit(gpa); + comp.include_dirs.deinit(gpa); + comp.system_include_dirs.deinit(gpa); + comp.after_include_dirs.deinit(gpa); + comp.framework_dirs.deinit(gpa); + comp.system_framework_dirs.deinit(gpa); + comp.embed_dirs.deinit(gpa); + comp.pragma_handlers.deinit(gpa); + comp.generated_buf.deinit(gpa); + comp.builtins.deinit(gpa); + comp.string_interner.deinit(gpa); + comp.interner.deinit(gpa); + comp.environment.deinit(gpa); + comp.type_store.deinit(gpa); + comp.* = undefined; } -/// Dec 31 9999 23:59:59 -const max_timestamp = 253402300799; - -fn getTimestamp(comp: *Compilation) !u47 { - const provided: ?i64 = comp.getSourceEpoch(max_timestamp) catch blk: { - try comp.addDiagnostic(.{ - .tag = .invalid_source_epoch, - .loc = .{ .id = .unused, .byte_offset = 0, .line = 0 }, - }, &.{}); - break :blk null; - }; - const timestamp = provided orelse std.time.timestamp(); - return @intCast(std.math.clamp(timestamp, 0, max_timestamp)); -} - -fn generateDateAndTime(w: anytype, timestamp: u47) !void { - const epoch_seconds = EpochSeconds{ .secs = timestamp }; - const epoch_day = epoch_seconds.getEpochDay(); - const day_seconds = epoch_seconds.getDaySeconds(); - const year_day = epoch_day.calculateYearDay(); - const month_day = year_day.calculateMonthDay(); - - const month_names = [_][]const u8{ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; - std.debug.assert(std.time.epoch.Month.jan.numeric() == 1); - - const month_name = month_names[month_day.month.numeric() - 1]; - try w.print("#define __DATE__ \"{s} {d: >2} {d}\"\n", .{ - month_name, - month_day.day_index + 1, - year_day.year, - }); - try w.print("#define __TIME__ \"{d:0>2}:{d:0>2}:{d:0>2}\"\n", .{ - day_seconds.getHoursIntoDay(), - day_seconds.getMinutesIntoHour(), - day_seconds.getSecondsIntoMinute(), - }); - - const day_names = [_][]const u8{ "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" }; - const day_name = day_names[@intCast((epoch_day.day + 3) % 7)]; - try w.print("#define __TIMESTAMP__ \"{s} {s} {d: >2} {d:0>2}:{d:0>2}:{d:0>2} {d}\"\n", .{ - day_name, - month_name, - month_day.day_index + 1, - day_seconds.getHoursIntoDay(), - day_seconds.getMinutesIntoHour(), - day_seconds.getSecondsIntoMinute(), - year_day.year, - }); +pub fn internString(comp: *Compilation, str: []const u8) !StringInterner.StringId { + return comp.string_interner.intern(comp.gpa, str); } /// Which set of system defines to generate via generateBuiltinMacros @@ -242,8 +219,26 @@ pub const SystemDefinesMode = enum { include_system_defines, }; -fn generateSystemDefines(comp: *Compilation, w: anytype) !void { +fn generateSystemDefines(comp: *Compilation, w: *std.Io.Writer) !void { + const define = struct { + fn define(_w: *std.Io.Writer, name: []const u8) !void { + try _w.print("#define {s} 1\n", .{name}); + } + }.define; + const defineStd = struct { + fn defineStd(_w: *std.Io.Writer, name: []const u8, is_gnu: bool) !void { + if (is_gnu) { + try _w.print("#define {s} 1\n", .{name}); + } + try _w.print( + \\#define __{s} 1 + \\#define __{s}__ 1 + \\ + , .{ name, name }); + } + }.defineStd; const ptr_width = comp.target.ptrBitWidth(); + const is_gnu = comp.langopts.standard.isGNU(); if (comp.langopts.gnuc_version > 0) { try w.print("#define __GNUC__ {d}\n", .{comp.langopts.gnuc_version / 10_000}); @@ -251,45 +246,90 @@ fn generateSystemDefines(comp: *Compilation, w: anytype) !void { try w.print("#define __GNUC_PATCHLEVEL__ {d}\n", .{comp.langopts.gnuc_version % 100}); } + if (comp.code_gen_options.optimization_level.hasAnyOptimizations()) { + try define(w, "__OPTIMIZE__"); + } + if (comp.code_gen_options.optimization_level.isSizeOptimized()) { + try define(w, "__OPTIMIZE_SIZE__"); + } + // os macros switch (comp.target.os.tag) { - .linux => try w.writeAll( - \\#define linux 1 - \\#define __linux 1 - \\#define __linux__ 1 - \\ - ), - .windows => if (ptr_width == 32) try w.writeAll( - \\#define WIN32 1 - \\#define _WIN32 1 - \\#define __WIN32 1 - \\#define __WIN32__ 1 - \\ - ) else try w.writeAll( - \\#define WIN32 1 - \\#define WIN64 1 - \\#define _WIN32 1 - \\#define _WIN64 1 - \\#define __WIN32 1 - \\#define __WIN64 1 - \\#define __WIN32__ 1 - \\#define __WIN64__ 1 - \\ - ), - .freebsd => try w.print("#define __FreeBSD__ {d}\n", .{comp.target.os.version_range.semver.min.major}), - .netbsd => try w.writeAll("#define __NetBSD__ 1\n"), - .openbsd => try w.writeAll("#define __OpenBSD__ 1\n"), - .dragonfly => try w.writeAll("#define __DragonFly__ 1\n"), - .solaris => try w.writeAll( - \\#define sun 1 - \\#define __sun 1 - \\ - ), - .macos => try w.writeAll( - \\#define __APPLE__ 1 - \\#define __MACH__ 1 - \\ - ), + .linux => try defineStd(w, "linux", is_gnu), + .windows => { + try define(w, "_WIN32"); + if (ptr_width == 64) { + try define(w, "_WIN64"); + } + + if (comp.target.abi.isGnu()) { + try defineStd(w, "WIN32", is_gnu); + try defineStd(w, "WINNT", is_gnu); + if (ptr_width == 64) { + try defineStd(w, "WIN64", is_gnu); + try define(w, "__MINGW64__"); + } + try define(w, "__MSVCRT__"); + try define(w, "__MINGW32__"); + } else if (comp.target.abi == .cygnus) { + try define(w, "__CYGWIN__"); + if (ptr_width == 64) { + try define(w, "__CYGWIN64__"); + } else { + try define(w, "__CYGWIN32__"); + } + } + + if (comp.target.abi.isGnu() or comp.target.abi == .cygnus) { + // MinGW and Cygwin define __declspec(a) to __attribute((a)). + // Like Clang we make the define no op if -fdeclspec is enabled. + if (comp.langopts.declspec_attrs) { + try w.writeAll("#define __declspec __declspec\n"); + } else { + try w.writeAll("#define __declspec(a) __attribute__((a))\n"); + } + if (!comp.langopts.ms_extensions) { + // Provide aliases for the calling convention keywords. + for ([_][]const u8{ "cdecl", "stdcall", "fastcall", "thiscall" }) |keyword| { + try w.print( + \\#define _{[0]s} __attribute__((__{[0]s}__)) + \\#define __{[0]s} __attribute__((__{[0]s}__)) + \\ + , .{keyword}); + } + } + } + }, + .uefi => try define(w, "__UEFI__"), + .freebsd => { + const release = comp.target.os.version_range.semver.min.major; + const cc_version = release * 10_000 + 1; + try w.print( + \\#define __FreeBSD__ {d} + \\#define __FreeBSD_cc_version {d} + \\ + , .{ release, cc_version }); + }, + .ps4, .ps5 => { + try w.writeAll( + \\#define __FreeBSD__ 9 + \\#define __FreeBSD_cc_version 900001 + \\ + ); + }, + .netbsd => try define(w, "__NetBSD__"), + .openbsd => try define(w, "__OpenBSD__"), + .dragonfly => try define(w, "__DragonFly__"), + .solaris => try defineStd(w, "sun", is_gnu), + .macos, + .tvos, + .ios, + .driverkit, + .visionos, + .watchos, + => try define(w, "__APPLE__"), + .wasi => try define(w, "__wasi__"), + .emscripten => try define(w, "__EMSCRIPTEN__"), else => {}, } @@ -300,107 +340,437 @@ fn generateSystemDefines(comp: *Compilation, w: anytype) !void { .openbsd, .dragonfly, .linux, - => try w.writeAll( - \\#define unix 1 - \\#define __unix 1 - \\#define __unix__ 1 - \\ - ), + .haiku, + .hurd, + .solaris, + .aix, + .emscripten, + .ps4, + .ps5, + => try defineStd(w, "unix", is_gnu), + .windows => if (comp.target.abi.isGnu() or comp.target.abi == .cygnus) { + try defineStd(w, "unix", is_gnu); + }, else => {}, } if (comp.target.abi.isAndroid()) { - try w.writeAll("#define __ANDROID__ 1\n"); + try define(w, "__ANDROID__"); } // architecture macros switch (comp.target.cpu.arch) { - .x86_64 => try w.writeAll( - \\#define __amd64__ 1 - \\#define __amd64 1 - \\#define __x86_64 1 - \\#define __x86_64__ 1 - \\ - ), - .x86 => try w.writeAll( - \\#define i386 1 - \\#define __i386 1 - \\#define __i386__ 1 - \\ - ), + .x86, .x86_64 => { + try w.print("#define __code_model_{s}__ 1\n", .{switch (comp.cmodel) { + .default => "small", + else => @tagName(comp.cmodel), + }}); + + if (comp.target.cpu.arch == .x86_64) { + try define(w, "__amd64__"); + try define(w, "__amd64"); + try define(w, "__x86_64__"); + try define(w, "__x86_64"); + + if (comp.target.os.tag == .windows and comp.target.abi == .msvc) { + try w.writeAll( + \\#define _M_X64 100 + \\#define _M_AMD64 100 + \\ + ); + } + } else { + try defineStd(w, "i386", is_gnu); + + if (comp.target.os.tag == .windows and comp.target.abi == .msvc) { + try w.print("#define _M_IX86 {d}\n", .{blk: { + if (comp.target.cpu.model == &std.Target.x86.cpu.i386) break :blk 300; + if (comp.target.cpu.model == &std.Target.x86.cpu.i486) break :blk 400; + if (comp.target.cpu.model == &std.Target.x86.cpu.i586) break :blk 500; + break :blk @as(u32, 600); + }}); + } + } + try define(w, "__SEG_GS"); + try define(w, "__SEG_FS"); + try w.writeAll( + \\#define __seg_gs __attribute__((address_space(256))) + \\#define __seg_fs __attribute__((address_space(257))) + \\ + ); + + if (comp.target.cpu.has(.x86, .sahf) or (comp.langopts.emulate == .clang and comp.target.cpu.arch == .x86)) { + try define(w, "__LAHF_SAHF__"); + } + + const features = comp.target.cpu.features; + for ([_]struct { std.Target.x86.Feature, []const u8 }{ + .{ .aes, "__AES__" }, + .{ .vaes, "__VAES__" }, + .{ .pclmul, "__PCLMUL__" }, + .{ .vpclmulqdq, "__VPCLMULQDQ__" }, + .{ .lzcnt, "__LZCNT__" }, + .{ .rdrnd, "__RDRND__" }, + .{ .fsgsbase, "__FSGSBASE__" }, + .{ .bmi, "__BMI__" }, + .{ .bmi2, "__BMI2__" }, + .{ .popcnt, "__POPCNT__" }, + .{ .rtm, "__RTM__" }, + .{ .prfchw, "__PRFCHW__" }, + .{ .rdseed, "__RDSEED__" }, + .{ .adx, "__ADX__" }, + .{ .tbm, "__TBM__" }, + .{ .lwp, "__LWP__" }, + .{ .mwaitx, "__MWAITX__" }, + .{ .movbe, "__MOVBE__" }, + + .{ .xop, "__XOP__" }, + .{ .fma4, "__FMA4__" }, + .{ .sse4a, "__SSE4A__" }, + + .{ .fma, "__FMA__" }, + .{ .f16c, "__F16C__" }, + .{ .gfni, "__GFNI__" }, + .{ .evex512, "__EVEX512__" }, + .{ .avx10_1_256, "__AVX10_1__" }, + .{ .avx10_1_512, "__AVX10_1_512__" }, + .{ .avx10_2_256, "__AVX10_2__" }, + .{ .avx10_2_512, "__AVX10_2_512__" }, + .{ .avx512cd, "__AVX512CD__" }, + .{ .avx512vpopcntdq, "__AVX512VPOPCNTDQ__" }, + .{ .avx512vnni, "__AVX512VNNI__" }, + .{ .avx512bf16, "__AVX512BF16__" }, + .{ .avx512fp16, "__AVX512FP16__" }, + .{ .avx512dq, "__AVX512DQ__" }, + .{ .avx512bitalg, "__AVX512BITALG__" }, + .{ .avx512bw, "__AVX512BW__" }, + + .{ .avx512vl, "__AVX512VL__" }, + .{ .avx512vl, "__EVEX256__" }, + + .{ .avx512vbmi, "__AVX512VBMI__" }, + .{ .avx512vbmi2, "__AVX512VBMI2__" }, + .{ .avx512ifma, "__AVX512IFMA__" }, + .{ .avx512vp2intersect, "__AVX512VP2INTERSECT__" }, + .{ .sha, "__SHA__" }, + .{ .sha512, "__SHA512__" }, + .{ .fxsr, "__FXSR__" }, + .{ .xsave, "__XSAVE__" }, + .{ .xsaveopt, "__XSAVEOPT__" }, + .{ .xsavec, "__XSAVEC__" }, + .{ .xsaves, "__XSAVES__" }, + .{ .pku, "__PKU__" }, + .{ .clflushopt, "__CLFLUSHOPT__" }, + .{ .clwb, "__CLWB__" }, + .{ .wbnoinvd, "__WBNOINVD__" }, + .{ .shstk, "__SHSTK__" }, + .{ .sgx, "__SGX__" }, + .{ .sm3, "__SM3__" }, + .{ .sm4, "__SM4__" }, + .{ .prefetchi, "__PREFETCHI__" }, + .{ .clzero, "__CLZERO__" }, + .{ .kl, "__KL__" }, + .{ .widekl, "__WIDEKL__" }, + .{ .rdpid, "__RDPID__" }, + .{ .rdpru, "__RDPRU__" }, + .{ .cldemote, "__CLDEMOTE__" }, + .{ .waitpkg, "__WAITPKG__" }, + .{ .movdiri, "__MOVDIRI__" }, + .{ .movdir64b, "__MOVDIR64B__" }, + .{ .movrs, "__MOVRS__" }, + .{ .pconfig, "__PCONFIG__" }, + .{ .ptwrite, "__PTWRITE__" }, + .{ .invpcid, "__INVPCID__" }, + .{ .enqcmd, "__ENQCMD__" }, + .{ .hreset, "__HRESET__" }, + .{ .amx_tile, "__AMX_TILE__" }, + .{ .amx_int8, "__AMX_INT8__" }, + .{ .amx_bf16, "__AMX_BF16__" }, + .{ .amx_fp16, "__AMX_FP16__" }, + .{ .amx_complex, "__AMX_COMPLEX__" }, + .{ .amx_fp8, "__AMX_FP8__" }, + .{ .amx_movrs, "__AMX_MOVRS__" }, + .{ .amx_transpose, "__AMX_TRANSPOSE__" }, + .{ .amx_avx512, "__AMX_AVX512__" }, + .{ .amx_tf32, "__AMX_TF32__" }, + .{ .cmpccxadd, "__CMPCCXADD__" }, + .{ .raoint, "__RAOINT__" }, + .{ .avxifma, "__AVXIFMA__" }, + .{ .avxneconvert, "__AVXNECONVERT__" }, + .{ .avxvnni, "__AVXVNNI__" }, + .{ .avxvnniint16, "__AVXVNNIINT16__" }, + .{ .avxvnniint8, "__AVXVNNIINT8__" }, + .{ .serialize, "__SERIALIZE__" }, + .{ .tsxldtrk, "__TSXLDTRK__" }, + .{ .uintr, "__UINTR__" }, + .{ .usermsr, "__USERMSR__" }, + .{ .crc32, "__CRC32__" }, + .{ .egpr, "__EGPR__" }, + .{ .push2pop2, "__PUSH2POP2__" }, + .{ .ppx, "__PPX__" }, + .{ .ndd, "__NDD__" }, + .{ .ccmp, "__CCMP__" }, + .{ .nf, "__NF__" }, + .{ .cf, "__CF__" }, + .{ .zu, "__ZU__" }, + + .{ .avx512f, "__AVX512F__" }, + .{ .avx2, "__AVX2__" }, + .{ .avx, "__AVX__" }, + .{ .sse4_2, "__SSE4_2__" }, + .{ .sse4_1, "__SSE4_1__" }, + .{ .ssse3, "__SSSE3__" }, + .{ .sse3, "__SSE3__" }, + .{ .sse2, "__SSE2__" }, + .{ .sse, "__SSE__" }, + .{ .sse, "__SSE_MATH__" }, + + .{ .mmx, "__MMX__" }, + }) |fs| { + if (features.isEnabled(@intFromEnum(fs[0]))) { + try define(w, fs[1]); + } + } + + if (comp.langopts.ms_extensions and comp.target.cpu.arch == .x86) { + const level = if (comp.target.cpu.has(.x86, .sse2)) + "2" + else if (comp.target.cpu.has(.x86, .sse)) + "1" + else + "0"; + + try w.print("#define _M_IX86_FP {s}\n", .{level}); + } + + if (comp.target.cpu.hasAll(.x86, &.{ .egpr, .push2pop2, .ppx, .ndd, .ccmp, .nf, .cf, .zu })) { + try define(w, "__APX_F__"); + } + + if (comp.target.cpu.hasAll(.x86, &.{ .egpr, .inline_asm_use_gpr32 })) { + try define(w, "__APX_INLINE_ASM_USE_GPR32__"); + } + + if (comp.target.cpu.has(.x86, .cx8)) { + try define(w, "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8"); + } + if (comp.target.cpu.has(.x86, .cx16) and comp.target.cpu.arch == .x86_64) { + try define(w, "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8"); + } + + if (comp.hasFloat128()) { + try w.writeAll("#define __SIZEOF_FLOAT128__ 16\n"); + } + }, .mips, .mipsel, .mips64, .mips64el, - => try w.writeAll( - \\#define __mips__ 1 - \\#define mips 1 - \\ - ), + => { + try define(w, "__mips__"); + try define(w, "_mips"); + }, .powerpc, .powerpcle, - => try w.writeAll( - \\#define __powerpc__ 1 - \\#define __POWERPC__ 1 - \\#define __ppc__ 1 - \\#define __PPC__ 1 - \\#define _ARCH_PPC 1 - \\ - ), + => { + try define(w, "__powerpc__"); + try define(w, "__POWERPC__"); + try define(w, "__ppc__"); + try define(w, "__PPC__"); + try define(w, "_ARCH_PPC"); + }, .powerpc64, .powerpc64le, - => try w.writeAll( - \\#define __powerpc 1 - \\#define __powerpc__ 1 - \\#define __powerpc64__ 1 - \\#define __POWERPC__ 1 - \\#define __ppc__ 1 - \\#define __ppc64__ 1 - \\#define __PPC__ 1 - \\#define __PPC64__ 1 - \\#define _ARCH_PPC 1 - \\#define _ARCH_PPC64 1 - \\ - ), - .sparc64 => try w.writeAll( - \\#define __sparc__ 1 - \\#define __sparc 1 - \\#define __sparc_v9__ 1 - \\ - ), - .sparc => try w.writeAll( - \\#define __sparc__ 1 - \\#define __sparc 1 - \\ - ), - .arm, .armeb => try w.writeAll( - \\#define __arm__ 1 - \\#define __arm 1 - \\ - ), - .thumb, .thumbeb => try w.writeAll( - \\#define __arm__ 1 - \\#define __arm 1 - \\#define __thumb__ 1 - \\ - ), - .aarch64, .aarch64_be => try w.writeAll("#define __aarch64__ 1\n"), - .msp430 => try w.writeAll( - \\#define MSP430 1 - \\#define __MSP430__ 1 - \\ - ), + => { + try define(w, "__powerpc"); + try define(w, "__powerpc__"); + try define(w, "__powerpc64__"); + try define(w, "__POWERPC__"); + try define(w, "__ppc__"); + try define(w, "__ppc64__"); + try define(w, "__PPC__"); + try define(w, "__PPC64__"); + try define(w, "_ARCH_PPC"); + try define(w, "_ARCH_PPC64"); + }, + .sparc64 => { + try defineStd(w, "sparc", is_gnu); + try define(w, "__sparc_v9__"); + try define(w, "__arch64__"); + if (comp.target.os.tag != .solaris) { + try define(w, "__sparc64__"); + try define(w, "__sparc_v9__"); + try define(w, "__sparcv9__"); + } + }, + .sparc => { + try defineStd(w, "sparc", is_gnu); + if (comp.target.os.tag == .solaris) { + try define(w, "__sparcv8"); + } + }, + .arm, .armeb, .thumb, .thumbeb => { + try define(w, "__arm__"); + try define(w, "__arm"); + if (comp.target.cpu.arch.isThumb()) { + try define(w, "__thumb__"); + } + }, + .aarch64, .aarch64_be => { + try define(w, "__aarch64__"); + if (comp.target.os.tag == .macos) { + try define(w, "__AARCH64_SIMD__"); + if (ptr_width == 32) { + try define(w, "__ARM64_ARCH_8_32__"); + } else { + try define(w, "__ARM64_ARCH_8__"); + } + try define(w, "__ARM_NEON__"); + try define(w, "__arm64"); + try define(w, "__arm64__"); + } + if (comp.target.os.tag == .windows and comp.target.abi == .msvc) { + try w.writeAll("#define _M_ARM64 1\n"); + } + + { + const cmodel = switch (comp.cmodel) { + .default => "small", + else => @tagName(comp.cmodel), + }; + try w.writeAll("#define __AARCH64_CMODEL_"); + for (cmodel) |c| { + try w.writeByte(std.ascii.toUpper(c)); + } + try w.writeAll("__ 1\n"); + } + + if (comp.target.cpu.has(.aarch64, .fp_armv8)) { + try w.writeAll("#define __ARM_FP 0xE\n"); + } + if (comp.target.cpu.has(.aarch64, .neon)) { + try define(w, "__ARM_NEON"); + try w.writeAll("#define __ARM_NEON_FP 0xE\n"); + } + if (comp.target.cpu.has(.aarch64, .bf16)) { + try define(w, "__ARM_FEATURE_BF16"); + try define(w, "__ARM_FEATURE_BF16_VECTOR_ARITHMETIC"); + try define(w, "__ARM_BF16_FORMAT_ALTERNATIVE"); + try define(w, "__ARM_FEATURE_BF16_SCALAR_ARITHMETIC"); + if (comp.target.cpu.has(.aarch64, .sve)) { + try define(w, "__ARM_FEATURE_SVE_BF16"); + } + } + if (comp.target.cpu.hasAll(.aarch64, &.{ .sve2, .sve_aes })) { + try define(w, "__ARM_FEATURE_SVE2_AES"); + } + if (comp.target.cpu.hasAll(.aarch64, &.{ .sve2, .sve_bitperm })) { + try define(w, "__ARM_FEATURE_SVE2_BITPERM"); + } + if (comp.target.cpu.has(.aarch64, .sme)) { + try define(w, "__ARM_FEATURE_SME"); + try define(w, "__ARM_FEATURE_LOCALLY_STREAMING"); + } + if (comp.target.cpu.has(.aarch64, .fmv)) { + try define(w, "__HAVE_FUNCTION_MULTI_VERSIONING"); + } + if (comp.target.cpu.has(.aarch64, .sha3)) { + try define(w, "__ARM_FEATURE_SHA3"); + try define(w, "__ARM_FEATURE_SHA512"); + } + if (comp.target.cpu.has(.aarch64, .sm4)) { + try define(w, "__ARM_FEATURE_SM3"); + try define(w, "__ARM_FEATURE_SM4"); + } + if (!comp.target.cpu.has(.aarch64, .strict_align)) { + try define(w, "__ARM_FEATURE_UNALIGNED"); + } + if (comp.target.cpu.hasAll(.aarch64, &.{ .neon, .fullfp16 })) { + try define(w, "__ARM_FEATURE_FP16_VECTOR_ARITHMETIC"); + } + if (comp.target.cpu.has(.aarch64, .rcpc3)) { + try w.writeAll("#define __ARM_FEATURE_RCPC 3\n"); + } else if (comp.target.cpu.has(.aarch64, .rcpc)) { + try define(w, "__ARM_FEATURE_RCPC"); + } + + const features = comp.target.cpu.features; + for ([_]struct { std.Target.aarch64.Feature, []const u8 }{ + .{ .sve, "SVE" }, + .{ .sve2, "SVE2" }, + .{ .sve2p1, "SVE2p1" }, + .{ .sve2_sha3, "SVE2_SHA3" }, + .{ .sve2_sm4, "SVE2_SM4" }, + .{ .sve_b16b16, "SVE_B16B16" }, + .{ .sme2, "SME2" }, + .{ .sme2p1, "SME2p1" }, + .{ .sme_f16f16, "SME_F16F16" }, + .{ .sme_b16b16, "SME_B16B16" }, + .{ .crc, "CRC32" }, + .{ .aes, "AES" }, + .{ .sha2, "SHA2" }, + .{ .pauth, "PAUTH" }, + .{ .pauth_lr, "PAUTH_LR" }, + .{ .bti, "BTI" }, + .{ .fullfp16, "FP16_SCALAR_ARITHMETIC" }, + .{ .dotprod, "DOTPROD" }, + .{ .mte, "MEMORY_TAGGING" }, + .{ .tme, "TME" }, + .{ .i8mm, "MATMUL_INT8" }, + .{ .lse, "ATOMICS" }, + .{ .f64mm, "SVE_MATMUL_FP64" }, + .{ .f32mm, "SVE_MATMUL_FP32" }, + .{ .i8mm, "SVE_MATMUL_INT8" }, + .{ .fp16fml, "FP16_FML" }, + .{ .ls64, "LS64" }, + .{ .rand, "RNG" }, + .{ .mops, "MOPS" }, + .{ .d128, "SYSREG128" }, + .{ .gcs, "GCS" }, + }) |fs| { + if (features.isEnabled(@intFromEnum(fs[0]))) { + try w.print("#define __ARM_FEATURE_{s} 1\n", .{fs[1]}); + } + } + }, + .msp430 => { + try define(w, "MSP430"); + try define(w, "__MSP430__"); + }, + .arc => { + try define(w, "__arc__"); + }, + .wasm32, .wasm64 => { + try define(w, "__wasm"); + try define(w, "__wasm__"); + if (comp.target.cpu.arch == .wasm32) { + try define(w, "__wasm32"); + try define(w, "__wasm32__"); + } else { + try define(w, "__wasm64"); + try define(w, "__wasm64__"); + } + + for (comp.target.cpu.arch.allFeaturesList()) |feature| { + if (!comp.target.cpu.features.isEnabled(feature.index)) continue; + try w.print("#define __wasm_{s}__ 1\n", .{feature.name}); + } + }, else => {}, } - if (comp.target.os.tag != .windows) switch (ptr_width) { - 64 => try w.writeAll( - \\#define _LP64 1 - \\#define __LP64__ 1 - \\ - ), - 32 => try w.writeAll("#define _ILP32 1\n"), - else => {}, - }; + if (ptr_width == 64 and comp.target.cTypeBitSize(.long) == 32) { + try define(w, "_LP64"); + try define(w, "__LP64__"); + } else if (ptr_width == 32 and comp.target.cTypeBitSize(.long) == 32 and + comp.target.cTypeBitSize(.int) == 32) + { + try define(w, "_ILP32"); + try define(w, "__ILP32__"); + } + + if (comp.hasFloat128()) { + try define(w, "__FLOAT128__"); + } try w.writeAll( \\#define __ORDER_LITTLE_ENDIAN__ 1234 @@ -418,6 +788,21 @@ fn generateSystemDefines(comp: *Compilation, w: anytype) !void { \\ ); + switch (comp.target.ofmt) { + .elf => try define(w, "__ELF__"), + .macho => try define(w, "__MACH__"), + else => {}, + } + + if (comp.target.os.tag.isDarwin()) { + try w.writeAll( + \\#define __nonnull _Nonnull + \\#define __null_unspecified _Null_unspecified + \\#define __nullable _Nullable + \\ + ); + } + // atomics try w.writeAll( \\#define __ATOMIC_RELAXED 0 @@ -453,62 +838,61 @@ fn generateSystemDefines(comp: *Compilation, w: anytype) !void { try w.writeAll("#define __CHAR_BIT__ 8\n"); // int maxs - try comp.generateIntWidth(w, "BOOL", .{ .specifier = .bool }); - try comp.generateIntMaxAndWidth(w, "SCHAR", .{ .specifier = .schar }); - try comp.generateIntMaxAndWidth(w, "SHRT", .{ .specifier = .short }); - try comp.generateIntMaxAndWidth(w, "INT", .{ .specifier = .int }); - try comp.generateIntMaxAndWidth(w, "LONG", .{ .specifier = .long }); - try comp.generateIntMaxAndWidth(w, "LONG_LONG", .{ .specifier = .long_long }); - try comp.generateIntMaxAndWidth(w, "WCHAR", comp.types.wchar); - // try comp.generateIntMax(w, "WINT", comp.types.wchar); - try comp.generateIntMaxAndWidth(w, "INTMAX", comp.types.intmax); - try comp.generateIntMaxAndWidth(w, "SIZE", comp.types.size); - try comp.generateIntMaxAndWidth(w, "UINTMAX", comp.types.intmax.makeIntegerUnsigned()); - try comp.generateIntMaxAndWidth(w, "PTRDIFF", comp.types.ptrdiff); - try comp.generateIntMaxAndWidth(w, "INTPTR", comp.types.intptr); - try comp.generateIntMaxAndWidth(w, "UINTPTR", comp.types.intptr.makeIntegerUnsigned()); + try comp.generateIntWidth(w, "BOOL", .bool); + try comp.generateIntMaxAndWidth(w, "SCHAR", .schar); + try comp.generateIntMaxAndWidth(w, "SHRT", .short); + try comp.generateIntMaxAndWidth(w, "INT", .int); + try comp.generateIntMaxAndWidth(w, "LONG", .long); + try comp.generateIntMaxAndWidth(w, "LONG_LONG", .long_long); + try comp.generateIntMaxAndWidth(w, "WCHAR", comp.type_store.wchar); + // try comp.generateIntMax(w, "WINT", comp.type_store.wchar); + try comp.generateIntMaxAndWidth(w, "INTMAX", comp.type_store.intmax); + try comp.generateIntMaxAndWidth(w, "SIZE", comp.type_store.size); + try comp.generateIntMaxAndWidth(w, "UINTMAX", try comp.type_store.intmax.makeIntUnsigned(comp)); + try comp.generateIntMaxAndWidth(w, "PTRDIFF", comp.type_store.ptrdiff); + try comp.generateIntMaxAndWidth(w, "INTPTR", comp.type_store.intptr); + try comp.generateIntMaxAndWidth(w, "UINTPTR", try comp.type_store.intptr.makeIntUnsigned(comp)); try comp.generateIntMaxAndWidth(w, "SIG_ATOMIC", target_util.sigAtomicType(comp.target)); // int widths try w.print("#define __BITINT_MAXWIDTH__ {d}\n", .{bit_int_max_bits}); // sizeof types - try comp.generateSizeofType(w, "__SIZEOF_FLOAT__", .{ .specifier = .float }); - try comp.generateSizeofType(w, "__SIZEOF_DOUBLE__", .{ .specifier = .double }); - try comp.generateSizeofType(w, "__SIZEOF_LONG_DOUBLE__", .{ .specifier = .long_double }); - try comp.generateSizeofType(w, "__SIZEOF_SHORT__", .{ .specifier = .short }); - try comp.generateSizeofType(w, "__SIZEOF_INT__", .{ .specifier = .int }); - try comp.generateSizeofType(w, "__SIZEOF_LONG__", .{ .specifier = .long }); - try comp.generateSizeofType(w, "__SIZEOF_LONG_LONG__", .{ .specifier = .long_long }); - try comp.generateSizeofType(w, "__SIZEOF_POINTER__", .{ .specifier = .pointer }); - try comp.generateSizeofType(w, "__SIZEOF_PTRDIFF_T__", comp.types.ptrdiff); - try comp.generateSizeofType(w, "__SIZEOF_SIZE_T__", comp.types.size); - try comp.generateSizeofType(w, "__SIZEOF_WCHAR_T__", comp.types.wchar); - // try comp.generateSizeofType(w, "__SIZEOF_WINT_T__", .{ .specifier = .pointer }); + try comp.generateSizeofType(w, "__SIZEOF_FLOAT__", .float); + try comp.generateSizeofType(w, "__SIZEOF_DOUBLE__", .double); + try comp.generateSizeofType(w, "__SIZEOF_LONG_DOUBLE__", .long_double); + try comp.generateSizeofType(w, "__SIZEOF_SHORT__", .short); + try comp.generateSizeofType(w, "__SIZEOF_INT__", .int); + try comp.generateSizeofType(w, "__SIZEOF_LONG__", .long); + try comp.generateSizeofType(w, "__SIZEOF_LONG_LONG__", .long_long); + try comp.generateSizeofType(w, "__SIZEOF_POINTER__", .void_pointer); + try comp.generateSizeofType(w, "__SIZEOF_PTRDIFF_T__", comp.type_store.ptrdiff); + try comp.generateSizeofType(w, "__SIZEOF_SIZE_T__", comp.type_store.size); + try comp.generateSizeofType(w, "__SIZEOF_WCHAR_T__", comp.type_store.wchar); + // try comp.generateSizeofType(w, "__SIZEOF_WINT_T__", .void_pointer); if (target_util.hasInt128(comp.target)) { - try comp.generateSizeofType(w, "__SIZEOF_INT128__", .{ .specifier = .int128 }); + try comp.generateSizeofType(w, "__SIZEOF_INT128__", .int128); } // various int types - const mapper = comp.string_interner.getSlowTypeMapper(); - try generateTypeMacro(w, mapper, "__INTPTR_TYPE__", comp.types.intptr, comp.langopts); - try generateTypeMacro(w, mapper, "__UINTPTR_TYPE__", comp.types.intptr.makeIntegerUnsigned(), comp.langopts); + try comp.generateTypeMacro(w, "__INTPTR_TYPE__", comp.type_store.intptr); + try comp.generateTypeMacro(w, "__UINTPTR_TYPE__", try comp.type_store.intptr.makeIntUnsigned(comp)); - try generateTypeMacro(w, mapper, "__INTMAX_TYPE__", comp.types.intmax, comp.langopts); - try comp.generateSuffixMacro("__INTMAX", w, comp.types.intptr); + try comp.generateTypeMacro(w, "__INTMAX_TYPE__", comp.type_store.intmax); + try comp.generateSuffixMacro("__INTMAX", w, comp.type_store.intptr); - try generateTypeMacro(w, mapper, "__UINTMAX_TYPE__", comp.types.intmax.makeIntegerUnsigned(), comp.langopts); - try comp.generateSuffixMacro("__UINTMAX", w, comp.types.intptr.makeIntegerUnsigned()); + try comp.generateTypeMacro(w, "__UINTMAX_TYPE__", try comp.type_store.intmax.makeIntUnsigned(comp)); + try comp.generateSuffixMacro("__UINTMAX", w, try comp.type_store.intptr.makeIntUnsigned(comp)); - try generateTypeMacro(w, mapper, "__PTRDIFF_TYPE__", comp.types.ptrdiff, comp.langopts); - try generateTypeMacro(w, mapper, "__SIZE_TYPE__", comp.types.size, comp.langopts); - try generateTypeMacro(w, mapper, "__WCHAR_TYPE__", comp.types.wchar, comp.langopts); - try generateTypeMacro(w, mapper, "__CHAR16_TYPE__", comp.types.uint_least16_t, comp.langopts); - try generateTypeMacro(w, mapper, "__CHAR32_TYPE__", comp.types.uint_least32_t, comp.langopts); + try comp.generateTypeMacro(w, "__PTRDIFF_TYPE__", comp.type_store.ptrdiff); + try comp.generateTypeMacro(w, "__SIZE_TYPE__", comp.type_store.size); + try comp.generateTypeMacro(w, "__WCHAR_TYPE__", comp.type_store.wchar); + try comp.generateTypeMacro(w, "__CHAR16_TYPE__", comp.type_store.uint_least16_t); + try comp.generateTypeMacro(w, "__CHAR32_TYPE__", comp.type_store.uint_least32_t); - try comp.generateExactWidthTypes(w, mapper); - try comp.generateFastAndLeastWidthTypes(w, mapper); + try comp.generateExactWidthTypes(w); + try comp.generateFastAndLeastWidthTypes(w); if (target_util.FPSemantics.halfPrecisionType(comp.target)) |half| { try generateFloatMacros(w, "FLT16", half, "F16"); @@ -527,17 +911,47 @@ fn generateSystemDefines(comp: *Compilation, w: anytype) !void { \\#define __DECIMAL_DIG__ __LDBL_DECIMAL_DIG__ \\ ); + + switch (comp.code_gen_options.pic_level) { + .none => {}, + .one, .two => { + try w.print( + \\#define __pic__ {0d} + \\#define __PIC__ {0d} + \\ + , .{@intFromEnum(comp.code_gen_options.pic_level)}); + if (comp.code_gen_options.is_pie) { + try w.print( + \\#define __pie__ {0d} + \\#define __PIE__ {0d} + \\ + , .{@intFromEnum(comp.code_gen_options.pic_level)}); + } + }, + } } /// Generate builtin macros that will be available to each source file. -pub fn generateBuiltinMacros(comp: *Compilation, system_defines_mode: SystemDefinesMode) !Source { - try comp.generateBuiltinTypes(); +pub fn generateBuiltinMacros(comp: *Compilation, system_defines_mode: SystemDefinesMode) AddSourceError!Source { + try comp.type_store.initNamedTypes(comp); + + var allocating: std.io.Writer.Allocating = try .initCapacity(comp.gpa, 2 << 13); + defer allocating.deinit(); + + comp.writeBuiltinMacros(system_defines_mode, &allocating.writer) catch |err| switch (err) { + error.WriteFailed, error.OutOfMemory => return error.OutOfMemory, + }; + + if (allocating.written().len > std.math.maxInt(u32)) return error.FileTooBig; - var buf = std.array_list.Managed(u8).init(comp.gpa); - defer buf.deinit(); + const contents = try allocating.toOwnedSlice(); + errdefer comp.gpa.free(contents); + return comp.addSourceFromOwnedBuffer("", contents, .user); +} +fn writeBuiltinMacros(comp: *Compilation, system_defines_mode: SystemDefinesMode, w: *std.Io.Writer) !void { if (system_defines_mode == .include_system_defines) { - try buf.appendSlice( + try w.writeAll( \\#define __VERSION__ "Aro ++ " " ++ @import("../backend.zig").version_str ++ "\"\n" ++ \\#define __Aro__ @@ -545,14 +959,13 @@ pub fn generateBuiltinMacros(comp: *Compilation, system_defines_mode: SystemDefi ); } - try buf.appendSlice("#define __STDC__ 1\n"); - try buf.writer().print("#define __STDC_HOSTED__ {d}\n", .{@intFromBool(comp.target.os.tag != .freestanding)}); + if (comp.langopts.emulate != .msvc) { + try w.writeAll("#define __STDC__ 1\n"); + } + try w.print("#define __STDC_HOSTED__ {d}\n", .{@intFromBool(comp.target.os.tag != .freestanding)}); // standard macros - try buf.appendSlice( - \\#define __STDC_NO_COMPLEX__ 1 - \\#define __STDC_NO_THREADS__ 1 - \\#define __STDC_NO_VLA__ 1 + try w.writeAll( \\#define __STDC_UTF_16__ 1 \\#define __STDC_UTF_32__ 1 \\#define __STDC_EMBED_NOT_FOUND__ 0 @@ -560,24 +973,38 @@ pub fn generateBuiltinMacros(comp: *Compilation, system_defines_mode: SystemDefi \\#define __STDC_EMBED_EMPTY__ 2 \\ ); + if (comp.langopts.standard.atLeast(.c11)) switch (comp.target.os.tag) { + .openbsd, .driverkit, .ios, .macos, .tvos, .visionos, .watchos => { + try w.writeAll("#define __STDC_NO_THREADS__ 1\n"); + }, + .ps4, .ps5 => { + try w.writeAll( + \\#define __STDC_NO_THREADS__ 1 + \\#define __STDC_NO_COMPLEX__ 1 + \\ + ); + }, + .aix => { + try w.writeAll( + \\#define __STDC_NO_THREADS__ 1 + \\#define __STDC_NO_ATOMICS__ 1 + \\ + ); + }, + else => {}, + }; if (comp.langopts.standard.StdCVersionMacro()) |stdc_version| { - try buf.appendSlice("#define __STDC_VERSION__ "); - try buf.appendSlice(stdc_version); - try buf.append('\n'); + try w.writeAll("#define __STDC_VERSION__ "); + try w.writeAll(stdc_version); + try w.writeByte('\n'); } - // timestamps - const timestamp = try comp.getTimestamp(); - try generateDateAndTime(buf.writer(), timestamp); - if (system_defines_mode == .include_system_defines) { - try comp.generateSystemDefines(buf.writer()); + try comp.generateSystemDefines(w); } - - return comp.addSourceFromBuffer("", buf.items); } -fn generateFloatMacros(w: anytype, prefix: []const u8, semantics: target_util.FPSemantics, ext: []const u8) !void { +fn generateFloatMacros(w: *std.Io.Writer, prefix: []const u8, semantics: target_util.FPSemantics, ext: []const u8) !void { const denormMin = semantics.chooseValue( []const u8, .{ @@ -633,137 +1060,61 @@ fn generateFloatMacros(w: anytype, prefix: []const u8, semantics: target_util.FP }, ); - var def_prefix_buf: [32]u8 = undefined; - const prefix_slice = std.fmt.bufPrint(&def_prefix_buf, "__{s}_", .{prefix}) catch - return error.OutOfMemory; - - try w.print("#define {s}DENORM_MIN__ {s}{s}\n", .{ prefix_slice, denormMin, ext }); - try w.print("#define {s}HAS_DENORM__\n", .{prefix_slice}); - try w.print("#define {s}DIG__ {d}\n", .{ prefix_slice, digits }); - try w.print("#define {s}DECIMAL_DIG__ {d}\n", .{ prefix_slice, decimalDigits }); + try w.print("#define __{s}_DENORM_MIN__ {s}{s}\n", .{ prefix, denormMin, ext }); + try w.print("#define __{s}_HAS_DENORM__\n", .{prefix}); + try w.print("#define __{s}_DIG__ {d}\n", .{ prefix, digits }); + try w.print("#define __{s}_DECIMAL_DIG__ {d}\n", .{ prefix, decimalDigits }); - try w.print("#define {s}EPSILON__ {s}{s}\n", .{ prefix_slice, epsilon, ext }); - try w.print("#define {s}HAS_INFINITY__\n", .{prefix_slice}); - try w.print("#define {s}HAS_QUIET_NAN__\n", .{prefix_slice}); - try w.print("#define {s}MANT_DIG__ {d}\n", .{ prefix_slice, mantissaDigits }); + try w.print("#define __{s}_EPSILON__ {s}{s}\n", .{ prefix, epsilon, ext }); + try w.print("#define __{s}_HAS_INFINITY__\n", .{prefix}); + try w.print("#define __{s}_HAS_QUIET_NAN__\n", .{prefix}); + try w.print("#define __{s}_MANT_DIG__ {d}\n", .{ prefix, mantissaDigits }); - try w.print("#define {s}MAX_10_EXP__ {d}\n", .{ prefix_slice, max10Exp }); - try w.print("#define {s}MAX_EXP__ {d}\n", .{ prefix_slice, maxExp }); - try w.print("#define {s}MAX__ {s}{s}\n", .{ prefix_slice, max, ext }); + try w.print("#define __{s}_MAX_10_EXP__ {d}\n", .{ prefix, max10Exp }); + try w.print("#define __{s}_MAX_EXP__ {d}\n", .{ prefix, maxExp }); + try w.print("#define __{s}_MAX__ {s}{s}\n", .{ prefix, max, ext }); - try w.print("#define {s}MIN_10_EXP__ ({d})\n", .{ prefix_slice, min10Exp }); - try w.print("#define {s}MIN_EXP__ ({d})\n", .{ prefix_slice, minExp }); - try w.print("#define {s}MIN__ {s}{s}\n", .{ prefix_slice, min, ext }); + try w.print("#define __{s}_MIN_10_EXP__ ({d})\n", .{ prefix, min10Exp }); + try w.print("#define __{s}_MIN_EXP__ ({d})\n", .{ prefix, minExp }); + try w.print("#define __{s}_MIN__ {s}{s}\n", .{ prefix, min, ext }); } -fn generateTypeMacro(w: anytype, mapper: StrInt.TypeMapper, name: []const u8, ty: Type, langopts: LangOpts) !void { +fn generateTypeMacro(comp: *const Compilation, w: *std.Io.Writer, name: []const u8, qt: QualType) !void { try w.print("#define {s} ", .{name}); - try ty.print(mapper, langopts, w); + try qt.print(comp, w); try w.writeByte('\n'); } -fn generateBuiltinTypes(comp: *Compilation) !void { - const os = comp.target.os.tag; - const wchar: Type = switch (comp.target.cpu.arch) { - .xcore => .{ .specifier = .uchar }, - .ve, .msp430 => .{ .specifier = .uint }, - .arm, .armeb, .thumb, .thumbeb => .{ - .specifier = if (os != .windows and os != .netbsd and os != .openbsd) .uint else .int, - }, - .aarch64, .aarch64_be => .{ - .specifier = if (!os.isDarwin() and os != .netbsd) .uint else .int, - }, - .x86_64, .x86 => .{ .specifier = if (os == .windows) .ushort else .int }, - else => .{ .specifier = .int }, - }; - - const ptr_width = comp.target.ptrBitWidth(); - const ptrdiff = if (os == .windows and ptr_width == 64) - Type{ .specifier = .long_long } - else switch (ptr_width) { - 16 => Type{ .specifier = .int }, - 32 => Type{ .specifier = .int }, - 64 => Type{ .specifier = .long }, - else => unreachable, - }; - - const size = if (os == .windows and ptr_width == 64) - Type{ .specifier = .ulong_long } - else switch (ptr_width) { - 16 => Type{ .specifier = .uint }, - 32 => Type{ .specifier = .uint }, - 64 => Type{ .specifier = .ulong }, - else => unreachable, - }; - - const va_list = try comp.generateVaListType(); - - const pid_t: Type = switch (os) { - .haiku => .{ .specifier = .long }, - // Todo: pid_t is required to "a signed integer type"; are there any systems - // on which it is `short int`? - else => .{ .specifier = .int }, - }; - - const intmax = target_util.intMaxType(comp.target); - const intptr = target_util.intPtrType(comp.target); - const int16 = target_util.int16Type(comp.target); - const int64 = target_util.int64Type(comp.target); - - comp.types = .{ - .wchar = wchar, - .ptrdiff = ptrdiff, - .size = size, - .va_list = va_list, - .pid_t = pid_t, - .intmax = intmax, - .intptr = intptr, - .int16 = int16, - .int64 = int64, - .uint_least16_t = comp.intLeastN(16, .unsigned), - .uint_least32_t = comp.intLeastN(32, .unsigned), - }; - - try comp.generateNsConstantStringType(); -} - -pub fn float80Type(comp: *const Compilation) ?Type { +pub fn float80Type(comp: *const Compilation) ?QualType { if (comp.langopts.emulate != .gcc) return null; return target_util.float80Type(comp.target); } /// Smallest integer type with at least N bits -pub fn intLeastN(comp: *const Compilation, bits: usize, signedness: std.builtin.Signedness) Type { +pub fn intLeastN(comp: *const Compilation, bits: usize, signedness: std.builtin.Signedness) QualType { if (bits == 64 and (comp.target.os.tag.isDarwin() or comp.target.cpu.arch.isWasm())) { // WebAssembly and Darwin use `long long` for `int_least64_t` and `int_fast64_t`. - return .{ .specifier = if (signedness == .signed) .long_long else .ulong_long }; + return if (signedness == .signed) .long_long else .ulong_long; } if (bits == 16 and comp.target.cpu.arch == .avr) { // AVR uses int for int_least16_t and int_fast16_t. - return .{ .specifier = if (signedness == .signed) .int else .uint }; + return if (signedness == .signed) .int else .uint; } - const candidates = switch (signedness) { - .signed => &[_]Type.Specifier{ .schar, .short, .int, .long, .long_long }, - .unsigned => &[_]Type.Specifier{ .uchar, .ushort, .uint, .ulong, .ulong_long }, + const candidates: [5]QualType = switch (signedness) { + .signed => .{ .schar, .short, .int, .long, .long_long }, + .unsigned => .{ .uchar, .ushort, .uint, .ulong, .ulong_long }, }; - for (candidates) |specifier| { - const ty: Type = .{ .specifier = specifier }; - if (ty.sizeof(comp).? * 8 >= bits) return ty; + for (candidates) |qt| { + if (qt.bitSizeof(comp) >= bits) return qt; } else unreachable; } -fn intSize(comp: *const Compilation, specifier: Type.Specifier) u64 { - const ty = Type{ .specifier = specifier }; - return ty.sizeof(comp).?; -} - fn generateFastOrLeastType( comp: *Compilation, bits: usize, kind: enum { least, fast }, signedness: std.builtin.Signedness, - w: anytype, - mapper: StrInt.TypeMapper, + w: *std.Io.Writer, ) !void { const ty = comp.intLeastN(bits, signedness); // defining the fast types as the least types is permitted @@ -780,9 +1131,9 @@ fn generateFastOrLeastType( const full = std.fmt.bufPrint(&buf, "{s}{s}{d}{s}", .{ base_name, kind_str, bits, suffix, - }) catch return error.OutOfMemory; + }) catch unreachable; - try generateTypeMacro(w, mapper, full, ty, comp.langopts); + try comp.generateTypeMacro(w, full, ty); const prefix = full[2 .. full.len - suffix.len]; // remove "__" and "_TYPE__" @@ -793,104 +1144,104 @@ fn generateFastOrLeastType( try comp.generateFmt(prefix, w, ty); } -fn generateFastAndLeastWidthTypes(comp: *Compilation, w: anytype, mapper: StrInt.TypeMapper) !void { +fn generateFastAndLeastWidthTypes(comp: *Compilation, w: *std.Io.Writer) !void { const sizes = [_]usize{ 8, 16, 32, 64 }; for (sizes) |size| { - try comp.generateFastOrLeastType(size, .least, .signed, w, mapper); - try comp.generateFastOrLeastType(size, .least, .unsigned, w, mapper); - try comp.generateFastOrLeastType(size, .fast, .signed, w, mapper); - try comp.generateFastOrLeastType(size, .fast, .unsigned, w, mapper); + try comp.generateFastOrLeastType(size, .least, .signed, w); + try comp.generateFastOrLeastType(size, .least, .unsigned, w); + try comp.generateFastOrLeastType(size, .fast, .signed, w); + try comp.generateFastOrLeastType(size, .fast, .unsigned, w); } } -fn generateExactWidthTypes(comp: *const Compilation, w: anytype, mapper: StrInt.TypeMapper) !void { - try comp.generateExactWidthType(w, mapper, .schar); +fn generateExactWidthTypes(comp: *Compilation, w: *std.Io.Writer) !void { + try comp.generateExactWidthType(w, .schar); - if (comp.intSize(.short) > comp.intSize(.char)) { - try comp.generateExactWidthType(w, mapper, .short); + if (QualType.short.sizeof(comp) > QualType.char.sizeof(comp)) { + try comp.generateExactWidthType(w, .short); } - if (comp.intSize(.int) > comp.intSize(.short)) { - try comp.generateExactWidthType(w, mapper, .int); + if (QualType.int.sizeof(comp) > QualType.short.sizeof(comp)) { + try comp.generateExactWidthType(w, .int); } - if (comp.intSize(.long) > comp.intSize(.int)) { - try comp.generateExactWidthType(w, mapper, .long); + if (QualType.long.sizeof(comp) > QualType.int.sizeof(comp)) { + try comp.generateExactWidthType(w, .long); } - if (comp.intSize(.long_long) > comp.intSize(.long)) { - try comp.generateExactWidthType(w, mapper, .long_long); + if (QualType.long_long.sizeof(comp) > QualType.long.sizeof(comp)) { + try comp.generateExactWidthType(w, .long_long); } - try comp.generateExactWidthType(w, mapper, .uchar); + try comp.generateExactWidthType(w, .uchar); try comp.generateExactWidthIntMax(w, .uchar); try comp.generateExactWidthIntMax(w, .schar); - if (comp.intSize(.short) > comp.intSize(.char)) { - try comp.generateExactWidthType(w, mapper, .ushort); + if (QualType.short.sizeof(comp) > QualType.char.sizeof(comp)) { + try comp.generateExactWidthType(w, .ushort); try comp.generateExactWidthIntMax(w, .ushort); try comp.generateExactWidthIntMax(w, .short); } - if (comp.intSize(.int) > comp.intSize(.short)) { - try comp.generateExactWidthType(w, mapper, .uint); + if (QualType.int.sizeof(comp) > QualType.short.sizeof(comp)) { + try comp.generateExactWidthType(w, .uint); try comp.generateExactWidthIntMax(w, .uint); try comp.generateExactWidthIntMax(w, .int); } - if (comp.intSize(.long) > comp.intSize(.int)) { - try comp.generateExactWidthType(w, mapper, .ulong); + if (QualType.long.sizeof(comp) > QualType.int.sizeof(comp)) { + try comp.generateExactWidthType(w, .ulong); try comp.generateExactWidthIntMax(w, .ulong); try comp.generateExactWidthIntMax(w, .long); } - if (comp.intSize(.long_long) > comp.intSize(.long)) { - try comp.generateExactWidthType(w, mapper, .ulong_long); + if (QualType.long_long.sizeof(comp) > QualType.long.sizeof(comp)) { + try comp.generateExactWidthType(w, .ulong_long); try comp.generateExactWidthIntMax(w, .ulong_long); try comp.generateExactWidthIntMax(w, .long_long); } } -fn generateFmt(comp: *const Compilation, prefix: []const u8, w: anytype, ty: Type) !void { - const unsigned = ty.isUnsignedInt(comp); - const modifier = ty.formatModifier(); +fn generateFmt(comp: *const Compilation, prefix: []const u8, w: *std.Io.Writer, qt: QualType) !void { + const unsigned = qt.signedness(comp) == .unsigned; + const modifier = qt.formatModifier(comp); const formats = if (unsigned) "ouxX" else "di"; for (formats) |c| { try w.print("#define {s}_FMT{c}__ \"{s}{c}\"\n", .{ prefix, c, modifier, c }); } } -fn generateSuffixMacro(comp: *const Compilation, prefix: []const u8, w: anytype, ty: Type) !void { - return w.print("#define {s}_C_SUFFIX__ {s}\n", .{ prefix, ty.intValueSuffix(comp) }); +fn generateSuffixMacro(comp: *const Compilation, prefix: []const u8, w: *std.Io.Writer, qt: QualType) !void { + return w.print("#define {s}_C_SUFFIX__ {s}\n", .{ prefix, qt.intValueSuffix(comp) }); } -/// Generate the following for ty: +/// Generate the following for a type: /// Name macro (e.g. #define __UINT32_TYPE__ unsigned int) /// Format strings (e.g. #define __UINT32_FMTu__ "u") /// Suffix macro (e.g. #define __UINT32_C_SUFFIX__ U) -fn generateExactWidthType(comp: *const Compilation, w: anytype, mapper: StrInt.TypeMapper, specifier: Type.Specifier) !void { - var ty = Type{ .specifier = specifier }; - const width = 8 * ty.sizeof(comp).?; - const unsigned = ty.isUnsignedInt(comp); +fn generateExactWidthType(comp: *Compilation, w: *std.Io.Writer, original_qt: QualType) !void { + var qt = original_qt; + const width = qt.sizeof(comp) * 8; + const unsigned = qt.signedness(comp) == .unsigned; if (width == 16) { - ty = if (unsigned) comp.types.int16.makeIntegerUnsigned() else comp.types.int16; + qt = if (unsigned) try comp.type_store.int16.makeIntUnsigned(comp) else comp.type_store.int16; } else if (width == 64) { - ty = if (unsigned) comp.types.int64.makeIntegerUnsigned() else comp.types.int64; + qt = if (unsigned) try comp.type_store.int64.makeIntUnsigned(comp) else comp.type_store.int64; } var buffer: [16]u8 = undefined; const suffix = "_TYPE__"; const full = std.fmt.bufPrint(&buffer, "{s}{d}{s}", .{ if (unsigned) "__UINT" else "__INT", width, suffix, - }) catch return error.OutOfMemory; + }) catch unreachable; - try generateTypeMacro(w, mapper, full, ty, comp.langopts); + try comp.generateTypeMacro(w, full, qt); const prefix = full[0 .. full.len - suffix.len]; // remove "_TYPE__" - try comp.generateFmt(prefix, w, ty); - try comp.generateSuffixMacro(prefix, w, ty); + try comp.generateFmt(prefix, w, qt); + try comp.generateSuffixMacro(prefix, w, qt); } pub fn hasFloat128(comp: *const Compilation) bool { @@ -901,107 +1252,9 @@ pub fn hasHalfPrecisionFloatABI(comp: *const Compilation) bool { return comp.langopts.allow_half_args_and_returns or target_util.hasHalfPrecisionFloatABI(comp.target); } -fn generateNsConstantStringType(comp: *Compilation) !void { - comp.types.ns_constant_string.record = .{ - .name = try StrInt.intern(comp, "__NSConstantString_tag"), - .fields = &comp.types.ns_constant_string.fields, - .field_attributes = null, - .type_layout = undefined, - }; - const const_int_ptr = Type{ .specifier = .pointer, .data = .{ .sub_type = &comp.types.ns_constant_string.int_ty } }; - const const_char_ptr = Type{ .specifier = .pointer, .data = .{ .sub_type = &comp.types.ns_constant_string.char_ty } }; - - comp.types.ns_constant_string.fields[0] = .{ .name = try StrInt.intern(comp, "isa"), .ty = const_int_ptr }; - comp.types.ns_constant_string.fields[1] = .{ .name = try StrInt.intern(comp, "flags"), .ty = .{ .specifier = .int } }; - comp.types.ns_constant_string.fields[2] = .{ .name = try StrInt.intern(comp, "str"), .ty = const_char_ptr }; - comp.types.ns_constant_string.fields[3] = .{ .name = try StrInt.intern(comp, "length"), .ty = .{ .specifier = .long } }; - comp.types.ns_constant_string.ty = .{ .specifier = .@"struct", .data = .{ .record = &comp.types.ns_constant_string.record } }; - record_layout.compute(&comp.types.ns_constant_string.record, comp.types.ns_constant_string.ty, comp, null) catch unreachable; -} - -fn generateVaListType(comp: *Compilation) !Type { - const Kind = enum { char_ptr, void_ptr, aarch64_va_list, x86_64_va_list }; - const kind: Kind = switch (comp.target.cpu.arch) { - .aarch64 => switch (comp.target.os.tag) { - .windows => @as(Kind, .char_ptr), - .ios, .macos, .tvos, .watchos => .char_ptr, - else => .aarch64_va_list, - }, - .sparc, .wasm32, .wasm64, .bpfel, .bpfeb, .riscv32, .riscv64, .avr, .spirv32, .spirv64 => .void_ptr, - .powerpc => switch (comp.target.os.tag) { - .ios, .macos, .tvos, .watchos, .aix => @as(Kind, .char_ptr), - else => return Type{ .specifier = .void }, // unknown - }, - .x86, .msp430 => .char_ptr, - .x86_64 => switch (comp.target.os.tag) { - .windows => @as(Kind, .char_ptr), - else => .x86_64_va_list, - }, - else => return Type{ .specifier = .void }, // unknown - }; - - // TODO this might be bad? - const arena = comp.diagnostics.arena.allocator(); - - var ty: Type = undefined; - switch (kind) { - .char_ptr => ty = .{ .specifier = .char }, - .void_ptr => ty = .{ .specifier = .void }, - .aarch64_va_list => { - const record_ty = try arena.create(Type.Record); - record_ty.* = .{ - .name = try StrInt.intern(comp, "__va_list_tag"), - .fields = try arena.alloc(Type.Record.Field, 5), - .field_attributes = null, - .type_layout = undefined, // computed below - }; - const void_ty = try arena.create(Type); - void_ty.* = .{ .specifier = .void }; - const void_ptr = Type{ .specifier = .pointer, .data = .{ .sub_type = void_ty } }; - record_ty.fields[0] = .{ .name = try StrInt.intern(comp, "__stack"), .ty = void_ptr }; - record_ty.fields[1] = .{ .name = try StrInt.intern(comp, "__gr_top"), .ty = void_ptr }; - record_ty.fields[2] = .{ .name = try StrInt.intern(comp, "__vr_top"), .ty = void_ptr }; - record_ty.fields[3] = .{ .name = try StrInt.intern(comp, "__gr_offs"), .ty = .{ .specifier = .int } }; - record_ty.fields[4] = .{ .name = try StrInt.intern(comp, "__vr_offs"), .ty = .{ .specifier = .int } }; - ty = .{ .specifier = .@"struct", .data = .{ .record = record_ty } }; - record_layout.compute(record_ty, ty, comp, null) catch unreachable; - }, - .x86_64_va_list => { - const record_ty = try arena.create(Type.Record); - record_ty.* = .{ - .name = try StrInt.intern(comp, "__va_list_tag"), - .fields = try arena.alloc(Type.Record.Field, 4), - .field_attributes = null, - .type_layout = undefined, // computed below - }; - const void_ty = try arena.create(Type); - void_ty.* = .{ .specifier = .void }; - const void_ptr = Type{ .specifier = .pointer, .data = .{ .sub_type = void_ty } }; - record_ty.fields[0] = .{ .name = try StrInt.intern(comp, "gp_offset"), .ty = .{ .specifier = .uint } }; - record_ty.fields[1] = .{ .name = try StrInt.intern(comp, "fp_offset"), .ty = .{ .specifier = .uint } }; - record_ty.fields[2] = .{ .name = try StrInt.intern(comp, "overflow_arg_area"), .ty = void_ptr }; - record_ty.fields[3] = .{ .name = try StrInt.intern(comp, "reg_save_area"), .ty = void_ptr }; - ty = .{ .specifier = .@"struct", .data = .{ .record = record_ty } }; - record_layout.compute(record_ty, ty, comp, null) catch unreachable; - }, - } - if (kind == .char_ptr or kind == .void_ptr) { - const elem_ty = try arena.create(Type); - elem_ty.* = ty; - ty = Type{ .specifier = .pointer, .data = .{ .sub_type = elem_ty } }; - } else { - const arr_ty = try arena.create(Type.Array); - arr_ty.* = .{ .len = 1, .elem = ty }; - ty = Type{ .specifier = .array, .data = .{ .array = arr_ty } }; - } - - return ty; -} - -fn generateIntMax(comp: *const Compilation, w: anytype, name: []const u8, ty: Type) !void { - const bit_count: u8 = @intCast(ty.sizeof(comp).? * 8); - const unsigned = ty.isUnsignedInt(comp); - const max: u128 = switch (bit_count) { +fn generateIntMax(comp: *const Compilation, w: *std.Io.Writer, name: []const u8, qt: QualType) !void { + const unsigned = qt.signedness(comp) == .unsigned; + const max: u128 = switch (qt.bitSizeof(comp)) { 8 => if (unsigned) std.math.maxInt(u8) else std.math.maxInt(i8), 16 => if (unsigned) std.math.maxInt(u16) else std.math.maxInt(i16), 32 => if (unsigned) std.math.maxInt(u32) else std.math.maxInt(i32), @@ -1009,13 +1262,13 @@ fn generateIntMax(comp: *const Compilation, w: anytype, name: []const u8, ty: Ty 128 => if (unsigned) std.math.maxInt(u128) else std.math.maxInt(i128), else => unreachable, }; - try w.print("#define __{s}_MAX__ {d}{s}\n", .{ name, max, ty.intValueSuffix(comp) }); + try w.print("#define __{s}_MAX__ {d}{s}\n", .{ name, max, qt.intValueSuffix(comp) }); } /// Largest value that can be stored in wchar_t pub fn wcharMax(comp: *const Compilation) u32 { - const unsigned = comp.types.wchar.isUnsignedInt(comp); - return switch (comp.types.wchar.bitSizeof(comp).?) { + const unsigned = comp.type_store.wchar.signedness(comp) == .unsigned; + return switch (comp.type_store.wchar.bitSizeof(comp)) { 8 => if (unsigned) std.math.maxInt(u8) else std.math.maxInt(i8), 16 => if (unsigned) std.math.maxInt(u16) else std.math.maxInt(i16), 32 => if (unsigned) std.math.maxInt(u32) else std.math.maxInt(i32), @@ -1023,46 +1276,46 @@ pub fn wcharMax(comp: *const Compilation) u32 { }; } -fn generateExactWidthIntMax(comp: *const Compilation, w: anytype, specifier: Type.Specifier) !void { - var ty = Type{ .specifier = specifier }; - const bit_count: u8 = @intCast(ty.sizeof(comp).? * 8); - const unsigned = ty.isUnsignedInt(comp); +fn generateExactWidthIntMax(comp: *Compilation, w: *std.Io.Writer, original_qt: QualType) !void { + var qt = original_qt; + const bit_count: u8 = @intCast(qt.sizeof(comp) * 8); + const unsigned = qt.signedness(comp) == .unsigned; if (bit_count == 64) { - ty = if (unsigned) comp.types.int64.makeIntegerUnsigned() else comp.types.int64; + qt = if (unsigned) try comp.type_store.int64.makeIntUnsigned(comp) else comp.type_store.int64; } var name_buffer: [6]u8 = undefined; const name = std.fmt.bufPrint(&name_buffer, "{s}{d}", .{ if (unsigned) "UINT" else "INT", bit_count, - }) catch return error.OutOfMemory; + }) catch unreachable; - return comp.generateIntMax(w, name, ty); + return comp.generateIntMax(w, name, qt); } -fn generateIntWidth(comp: *Compilation, w: anytype, name: []const u8, ty: Type) !void { - try w.print("#define __{s}_WIDTH__ {d}\n", .{ name, 8 * ty.sizeof(comp).? }); +fn generateIntWidth(comp: *Compilation, w: *std.Io.Writer, name: []const u8, qt: QualType) !void { + try w.print("#define __{s}_WIDTH__ {d}\n", .{ name, qt.sizeof(comp) * 8 }); } -fn generateIntMaxAndWidth(comp: *Compilation, w: anytype, name: []const u8, ty: Type) !void { - try comp.generateIntMax(w, name, ty); - try comp.generateIntWidth(w, name, ty); +fn generateIntMaxAndWidth(comp: *Compilation, w: *std.Io.Writer, name: []const u8, qt: QualType) !void { + try comp.generateIntMax(w, name, qt); + try comp.generateIntWidth(w, name, qt); } -fn generateSizeofType(comp: *Compilation, w: anytype, name: []const u8, ty: Type) !void { - try w.print("#define {s} {d}\n", .{ name, ty.sizeof(comp).? }); +fn generateSizeofType(comp: *Compilation, w: *std.Io.Writer, name: []const u8, qt: QualType) !void { + try w.print("#define {s} {d}\n", .{ name, qt.sizeof(comp) }); } -pub fn nextLargestIntSameSign(comp: *const Compilation, ty: Type) ?Type { - assert(ty.isInt()); - const specifiers = if (ty.isUnsignedInt(comp)) - [_]Type.Specifier{ .short, .int, .long, .long_long } +pub fn nextLargestIntSameSign(comp: *const Compilation, qt: QualType) ?QualType { + assert(qt.isInt(comp)); + const candidates: [4]QualType = if (qt.signedness(comp) == .signed) + .{ .short, .int, .long, .long_long } else - [_]Type.Specifier{ .ushort, .uint, .ulong, .ulong_long }; - const size = ty.sizeof(comp).?; - for (specifiers) |specifier| { - const candidate = Type{ .specifier = specifier }; - if (candidate.sizeof(comp).? > size) return candidate; + .{ .ushort, .uint, .ulong, .ulong_long }; + + const size = qt.sizeof(comp); + for (candidates) |candidate| { + if (candidate.sizeof(comp) > size) return candidate; } return null; } @@ -1077,7 +1330,7 @@ pub fn maxArrayBytes(comp: *const Compilation) u64 { /// __attribute__((packed)) or the range of values of the corresponding enumerator constants, /// specify it here. /// TODO: likely incomplete -pub fn fixedEnumTagSpecifier(comp: *const Compilation) ?Type.Specifier { +pub fn fixedEnumTagType(comp: *const Compilation) ?QualType { switch (comp.langopts.emulate) { .msvc => return .int, .clang => if (comp.target.os.tag == .windows) return .int, @@ -1091,24 +1344,27 @@ pub fn getCharSignedness(comp: *const Compilation) std.builtin.Signedness { } /// Add built-in aro headers directory to system include paths -pub fn addBuiltinIncludeDir(comp: *Compilation, aro_dir: []const u8) !void { +pub fn addBuiltinIncludeDir(comp: *Compilation, aro_dir: []const u8, override_resource_dir: ?[]const u8) !void { + const gpa = comp.gpa; + const arena = comp.arena; + try comp.system_include_dirs.ensureUnusedCapacity(gpa, 1); + if (override_resource_dir) |resource_dir| { + comp.system_include_dirs.appendAssumeCapacity(try std.fs.path.join(arena, &.{ resource_dir, "include" })); + return; + } var search_path = aro_dir; while (std.fs.path.dirname(search_path)) |dirname| : (search_path = dirname) { var base_dir = comp.cwd.openDir(dirname, .{}) catch continue; defer base_dir.close(); base_dir.access("include/stddef.h", .{}) catch continue; - const path = try std.fs.path.join(comp.gpa, &.{ dirname, "include" }); - errdefer comp.gpa.free(path); - try comp.system_include_dirs.append(comp.gpa, path); + comp.system_include_dirs.appendAssumeCapacity(try std.fs.path.join(arena, &.{ dirname, "include" })); break; } else return error.AroIncludeNotFound; } pub fn addSystemIncludeDir(comp: *Compilation, path: []const u8) !void { - const duped = try comp.gpa.dupe(u8, path); - errdefer comp.gpa.free(duped); - try comp.system_include_dirs.append(comp.gpa, duped); + try comp.system_include_dirs.append(comp.gpa, try comp.arena.dupe(u8, path)); } pub fn getSource(comp: *const Compilation, id: Source.Id) Source { @@ -1122,29 +1378,22 @@ pub fn getSource(comp: *const Compilation, id: Source.Id) Source { return comp.sources.values()[@intFromEnum(id) - 2]; } -/// Creates a Source from the contents of `reader` and adds it to the Compilation -pub fn addSourceFromReader(comp: *Compilation, reader: anytype, path: []const u8, kind: Source.Kind) !Source { - const contents = try reader.readAllAlloc(comp.gpa, std.math.maxInt(u32)); - errdefer comp.gpa.free(contents); - return comp.addSourceFromOwnedBuffer(contents, path, kind); -} - /// Creates a Source from `buf` and adds it to the Compilation /// Performs newline splicing and line-ending normalization to '\n' /// `buf` will be modified and the allocation will be resized if newline splicing /// or line-ending changes happen. /// caller retains ownership of `path` -/// To add the contents of an arbitrary reader as a Source, see addSourceFromReader /// To add a file's contents given its path, see addSourceFromPath -pub fn addSourceFromOwnedBuffer(comp: *Compilation, buf: []u8, path: []const u8, kind: Source.Kind) !Source { +pub fn addSourceFromOwnedBuffer(comp: *Compilation, path: []const u8, buf: []u8, kind: Source.Kind) !Source { + assert(buf.len <= std.math.maxInt(u32)); try comp.sources.ensureUnusedCapacity(comp.gpa, 1); var contents = buf; const duped_path = try comp.gpa.dupe(u8, path); errdefer comp.gpa.free(duped_path); - var splice_list = std.array_list.Managed(u32).init(comp.gpa); - defer splice_list.deinit(); + var splice_list: std.ArrayList(u32) = .empty; + defer splice_list.deinit(comp.gpa); const source_id: Source.Id = @enumFromInt(comp.sources.count() + 2); @@ -1177,12 +1426,9 @@ pub fn addSourceFromOwnedBuffer(comp: *Compilation, buf: []u8, path: []const u8, }, .back_slash, .trailing_ws, .back_slash_cr => { i = backslash_loc; - try splice_list.append(i); + try splice_list.append(comp.gpa, i); if (state == .trailing_ws) { - try comp.addDiagnostic(.{ - .tag = .backslash_newline_escape, - .loc = .{ .id = source_id, .byte_offset = i, .line = line }, - }, &.{}); + try comp.addNewlineEscapeError(path, buf, splice_list.items, i, line, kind); } state = if (state == .back_slash_cr) .cr else .back_slash_cr; }, @@ -1200,13 +1446,10 @@ pub fn addSourceFromOwnedBuffer(comp: *Compilation, buf: []u8, path: []const u8, .back_slash, .trailing_ws => { i = backslash_loc; if (state == .back_slash or state == .trailing_ws) { - try splice_list.append(i); + try splice_list.append(comp.gpa, i); } if (state == .trailing_ws) { - try comp.addDiagnostic(.{ - .tag = .backslash_newline_escape, - .loc = .{ .id = source_id, .byte_offset = i, .line = line }, - }, &.{}); + try comp.addNewlineEscapeError(path, buf, splice_list.items, i, line, kind); } }, .bom1, .bom2 => break, @@ -1256,13 +1499,19 @@ pub fn addSourceFromOwnedBuffer(comp: *Compilation, buf: []u8, path: []const u8, } } - const splice_locs = try splice_list.toOwnedSlice(); + const splice_locs = try splice_list.toOwnedSlice(comp.gpa); errdefer comp.gpa.free(splice_locs); - if (i != contents.len) contents = try comp.gpa.realloc(contents, i); + if (i != contents.len) { + var list: std.ArrayList(u8) = .{ + .items = contents[0..i], + .capacity = contents.len, + }; + contents = try list.toOwnedSlice(comp.gpa); + } errdefer @compileError("errdefers in callers would possibly free the realloced slice using the original len"); - const source = Source{ + const source: Source = .{ .id = source_id, .path = duped_path, .buf = contents, @@ -1274,17 +1523,49 @@ pub fn addSourceFromOwnedBuffer(comp: *Compilation, buf: []u8, path: []const u8, return source; } +fn addNewlineEscapeError( + comp: *Compilation, + path: []const u8, + buf: []const u8, + splice_locs: []const u32, + byte_offset: u32, + line: u32, + kind: Source.Kind, +) !void { + // Temporary source for getting the location for errors. + var tmp_source: Source = .{ + .path = path, + .buf = buf, + .id = undefined, + .kind = kind, + .splice_locs = splice_locs, + }; + + const diagnostic: Diagnostic = .backslash_newline_escape; + var loc = tmp_source.lineCol(.{ .id = undefined, .byte_offset = byte_offset, .line = line }); + loc.line = loc.line[0 .. loc.line.len - 1]; + loc.width += 1; + loc.col += 1; + + try comp.diagnostics.add(.{ + .text = diagnostic.fmt, + .kind = diagnostic.kind, + .opt = diagnostic.opt, + .location = loc, + }); +} + /// Caller retains ownership of `path` and `buf`. /// Dupes the source buffer; if it is acceptable to modify the source buffer and possibly resize /// the allocation, please use `addSourceFromOwnedBuffer` -pub fn addSourceFromBuffer(comp: *Compilation, path: []const u8, buf: []const u8) !Source { +pub fn addSourceFromBuffer(comp: *Compilation, path: []const u8, buf: []const u8) AddSourceError!Source { if (comp.sources.get(path)) |some| return some; - if (@as(u64, buf.len) > std.math.maxInt(u32)) return error.StreamTooLong; + if (buf.len > std.math.maxInt(u32)) return error.FileTooBig; const contents = try comp.gpa.dupe(u8, buf); errdefer comp.gpa.free(contents); - return comp.addSourceFromOwnedBuffer(contents, path, .user); + return comp.addSourceFromOwnedBuffer(path, contents, .user); } /// Caller retains ownership of `path`. @@ -1302,113 +1583,189 @@ fn addSourceFromPathExtra(comp: *Compilation, path: []const u8, kind: Source.Kin const file = try comp.cwd.openFile(path, .{}); defer file.close(); + return comp.addSourceFromFile(file, path, kind); +} - const contents = file.readToEndAlloc(comp.gpa, std.math.maxInt(u32)) catch |err| switch (err) { - error.FileTooBig => return error.StreamTooLong, - else => |e| return e, - }; +pub fn addSourceFromFile(comp: *Compilation, file: std.fs.File, path: []const u8, kind: Source.Kind) !Source { + const contents = try comp.getFileContents(file, .unlimited); errdefer comp.gpa.free(contents); + return comp.addSourceFromOwnedBuffer(path, contents, kind); +} - return comp.addSourceFromOwnedBuffer(contents, path, kind); +pub fn hasInclude( + comp: *Compilation, + filename: []const u8, + includer_token_source: Source.Id, + /// angle bracket vs quotes + include_type: IncludeType, + /// __has_include vs __has_include_next + which: WhichInclude, + opt_dep_file: ?*DepFile, +) Compilation.Error!bool { + if (try FindInclude.run(comp, filename, switch (which) { + .next => .{ .only_search_after_dir = comp.getSource(includer_token_source).path }, + .first => switch (include_type) { + .quotes => .{ .allow_same_dir = comp.getSource(includer_token_source).path }, + .angle_brackets => .only_search, + }, + })) |found| { + if (opt_dep_file) |dep_file| { + const source = comp.getSource(found.source); + try dep_file.addDependency(comp.gpa, source.path); + } + return true; + } else { + return false; + } } -pub const IncludeDirIterator = struct { - comp: *const Compilation, - cwd_source_id: ?Source.Id, - include_dirs_idx: usize = 0, - sys_include_dirs_idx: usize = 0, - tried_ms_cwd: bool = false, +const FindInclude = struct { + comp: *Compilation, + include_path: []const u8, + /// We won't actually consider any include directories until after this directory. + wait_for: ?[]const u8, - const FoundSource = struct { - path: []const u8, + const Result = struct { + source: Source.Id, kind: Source.Kind, + used_ms_search_rule: bool, }; - fn next(self: *IncludeDirIterator) ?FoundSource { - if (self.cwd_source_id) |source_id| { - self.cwd_source_id = null; - const path = self.comp.getSource(source_id).path; - return .{ .path = std.fs.path.dirname(path) orelse ".", .kind = .user }; + fn run( + comp: *Compilation, + include_path: []const u8, + search_strat: union(enum) { + allow_same_dir: []const u8, + only_search, + only_search_after_dir: []const u8, + }, + ) Allocator.Error!?Result { + var find: FindInclude = .{ + .comp = comp, + .include_path = include_path, + .wait_for = null, + }; + + if (std.fs.path.isAbsolute(include_path)) { + switch (search_strat) { + .allow_same_dir, .only_search => {}, + .only_search_after_dir => return null, + } + return find.check("{s}", .{include_path}, .user, false); + } + + switch (search_strat) { + .allow_same_dir => |other_file| { + const dir = std.fs.path.dirname(other_file) orelse "."; + if (try find.checkIncludeDir(dir, .user)) |res| return res; + }, + .only_search => {}, + .only_search_after_dir => |other_file| { + // TODO: this is not the correct interpretation of `#include_next` and friends, + // because a file might not be directly inside of an include directory. To implement + // this correctly, we will need to track which include directory a file has been + // included from. + find.wait_for = std.fs.path.dirname(other_file); + }, + } + + for (comp.include_dirs.items) |dir| { + if (try find.checkIncludeDir(dir, .user)) |res| return res; } - if (self.include_dirs_idx < self.comp.include_dirs.items.len) { - defer self.include_dirs_idx += 1; - return .{ .path = self.comp.include_dirs.items[self.include_dirs_idx], .kind = .user }; + for (comp.framework_dirs.items) |dir| { + if (try find.checkFrameworkDir(dir, .user)) |res| return res; } - if (self.sys_include_dirs_idx < self.comp.system_include_dirs.items.len) { - defer self.sys_include_dirs_idx += 1; - return .{ .path = self.comp.system_include_dirs.items[self.sys_include_dirs_idx], .kind = .system }; + for (comp.system_include_dirs.items) |dir| { + if (try find.checkIncludeDir(dir, .system)) |res| return res; } - if (self.comp.ms_cwd_source_id) |source_id| { - if (self.tried_ms_cwd) return null; - self.tried_ms_cwd = true; - const path = self.comp.getSource(source_id).path; - return .{ .path = std.fs.path.dirname(path) orelse ".", .kind = .user }; + for (comp.system_framework_dirs.items) |dir| { + if (try find.checkFrameworkDir(dir, .system)) |res| return res; } - return null; - } - - /// Returned value's path field must be freed by allocator - fn nextWithFile(self: *IncludeDirIterator, filename: []const u8, allocator: Allocator) !?FoundSource { - while (self.next()) |found| { - const path = try std.fs.path.join(allocator, &.{ found.path, filename }); - if (self.comp.langopts.ms_extensions) { - std.mem.replaceScalar(u8, path, '\\', '/'); - } - return .{ .path = path, .kind = found.kind }; + for (comp.after_include_dirs.items) |dir| { + if (try find.checkIncludeDir(dir, .system)) |res| return res; + } + if (comp.ms_cwd_source_id) |source_id| { + if (try find.checkMsCwdIncludeDir(source_id)) |res| return res; } return null; } - - /// Advance the iterator until it finds an include directory that matches - /// the directory which contains `source`. - fn skipUntilDirMatch(self: *IncludeDirIterator, source: Source.Id) void { - const path = self.comp.getSource(source).path; - const includer_path = std.fs.path.dirname(path) orelse "."; - while (self.next()) |found| { - if (mem.eql(u8, includer_path, found.path)) break; + fn checkIncludeDir(find: *FindInclude, include_dir: []const u8, kind: Source.Kind) Allocator.Error!?Result { + if (find.wait_for) |wait_for| { + if (std.mem.eql(u8, include_dir, wait_for)) find.wait_for = null; + return null; } + return find.check("{s}{c}{s}", .{ + include_dir, + std.fs.path.sep, + find.include_path, + }, kind, false); } -}; - -pub fn hasInclude( - comp: *const Compilation, - filename: []const u8, - includer_token_source: Source.Id, - /// angle bracket vs quotes - include_type: IncludeType, - /// __has_include vs __has_include_next - which: WhichInclude, -) !bool { - if (mem.indexOfScalar(u8, filename, 0) != null) { - return false; + fn checkMsCwdIncludeDir(find: *FindInclude, source_id: Source.Id) Allocator.Error!?Result { + const path = find.comp.getSource(source_id).path; + const dir = std.fs.path.dirname(path) orelse "."; + if (find.wait_for) |wait_for| { + if (std.mem.eql(u8, dir, wait_for)) find.wait_for = null; + return null; + } + return find.check("{s}{c}{s}", .{ + dir, + std.fs.path.sep, + find.include_path, + }, .user, true); } - - if (std.fs.path.isAbsolute(filename)) { - if (which == .next) return false; - return !std.meta.isError(comp.cwd.access(filename, .{})); + fn checkFrameworkDir(find: *FindInclude, framework_dir: []const u8, kind: Source.Kind) Allocator.Error!?Result { + if (find.wait_for) |wait_for| { + match: { + // If this is a match, then `wait_for` looks like '.../Foo.framework/Headers'. + const wait_framework = std.fs.path.dirname(wait_for) orelse break :match; + const wait_framework_dir = std.fs.path.dirname(wait_framework) orelse break :match; + if (!std.mem.eql(u8, framework_dir, wait_framework_dir)) break :match; + find.wait_for = null; + } + return null; + } + // For an include like 'Foo/Bar.h', search in '/Foo.framework/Headers/Bar.h'. + const framework_name: []const u8, const header_sub_path: []const u8 = f: { + const i = std.mem.indexOfScalar(u8, find.include_path, '/') orelse return null; + break :f .{ find.include_path[0..i], find.include_path[i + 1 ..] }; + }; + return find.check("{s}{c}{s}.framework{c}Headers{c}{s}", .{ + framework_dir, + std.fs.path.sep, + framework_name, + std.fs.path.sep, + std.fs.path.sep, + header_sub_path, + }, kind, false); } + fn check( + find: *FindInclude, + comptime format: []const u8, + args: anytype, + kind: Source.Kind, + used_ms_search_rule: bool, + ) Allocator.Error!?Result { + const comp = find.comp; - const cwd_source_id = switch (include_type) { - .quotes => switch (which) { - .first => includer_token_source, - .next => null, - }, - .angle_brackets => null, - }; - var it = IncludeDirIterator{ .comp = comp, .cwd_source_id = cwd_source_id }; - if (which == .next) { - it.skipUntilDirMatch(includer_token_source); - } + var stack_fallback = std.heap.stackFallback(path_buf_stack_limit, comp.gpa); + const sfa = stack_fallback.get(); + const header_path = try std.fmt.allocPrint(sfa, format, args); + defer sfa.free(header_path); - var stack_fallback = std.heap.stackFallback(path_buf_stack_limit, comp.gpa); - const sf_allocator = stack_fallback.get(); - - while (try it.nextWithFile(filename, sf_allocator)) |found| { - defer sf_allocator.free(found.path); - if (!std.meta.isError(comp.cwd.access(found.path, .{}))) return true; + if (find.comp.langopts.ms_extensions) { + std.mem.replaceScalar(u8, header_path, '\\', '/'); + } + const source = comp.addSourceFromPathExtra(header_path, kind) catch |err| switch (err) { + error.OutOfMemory => |e| return e, + else => return null, + }; + return .{ + .source = source.id, + .kind = kind, + .used_ms_search_rule = used_ms_search_rule, + }; } - return false; -} +}; pub const WhichInclude = enum { first, @@ -1420,24 +1777,39 @@ pub const IncludeType = enum { angle_brackets, }; -fn getFileContents(comp: *Compilation, path: []const u8, limit: ?u32) ![]const u8 { +fn getPathContents(comp: *Compilation, path: []const u8, limit: std.Io.Limit) ![]u8 { if (mem.indexOfScalar(u8, path, 0) != null) { return error.FileNotFound; } const file = try comp.cwd.openFile(path, .{}); defer file.close(); + return comp.getFileContents(file, limit); +} - var buf = std.array_list.Managed(u8).init(comp.gpa); - defer buf.deinit(); - - const max = limit orelse std.math.maxInt(u32); - file.deprecatedReader().readAllArrayList(&buf, max) catch |e| switch (e) { - error.StreamTooLong => if (limit == null) return e, - else => return e, - }; - - return buf.toOwnedSlice(); +fn getFileContents(comp: *Compilation, file: std.fs.File, limit: std.Io.Limit) ![]u8 { + var file_buf: [4096]u8 = undefined; + var file_reader = file.reader(&file_buf); + + var allocating: std.Io.Writer.Allocating = .init(comp.gpa); + defer allocating.deinit(); + if (file_reader.getSize()) |size| { + const limited_size = limit.minInt64(size); + if (limited_size > std.math.maxInt(u32)) return error.FileTooBig; + try allocating.ensureUnusedCapacity(limited_size); + } else |_| {} + + var remaining = limit.min(.limited(std.math.maxInt(u32))); + while (remaining.nonzero()) { + const n = file_reader.interface.stream(&allocating.writer, remaining) catch |err| switch (err) { + error.EndOfStream => return allocating.toOwnedSlice(), + error.WriteFailed => return error.OutOfMemory, + error.ReadFailed => return file_reader.err.?, + }; + remaining = remaining.subtract(n).?; + } + if (limit == .unlimited) return error.FileTooBig; + return allocating.toOwnedSlice(); } pub fn findEmbed( @@ -1446,30 +1818,53 @@ pub fn findEmbed( includer_token_source: Source.Id, /// angle bracket vs quotes include_type: IncludeType, - limit: ?u32, -) !?[]const u8 { + limit: std.Io.Limit, + opt_dep_file: ?*DepFile, +) !?[]u8 { if (std.fs.path.isAbsolute(filename)) { - return if (comp.getFileContents(filename, limit)) |some| - some - else |err| switch (err) { + if (comp.getPathContents(filename, limit)) |some| { + errdefer comp.gpa.free(some); + if (opt_dep_file) |dep_file| try dep_file.addDependencyDupe(comp.gpa, comp.arena, filename); + return some; + } else |err| switch (err) { error.OutOfMemory => |e| return e, - else => null, - }; + else => return null, + } } - const cwd_source_id = switch (include_type) { - .quotes => includer_token_source, - .angle_brackets => null, - }; - var it = IncludeDirIterator{ .comp = comp, .cwd_source_id = cwd_source_id }; var stack_fallback = std.heap.stackFallback(path_buf_stack_limit, comp.gpa); const sf_allocator = stack_fallback.get(); - while (try it.nextWithFile(filename, sf_allocator)) |found| { - defer sf_allocator.free(found.path); - if (comp.getFileContents(found.path, limit)) |some| - return some - else |err| switch (err) { + switch (include_type) { + .quotes => { + const dir = std.fs.path.dirname(comp.getSource(includer_token_source).path) orelse "."; + const path = try std.fs.path.join(sf_allocator, &.{ dir, filename }); + defer sf_allocator.free(path); + if (comp.langopts.ms_extensions) { + std.mem.replaceScalar(u8, path, '\\', '/'); + } + if (comp.getPathContents(path, limit)) |some| { + errdefer comp.gpa.free(some); + if (opt_dep_file) |dep_file| try dep_file.addDependencyDupe(comp.gpa, comp.arena, filename); + return some; + } else |err| switch (err) { + error.OutOfMemory => return error.OutOfMemory, + else => {}, + } + }, + .angle_brackets => {}, + } + for (comp.embed_dirs.items) |embed_dir| { + const path = try std.fs.path.join(sf_allocator, &.{ embed_dir, filename }); + defer sf_allocator.free(path); + if (comp.langopts.ms_extensions) { + std.mem.replaceScalar(u8, path, '\\', '/'); + } + if (comp.getPathContents(path, limit)) |some| { + errdefer comp.gpa.free(some); + if (opt_dep_file) |dep_file| try dep_file.addDependencyDupe(comp.gpa, comp.arena, filename); + return some; + } else |err| switch (err) { error.OutOfMemory => return error.OutOfMemory, else => {}, } @@ -1485,54 +1880,29 @@ pub fn findInclude( include_type: IncludeType, /// include vs include_next which: WhichInclude, -) !?Source { - if (std.fs.path.isAbsolute(filename)) { - if (which == .next) return null; - // TODO: classify absolute file as belonging to system includes or not? - return if (comp.addSourceFromPath(filename)) |some| - some - else |err| switch (err) { - error.OutOfMemory => |e| return e, - else => null, - }; - } - const cwd_source_id = switch (include_type) { - .quotes => switch (which) { - .first => includer_token.source, - .next => null, +) Compilation.Error!?Source { + const found = try FindInclude.run(comp, filename, switch (which) { + .next => .{ .only_search_after_dir = comp.getSource(includer_token.source).path }, + .first => switch (include_type) { + .quotes => .{ .allow_same_dir = comp.getSource(includer_token.source).path }, + .angle_brackets => .only_search, }, - .angle_brackets => null, - }; - var it = IncludeDirIterator{ .comp = comp, .cwd_source_id = cwd_source_id }; - - if (which == .next) { - it.skipUntilDirMatch(includer_token.source); - } - - var stack_fallback = std.heap.stackFallback(path_buf_stack_limit, comp.gpa); - const sf_allocator = stack_fallback.get(); - - while (try it.nextWithFile(filename, sf_allocator)) |found| { - defer sf_allocator.free(found.path); - if (comp.addSourceFromPathExtra(found.path, found.kind)) |some| { - if (it.tried_ms_cwd) { - try comp.addDiagnostic(.{ - .tag = .ms_search_rule, - .extra = .{ .str = some.path }, - .loc = .{ - .id = includer_token.source, - .byte_offset = includer_token.start, - .line = includer_token.line, - }, - }, &.{}); - } - return some; - } else |err| switch (err) { - error.OutOfMemory => return error.OutOfMemory, - else => {}, - } + }) orelse return null; + if (found.used_ms_search_rule) { + const diagnostic: Diagnostic = .ms_search_rule; + try comp.diagnostics.add(.{ + .text = diagnostic.fmt, + .kind = diagnostic.kind, + .opt = diagnostic.opt, + .extension = diagnostic.extension, + .location = (Source.Location{ + .id = includer_token.source, + .byte_offset = includer_token.start, + .line = includer_token.line, + }).expand(comp), + }); } - return null; + return comp.getSource(found.source); } pub fn addPragmaHandler(comp: *Compilation, name: []const u8, handler: *Pragma) Allocator.Error!void { @@ -1584,12 +1954,6 @@ pub fn pragmaEvent(comp: *Compilation, event: PragmaEvent) void { } pub fn hasBuiltin(comp: *const Compilation, name: []const u8) bool { - if (std.mem.eql(u8, name, "__builtin_va_arg") or - std.mem.eql(u8, name, "__builtin_choose_expr") or - std.mem.eql(u8, name, "__builtin_bitoffsetof") or - std.mem.eql(u8, name, "__builtin_offsetof") or - std.mem.eql(u8, name, "__builtin_types_compatible_p")) return true; - const builtin = Builtin.fromName(name) orelse return false; return comp.hasBuiltinFunction(builtin); } @@ -1615,6 +1979,16 @@ pub fn locSlice(comp: *const Compilation, loc: Source.Location) []const u8 { return tmp_tokenizer.buf[tok.start..tok.end]; } +pub fn getSourceMTimeUncached(comp: *const Compilation, source_id: Source.Id) ?u64 { + const source = comp.getSource(source_id); + if (comp.cwd.statFile(source.path)) |stat| { + const mtime = @divTrunc(stat.mtime, std.time.ns_per_s); + return std.math.cast(u64, mtime); + } else |_| { + return null; + } +} + pub const CharUnitSize = enum(u32) { @"1" = 1, @"2" = 2, @@ -1629,66 +2003,100 @@ pub const CharUnitSize = enum(u32) { } }; -pub const addDiagnostic = Diagnostics.add; +pub const Diagnostic = struct { + fmt: []const u8, + kind: Diagnostics.Message.Kind, + opt: ?Diagnostics.Option = null, + extension: bool = false, + + pub const backslash_newline_escape: Diagnostic = .{ + .fmt = "backslash and newline separated by space", + .kind = .warning, + .opt = .@"backslash-newline-escape", + }; + + pub const ms_search_rule: Diagnostic = .{ + .fmt = "#include resolved using non-portable Microsoft search rules as: {s}", + .kind = .warning, + .opt = .@"microsoft-include", + .extension = true, + }; + + pub const ctrl_z_eof: Diagnostic = .{ + .fmt = "treating Ctrl-Z as end-of-file is a Microsoft extension", + .kind = .off, + .opt = .@"microsoft-end-of-file", + .extension = true, + }; +}; -test "addSourceFromReader" { +test "addSourceFromBuffer" { const Test = struct { - fn addSourceFromReader(str: []const u8, expected: []const u8, warning_count: u32, splices: []const u32) !void { - var comp = Compilation.init(std.testing.allocator, std.fs.cwd()); + fn addSourceFromBuffer(str: []const u8, expected: []const u8, warning_count: u32, splices: []const u32) !void { + var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena.deinit(); + var diagnostics: Diagnostics = .{ .output = .ignore }; + var comp = Compilation.init(std.testing.allocator, arena.allocator(), &diagnostics, std.fs.cwd()); defer comp.deinit(); - var buf_reader = std.io.fixedBufferStream(str); - const source = try comp.addSourceFromReader(buf_reader.reader(), "path", .user); + const source = try comp.addSourceFromBuffer("path", str); try std.testing.expectEqualStrings(expected, source.buf); - try std.testing.expectEqual(warning_count, @as(u32, @intCast(comp.diagnostics.list.items.len))); + try std.testing.expectEqual(warning_count, @as(u32, @intCast(diagnostics.warnings))); try std.testing.expectEqualSlices(u32, splices, source.splice_locs); } fn withAllocationFailures(allocator: std.mem.Allocator) !void { - var comp = Compilation.init(allocator, std.fs.cwd()); + var arena: std.heap.ArenaAllocator = .init(allocator); + defer arena.deinit(); + var diagnostics: Diagnostics = .{ .output = .ignore }; + var comp = Compilation.init(allocator, arena.allocator(), &diagnostics, std.fs.cwd()); defer comp.deinit(); _ = try comp.addSourceFromBuffer("path", "spliced\\\nbuffer\n"); _ = try comp.addSourceFromBuffer("path", "non-spliced buffer\n"); } }; - try Test.addSourceFromReader("ab\\\nc", "abc", 0, &.{2}); - try Test.addSourceFromReader("ab\\\rc", "abc", 0, &.{2}); - try Test.addSourceFromReader("ab\\\r\nc", "abc", 0, &.{2}); - try Test.addSourceFromReader("ab\\ \nc", "abc", 1, &.{2}); - try Test.addSourceFromReader("ab\\\t\nc", "abc", 1, &.{2}); - try Test.addSourceFromReader("ab\\ \t\nc", "abc", 1, &.{2}); - try Test.addSourceFromReader("ab\\\r \nc", "ab \nc", 0, &.{2}); - try Test.addSourceFromReader("ab\\\\\nc", "ab\\c", 0, &.{3}); - try Test.addSourceFromReader("ab\\ \r\nc", "abc", 1, &.{2}); - try Test.addSourceFromReader("ab\\ \\\nc", "ab\\ c", 0, &.{4}); - try Test.addSourceFromReader("ab\\\r\\\nc", "abc", 0, &.{ 2, 2 }); - try Test.addSourceFromReader("ab\\ \rc", "abc", 1, &.{2}); - try Test.addSourceFromReader("ab\\", "ab\\", 0, &.{}); - try Test.addSourceFromReader("ab\\\\", "ab\\\\", 0, &.{}); - try Test.addSourceFromReader("ab\\ ", "ab\\ ", 0, &.{}); - try Test.addSourceFromReader("ab\\\n", "ab", 0, &.{2}); - try Test.addSourceFromReader("ab\\\r\n", "ab", 0, &.{2}); - try Test.addSourceFromReader("ab\\\r", "ab", 0, &.{2}); + try Test.addSourceFromBuffer("ab\\\nc", "abc", 0, &.{2}); + try Test.addSourceFromBuffer("ab\\\rc", "abc", 0, &.{2}); + try Test.addSourceFromBuffer("ab\\\r\nc", "abc", 0, &.{2}); + try Test.addSourceFromBuffer("ab\\ \nc", "abc", 1, &.{2}); + try Test.addSourceFromBuffer("ab\\\t\nc", "abc", 1, &.{2}); + try Test.addSourceFromBuffer("ab\\ \t\nc", "abc", 1, &.{2}); + try Test.addSourceFromBuffer("ab\\\r \nc", "ab \nc", 0, &.{2}); + try Test.addSourceFromBuffer("ab\\\\\nc", "ab\\c", 0, &.{3}); + try Test.addSourceFromBuffer("ab\\ \r\nc", "abc", 1, &.{2}); + try Test.addSourceFromBuffer("ab\\ \\\nc", "ab\\ c", 0, &.{4}); + try Test.addSourceFromBuffer("ab\\\r\\\nc", "abc", 0, &.{ 2, 2 }); + try Test.addSourceFromBuffer("ab\\ \rc", "abc", 1, &.{2}); + try Test.addSourceFromBuffer("ab\\", "ab\\", 0, &.{}); + try Test.addSourceFromBuffer("ab\\\\", "ab\\\\", 0, &.{}); + try Test.addSourceFromBuffer("ab\\ ", "ab\\ ", 0, &.{}); + try Test.addSourceFromBuffer("ab\\\n", "ab", 0, &.{2}); + try Test.addSourceFromBuffer("ab\\\r\n", "ab", 0, &.{2}); + try Test.addSourceFromBuffer("ab\\\r", "ab", 0, &.{2}); // carriage return normalization - try Test.addSourceFromReader("ab\r", "ab\n", 0, &.{}); - try Test.addSourceFromReader("ab\r\r", "ab\n\n", 0, &.{}); - try Test.addSourceFromReader("ab\r\r\n", "ab\n\n", 0, &.{}); - try Test.addSourceFromReader("ab\r\r\n\r", "ab\n\n\n", 0, &.{}); - try Test.addSourceFromReader("\r\\", "\n\\", 0, &.{}); - try Test.addSourceFromReader("\\\r\\", "\\", 0, &.{0}); + try Test.addSourceFromBuffer("ab\r", "ab\n", 0, &.{}); + try Test.addSourceFromBuffer("ab\r\r", "ab\n\n", 0, &.{}); + try Test.addSourceFromBuffer("ab\r\r\n", "ab\n\n", 0, &.{}); + try Test.addSourceFromBuffer("ab\r\r\n\r", "ab\n\n\n", 0, &.{}); + try Test.addSourceFromBuffer("\r\\", "\n\\", 0, &.{}); + try Test.addSourceFromBuffer("\\\r\\", "\\", 0, &.{0}); try std.testing.checkAllAllocationFailures(std.testing.allocator, Test.withAllocationFailures, .{}); } -test "addSourceFromReader - exhaustive check for carriage return elimination" { +test "addSourceFromBuffer - exhaustive check for carriage return elimination" { + var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena.deinit(); + const alphabet = [_]u8{ '\r', '\n', ' ', '\\', 'a' }; const alen = alphabet.len; var buf: [alphabet.len]u8 = [1]u8{alphabet[0]} ** alen; - var comp = Compilation.init(std.testing.allocator, std.fs.cwd()); + var diagnostics: Diagnostics = .{ .output = .ignore }; + var comp = Compilation.init(std.testing.allocator, arena.allocator(), &diagnostics, std.fs.cwd()); defer comp.deinit(); var source_count: u32 = 0; @@ -1713,28 +2121,31 @@ test "addSourceFromReader - exhaustive check for carriage return elimination" { test "ignore BOM at beginning of file" { const BOM = "\xEF\xBB\xBF"; - const Test = struct { - fn run(buf: []const u8) !void { - var comp = Compilation.init(std.testing.allocator, std.fs.cwd()); + fn run(arena: Allocator, buf: []const u8) !void { + var diagnostics: Diagnostics = .{ .output = .ignore }; + var comp = Compilation.init(std.testing.allocator, arena, &diagnostics, std.fs.cwd()); defer comp.deinit(); - var buf_reader = std.io.fixedBufferStream(buf); - const source = try comp.addSourceFromReader(buf_reader.reader(), "file.c", .user); + const source = try comp.addSourceFromBuffer("file.c", buf); const expected_output = if (mem.startsWith(u8, buf, BOM)) buf[BOM.len..] else buf; try std.testing.expectEqualStrings(expected_output, source.buf); } }; - try Test.run(BOM); - try Test.run(BOM ++ "x"); - try Test.run("x" ++ BOM); - try Test.run(BOM ++ " "); - try Test.run(BOM ++ "\n"); - try Test.run(BOM ++ "\\"); - - try Test.run(BOM[0..1] ++ "x"); - try Test.run(BOM[0..2] ++ "x"); - try Test.run(BOM[1..] ++ "x"); - try Test.run(BOM[2..] ++ "x"); + var arena_state: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena_state.deinit(); + const arena = arena_state.allocator(); + + try Test.run(arena, BOM); + try Test.run(arena, BOM ++ "x"); + try Test.run(arena, "x" ++ BOM); + try Test.run(arena, BOM ++ " "); + try Test.run(arena, BOM ++ "\n"); + try Test.run(arena, BOM ++ "\\"); + + try Test.run(arena, BOM[0..1] ++ "x"); + try Test.run(arena, BOM[0..2] ++ "x"); + try Test.run(arena, BOM[1..] ++ "x"); + try Test.run(arena, BOM[2..] ++ "x"); } diff --git a/lib/compiler/aro/aro/DepFile.zig b/lib/compiler/aro/aro/DepFile.zig new file mode 100644 index 000000000000..a8f8d7cbaebe --- /dev/null +++ b/lib/compiler/aro/aro/DepFile.zig @@ -0,0 +1,99 @@ +const std = @import("std"); +const Allocator = std.mem.Allocator; + +pub const Format = enum { make, nmake }; + +const DepFile = @This(); + +target: []const u8, +deps: std.StringArrayHashMapUnmanaged(void) = .empty, +format: Format, + +pub fn deinit(d: *DepFile, gpa: Allocator) void { + d.deps.deinit(gpa); + d.* = undefined; +} + +pub fn addDependency(d: *DepFile, gpa: Allocator, path: []const u8) !void { + try d.deps.put(gpa, path, {}); +} + +pub fn addDependencyDupe(d: *DepFile, gpa: Allocator, arena: Allocator, path: []const u8) !void { + const gop = try d.deps.getOrPut(gpa, path); + if (gop.found_existing) return; + gop.key_ptr.* = try arena.dupe(u8, path); +} + +pub fn write(d: *const DepFile, w: *std.Io.Writer) std.Io.Writer.Error!void { + const max_columns = 75; + var columns: usize = 0; + + try writeTarget(d.target, w); + columns += d.target.len; + try w.writeByte(':'); + columns += 1; + + for (d.deps.keys()) |path| { + if (std.mem.eql(u8, path, "")) continue; + + if (columns + path.len + " \\\n".len > max_columns) { + try w.writeAll(" \\\n "); + columns = 1; + } + try w.writeByte(' '); + try d.writePath(path, w); + columns += path.len + 1; + } + try w.writeByte('\n'); + try w.flush(); +} + +fn writeTarget(path: []const u8, w: *std.Io.Writer) !void { + for (path, 0..) |c, i| { + switch (c) { + ' ', '\t' => { + try w.writeByte('\\'); + var j = i; + while (j != 0) { + j -= 1; + if (path[j] != '\\') break; + try w.writeByte('\\'); + } + }, + '$' => try w.writeByte('$'), + '#' => try w.writeByte('\\'), + else => {}, + } + try w.writeByte(c); + } +} + +fn writePath(d: *const DepFile, path: []const u8, w: *std.Io.Writer) !void { + switch (d.format) { + .nmake => { + if (std.mem.indexOfAny(u8, path, " #${}^!")) |_| + try w.print("\"{s}\"", .{path}) + else + try w.writeAll(path); + }, + .make => { + for (path, 0..) |c, i| { + switch (c) { + ' ' => { + try w.writeByte('\\'); + var j = i; + while (j != 0) { + j -= 1; + if (path[j] != '\\') break; + try w.writeByte('\\'); + } + }, + '$' => try w.writeByte('$'), + '#' => try w.writeByte('\\'), + else => {}, + } + try w.writeByte(c); + } + }, + } +} diff --git a/lib/compiler/aro/aro/Diagnostics.zig b/lib/compiler/aro/aro/Diagnostics.zig index dbf6e29af513..a2f6163fd980 100644 --- a/lib/compiler/aro/aro/Diagnostics.zig +++ b/lib/compiler/aro/aro/Diagnostics.zig @@ -1,592 +1,555 @@ const std = @import("std"); -const assert = std.debug.assert; -const Allocator = mem.Allocator; const mem = std.mem; -const Source = @import("Source.zig"); +const Allocator = mem.Allocator; + const Compilation = @import("Compilation.zig"); -const Attribute = @import("Attribute.zig"); -const Builtins = @import("Builtins.zig"); -const Builtin = Builtins.Builtin; -const Header = @import("Builtins/Properties.zig").Header; -const Tree = @import("Tree.zig"); -const is_windows = @import("builtin").os.tag == .windows; const LangOpts = @import("LangOpts.zig"); +const Source = @import("Source.zig"); pub const Message = struct { - tag: Tag, - kind: Kind = undefined, - loc: Source.Location = .{}, - extra: Extra = .{ .none = {} }, - - pub const Extra = union { - str: []const u8, - tok_id: struct { - expected: Tree.Token.Id, - actual: Tree.Token.Id, - }, - tok_id_expected: Tree.Token.Id, - arguments: struct { - expected: u32, - actual: u32, - }, - codepoints: struct { - actual: u21, - resembles: u21, - }, - attr_arg_count: struct { - attribute: Attribute.Tag, - expected: u32, - }, - attr_arg_type: struct { - expected: Attribute.ArgumentType, - actual: Attribute.ArgumentType, - }, - attr_enum: struct { - tag: Attribute.Tag, - }, - ignored_record_attr: struct { - tag: Attribute.Tag, - specifier: enum { @"struct", @"union", @"enum" }, - }, - attribute_todo: struct { - tag: Attribute.Tag, - kind: enum { variables, fields, types, functions }, - }, - builtin_with_header: struct { - builtin: Builtin.Tag, - header: Header, - }, - invalid_escape: struct { - offset: u32, - char: u8, - }, - actual_codepoint: u21, - ascii: u7, - unsigned: u64, - offset: u64, - pow_2_as_string: u8, - signed: i64, - normalized: []const u8, - none: void, + kind: Kind, + text: []const u8, + + opt: ?Option = null, + extension: bool = false, + location: ?Source.ExpandedLocation, + + effective_kind: Kind = .off, + + pub const Kind = enum { + off, + note, + warning, + @"error", + @"fatal error", }; -}; -const Properties = struct { - msg: []const u8, - kind: Kind, - extra: std.meta.FieldEnum(Message.Extra) = .none, - opt: ?u8 = null, - all: bool = false, - w_extra: bool = false, - pedantic: bool = false, - suppress_version: ?LangOpts.Standard = null, - suppress_unless_version: ?LangOpts.Standard = null, - suppress_gnu: bool = false, - suppress_gcc: bool = false, - suppress_clang: bool = false, - suppress_msvc: bool = false, - - pub fn makeOpt(comptime str: []const u8) u16 { - return @offsetOf(Options, str); - } - pub fn getKind(prop: Properties, options: *Options) Kind { - const opt = @as([*]Kind, @ptrCast(options))[prop.opt orelse return prop.kind]; - if (opt == .default) return prop.kind; - return opt; + pub fn write(msg: Message, w: *std.Io.Writer, config: std.Io.tty.Config, details: bool) std.Io.tty.Config.SetColorError!void { + try config.setColor(w, .bold); + if (msg.location) |loc| { + try w.print("{s}:{d}:{d}: ", .{ loc.path, loc.line_no, loc.col }); + } + switch (msg.effective_kind) { + .@"fatal error", .@"error" => try config.setColor(w, .bright_red), + .note => try config.setColor(w, .bright_cyan), + .warning => try config.setColor(w, .bright_magenta), + .off => unreachable, + } + try w.print("{s}: ", .{@tagName(msg.effective_kind)}); + + try config.setColor(w, .white); + try w.writeAll(msg.text); + if (msg.opt) |some| { + if (msg.effective_kind == .@"error" and msg.kind != .@"error") { + try w.print(" [-Werror,-W{s}]", .{@tagName(some)}); + } else if (msg.effective_kind != .note) { + try w.print(" [-W{s}]", .{@tagName(some)}); + } + } else if (msg.extension) { + if (msg.effective_kind == .@"error") { + try w.writeAll(" [-Werror,-Wpedantic]"); + } else if (msg.effective_kind != msg.kind) { + try w.writeAll(" [-Wpedantic]"); + } + } + + if (!details or msg.location == null) { + try w.writeAll("\n"); + try config.setColor(w, .reset); + } else { + const loc = msg.location.?; + const trailer = if (loc.end_with_splice) "\\ " else ""; + try config.setColor(w, .reset); + try w.print("\n{s}{s}\n", .{ loc.line, trailer }); + try w.splatByteAll(' ', loc.width); + try config.setColor(w, .bold); + try config.setColor(w, .bright_green); + try w.writeAll("^\n"); + try config.setColor(w, .reset); + } + try w.flush(); } - pub const max_bits = Compilation.bit_int_max_bits; }; -pub const Tag = @import("Diagnostics/messages.zig").with(Properties).Tag; - -pub const Kind = enum { @"fatal error", @"error", note, warning, off, default }; - -pub const Options = struct { - // do not directly use these, instead add `const NAME = true;` - all: Kind = .default, - extra: Kind = .default, - pedantic: Kind = .default, - - @"unsupported-pragma": Kind = .default, - @"c99-extensions": Kind = .default, - @"implicit-int": Kind = .default, - @"duplicate-decl-specifier": Kind = .default, - @"missing-declaration": Kind = .default, - @"extern-initializer": Kind = .default, - @"implicit-function-declaration": Kind = .default, - @"unused-value": Kind = .default, - @"unreachable-code": Kind = .default, - @"unknown-warning-option": Kind = .default, - @"gnu-empty-struct": Kind = .default, - @"gnu-alignof-expression": Kind = .default, - @"macro-redefined": Kind = .default, - @"generic-qual-type": Kind = .default, - multichar: Kind = .default, - @"pointer-integer-compare": Kind = .default, - @"compare-distinct-pointer-types": Kind = .default, - @"literal-conversion": Kind = .default, - @"cast-qualifiers": Kind = .default, - @"array-bounds": Kind = .default, - @"int-conversion": Kind = .default, - @"pointer-type-mismatch": Kind = .default, - @"c23-extensions": Kind = .default, - @"incompatible-pointer-types": Kind = .default, - @"excess-initializers": Kind = .default, - @"division-by-zero": Kind = .default, - @"initializer-overrides": Kind = .default, - @"incompatible-pointer-types-discards-qualifiers": Kind = .default, - @"unknown-attributes": Kind = .default, - @"ignored-attributes": Kind = .default, - @"builtin-macro-redefined": Kind = .default, - @"gnu-label-as-value": Kind = .default, - @"malformed-warning-check": Kind = .default, - @"#pragma-messages": Kind = .default, - @"newline-eof": Kind = .default, - @"empty-translation-unit": Kind = .default, - @"implicitly-unsigned-literal": Kind = .default, - @"c99-compat": Kind = .default, - @"unicode-zero-width": Kind = .default, - @"unicode-homoglyph": Kind = .default, - unicode: Kind = .default, - @"return-type": Kind = .default, - @"dollar-in-identifier-extension": Kind = .default, - @"unknown-pragmas": Kind = .default, - @"predefined-identifier-outside-function": Kind = .default, - @"many-braces-around-scalar-init": Kind = .default, - uninitialized: Kind = .default, - @"gnu-statement-expression": Kind = .default, - @"gnu-imaginary-constant": Kind = .default, - @"gnu-complex-integer": Kind = .default, - @"ignored-qualifiers": Kind = .default, - @"integer-overflow": Kind = .default, - @"extra-semi": Kind = .default, - @"gnu-binary-literal": Kind = .default, - @"variadic-macros": Kind = .default, - varargs: Kind = .default, - @"#warnings": Kind = .default, - @"deprecated-declarations": Kind = .default, - @"backslash-newline-escape": Kind = .default, - @"pointer-to-int-cast": Kind = .default, - @"gnu-case-range": Kind = .default, - @"c++-compat": Kind = .default, - vla: Kind = .default, - @"float-overflow-conversion": Kind = .default, - @"float-zero-conversion": Kind = .default, - @"float-conversion": Kind = .default, - @"gnu-folding-constant": Kind = .default, - undef: Kind = .default, - @"ignored-pragmas": Kind = .default, - @"gnu-include-next": Kind = .default, - @"include-next-outside-header": Kind = .default, - @"include-next-absolute-path": Kind = .default, - @"enum-too-large": Kind = .default, - @"fixed-enum-extension": Kind = .default, - @"designated-init": Kind = .default, - @"attribute-warning": Kind = .default, - @"invalid-noreturn": Kind = .default, - @"zero-length-array": Kind = .default, - @"old-style-flexible-struct": Kind = .default, - @"gnu-zero-variadic-macro-arguments": Kind = .default, - @"main-return-type": Kind = .default, - @"expansion-to-defined": Kind = .default, - @"bit-int-extension": Kind = .default, - @"keyword-macro": Kind = .default, - @"pointer-arith": Kind = .default, - @"sizeof-array-argument": Kind = .default, - @"pre-c23-compat": Kind = .default, - @"pointer-bool-conversion": Kind = .default, - @"string-conversion": Kind = .default, - @"gnu-auto-type": Kind = .default, - @"gnu-union-cast": Kind = .default, - @"pointer-sign": Kind = .default, - @"fuse-ld-path": Kind = .default, - @"language-extension-token": Kind = .default, - @"complex-component-init": Kind = .default, - @"microsoft-include": Kind = .default, - @"microsoft-end-of-file": Kind = .default, - @"invalid-source-encoding": Kind = .default, - @"four-char-constants": Kind = .default, - @"unknown-escape-sequence": Kind = .default, - @"invalid-pp-token": Kind = .default, - @"deprecated-non-prototype": Kind = .default, - @"duplicate-embed-param": Kind = .default, - @"unsupported-embed-param": Kind = .default, - @"unused-result": Kind = .default, - normalized: Kind = .default, - @"shift-count-negative": Kind = .default, - @"shift-count-overflow": Kind = .default, - @"constant-conversion": Kind = .default, - @"sign-conversion": Kind = .default, - nonnull: Kind = .default, +pub const Option = enum { + @"unsupported-pragma", + @"c99-extensions", + @"implicit-int", + @"duplicate-decl-specifier", + @"missing-declaration", + @"extern-initializer", + @"implicit-function-declaration", + @"unused-value", + @"unreachable-code", + @"unknown-warning-option", + @"gnu-empty-struct", + @"gnu-alignof-expression", + @"macro-redefined", + @"generic-qual-type", + multichar, + @"pointer-integer-compare", + @"compare-distinct-pointer-types", + @"literal-conversion", + @"cast-qualifiers", + @"array-bounds", + @"int-conversion", + @"pointer-type-mismatch", + @"c23-extensions", + @"incompatible-pointer-types", + @"excess-initializers", + @"division-by-zero", + @"initializer-overrides", + @"incompatible-pointer-types-discards-qualifiers", + @"unknown-attributes", + @"ignored-attributes", + @"builtin-macro-redefined", + @"gnu-label-as-value", + @"malformed-warning-check", + @"#pragma-messages", + @"newline-eof", + @"empty-translation-unit", + @"implicitly-unsigned-literal", + @"c99-compat", + @"unicode-zero-width", + @"unicode-homoglyph", + unicode, + @"return-type", + @"dollar-in-identifier-extension", + @"unknown-pragmas", + @"predefined-identifier-outside-function", + @"many-braces-around-scalar-init", + uninitialized, + @"gnu-statement-expression", + @"gnu-imaginary-constant", + @"gnu-complex-integer", + @"ignored-qualifiers", + @"integer-overflow", + @"extra-semi", + @"gnu-binary-literal", + @"variadic-macros", + varargs, + @"#warnings", + @"deprecated-declarations", + @"backslash-newline-escape", + @"pointer-to-int-cast", + @"gnu-case-range", + @"c++-compat", + vla, + @"float-overflow-conversion", + @"float-zero-conversion", + @"float-conversion", + @"gnu-folding-constant", + undef, + @"ignored-pragmas", + @"gnu-include-next", + @"include-next-outside-header", + @"include-next-absolute-path", + @"enum-too-large", + @"fixed-enum-extension", + @"designated-init", + @"attribute-warning", + @"invalid-noreturn", + @"zero-length-array", + @"old-style-flexible-struct", + @"gnu-zero-variadic-macro-arguments", + @"main-return-type", + @"expansion-to-defined", + @"bit-int-extension", + @"keyword-macro", + @"pointer-arith", + @"sizeof-array-argument", + @"pre-c23-compat", + @"pointer-bool-conversion", + @"string-conversion", + @"gnu-auto-type", + @"gnu-pointer-arith", + @"gnu-union-cast", + @"pointer-sign", + @"fuse-ld-path", + @"language-extension-token", + @"complex-component-init", + @"microsoft-include", + @"microsoft-end-of-file", + @"invalid-source-encoding", + @"four-char-constants", + @"unknown-escape-sequence", + @"invalid-pp-token", + @"deprecated-non-prototype", + @"duplicate-embed-param", + @"unsupported-embed-param", + @"unused-result", + normalized, + @"shift-count-negative", + @"shift-count-overflow", + @"constant-conversion", + @"sign-conversion", + @"address-of-packed-member", + nonnull, + @"atomic-access", + @"gnu-designator", + @"empty-body", + @"nullability-extension", + nullability, + @"microsoft-flexible-array", + @"microsoft-anon-tag", + @"out-of-scope-function", + @"date-time", + @"attribute-todo", + + /// GNU extensions + pub const gnu = [_]Option{ + .@"gnu-empty-struct", + .@"gnu-alignof-expression", + .@"gnu-label-as-value", + .@"gnu-statement-expression", + .@"gnu-imaginary-constant", + .@"gnu-complex-integer", + .@"gnu-binary-literal", + .@"gnu-case-range", + .@"gnu-folding-constant", + .@"gnu-include-next", + .@"gnu-zero-variadic-macro-arguments", + .@"gnu-auto-type", + .@"gnu-pointer-arith", + .@"gnu-union-cast", + .@"gnu-designator", + .@"zero-length-array", + }; + + /// Clang extensions + pub const clang = [_]Option{ + .@"fixed-enum-extension", + .@"bit-int-extension", + .@"nullability-extension", + }; + + /// Microsoft extensions + pub const microsoft = [_]Option{ + .@"microsoft-end-of-file", + .@"microsoft-include", + .@"microsoft-flexible-array", + .@"microsoft-anon-tag", + }; + + pub const extra = [_]Option{ + .@"initializer-overrides", + .@"ignored-qualifiers", + .@"initializer-overrides", + .@"expansion-to-defined", + .@"fuse-ld-path", + }; + + pub const implicit = [_]Option{ + .@"implicit-int", + .@"implicit-function-declaration", + }; + + pub const unused = [_]Option{ + .@"unused-value", + .@"unused-result", + }; + + pub const most = implicit ++ unused ++ [_]Option{ + .@"initializer-overrides", + .@"ignored-qualifiers", + .@"initializer-overrides", + .multichar, + .@"return-type", + .@"sizeof-array-argument", + .uninitialized, + .@"unknown-pragmas", + }; + + pub const all = most ++ [_]Option{ + .nonnull, + .@"unreachable-code", + .@"malformed-warning-check", + }; +}; + +pub const State = struct { + // Treat all errors as fatal, set by -Wfatal-errors + fatal_errors: bool = false, + // Treat all warnings as errors, set by -Werror + error_warnings: bool = false, + /// Enable all warnings, set by -Weverything + enable_all_warnings: bool = false, + /// Ignore all warnings, set by -w + ignore_warnings: bool = false, + /// How to treat extension diagnostics, set by -Wpedantic + extensions: Message.Kind = .off, + /// How to treat individual options, set by -W + options: std.EnumMap(Option, Message.Kind) = .{}, + /// Should warnings be suppressed in system headers, set by -Wsystem-headers + suppress_system_headers: bool = true, }; const Diagnostics = @This(); -list: std.ArrayListUnmanaged(Message) = .empty, -arena: std.heap.ArenaAllocator, -fatal_errors: bool = false, -options: Options = .{}, +output: union(enum) { + to_writer: struct { + writer: *std.Io.Writer, + color: std.Io.tty.Config, + }, + to_list: struct { + messages: std.ArrayList(Message) = .empty, + arena: std.heap.ArenaAllocator, + }, + ignore, +}, +/// Force usage of color in output. +color: ?bool = null, +/// Include line of code in output. +details: bool = true, + +state: State = .{}, +/// Amount of error or fatal error messages that have been sent to `output`. errors: u32 = 0, +/// Amount of warnings that have been sent to `output`. +warnings: u32 = 0, +// Total amount of diagnostics messages sent to `output`. +total: u32 = 0, macro_backtrace_limit: u32 = 6, +/// If `effectiveKind` causes us to skip a diagnostic, this is temporarily set to +/// `true` to signal that associated notes should also be skipped. +hide_notes: bool = false, + +pub fn deinit(d: *Diagnostics) void { + switch (d.output) { + .ignore => {}, + .to_writer => {}, + .to_list => |*list| { + list.messages.deinit(list.arena.child_allocator); + list.arena.deinit(); + }, + } +} +/// Used by the __has_warning builtin macro. pub fn warningExists(name: []const u8) bool { - inline for (@typeInfo(Options).@"struct".fields) |f| { - if (mem.eql(u8, f.name, name)) return true; + if (std.mem.eql(u8, name, "pedantic")) return true; + inline for (comptime std.meta.declarations(Option)) |group| { + if (std.mem.eql(u8, name, group.name)) return true; } - return false; + return std.meta.stringToEnum(Option, name) != null; } -pub fn set(d: *Diagnostics, name: []const u8, to: Kind) !void { - inline for (@typeInfo(Options).@"struct".fields) |f| { - if (mem.eql(u8, f.name, name)) { - @field(d.options, f.name) = to; +pub fn set(d: *Diagnostics, name: []const u8, to: Message.Kind) Compilation.Error!void { + if (std.mem.eql(u8, name, "pedantic")) { + d.state.extensions = to; + return; + } + if (std.meta.stringToEnum(Option, name)) |option| { + d.state.options.put(option, to); + return; + } + + inline for (comptime std.meta.declarations(Option)) |group| { + if (std.mem.eql(u8, name, group.name)) { + for (@field(Option, group.name)) |option| { + d.state.options.put(option, to); + } return; } } - try d.addExtra(.{}, .{ - .tag = .unknown_warning, - .extra = .{ .str = name }, - }, &.{}, true); -} -pub fn init(gpa: Allocator) Diagnostics { - return .{ - .arena = std.heap.ArenaAllocator.init(gpa), - }; + var buf: [256]u8 = undefined; + const slice = std.fmt.bufPrint(&buf, "unknown warning '{s}'", .{name}) catch &buf; + + try d.add(.{ + .text = slice, + .kind = .warning, + .opt = .@"unknown-warning-option", + .location = null, + }); } -pub fn deinit(d: *Diagnostics) void { - d.list.deinit(d.arena.child_allocator); - d.arena.deinit(); +/// This mutates the `Diagnostics`, so may only be called when `message` is being added. +/// If `.off` is returned, `message` will not be included, so the caller should give up. +pub fn effectiveKind(d: *Diagnostics, message: anytype) Message.Kind { + if (d.hide_notes and message.kind == .note) { + return .off; + } + + // -w disregards explicit kind set with -W + if (d.state.ignore_warnings and message.kind == .warning) { + d.hide_notes = true; + return .off; + } + + if (@hasField(@TypeOf(message), "location")) { + if (message.location) |location| { + if (location.kind != .user and d.state.suppress_system_headers and + (message.kind == .warning or message.kind == .off)) + { + return .off; + } + } + } + + var kind = message.kind; + + // Get explicit kind set by -W= + var set_explicit = false; + if (message.opt) |option| { + if (d.state.options.get(option)) |explicit| { + kind = explicit; + set_explicit = true; + } + } + + // Use extension diagnostic behavior if not set explicitly. + if (message.extension and !set_explicit) { + kind = @enumFromInt(@max(@intFromEnum(kind), @intFromEnum(d.state.extensions))); + } + + // Make diagnostic a warning if -Weverything is set. + if (kind == .off and d.state.enable_all_warnings) kind = .warning; + + // Upgrade warnigns to errors if -Werror is set + if (kind == .warning and d.state.error_warnings) kind = .@"error"; + + // Upgrade errors to fatal errors if -Wfatal-errors is set + if (kind == .@"error" and d.state.fatal_errors) kind = .@"fatal error"; + + if (kind == .off) d.hide_notes = true; + return kind; } -pub fn add(comp: *Compilation, msg: Message, expansion_locs: []const Source.Location) Compilation.Error!void { - return comp.diagnostics.addExtra(comp.langopts, msg, expansion_locs, true); +pub fn add(d: *Diagnostics, msg: Message) Compilation.Error!void { + var copy = msg; + copy.effective_kind = d.effectiveKind(msg); + if (copy.effective_kind == .off) return; + try d.addMessage(copy); + if (copy.effective_kind == .@"fatal error") return error.FatalError; } -pub fn addExtra( +pub fn addWithLocation( d: *Diagnostics, - langopts: LangOpts, + comp: *const Compilation, msg: Message, expansion_locs: []const Source.Location, note_msg_loc: bool, ) Compilation.Error!void { - const kind = d.tagKind(msg.tag, langopts); - if (kind == .off) return; var copy = msg; - copy.kind = kind; + if (expansion_locs.len != 0) copy.location = expansion_locs[expansion_locs.len - 1].expand(comp); + copy.effective_kind = d.effectiveKind(copy); + if (copy.effective_kind == .off) return; + try d.addMessage(copy); - if (expansion_locs.len != 0) copy.loc = expansion_locs[expansion_locs.len - 1]; - try d.list.append(d.arena.child_allocator, copy); if (expansion_locs.len != 0) { // Add macro backtrace notes in reverse order omitting from the middle if needed. var i = expansion_locs.len - 1; const half = d.macro_backtrace_limit / 2; const limit = if (i < d.macro_backtrace_limit) 0 else i - half; - try d.list.ensureUnusedCapacity( - d.arena.child_allocator, - if (limit == 0) expansion_locs.len else d.macro_backtrace_limit + 1, - ); while (i > limit) { i -= 1; - d.list.appendAssumeCapacity(.{ - .tag = .expanded_from_here, + try d.addMessage(.{ .kind = .note, - .loc = expansion_locs[i], + .effective_kind = .note, + .text = "expanded from here", + .location = expansion_locs[i].expand(comp), }); } if (limit != 0) { - d.list.appendAssumeCapacity(.{ - .tag = .skipping_macro_backtrace, + var buf: [256]u8 = undefined; + try d.addMessage(.{ .kind = .note, - .extra = .{ .unsigned = expansion_locs.len - d.macro_backtrace_limit }, + .effective_kind = .note, + .text = std.fmt.bufPrint( + &buf, + "(skipping {d} expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)", + .{expansion_locs.len - d.macro_backtrace_limit}, + ) catch unreachable, + .location = null, }); i = half -| 1; while (i > 0) { i -= 1; - d.list.appendAssumeCapacity(.{ - .tag = .expanded_from_here, + try d.addMessage(.{ .kind = .note, - .loc = expansion_locs[i], + .effective_kind = .note, + .text = "expanded from here", + .location = expansion_locs[i].expand(comp), }); } } - if (note_msg_loc) d.list.appendAssumeCapacity(.{ - .tag = .expanded_from_here, - .kind = .note, - .loc = msg.loc, - }); - } - if (kind == .@"fatal error" or (kind == .@"error" and d.fatal_errors)) - return error.FatalError; -} - -pub fn render(comp: *Compilation, config: std.io.tty.Config) void { - if (comp.diagnostics.list.items.len == 0) return; - var buffer: [1000]u8 = undefined; - var m = defaultMsgWriter(config, &buffer); - defer m.deinit(); - renderMessages(comp, &m); -} -pub fn defaultMsgWriter(config: std.io.tty.Config, buffer: []u8) MsgWriter { - return MsgWriter.init(config, buffer); -} - -pub fn renderMessages(comp: *Compilation, m: anytype) void { - var errors: u32 = 0; - var warnings: u32 = 0; - for (comp.diagnostics.list.items) |msg| { - switch (msg.kind) { - .@"fatal error", .@"error" => errors += 1, - .warning => warnings += 1, - .note => {}, - .off => continue, // happens if an error is added before it is disabled - .default => unreachable, - } - renderMessage(comp, m, msg); - } - const w_s: []const u8 = if (warnings == 1) "" else "s"; - const e_s: []const u8 = if (errors == 1) "" else "s"; - if (errors != 0 and warnings != 0) { - m.print("{d} warning{s} and {d} error{s} generated.\n", .{ warnings, w_s, errors, e_s }); - } else if (warnings != 0) { - m.print("{d} warning{s} generated.\n", .{ warnings, w_s }); - } else if (errors != 0) { - m.print("{d} error{s} generated.\n", .{ errors, e_s }); - } - - comp.diagnostics.list.items.len = 0; - comp.diagnostics.errors += errors; -} - -pub fn renderMessage(comp: *Compilation, m: anytype, msg: Message) void { - var line: ?[]const u8 = null; - var end_with_splice = false; - const width = if (msg.loc.id != .unused) blk: { - var loc = msg.loc; - switch (msg.tag) { - .escape_sequence_overflow, - .invalid_universal_character, - => loc.byte_offset += @truncate(msg.extra.offset), - .non_standard_escape_char, - .unknown_escape_sequence, - => loc.byte_offset += msg.extra.invalid_escape.offset, - else => {}, - } - const source = comp.getSource(loc.id); - var line_col = source.lineCol(loc); - line = line_col.line; - end_with_splice = line_col.end_with_splice; - if (msg.tag == .backslash_newline_escape) { - line = line_col.line[0 .. line_col.col - 1]; - line_col.col += 1; - line_col.width += 1; - } - m.location(source.path, line_col.line_no, line_col.col); - break :blk line_col.width; - } else 0; - - m.start(msg.kind); - const prop = msg.tag.property(); - switch (prop.extra) { - .str => printRt(m, prop.msg, .{"{s}"}, .{msg.extra.str}), - .tok_id => printRt(m, prop.msg, .{ "{s}", "{s}" }, .{ - msg.extra.tok_id.expected.symbol(), - msg.extra.tok_id.actual.symbol(), - }), - .tok_id_expected => printRt(m, prop.msg, .{"{s}"}, .{msg.extra.tok_id_expected.symbol()}), - .arguments => printRt(m, prop.msg, .{ "{d}", "{d}" }, .{ - msg.extra.arguments.expected, - msg.extra.arguments.actual, - }), - .codepoints => printRt(m, prop.msg, .{ "{X:0>4}", "{u}" }, .{ - msg.extra.codepoints.actual, - msg.extra.codepoints.resembles, - }), - .attr_arg_count => printRt(m, prop.msg, .{ "{s}", "{d}" }, .{ - @tagName(msg.extra.attr_arg_count.attribute), - msg.extra.attr_arg_count.expected, - }), - .attr_arg_type => printRt(m, prop.msg, .{ "{s}", "{s}" }, .{ - msg.extra.attr_arg_type.expected.toString(), - msg.extra.attr_arg_type.actual.toString(), - }), - .actual_codepoint => printRt(m, prop.msg, .{"{X:0>4}"}, .{msg.extra.actual_codepoint}), - .ascii => printRt(m, prop.msg, .{"{c}"}, .{msg.extra.ascii}), - .unsigned => printRt(m, prop.msg, .{"{d}"}, .{msg.extra.unsigned}), - .pow_2_as_string => printRt(m, prop.msg, .{"{s}"}, .{switch (msg.extra.pow_2_as_string) { - 63 => "9223372036854775808", - 64 => "18446744073709551616", - 127 => "170141183460469231731687303715884105728", - 128 => "340282366920938463463374607431768211456", - else => unreachable, - }}), - .signed => printRt(m, prop.msg, .{"{d}"}, .{msg.extra.signed}), - .attr_enum => printRt(m, prop.msg, .{ "{s}", "{s}" }, .{ - @tagName(msg.extra.attr_enum.tag), - Attribute.Formatting.choices(msg.extra.attr_enum.tag), - }), - .ignored_record_attr => printRt(m, prop.msg, .{ "{s}", "{s}" }, .{ - @tagName(msg.extra.ignored_record_attr.tag), - @tagName(msg.extra.ignored_record_attr.specifier), - }), - .attribute_todo => printRt(m, prop.msg, .{ "{s}", "{s}" }, .{ - @tagName(msg.extra.attribute_todo.tag), - @tagName(msg.extra.attribute_todo.kind), - }), - .builtin_with_header => printRt(m, prop.msg, .{ "{s}", "{s}" }, .{ - @tagName(msg.extra.builtin_with_header.header), - Builtin.nameFromTag(msg.extra.builtin_with_header.builtin).span(), - }), - .invalid_escape => { - if (std.ascii.isPrint(msg.extra.invalid_escape.char)) { - const str: [1]u8 = .{msg.extra.invalid_escape.char}; - printRt(m, prop.msg, .{"{s}"}, .{&str}); - } else { - var buf: [3]u8 = undefined; - const str = std.fmt.bufPrint(&buf, "x{x}", .{msg.extra.invalid_escape.char}) catch unreachable; - printRt(m, prop.msg, .{"{s}"}, .{str}); - } - }, - .normalized => { - const f = struct { - pub fn f(bytes: []const u8, writer: *std.io.Writer) std.io.Writer.Error!void { - var it: std.unicode.Utf8Iterator = .{ - .bytes = bytes, - .i = 0, - }; - while (it.nextCodepoint()) |codepoint| { - if (codepoint < 0x7F) { - try writer.writeByte(@intCast(codepoint)); - } else if (codepoint < 0xFFFF) { - try writer.writeAll("\\u"); - try writer.printInt(codepoint, 16, .upper, .{ .fill = '0', .width = 4 }); - } else { - try writer.writeAll("\\U"); - try writer.printInt(codepoint, 16, .upper, .{ .fill = '0', .width = 8 }); - } - } - } - }.f; - printRt(m, prop.msg, .{"{f}"}, .{ - std.fmt.Formatter([]const u8, f){ .data = msg.extra.normalized }, + if (note_msg_loc) { + try d.addMessage(.{ + .kind = .note, + .effective_kind = .note, + .text = "expanded from here", + .location = msg.location.?, }); - }, - .none, .offset => m.write(prop.msg), - } - - if (prop.opt) |some| { - if (msg.kind == .@"error" and prop.kind != .@"error") { - m.print(" [-Werror,-W{s}]", .{optName(some)}); - } else if (msg.kind != .note) { - m.print(" [-W{s}]", .{optName(some)}); } } - - m.end(line, width, end_with_splice); + if (copy.kind == .@"fatal error") return error.FatalError; } -fn printRt(m: anytype, str: []const u8, comptime fmts: anytype, args: anytype) void { +pub fn formatArgs(w: *std.Io.Writer, fmt: []const u8, args: anytype) std.Io.Writer.Error!void { var i: usize = 0; - inline for (fmts, args) |fmt, arg| { - const new = std.mem.indexOfPos(u8, str, i, fmt).?; - m.write(str[i..new]); - i = new + fmt.len; - m.print(fmt, .{arg}); + inline for (std.meta.fields(@TypeOf(args))) |arg_info| { + const arg = @field(args, arg_info.name); + i += switch (@TypeOf(arg)) { + []const u8 => try formatString(w, fmt[i..], arg), + else => switch (@typeInfo(@TypeOf(arg))) { + .int, .comptime_int => try Diagnostics.formatInt(w, fmt[i..], arg), + .pointer => try Diagnostics.formatString(w, fmt[i..], arg), + else => unreachable, + }, + }; } - m.write(str[i..]); + try w.writeAll(fmt[i..]); } -fn optName(offset: u16) []const u8 { - return std.meta.fieldNames(Options)[offset / @sizeOf(Kind)]; +pub fn formatString(w: *std.Io.Writer, fmt: []const u8, str: []const u8) std.Io.Writer.Error!usize { + const template = "{s}"; + const i = std.mem.indexOf(u8, fmt, template).?; + try w.writeAll(fmt[0..i]); + try w.writeAll(str); + return i + template.len; } -fn tagKind(d: *Diagnostics, tag: Tag, langopts: LangOpts) Kind { - const prop = tag.property(); - var kind = prop.getKind(&d.options); - - if (prop.all) { - if (d.options.all != .default) kind = d.options.all; - } - if (prop.w_extra) { - if (d.options.extra != .default) kind = d.options.extra; - } - if (prop.pedantic) { - if (d.options.pedantic != .default) kind = d.options.pedantic; - } - if (prop.suppress_version) |some| if (langopts.standard.atLeast(some)) return .off; - if (prop.suppress_unless_version) |some| if (!langopts.standard.atLeast(some)) return .off; - if (prop.suppress_gnu and langopts.standard.isExplicitGNU()) return .off; - if (prop.suppress_gcc and langopts.emulate == .gcc) return .off; - if (prop.suppress_clang and langopts.emulate == .clang) return .off; - if (prop.suppress_msvc and langopts.emulate == .msvc) return .off; - if (kind == .@"error" and d.fatal_errors) kind = .@"fatal error"; - return kind; +pub fn formatInt(w: *std.Io.Writer, fmt: []const u8, int: anytype) std.Io.Writer.Error!usize { + const template = "{d}"; + const i = std.mem.indexOf(u8, fmt, template).?; + try w.writeAll(fmt[0..i]); + try w.printInt(int, 10, .lower, .{}); + return i + template.len; } -const MsgWriter = struct { - writer: *std.io.Writer, - config: std.io.tty.Config, - - fn init(config: std.io.tty.Config, buffer: []u8) MsgWriter { - return .{ - .writer = std.debug.lockStderrWriter(buffer), - .config = config, - }; - } - - pub fn deinit(m: *MsgWriter) void { - std.debug.unlockStderrWriter(); - m.* = undefined; - } - - pub fn print(m: *MsgWriter, comptime fmt: []const u8, args: anytype) void { - m.writer.print(fmt, args) catch {}; - } - - fn write(m: *MsgWriter, msg: []const u8) void { - m.writer.writeAll(msg) catch {}; - } - - fn setColor(m: *MsgWriter, color: std.io.tty.Color) void { - m.config.setColor(m.writer, color) catch {}; - } - - fn location(m: *MsgWriter, path: []const u8, line: u32, col: u32) void { - m.setColor(.bold); - m.print("{s}:{d}:{d}: ", .{ path, line, col }); - } - - fn start(m: *MsgWriter, kind: Kind) void { - switch (kind) { - .@"fatal error", .@"error" => m.setColor(.bright_red), - .note => m.setColor(.bright_cyan), - .warning => m.setColor(.bright_magenta), - .off, .default => unreachable, - } - m.write(switch (kind) { - .@"fatal error" => "fatal error: ", - .@"error" => "error: ", - .note => "note: ", - .warning => "warning: ", - .off, .default => unreachable, - }); - m.setColor(.white); +fn addMessage(d: *Diagnostics, msg: Message) Compilation.Error!void { + std.debug.assert(msg.effective_kind != .off); + switch (msg.effective_kind) { + .off => unreachable, + .@"error", .@"fatal error" => d.errors += 1, + .warning => d.warnings += 1, + .note => {}, } - - fn end(m: *MsgWriter, maybe_line: ?[]const u8, col: u32, end_with_splice: bool) void { - const line = maybe_line orelse { - m.write("\n"); - m.setColor(.reset); - return; - }; - const trailer = if (end_with_splice) "\\ " else ""; - m.setColor(.reset); - m.print("\n{s}{s}\n{s: >[3]}", .{ line, trailer, "", col }); - m.setColor(.bold); - m.setColor(.bright_green); - m.write("^\n"); - m.setColor(.reset); + d.total += 1; + d.hide_notes = false; + + switch (d.output) { + .ignore => {}, + .to_writer => |writer| { + var config = writer.color; + if (d.color == false) config = .no_color; + if (d.color == true and config == .no_color) config = .escape_codes; + msg.write(writer.writer, config, d.details) catch { + return error.FatalError; + }; + }, + .to_list => |*list| { + const arena = list.arena.allocator(); + try list.messages.append(list.arena.child_allocator, .{ + .kind = msg.kind, + .effective_kind = msg.effective_kind, + .text = try arena.dupe(u8, msg.text), + .opt = msg.opt, + .extension = msg.extension, + .location = msg.location, + }); + }, } -}; +} diff --git a/lib/compiler/aro/aro/Diagnostics/messages.zig b/lib/compiler/aro/aro/Diagnostics/messages.zig deleted file mode 100644 index c56641a4614d..000000000000 --- a/lib/compiler/aro/aro/Diagnostics/messages.zig +++ /dev/null @@ -1,1041 +0,0 @@ -//! Autogenerated by GenerateDef from src/aro/Diagnostics/messages.def, do not edit -// zig fmt: off - -const std = @import("std"); - -pub fn with(comptime Properties: type) type { -return struct { -const W = Properties.makeOpt; -const pointer_sign_message = " converts between pointers to integer types with different sign"; -const expected_arguments = "expected {d} argument(s) got {d}"; -pub const Tag = enum { - todo, - error_directive, - warning_directive, - elif_without_if, - elif_after_else, - elifdef_without_if, - elifdef_after_else, - elifndef_without_if, - elifndef_after_else, - else_without_if, - else_after_else, - endif_without_if, - unknown_pragma, - line_simple_digit, - line_invalid_filename, - unterminated_conditional_directive, - invalid_preprocessing_directive, - macro_name_missing, - extra_tokens_directive_end, - expected_value_in_expr, - closing_paren, - to_match_paren, - to_match_brace, - to_match_bracket, - header_str_closing, - header_str_match, - string_literal_in_pp_expr, - float_literal_in_pp_expr, - defined_as_macro_name, - macro_name_must_be_identifier, - whitespace_after_macro_name, - hash_hash_at_start, - hash_hash_at_end, - pasting_formed_invalid, - missing_paren_param_list, - unterminated_macro_param_list, - invalid_token_param_list, - expected_comma_param_list, - hash_not_followed_param, - expected_filename, - empty_filename, - expected_invalid, - expected_eof, - expected_token, - expected_expr, - expected_integer_constant_expr, - missing_type_specifier, - missing_type_specifier_c23, - multiple_storage_class, - static_assert_failure, - static_assert_failure_message, - expected_type, - cannot_combine_spec, - duplicate_decl_spec, - restrict_non_pointer, - expected_external_decl, - expected_ident_or_l_paren, - missing_declaration, - func_not_in_root, - illegal_initializer, - extern_initializer, - spec_from_typedef, - param_before_var_args, - void_only_param, - void_param_qualified, - void_must_be_first_param, - invalid_storage_on_param, - threadlocal_non_var, - func_spec_non_func, - illegal_storage_on_func, - illegal_storage_on_global, - expected_stmt, - func_cannot_return_func, - func_cannot_return_array, - undeclared_identifier, - not_callable, - unsupported_str_cat, - static_func_not_global, - implicit_func_decl, - unknown_builtin, - implicit_builtin, - implicit_builtin_header_note, - expected_param_decl, - invalid_old_style_params, - expected_fn_body, - invalid_void_param, - unused_value, - continue_not_in_loop, - break_not_in_loop_or_switch, - unreachable_code, - duplicate_label, - previous_label, - undeclared_label, - case_not_in_switch, - duplicate_switch_case, - multiple_default, - previous_case, - expected_arguments, - callee_with_static_array, - array_argument_too_small, - non_null_argument, - expected_arguments_old, - expected_at_least_arguments, - invalid_static_star, - static_non_param, - array_qualifiers, - star_non_param, - variable_len_array_file_scope, - useless_static, - negative_array_size, - array_incomplete_elem, - array_func_elem, - static_non_outermost_array, - qualifier_non_outermost_array, - unterminated_macro_arg_list, - unknown_warning, - overflow, - int_literal_too_big, - indirection_ptr, - addr_of_rvalue, - addr_of_bitfield, - not_assignable, - ident_or_l_brace, - empty_enum, - redefinition, - previous_definition, - expected_identifier, - expected_str_literal, - expected_str_literal_in, - parameter_missing, - empty_record, - empty_record_size, - wrong_tag, - expected_parens_around_typename, - alignof_expr, - invalid_alignof, - invalid_sizeof, - macro_redefined, - generic_qual_type, - generic_array_type, - generic_func_type, - generic_duplicate, - generic_duplicate_here, - generic_duplicate_default, - generic_no_match, - escape_sequence_overflow, - invalid_universal_character, - incomplete_universal_character, - multichar_literal_warning, - invalid_multichar_literal, - wide_multichar_literal, - char_lit_too_wide, - char_too_large, - must_use_struct, - must_use_union, - must_use_enum, - redefinition_different_sym, - redefinition_incompatible, - redefinition_of_parameter, - invalid_bin_types, - comparison_ptr_int, - comparison_distinct_ptr, - incompatible_pointers, - invalid_argument_un, - incompatible_assign, - implicit_ptr_to_int, - invalid_cast_to_float, - invalid_cast_to_pointer, - invalid_cast_type, - qual_cast, - invalid_index, - invalid_subscript, - array_after, - array_before, - statement_int, - statement_scalar, - func_should_return, - incompatible_return, - incompatible_return_sign, - implicit_int_to_ptr, - func_does_not_return, - void_func_returns_value, - incompatible_arg, - incompatible_ptr_arg, - incompatible_ptr_arg_sign, - parameter_here, - atomic_array, - atomic_func, - atomic_incomplete, - addr_of_register, - variable_incomplete_ty, - parameter_incomplete_ty, - tentative_array, - deref_incomplete_ty_ptr, - alignas_on_func, - alignas_on_param, - minimum_alignment, - maximum_alignment, - negative_alignment, - align_ignored, - zero_align_ignored, - non_pow2_align, - pointer_mismatch, - static_assert_not_constant, - static_assert_missing_message, - pre_c23_compat, - unbound_vla, - array_too_large, - record_too_large, - incompatible_ptr_init, - incompatible_ptr_init_sign, - incompatible_ptr_assign, - incompatible_ptr_assign_sign, - vla_init, - func_init, - incompatible_init, - empty_scalar_init, - excess_scalar_init, - excess_str_init, - excess_struct_init, - excess_array_init, - str_init_too_long, - arr_init_too_long, - invalid_typeof, - division_by_zero, - division_by_zero_macro, - builtin_choose_cond, - alignas_unavailable, - case_val_unavailable, - enum_val_unavailable, - incompatible_array_init, - array_init_str, - initializer_overrides, - previous_initializer, - invalid_array_designator, - negative_array_designator, - oob_array_designator, - invalid_field_designator, - no_such_field_designator, - empty_aggregate_init_braces, - ptr_init_discards_quals, - ptr_assign_discards_quals, - ptr_ret_discards_quals, - ptr_arg_discards_quals, - unknown_attribute, - ignored_attribute, - invalid_fallthrough, - cannot_apply_attribute_to_statement, - builtin_macro_redefined, - feature_check_requires_identifier, - missing_tok_builtin, - gnu_label_as_value, - expected_record_ty, - member_expr_not_ptr, - member_expr_ptr, - no_such_member, - malformed_warning_check, - invalid_computed_goto, - pragma_warning_message, - pragma_error_message, - pragma_message, - pragma_requires_string_literal, - poisoned_identifier, - pragma_poison_identifier, - pragma_poison_macro, - newline_eof, - empty_translation_unit, - omitting_parameter_name, - non_int_bitfield, - negative_bitwidth, - zero_width_named_field, - bitfield_too_big, - invalid_utf8, - implicitly_unsigned_literal, - invalid_preproc_operator, - invalid_preproc_expr_start, - c99_compat, - unexpected_character, - invalid_identifier_start_char, - unicode_zero_width, - unicode_homoglyph, - meaningless_asm_qual, - duplicate_asm_qual, - invalid_asm_str, - dollar_in_identifier_extension, - dollars_in_identifiers, - expanded_from_here, - skipping_macro_backtrace, - pragma_operator_string_literal, - unknown_gcc_pragma, - unknown_gcc_pragma_directive, - predefined_top_level, - incompatible_va_arg, - too_many_scalar_init_braces, - uninitialized_in_own_init, - gnu_statement_expression, - stmt_expr_not_allowed_file_scope, - gnu_imaginary_constant, - plain_complex, - complex_int, - qual_on_ret_type, - cli_invalid_standard, - cli_invalid_target, - cli_invalid_emulate, - cli_unknown_arg, - cli_error, - cli_unused_link_object, - cli_unknown_linker, - extra_semi, - func_field, - vla_field, - field_incomplete_ty, - flexible_in_union, - flexible_non_final, - flexible_in_empty, - duplicate_member, - binary_integer_literal, - gnu_va_macro, - builtin_must_be_called, - va_start_not_in_func, - va_start_fixed_args, - va_start_not_last_param, - attribute_not_enough_args, - attribute_too_many_args, - attribute_arg_invalid, - unknown_attr_enum, - attribute_requires_identifier, - declspec_not_enabled, - declspec_attr_not_supported, - deprecated_declarations, - deprecated_note, - unavailable, - unavailable_note, - warning_attribute, - error_attribute, - ignored_record_attr, - backslash_newline_escape, - array_size_non_int, - cast_to_smaller_int, - gnu_switch_range, - empty_case_range, - non_standard_escape_char, - invalid_pp_stringify_escape, - vla, - int_value_changed, - sign_conversion, - float_overflow_conversion, - float_out_of_range, - float_zero_conversion, - float_value_changed, - float_to_int, - const_decl_folded, - const_decl_folded_vla, - redefinition_of_typedef, - undefined_macro, - fn_macro_undefined, - preprocessing_directive_only, - missing_lparen_after_builtin, - offsetof_ty, - offsetof_incomplete, - offsetof_array, - pragma_pack_lparen, - pragma_pack_rparen, - pragma_pack_unknown_action, - pragma_pack_show, - pragma_pack_int, - pragma_pack_int_ident, - pragma_pack_undefined_pop, - pragma_pack_empty_stack, - cond_expr_type, - too_many_includes, - enumerator_too_small, - enumerator_too_large, - include_next, - include_next_outside_header, - enumerator_overflow, - enum_not_representable, - enum_too_large, - enum_fixed, - enum_prev_nonfixed, - enum_prev_fixed, - enum_different_explicit_ty, - enum_not_representable_fixed, - transparent_union_wrong_type, - transparent_union_one_field, - transparent_union_size, - transparent_union_size_note, - designated_init_invalid, - designated_init_needed, - ignore_common, - ignore_nocommon, - non_string_ignored, - local_variable_attribute, - ignore_cold, - ignore_hot, - ignore_noinline, - ignore_always_inline, - invalid_noreturn, - nodiscard_unused, - warn_unused_result, - invalid_vec_elem_ty, - vec_size_not_multiple, - invalid_imag, - invalid_real, - zero_length_array, - old_style_flexible_struct, - comma_deletion_va_args, - main_return_type, - expansion_to_defined, - invalid_int_suffix, - invalid_float_suffix, - invalid_octal_digit, - invalid_binary_digit, - exponent_has_no_digits, - hex_floating_constant_requires_exponent, - sizeof_returns_zero, - declspec_not_allowed_after_declarator, - declarator_name_tok, - type_not_supported_on_target, - bit_int, - unsigned_bit_int_too_small, - signed_bit_int_too_small, - unsigned_bit_int_too_big, - signed_bit_int_too_big, - keyword_macro, - ptr_arithmetic_incomplete, - callconv_not_supported, - pointer_arith_void, - sizeof_array_arg, - array_address_to_bool, - string_literal_to_bool, - constant_expression_conversion_not_allowed, - invalid_object_cast, - cli_invalid_fp_eval_method, - suggest_pointer_for_invalid_fp16, - bitint_suffix, - auto_type_extension, - auto_type_not_allowed, - auto_type_requires_initializer, - auto_type_requires_single_declarator, - auto_type_requires_plain_declarator, - invalid_cast_to_auto_type, - auto_type_from_bitfield, - array_of_auto_type, - auto_type_with_init_list, - missing_semicolon, - tentative_definition_incomplete, - forward_declaration_here, - gnu_union_cast, - invalid_union_cast, - cast_to_incomplete_type, - invalid_source_epoch, - fuse_ld_path, - invalid_rtlib, - unsupported_rtlib_gcc, - invalid_unwindlib, - incompatible_unwindlib, - gnu_asm_disabled, - extension_token_used, - complex_component_init, - complex_prefix_postfix_op, - not_floating_type, - argument_types_differ, - ms_search_rule, - ctrl_z_eof, - illegal_char_encoding_warning, - illegal_char_encoding_error, - ucn_basic_char_error, - ucn_basic_char_warning, - ucn_control_char_error, - ucn_control_char_warning, - c89_ucn_in_literal, - four_char_char_literal, - multi_char_char_literal, - missing_hex_escape, - unknown_escape_sequence, - attribute_requires_string, - unterminated_string_literal_warning, - unterminated_string_literal_error, - empty_char_literal_warning, - empty_char_literal_error, - unterminated_char_literal_warning, - unterminated_char_literal_error, - unterminated_comment, - def_no_proto_deprecated, - passing_args_to_kr, - unknown_type_name, - label_compound_end, - u8_char_lit, - malformed_embed_param, - malformed_embed_limit, - duplicate_embed_param, - unsupported_embed_param, - invalid_compound_literal_storage_class, - va_opt_lparen, - va_opt_rparen, - attribute_int_out_of_range, - identifier_not_normalized, - c23_auto_plain_declarator, - c23_auto_single_declarator, - c32_auto_requires_initializer, - c23_auto_scalar_init, - negative_shift_count, - too_big_shift_count, - complex_conj, - overflow_builtin_requires_int, - overflow_result_requires_ptr, - attribute_todo, - invalid_type_underlying_enum, - auto_type_self_initialized, - - pub fn property(tag: Tag) Properties { - return named_data[@intFromEnum(tag)]; - } - - const named_data = [_]Properties{ - .{ .msg = "TODO: {s}", .extra = .str, .kind = .@"error" }, - .{ .msg = "{s}", .extra = .str, .kind = .@"error" }, - .{ .msg = "{s}", .opt = W("#warnings"), .extra = .str, .kind = .warning }, - .{ .msg = "#elif without #if", .kind = .@"error" }, - .{ .msg = "#elif after #else", .kind = .@"error" }, - .{ .msg = "#elifdef without #if", .kind = .@"error" }, - .{ .msg = "#elifdef after #else", .kind = .@"error" }, - .{ .msg = "#elifndef without #if", .kind = .@"error" }, - .{ .msg = "#elifndef after #else", .kind = .@"error" }, - .{ .msg = "#else without #if", .kind = .@"error" }, - .{ .msg = "#else after #else", .kind = .@"error" }, - .{ .msg = "#endif without #if", .kind = .@"error" }, - .{ .msg = "unknown pragma ignored", .opt = W("unknown-pragmas"), .kind = .off, .all = true }, - .{ .msg = "#line directive requires a simple digit sequence", .kind = .@"error" }, - .{ .msg = "invalid filename for #line directive", .kind = .@"error" }, - .{ .msg = "unterminated conditional directive", .kind = .@"error" }, - .{ .msg = "invalid preprocessing directive", .kind = .@"error" }, - .{ .msg = "macro name missing", .kind = .@"error" }, - .{ .msg = "extra tokens at end of macro directive", .kind = .@"error" }, - .{ .msg = "expected value in expression", .kind = .@"error" }, - .{ .msg = "expected closing ')'", .kind = .@"error" }, - .{ .msg = "to match this '('", .kind = .note }, - .{ .msg = "to match this '{'", .kind = .note }, - .{ .msg = "to match this '['", .kind = .note }, - .{ .msg = "expected closing '>'", .kind = .@"error" }, - .{ .msg = "to match this '<'", .kind = .note }, - .{ .msg = "string literal in preprocessor expression", .kind = .@"error" }, - .{ .msg = "floating point literal in preprocessor expression", .kind = .@"error" }, - .{ .msg = "'defined' cannot be used as a macro name", .kind = .@"error" }, - .{ .msg = "macro name must be an identifier", .kind = .@"error" }, - .{ .msg = "ISO C99 requires whitespace after the macro name", .opt = W("c99-extensions"), .kind = .warning }, - .{ .msg = "'##' cannot appear at the start of a macro expansion", .kind = .@"error" }, - .{ .msg = "'##' cannot appear at the end of a macro expansion", .kind = .@"error" }, - .{ .msg = "pasting formed '{s}', an invalid preprocessing token", .extra = .str, .kind = .@"error" }, - .{ .msg = "missing ')' in macro parameter list", .kind = .@"error" }, - .{ .msg = "unterminated macro param list", .kind = .@"error" }, - .{ .msg = "invalid token in macro parameter list", .kind = .@"error" }, - .{ .msg = "expected comma in macro parameter list", .kind = .@"error" }, - .{ .msg = "'#' is not followed by a macro parameter", .kind = .@"error" }, - .{ .msg = "expected \"FILENAME\" or ", .kind = .@"error" }, - .{ .msg = "empty filename", .kind = .@"error" }, - .{ .msg = "expected '{s}', found invalid bytes", .extra = .tok_id_expected, .kind = .@"error" }, - .{ .msg = "expected '{s}' before end of file", .extra = .tok_id_expected, .kind = .@"error" }, - .{ .msg = "expected '{s}', found '{s}'", .extra = .tok_id, .kind = .@"error" }, - .{ .msg = "expected expression", .kind = .@"error" }, - .{ .msg = "expression is not an integer constant expression", .kind = .@"error" }, - .{ .msg = "type specifier missing, defaults to 'int'", .opt = W("implicit-int"), .kind = .warning, .all = true }, - .{ .msg = "a type specifier is required for all declarations", .kind = .@"error" }, - .{ .msg = "cannot combine with previous '{s}' declaration specifier", .extra = .str, .kind = .@"error" }, - .{ .msg = "static assertion failed", .kind = .@"error" }, - .{ .msg = "static assertion failed {s}", .extra = .str, .kind = .@"error" }, - .{ .msg = "expected a type", .kind = .@"error" }, - .{ .msg = "cannot combine with previous '{s}' specifier", .extra = .str, .kind = .@"error" }, - .{ .msg = "duplicate '{s}' declaration specifier", .extra = .str, .opt = W("duplicate-decl-specifier"), .kind = .warning, .all = true }, - .{ .msg = "restrict requires a pointer or reference ('{s}' is invalid)", .extra = .str, .kind = .@"error" }, - .{ .msg = "expected external declaration", .kind = .@"error" }, - .{ .msg = "expected identifier or '('", .kind = .@"error" }, - .{ .msg = "declaration does not declare anything", .opt = W("missing-declaration"), .kind = .warning }, - .{ .msg = "function definition is not allowed here", .kind = .@"error" }, - .{ .msg = "illegal initializer (only variables can be initialized)", .kind = .@"error" }, - .{ .msg = "extern variable has initializer", .opt = W("extern-initializer"), .kind = .warning }, - .{ .msg = "'{s}' came from typedef", .extra = .str, .kind = .note }, - .{ .msg = "ISO C requires a named parameter before '...'", .kind = .@"error", .suppress_version = .c23 }, - .{ .msg = "'void' must be the only parameter if specified", .kind = .@"error" }, - .{ .msg = "'void' parameter cannot be qualified", .kind = .@"error" }, - .{ .msg = "'void' must be the first parameter if specified", .kind = .@"error" }, - .{ .msg = "invalid storage class on function parameter", .kind = .@"error" }, - .{ .msg = "_Thread_local only allowed on variables", .kind = .@"error" }, - .{ .msg = "'{s}' can only appear on functions", .extra = .str, .kind = .@"error" }, - .{ .msg = "illegal storage class on function", .kind = .@"error" }, - .{ .msg = "illegal storage class on global variable", .kind = .@"error" }, - .{ .msg = "expected statement", .kind = .@"error" }, - .{ .msg = "function cannot return a function", .kind = .@"error" }, - .{ .msg = "function cannot return an array", .kind = .@"error" }, - .{ .msg = "use of undeclared identifier '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "cannot call non function type '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "unsupported string literal concatenation", .kind = .@"error" }, - .{ .msg = "static functions must be global", .kind = .@"error" }, - .{ .msg = "call to undeclared function '{s}'; ISO C99 and later do not support implicit function declarations", .extra = .str, .opt = W("implicit-function-declaration"), .kind = .@"error", .all = true }, - .{ .msg = "use of unknown builtin '{s}'", .extra = .str, .opt = W("implicit-function-declaration"), .kind = .@"error", .all = true }, - .{ .msg = "implicitly declaring library function '{s}'", .extra = .str, .opt = W("implicit-function-declaration"), .kind = .@"error", .all = true }, - .{ .msg = "include the header <{s}.h> or explicitly provide a declaration for '{s}'", .extra = .builtin_with_header, .opt = W("implicit-function-declaration"), .kind = .note, .all = true }, - .{ .msg = "expected parameter declaration", .kind = .@"error" }, - .{ .msg = "identifier parameter lists are only allowed in function definitions", .kind = .@"error" }, - .{ .msg = "expected function body after function declaration", .kind = .@"error" }, - .{ .msg = "parameter cannot have void type", .kind = .@"error" }, - .{ .msg = "expression result unused", .opt = W("unused-value"), .kind = .warning, .all = true }, - .{ .msg = "'continue' statement not in a loop", .kind = .@"error" }, - .{ .msg = "'break' statement not in a loop or a switch", .kind = .@"error" }, - .{ .msg = "unreachable code", .opt = W("unreachable-code"), .kind = .warning, .all = true }, - .{ .msg = "duplicate label '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "previous definition of label '{s}' was here", .extra = .str, .kind = .note }, - .{ .msg = "use of undeclared label '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "'{s}' statement not in a switch statement", .extra = .str, .kind = .@"error" }, - .{ .msg = "duplicate case value '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "multiple default cases in the same switch", .kind = .@"error" }, - .{ .msg = "previous case defined here", .kind = .note }, - .{ .msg = expected_arguments, .extra = .arguments, .kind = .@"error" }, - .{ .msg = "callee declares array parameter as static here", .kind = .note }, - .{ .msg = "array argument is too small; contains {d} elements, callee requires at least {d}", .extra = .arguments, .kind = .warning, .opt = W("array-bounds") }, - .{ .msg = "null passed to a callee that requires a non-null argument", .kind = .warning, .opt = W("nonnull") }, - .{ .msg = expected_arguments, .extra = .arguments, .kind = .warning }, - .{ .msg = "expected at least {d} argument(s) got {d}", .extra = .arguments, .kind = .warning }, - .{ .msg = "'static' may not be used with an unspecified variable length array size", .kind = .@"error" }, - .{ .msg = "'static' used outside of function parameters", .kind = .@"error" }, - .{ .msg = "type qualifier in non parameter array type", .kind = .@"error" }, - .{ .msg = "star modifier used outside of function parameters", .kind = .@"error" }, - .{ .msg = "variable length arrays not allowed at file scope", .kind = .@"error" }, - .{ .msg = "'static' useless without a constant size", .kind = .warning, .w_extra = true }, - .{ .msg = "array size must be 0 or greater", .kind = .@"error" }, - .{ .msg = "array has incomplete element type '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "arrays cannot have functions as their element type", .kind = .@"error" }, - .{ .msg = "'static' used in non-outermost array type", .kind = .@"error" }, - .{ .msg = "type qualifier used in non-outermost array type", .kind = .@"error" }, - .{ .msg = "unterminated function macro argument list", .kind = .@"error" }, - .{ .msg = "unknown warning '{s}'", .extra = .str, .opt = W("unknown-warning-option"), .kind = .warning }, - .{ .msg = "overflow in expression; result is '{s}'", .extra = .str, .opt = W("integer-overflow"), .kind = .warning }, - .{ .msg = "integer literal is too large to be represented in any integer type", .kind = .@"error" }, - .{ .msg = "indirection requires pointer operand", .kind = .@"error" }, - .{ .msg = "cannot take the address of an rvalue", .kind = .@"error" }, - .{ .msg = "address of bit-field requested", .kind = .@"error" }, - .{ .msg = "expression is not assignable", .kind = .@"error" }, - .{ .msg = "expected identifier or '{'", .kind = .@"error" }, - .{ .msg = "empty enum is invalid", .kind = .@"error" }, - .{ .msg = "redefinition of '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "previous definition is here", .kind = .note }, - .{ .msg = "expected identifier", .kind = .@"error" }, - .{ .msg = "expected string literal for diagnostic message in static_assert", .kind = .@"error" }, - .{ .msg = "expected string literal in '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "parameter named '{s}' is missing", .extra = .str, .kind = .@"error" }, - .{ .msg = "empty {s} is a GNU extension", .extra = .str, .opt = W("gnu-empty-struct"), .kind = .off, .pedantic = true }, - .{ .msg = "empty {s} has size 0 in C, size 1 in C++", .extra = .str, .opt = W("c++-compat"), .kind = .off }, - .{ .msg = "use of '{s}' with tag type that does not match previous definition", .extra = .str, .kind = .@"error" }, - .{ .msg = "expected parentheses around type name", .kind = .@"error" }, - .{ .msg = "'_Alignof' applied to an expression is a GNU extension", .opt = W("gnu-alignof-expression"), .kind = .warning, .suppress_gnu = true }, - .{ .msg = "invalid application of 'alignof' to an incomplete type '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "invalid application of 'sizeof' to an incomplete type '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "'{s}' macro redefined", .extra = .str, .opt = W("macro-redefined"), .kind = .warning }, - .{ .msg = "generic association with qualifiers cannot be matched with", .opt = W("generic-qual-type"), .kind = .warning }, - .{ .msg = "generic association array type cannot be matched with", .opt = W("generic-qual-type"), .kind = .warning }, - .{ .msg = "generic association function type cannot be matched with", .opt = W("generic-qual-type"), .kind = .warning }, - .{ .msg = "type '{s}' in generic association compatible with previously specified type", .extra = .str, .kind = .@"error" }, - .{ .msg = "compatible type '{s}' specified here", .extra = .str, .kind = .note }, - .{ .msg = "duplicate default generic association", .kind = .@"error" }, - .{ .msg = "controlling expression type '{s}' not compatible with any generic association type", .extra = .str, .kind = .@"error" }, - .{ .msg = "escape sequence out of range", .kind = .@"error" }, - .{ .msg = "invalid universal character", .kind = .@"error" }, - .{ .msg = "incomplete universal character name", .kind = .@"error" }, - .{ .msg = "multi-character character constant", .opt = W("multichar"), .kind = .warning, .all = true }, - .{ .msg = "{s} character literals may not contain multiple characters", .kind = .@"error", .extra = .str }, - .{ .msg = "extraneous characters in character constant ignored", .kind = .warning }, - .{ .msg = "character constant too long for its type", .kind = .warning, .all = true }, - .{ .msg = "character too large for enclosing character literal type", .kind = .@"error" }, - .{ .msg = "must use 'struct' tag to refer to type '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "must use 'union' tag to refer to type '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "must use 'enum' tag to refer to type '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "redefinition of '{s}' as different kind of symbol", .extra = .str, .kind = .@"error" }, - .{ .msg = "redefinition of '{s}' with a different type", .extra = .str, .kind = .@"error" }, - .{ .msg = "redefinition of parameter '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "invalid operands to binary expression ({s})", .extra = .str, .kind = .@"error" }, - .{ .msg = "comparison between pointer and integer ({s})", .extra = .str, .opt = W("pointer-integer-compare"), .kind = .warning }, - .{ .msg = "comparison of distinct pointer types ({s})", .extra = .str, .opt = W("compare-distinct-pointer-types"), .kind = .warning }, - .{ .msg = "incompatible pointer types ({s})", .extra = .str, .kind = .@"error" }, - .{ .msg = "invalid argument type '{s}' to unary expression", .extra = .str, .kind = .@"error" }, - .{ .msg = "assignment to {s}", .extra = .str, .kind = .@"error" }, - .{ .msg = "implicit pointer to integer conversion from {s}", .extra = .str, .opt = W("int-conversion"), .kind = .warning }, - .{ .msg = "pointer cannot be cast to type '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "operand of type '{s}' cannot be cast to a pointer type", .extra = .str, .kind = .@"error" }, - .{ .msg = "cannot cast to non arithmetic or pointer type '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "cast to type '{s}' will not preserve qualifiers", .extra = .str, .opt = W("cast-qualifiers"), .kind = .warning }, - .{ .msg = "array subscript is not an integer", .kind = .@"error" }, - .{ .msg = "subscripted value is not an array or pointer", .kind = .@"error" }, - .{ .msg = "array index {s} is past the end of the array", .extra = .str, .opt = W("array-bounds"), .kind = .warning }, - .{ .msg = "array index {s} is before the beginning of the array", .extra = .str, .opt = W("array-bounds"), .kind = .warning }, - .{ .msg = "statement requires expression with integer type ('{s}' invalid)", .extra = .str, .kind = .@"error" }, - .{ .msg = "statement requires expression with scalar type ('{s}' invalid)", .extra = .str, .kind = .@"error" }, - .{ .msg = "non-void function '{s}' should return a value", .extra = .str, .opt = W("return-type"), .kind = .@"error", .all = true }, - .{ .msg = "returning {s}", .extra = .str, .kind = .@"error" }, - .{ .msg = "returning {s}" ++ pointer_sign_message, .extra = .str, .kind = .warning, .opt = W("pointer-sign") }, - .{ .msg = "implicit integer to pointer conversion from {s}", .extra = .str, .opt = W("int-conversion"), .kind = .warning }, - .{ .msg = "non-void function '{s}' does not return a value", .extra = .str, .opt = W("return-type"), .kind = .warning, .all = true }, - .{ .msg = "void function '{s}' should not return a value", .extra = .str, .opt = W("return-type"), .kind = .@"error", .all = true }, - .{ .msg = "passing {s}", .extra = .str, .kind = .@"error" }, - .{ .msg = "passing {s}", .extra = .str, .kind = .warning, .opt = W("incompatible-pointer-types") }, - .{ .msg = "passing {s}" ++ pointer_sign_message, .extra = .str, .kind = .warning, .opt = W("pointer-sign") }, - .{ .msg = "passing argument to parameter here", .kind = .note }, - .{ .msg = "atomic cannot be applied to array type '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "atomic cannot be applied to function type '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "atomic cannot be applied to incomplete type '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "address of register variable requested", .kind = .@"error" }, - .{ .msg = "variable has incomplete type '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "parameter has incomplete type '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "tentative array definition assumed to have one element", .kind = .warning }, - .{ .msg = "dereferencing pointer to incomplete type '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "'_Alignas' attribute only applies to variables and fields", .kind = .@"error" }, - .{ .msg = "'_Alignas' attribute cannot be applied to a function parameter", .kind = .@"error" }, - .{ .msg = "requested alignment is less than minimum alignment of {d}", .extra = .unsigned, .kind = .@"error" }, - .{ .msg = "requested alignment of {s} is too large", .extra = .str, .kind = .@"error" }, - .{ .msg = "requested negative alignment of {s} is invalid", .extra = .str, .kind = .@"error" }, - .{ .msg = "'_Alignas' attribute is ignored here", .kind = .warning }, - .{ .msg = "requested alignment of zero is ignored", .kind = .warning }, - .{ .msg = "requested alignment is not a power of 2", .kind = .@"error" }, - .{ .msg = "pointer type mismatch ({s})", .extra = .str, .opt = W("pointer-type-mismatch"), .kind = .warning }, - .{ .msg = "static_assert expression is not an integral constant expression", .kind = .@"error" }, - .{ .msg = "static_assert with no message is a C23 extension", .opt = W("c23-extensions"), .kind = .warning, .suppress_version = .c23 }, - .{ .msg = "{s} is incompatible with C standards before C23", .extra = .str, .kind = .off, .suppress_unless_version = .c23, .opt = W("pre-c23-compat") }, - .{ .msg = "variable length array must be bound in function definition", .kind = .@"error" }, - .{ .msg = "array is too large", .kind = .@"error" }, - .{ .msg = "type '{s}' is too large", .kind = .@"error", .extra = .str }, - .{ .msg = "incompatible pointer types initializing {s}", .extra = .str, .opt = W("incompatible-pointer-types"), .kind = .warning }, - .{ .msg = "incompatible pointer types initializing {s}" ++ pointer_sign_message, .extra = .str, .opt = W("pointer-sign"), .kind = .warning }, - .{ .msg = "incompatible pointer types assigning to {s}", .extra = .str, .opt = W("incompatible-pointer-types"), .kind = .warning }, - .{ .msg = "incompatible pointer types assigning to {s} " ++ pointer_sign_message, .extra = .str, .opt = W("pointer-sign"), .kind = .warning }, - .{ .msg = "variable-sized object may not be initialized", .kind = .@"error" }, - .{ .msg = "illegal initializer type", .kind = .@"error" }, - .{ .msg = "initializing {s}", .extra = .str, .kind = .@"error" }, - .{ .msg = "scalar initializer cannot be empty", .kind = .@"error" }, - .{ .msg = "excess elements in scalar initializer", .opt = W("excess-initializers"), .kind = .warning }, - .{ .msg = "excess elements in string initializer", .opt = W("excess-initializers"), .kind = .warning }, - .{ .msg = "excess elements in struct initializer", .opt = W("excess-initializers"), .kind = .warning }, - .{ .msg = "excess elements in array initializer", .opt = W("excess-initializers"), .kind = .warning }, - .{ .msg = "initializer-string for char array is too long", .opt = W("excess-initializers"), .kind = .warning }, - .{ .msg = "cannot initialize type ({s})", .extra = .str, .kind = .@"error" }, - .{ .msg = "'{s} typeof' is invalid", .extra = .str, .kind = .@"error" }, - .{ .msg = "{s} by zero is undefined", .extra = .str, .opt = W("division-by-zero"), .kind = .warning }, - .{ .msg = "{s} by zero in preprocessor expression", .extra = .str, .kind = .@"error" }, - .{ .msg = "'__builtin_choose_expr' requires a constant expression", .kind = .@"error" }, - .{ .msg = "'_Alignas' attribute requires integer constant expression", .kind = .@"error" }, - .{ .msg = "case value must be an integer constant expression", .kind = .@"error" }, - .{ .msg = "enum value must be an integer constant expression", .kind = .@"error" }, - .{ .msg = "cannot initialize array of type {s}", .extra = .str, .kind = .@"error" }, - .{ .msg = "array initializer must be an initializer list or wide string literal", .kind = .@"error" }, - .{ .msg = "initializer overrides previous initialization", .opt = W("initializer-overrides"), .kind = .warning, .w_extra = true }, - .{ .msg = "previous initialization", .kind = .note }, - .{ .msg = "array designator used for non-array type '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "array designator value {s} is negative", .extra = .str, .kind = .@"error" }, - .{ .msg = "array designator index {s} exceeds array bounds", .extra = .str, .kind = .@"error" }, - .{ .msg = "field designator used for non-record type '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "record type has no field named '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "initializer for aggregate with no elements requires explicit braces", .kind = .@"error" }, - .{ .msg = "initializing {s} discards qualifiers", .extra = .str, .opt = W("incompatible-pointer-types-discards-qualifiers"), .kind = .warning }, - .{ .msg = "assigning to {s} discards qualifiers", .extra = .str, .opt = W("incompatible-pointer-types-discards-qualifiers"), .kind = .warning }, - .{ .msg = "returning {s} discards qualifiers", .extra = .str, .opt = W("incompatible-pointer-types-discards-qualifiers"), .kind = .warning }, - .{ .msg = "passing {s} discards qualifiers", .extra = .str, .opt = W("incompatible-pointer-types-discards-qualifiers"), .kind = .warning }, - .{ .msg = "unknown attribute '{s}' ignored", .extra = .str, .opt = W("unknown-attributes"), .kind = .warning }, - .{ .msg = "{s}", .extra = .str, .opt = W("ignored-attributes"), .kind = .warning }, - .{ .msg = "fallthrough annotation does not directly precede switch label", .kind = .@"error" }, - .{ .msg = "'{s}' attribute cannot be applied to a statement", .extra = .str, .kind = .@"error" }, - .{ .msg = "redefining builtin macro", .opt = W("builtin-macro-redefined"), .kind = .warning }, - .{ .msg = "builtin feature check macro requires a parenthesized identifier", .kind = .@"error" }, - .{ .msg = "missing '{s}', after builtin feature-check macro", .extra = .tok_id_expected, .kind = .@"error" }, - .{ .msg = "use of GNU address-of-label extension", .opt = W("gnu-label-as-value"), .kind = .off, .pedantic = true }, - .{ .msg = "member reference base type '{s}' is not a structure or union", .extra = .str, .kind = .@"error" }, - .{ .msg = "member reference type '{s}' is not a pointer; did you mean to use '.'?", .extra = .str, .kind = .@"error" }, - .{ .msg = "member reference type '{s}' is a pointer; did you mean to use '->'?", .extra = .str, .kind = .@"error" }, - .{ .msg = "no member named {s}", .extra = .str, .kind = .@"error" }, - .{ .msg = "{s} expected option name (e.g. \"-Wundef\")", .extra = .str, .opt = W("malformed-warning-check"), .kind = .warning, .all = true }, - .{ .msg = "computed goto in function with no address-of-label expressions", .kind = .@"error" }, - .{ .msg = "{s}", .extra = .str, .opt = W("#pragma-messages"), .kind = .warning }, - .{ .msg = "{s}", .extra = .str, .kind = .@"error" }, - .{ .msg = "#pragma message: {s}", .extra = .str, .kind = .note }, - .{ .msg = "pragma {s} requires string literal", .extra = .str, .kind = .@"error" }, - .{ .msg = "attempt to use a poisoned identifier", .kind = .@"error" }, - .{ .msg = "can only poison identifier tokens", .kind = .@"error" }, - .{ .msg = "poisoning existing macro", .kind = .warning }, - .{ .msg = "no newline at end of file", .opt = W("newline-eof"), .kind = .off, .pedantic = true }, - .{ .msg = "ISO C requires a translation unit to contain at least one declaration", .opt = W("empty-translation-unit"), .kind = .off, .pedantic = true }, - .{ .msg = "omitting the parameter name in a function definition is a C23 extension", .opt = W("c23-extensions"), .kind = .warning, .suppress_version = .c23 }, - .{ .msg = "bit-field has non-integer type '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "bit-field has negative width ({s})", .extra = .str, .kind = .@"error" }, - .{ .msg = "named bit-field has zero width", .kind = .@"error" }, - .{ .msg = "width of bit-field exceeds width of its type", .kind = .@"error" }, - .{ .msg = "source file is not valid UTF-8", .kind = .@"error" }, - .{ .msg = "integer literal is too large to be represented in a signed integer type, interpreting as unsigned", .opt = W("implicitly-unsigned-literal"), .kind = .warning }, - .{ .msg = "token is not a valid binary operator in a preprocessor subexpression", .kind = .@"error" }, - .{ .msg = "invalid token at start of a preprocessor expression", .kind = .@"error" }, - .{ .msg = "using this character in an identifier is incompatible with C99", .opt = W("c99-compat"), .kind = .off }, - .{ .msg = "unexpected character 4}>", .extra = .actual_codepoint, .kind = .@"error" }, - .{ .msg = "character 4}> not allowed at the start of an identifier", .extra = .actual_codepoint, .kind = .@"error" }, - .{ .msg = "identifier contains Unicode character 4}> that is invisible in some environments", .opt = W("unicode-homoglyph"), .extra = .actual_codepoint, .kind = .warning }, - .{ .msg = "treating Unicode character 4}> as identifier character rather than as '{u}' symbol", .extra = .codepoints, .opt = W("unicode-homoglyph"), .kind = .warning }, - .{ .msg = "meaningless '{s}' on assembly outside function", .extra = .str, .kind = .@"error" }, - .{ .msg = "duplicate asm qualifier '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "cannot use {s} string literal in assembly", .extra = .str, .kind = .@"error" }, - .{ .msg = "'$' in identifier", .opt = W("dollar-in-identifier-extension"), .kind = .off, .pedantic = true }, - .{ .msg = "illegal character '$' in identifier", .kind = .@"error" }, - .{ .msg = "expanded from here", .kind = .note }, - .{ .msg = "(skipping {d} expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)", .extra = .unsigned, .kind = .note }, - .{ .msg = "_Pragma requires exactly one string literal token", .kind = .@"error" }, - .{ .msg = "pragma GCC expected 'error', 'warning', 'diagnostic', 'poison'", .opt = W("unknown-pragmas"), .kind = .off, .all = true }, - .{ .msg = "pragma GCC diagnostic expected 'error', 'warning', 'ignored', 'fatal', 'push', or 'pop'", .opt = W("unknown-pragmas"), .kind = .warning, .all = true }, - .{ .msg = "predefined identifier is only valid inside function", .opt = W("predefined-identifier-outside-function"), .kind = .warning }, - .{ .msg = "first argument to va_arg, is of type '{s}' and not 'va_list'", .extra = .str, .kind = .@"error" }, - .{ .msg = "too many braces around scalar initializer", .opt = W("many-braces-around-scalar-init"), .kind = .warning }, - .{ .msg = "variable '{s}' is uninitialized when used within its own initialization", .extra = .str, .opt = W("uninitialized"), .kind = .off, .all = true }, - .{ .msg = "use of GNU statement expression extension", .opt = W("gnu-statement-expression"), .kind = .off, .suppress_gnu = true, .pedantic = true }, - .{ .msg = "statement expression not allowed at file scope", .kind = .@"error" }, - .{ .msg = "imaginary constants are a GNU extension", .opt = W("gnu-imaginary-constant"), .kind = .off, .suppress_gnu = true, .pedantic = true }, - .{ .msg = "plain '_Complex' requires a type specifier; assuming '_Complex double'", .kind = .warning }, - .{ .msg = "complex integer types are a GNU extension", .opt = W("gnu-complex-integer"), .suppress_gnu = true, .kind = .off }, - .{ .msg = "'{s}' type qualifier on return type has no effect", .opt = W("ignored-qualifiers"), .extra = .str, .kind = .off, .all = true }, - .{ .msg = "invalid standard '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "invalid target '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "invalid compiler '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "unknown argument '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "{s}", .extra = .str, .kind = .@"error" }, - .{ .msg = "{s}: linker input file unused because linking not done", .extra = .str, .kind = .warning }, - .{ .msg = "unrecognized linker '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "extra ';' outside of a function", .opt = W("extra-semi"), .kind = .off, .pedantic = true }, - .{ .msg = "field declared as a function", .kind = .@"error" }, - .{ .msg = "variable length array fields extension is not supported", .kind = .@"error" }, - .{ .msg = "field has incomplete type '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "flexible array member in union is not allowed", .kind = .@"error", .suppress_msvc = true }, - .{ .msg = "flexible array member is not at the end of struct", .kind = .@"error" }, - .{ .msg = "flexible array member in otherwise empty struct", .kind = .@"error", .suppress_msvc = true }, - .{ .msg = "duplicate member '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "binary integer literals are a GNU extension", .kind = .off, .opt = W("gnu-binary-literal"), .pedantic = true }, - .{ .msg = "named variadic macros are a GNU extension", .opt = W("variadic-macros"), .kind = .off, .pedantic = true }, - .{ .msg = "builtin function must be directly called", .kind = .@"error" }, - .{ .msg = "'va_start' cannot be used outside a function", .kind = .@"error" }, - .{ .msg = "'va_start' used in a function with fixed args", .kind = .@"error" }, - .{ .msg = "second argument to 'va_start' is not the last named parameter", .opt = W("varargs"), .kind = .warning }, - .{ .msg = "'{s}' attribute takes at least {d} argument(s)", .kind = .@"error", .extra = .attr_arg_count }, - .{ .msg = "'{s}' attribute takes at most {d} argument(s)", .kind = .@"error", .extra = .attr_arg_count }, - .{ .msg = "Attribute argument is invalid, expected {s} but got {s}", .kind = .@"error", .extra = .attr_arg_type }, - .{ .msg = "Unknown `{s}` argument. Possible values are: {s}", .kind = .@"error", .extra = .attr_enum }, - .{ .msg = "'{s}' attribute requires an identifier", .kind = .@"error", .extra = .str }, - .{ .msg = "'__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes", .kind = .@"error" }, - .{ .msg = "__declspec attribute '{s}' is not supported", .extra = .str, .opt = W("ignored-attributes"), .kind = .warning }, - .{ .msg = "{s}", .extra = .str, .opt = W("deprecated-declarations"), .kind = .warning }, - .{ .msg = "'{s}' has been explicitly marked deprecated here", .extra = .str, .opt = W("deprecated-declarations"), .kind = .note }, - .{ .msg = "{s}", .extra = .str, .kind = .@"error" }, - .{ .msg = "'{s}' has been explicitly marked unavailable here", .extra = .str, .kind = .note }, - .{ .msg = "{s}", .extra = .str, .kind = .warning, .opt = W("attribute-warning") }, - .{ .msg = "{s}", .extra = .str, .kind = .@"error" }, - .{ .msg = "attribute '{s}' is ignored, place it after \"{s}\" to apply attribute to type declaration", .extra = .ignored_record_attr, .kind = .warning, .opt = W("ignored-attributes") }, - .{ .msg = "backslash and newline separated by space", .kind = .warning, .opt = W("backslash-newline-escape") }, - .{ .msg = "size of array has non-integer type '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "cast to smaller integer type {s}", .extra = .str, .kind = .warning, .opt = W("pointer-to-int-cast") }, - .{ .msg = "use of GNU case range extension", .opt = W("gnu-case-range"), .kind = .off, .pedantic = true }, - .{ .msg = "empty case range specified", .kind = .warning }, - .{ .msg = "use of non-standard escape character '\\{s}'", .kind = .off, .opt = W("pedantic"), .extra = .invalid_escape }, - .{ .msg = "invalid string literal, ignoring final '\\'", .kind = .warning }, - .{ .msg = "variable length array used", .kind = .off, .opt = W("vla") }, - .{ .msg = "implicit conversion from {s}", .extra = .str, .kind = .warning, .opt = W("constant-conversion") }, - .{ .msg = "implicit conversion changes signedness: {s}", .extra = .str, .kind = .off, .opt = W("sign-conversion") }, - .{ .msg = "implicit conversion of non-finite value from {s} is undefined", .extra = .str, .kind = .off, .opt = W("float-overflow-conversion") }, - .{ .msg = "implicit conversion of out of range value from {s} is undefined", .extra = .str, .kind = .warning, .opt = W("literal-conversion") }, - .{ .msg = "implicit conversion from {s}", .extra = .str, .kind = .off, .opt = W("float-zero-conversion") }, - .{ .msg = "implicit conversion from {s}", .extra = .str, .kind = .warning, .opt = W("float-conversion") }, - .{ .msg = "implicit conversion turns floating-point number into integer: {s}", .extra = .str, .kind = .off, .opt = W("literal-conversion") }, - .{ .msg = "expression is not an integer constant expression; folding it to a constant is a GNU extension", .kind = .off, .opt = W("gnu-folding-constant"), .pedantic = true }, - .{ .msg = "variable length array folded to constant array as an extension", .kind = .off, .opt = W("gnu-folding-constant"), .pedantic = true }, - .{ .msg = "typedef redefinition with different types ({s})", .extra = .str, .kind = .@"error" }, - .{ .msg = "'{s}' is not defined, evaluates to 0", .extra = .str, .kind = .off, .opt = W("undef") }, - .{ .msg = "function-like macro '{s}' is not defined", .extra = .str, .kind = .@"error" }, - .{ .msg = "'{s}' must be used within a preprocessing directive", .extra = .tok_id_expected, .kind = .@"error" }, - .{ .msg = "Missing '(' after built-in macro '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "offsetof requires struct or union type, '{s}' invalid", .extra = .str, .kind = .@"error" }, - .{ .msg = "offsetof of incomplete type '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "offsetof requires array type, '{s}' invalid", .extra = .str, .kind = .@"error" }, - .{ .msg = "missing '(' after '#pragma pack' - ignoring", .kind = .warning, .opt = W("ignored-pragmas") }, - .{ .msg = "missing ')' after '#pragma pack' - ignoring", .kind = .warning, .opt = W("ignored-pragmas") }, - .{ .msg = "unknown action for '#pragma pack' - ignoring", .opt = W("ignored-pragmas"), .kind = .warning }, - .{ .msg = "value of #pragma pack(show) == {d}", .extra = .unsigned, .kind = .warning }, - .{ .msg = "expected #pragma pack parameter to be '1', '2', '4', '8', or '16'", .opt = W("ignored-pragmas"), .kind = .warning }, - .{ .msg = "expected integer or identifier in '#pragma pack' - ignored", .opt = W("ignored-pragmas"), .kind = .warning }, - .{ .msg = "specifying both a name and alignment to 'pop' is undefined", .kind = .warning }, - .{ .msg = "#pragma pack(pop, ...) failed: stack empty", .opt = W("ignored-pragmas"), .kind = .warning }, - .{ .msg = "used type '{s}' where arithmetic or pointer type is required", .extra = .str, .kind = .@"error" }, - .{ .msg = "#include nested too deeply", .kind = .@"error" }, - .{ .msg = "ISO C restricts enumerator values to range of 'int' ({s} is too small)", .extra = .str, .kind = .off, .opt = W("pedantic") }, - .{ .msg = "ISO C restricts enumerator values to range of 'int' ({s} is too large)", .extra = .str, .kind = .off, .opt = W("pedantic") }, - .{ .msg = "#include_next is a language extension", .kind = .off, .pedantic = true, .opt = W("gnu-include-next") }, - .{ .msg = "#include_next in primary source file; will search from start of include path", .kind = .warning, .opt = W("include-next-outside-header") }, - .{ .msg = "overflow in enumeration value", .kind = .warning }, - .{ .msg = "incremented enumerator value {s} is not representable in the largest integer type", .kind = .warning, .opt = W("enum-too-large"), .extra = .pow_2_as_string }, - .{ .msg = "enumeration values exceed range of largest integer", .kind = .warning, .opt = W("enum-too-large") }, - .{ .msg = "enumeration types with a fixed underlying type are a Clang extension", .kind = .off, .pedantic = true, .opt = W("fixed-enum-extension") }, - .{ .msg = "enumeration previously declared with nonfixed underlying type", .kind = .@"error" }, - .{ .msg = "enumeration previously declared with fixed underlying type", .kind = .@"error" }, - .{ .msg = "enumeration redeclared with different underlying type {s})", .extra = .str, .kind = .@"error" }, - .{ .msg = "enumerator value is not representable in the underlying type '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "'transparent_union' attribute only applies to unions", .opt = W("ignored-attributes"), .kind = .warning }, - .{ .msg = "transparent union definition must contain at least one field; transparent_union attribute ignored", .opt = W("ignored-attributes"), .kind = .warning }, - .{ .msg = "size of field {s} bits) does not match the size of the first field in transparent union; transparent_union attribute ignored", .extra = .str, .opt = W("ignored-attributes"), .kind = .warning }, - .{ .msg = "size of first field is {d}", .extra = .unsigned, .kind = .note }, - .{ .msg = "'designated_init' attribute is only valid on 'struct' type'", .kind = .@"error" }, - .{ .msg = "positional initialization of field in 'struct' declared with 'designated_init' attribute", .opt = W("designated-init"), .kind = .warning }, - .{ .msg = "ignoring attribute 'common' because it conflicts with attribute 'nocommon'", .opt = W("ignored-attributes"), .kind = .warning }, - .{ .msg = "ignoring attribute 'nocommon' because it conflicts with attribute 'common'", .opt = W("ignored-attributes"), .kind = .warning }, - .{ .msg = "'nonstring' attribute ignored on objects of type '{s}'", .opt = W("ignored-attributes"), .kind = .warning }, - .{ .msg = "'{s}' attribute only applies to local variables", .extra = .str, .opt = W("ignored-attributes"), .kind = .warning }, - .{ .msg = "ignoring attribute 'cold' because it conflicts with attribute 'hot'", .opt = W("ignored-attributes"), .kind = .warning }, - .{ .msg = "ignoring attribute 'hot' because it conflicts with attribute 'cold'", .opt = W("ignored-attributes"), .kind = .warning }, - .{ .msg = "ignoring attribute 'noinline' because it conflicts with attribute 'always_inline'", .opt = W("ignored-attributes"), .kind = .warning }, - .{ .msg = "ignoring attribute 'always_inline' because it conflicts with attribute 'noinline'", .opt = W("ignored-attributes"), .kind = .warning }, - .{ .msg = "function '{s}' declared 'noreturn' should not return", .extra = .str, .kind = .warning, .opt = W("invalid-noreturn") }, - .{ .msg = "ignoring return value of '{s}', declared with 'nodiscard' attribute", .extra = .str, .kind = .warning, .opt = W("unused-result") }, - .{ .msg = "ignoring return value of '{s}', declared with 'warn_unused_result' attribute", .extra = .str, .kind = .warning, .opt = W("unused-result") }, - .{ .msg = "invalid vector element type '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "vector size not an integral multiple of component size", .kind = .@"error" }, - .{ .msg = "invalid type '{s}' to __imag operator", .extra = .str, .kind = .@"error" }, - .{ .msg = "invalid type '{s}' to __real operator", .extra = .str, .kind = .@"error" }, - .{ .msg = "zero size arrays are an extension", .kind = .off, .pedantic = true, .opt = W("zero-length-array") }, - .{ .msg = "array index {s} is past the end of the array", .extra = .str, .kind = .off, .pedantic = true, .opt = W("old-style-flexible-struct") }, - .{ .msg = "token pasting of ',' and __VA_ARGS__ is a GNU extension", .kind = .off, .pedantic = true, .opt = W("gnu-zero-variadic-macro-arguments"), .suppress_gcc = true }, - .{ .msg = "return type of 'main' is not 'int'", .kind = .warning, .opt = W("main-return-type") }, - .{ .msg = "macro expansion producing 'defined' has undefined behavior", .kind = .off, .pedantic = true, .opt = W("expansion-to-defined") }, - .{ .msg = "invalid suffix '{s}' on integer constant", .extra = .str, .kind = .@"error" }, - .{ .msg = "invalid suffix '{s}' on floating constant", .extra = .str, .kind = .@"error" }, - .{ .msg = "invalid digit '{c}' in octal constant", .extra = .ascii, .kind = .@"error" }, - .{ .msg = "invalid digit '{c}' in binary constant", .extra = .ascii, .kind = .@"error" }, - .{ .msg = "exponent has no digits", .kind = .@"error" }, - .{ .msg = "hexadecimal floating constant requires an exponent", .kind = .@"error" }, - .{ .msg = "sizeof returns 0", .kind = .warning, .suppress_gcc = true, .suppress_clang = true }, - .{ .msg = "'declspec' attribute not allowed after declarator", .kind = .@"error" }, - .{ .msg = "this declarator", .kind = .note }, - .{ .msg = "{s} is not supported on this target", .extra = .str, .kind = .@"error" }, - .{ .msg = "'_BitInt' in C17 and earlier is a Clang extension'", .kind = .off, .pedantic = true, .opt = W("bit-int-extension"), .suppress_version = .c23 }, - .{ .msg = "{s}unsigned _BitInt must have a bit size of at least 1", .extra = .str, .kind = .@"error" }, - .{ .msg = "{s}signed _BitInt must have a bit size of at least 2", .extra = .str, .kind = .@"error" }, - .{ .msg = "{s}unsigned _BitInt of bit sizes greater than " ++ std.fmt.comptimePrint("{d}", .{Properties.max_bits}) ++ " not supported", .extra = .str, .kind = .@"error" }, - .{ .msg = "{s}signed _BitInt of bit sizes greater than " ++ std.fmt.comptimePrint("{d}", .{Properties.max_bits}) ++ " not supported", .extra = .str, .kind = .@"error" }, - .{ .msg = "keyword is hidden by macro definition", .kind = .off, .pedantic = true, .opt = W("keyword-macro") }, - .{ .msg = "arithmetic on a pointer to an incomplete type '{s}'", .extra = .str, .kind = .@"error" }, - .{ .msg = "'{s}' calling convention is not supported for this target", .extra = .str, .opt = W("ignored-attributes"), .kind = .warning }, - .{ .msg = "invalid application of '{s}' to a void type", .extra = .str, .kind = .off, .pedantic = true, .opt = W("pointer-arith") }, - .{ .msg = "sizeof on array function parameter will return size of {s}", .extra = .str, .kind = .warning, .opt = W("sizeof-array-argument") }, - .{ .msg = "address of array '{s}' will always evaluate to 'true'", .extra = .str, .kind = .warning, .opt = W("pointer-bool-conversion") }, - .{ .msg = "implicit conversion turns string literal into bool: {s}", .extra = .str, .kind = .off, .opt = W("string-conversion") }, - .{ .msg = "this conversion is not allowed in a constant expression", .kind = .note }, - .{ .msg = "cannot cast an object of type {s}", .extra = .str, .kind = .@"error" }, - .{ .msg = "unsupported argument '{s}' to option '-ffp-eval-method='; expected 'source', 'double', or 'extended'", .extra = .str, .kind = .@"error" }, - .{ .msg = "{s} cannot have __fp16 type; did you forget * ?", .extra = .str, .kind = .@"error" }, - .{ .msg = "'_BitInt' suffix for literals is a C23 extension", .opt = W("c23-extensions"), .kind = .warning, .suppress_version = .c23 }, - .{ .msg = "'__auto_type' is a GNU extension", .opt = W("gnu-auto-type"), .kind = .off, .pedantic = true }, - .{ .msg = "'__auto_type' not allowed in {s}", .kind = .@"error", .extra = .str }, - .{ .msg = "declaration of variable '{s}' with deduced type requires an initializer", .kind = .@"error", .extra = .str }, - .{ .msg = "'__auto_type' may only be used with a single declarator", .kind = .@"error" }, - .{ .msg = "'__auto_type' requires a plain identifier as declarator", .kind = .@"error" }, - .{ .msg = "invalid cast to '__auto_type'", .kind = .@"error" }, - .{ .msg = "cannot use bit-field as '__auto_type' initializer", .kind = .@"error" }, - .{ .msg = "'{s}' declared as array of '__auto_type'", .kind = .@"error", .extra = .str }, - .{ .msg = "cannot use '__auto_type' with initializer list", .kind = .@"error" }, - .{ .msg = "expected ';' at end of declaration list", .kind = .warning }, - .{ .msg = "tentative definition has type '{s}' that is never completed", .kind = .@"error", .extra = .str }, - .{ .msg = "forward declaration of '{s}'", .kind = .note, .extra = .str }, - .{ .msg = "cast to union type is a GNU extension", .opt = W("gnu-union-cast"), .kind = .off, .pedantic = true }, - .{ .msg = "cast to union type from type '{s}' not present in union", .kind = .@"error", .extra = .str }, - .{ .msg = "cast to incomplete type '{s}'", .kind = .@"error", .extra = .str }, - .{ .msg = "environment variable SOURCE_DATE_EPOCH must expand to a non-negative integer less than or equal to 253402300799", .kind = .@"error" }, - .{ .msg = "'-fuse-ld=' taking a path is deprecated; use '--ld-path=' instead", .kind = .off, .opt = W("fuse-ld-path") }, - .{ .msg = "invalid runtime library name '{s}'", .kind = .@"error", .extra = .str }, - .{ .msg = "unsupported runtime library 'libgcc' for platform '{s}'", .kind = .@"error", .extra = .str }, - .{ .msg = "invalid unwind library name '{s}'", .kind = .@"error", .extra = .str }, - .{ .msg = "--rtlib=libgcc requires --unwindlib=libgcc", .kind = .@"error" }, - .{ .msg = "GNU-style inline assembly is disabled", .kind = .@"error" }, - .{ .msg = "extension used", .kind = .off, .pedantic = true, .opt = W("language-extension-token") }, - .{ .msg = "complex initialization specifying real and imaginary components is an extension", .opt = W("complex-component-init"), .kind = .off, .pedantic = true }, - .{ .msg = "ISO C does not support '++'/'--' on complex type '{s}'", .opt = W("pedantic"), .extra = .str, .kind = .off }, - .{ .msg = "argument type '{s}' is not a real floating point type", .extra = .str, .kind = .@"error" }, - .{ .msg = "arguments are of different types ({s})", .extra = .str, .kind = .@"error" }, - .{ .msg = "#include resolved using non-portable Microsoft search rules as: {s}", .extra = .str, .opt = W("microsoft-include"), .kind = .warning }, - .{ .msg = "treating Ctrl-Z as end-of-file is a Microsoft extension", .opt = W("microsoft-end-of-file"), .kind = .off, .pedantic = true }, - .{ .msg = "illegal character encoding in character literal", .opt = W("invalid-source-encoding"), .kind = .warning }, - .{ .msg = "illegal character encoding in character literal", .kind = .@"error" }, - .{ .msg = "character '{c}' cannot be specified by a universal character name", .kind = .@"error", .extra = .ascii }, - .{ .msg = "specifying character '{c}' with a universal character name is incompatible with C standards before C23", .kind = .off, .extra = .ascii, .suppress_unless_version = .c23, .opt = W("pre-c23-compat") }, - .{ .msg = "universal character name refers to a control character", .kind = .@"error" }, - .{ .msg = "universal character name referring to a control character is incompatible with C standards before C23", .kind = .off, .suppress_unless_version = .c23, .opt = W("pre-c23-compat") }, - .{ .msg = "universal character names are only valid in C99 or later", .suppress_version = .c99, .kind = .warning, .opt = W("unicode") }, - .{ .msg = "multi-character character constant", .opt = W("four-char-constants"), .kind = .off }, - .{ .msg = "multi-character character constant", .kind = .off }, - .{ .msg = "\\{c} used with no following hex digits", .kind = .@"error", .extra = .ascii }, - .{ .msg = "unknown escape sequence '\\{s}'", .kind = .warning, .opt = W("unknown-escape-sequence"), .extra = .invalid_escape }, - .{ .msg = "attribute '{s}' requires an ordinary string", .kind = .@"error", .extra = .str }, - .{ .msg = "missing terminating '\"' character", .kind = .warning, .opt = W("invalid-pp-token") }, - .{ .msg = "missing terminating '\"' character", .kind = .@"error" }, - .{ .msg = "empty character constant", .kind = .warning, .opt = W("invalid-pp-token") }, - .{ .msg = "empty character constant", .kind = .@"error" }, - .{ .msg = "missing terminating ' character", .kind = .warning, .opt = W("invalid-pp-token") }, - .{ .msg = "missing terminating ' character", .kind = .@"error" }, - .{ .msg = "unterminated comment", .kind = .@"error" }, - .{ .msg = "a function definition without a prototype is deprecated in all versions of C and is not supported in C23", .kind = .warning, .opt = W("deprecated-non-prototype") }, - .{ .msg = "passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C23", .kind = .warning, .opt = W("deprecated-non-prototype") }, - .{ .msg = "unknown type name '{s}'", .kind = .@"error", .extra = .str }, - .{ .msg = "label at end of compound statement is a C23 extension", .opt = W("c23-extensions"), .kind = .warning, .suppress_version = .c23 }, - .{ .msg = "UTF-8 character literal is a C23 extension", .opt = W("c23-extensions"), .kind = .warning, .suppress_version = .c23 }, - .{ .msg = "unexpected token in embed parameter", .kind = .@"error" }, - .{ .msg = "the limit parameter expects one non-negative integer as a parameter", .kind = .@"error" }, - .{ .msg = "duplicate embed parameter '{s}'", .kind = .warning, .extra = .str, .opt = W("duplicate-embed-param") }, - .{ .msg = "unsupported embed parameter '{s}' embed parameter", .kind = .warning, .extra = .str, .opt = W("unsupported-embed-param") }, - .{ .msg = "compound literal cannot have {s} storage class", .kind = .@"error", .extra = .str }, - .{ .msg = "missing '(' following __VA_OPT__", .kind = .@"error" }, - .{ .msg = "unterminated __VA_OPT__ argument list", .kind = .@"error" }, - .{ .msg = "attribute value '{s}' out of range", .kind = .@"error", .extra = .str }, - .{ .msg = "'{s}' is not in NFC", .kind = .warning, .extra = .normalized, .opt = W("normalized") }, - .{ .msg = "'auto' requires a plain identifier declarator", .kind = .@"error" }, - .{ .msg = "'auto' can only be used with a single declarator", .kind = .@"error" }, - .{ .msg = "'auto' requires an initializer", .kind = .@"error" }, - .{ .msg = "'auto' requires a scalar initializer", .kind = .@"error" }, - .{ .msg = "shift count is negative", .opt = W("shift-count-negative"), .kind = .warning, .all = true }, - .{ .msg = "shift count >= width of type", .opt = W("shift-count-overflow"), .kind = .warning, .all = true }, - .{ .msg = "ISO C does not support '~' for complex conjugation of '{s}'", .opt = W("pedantic"), .extra = .str, .kind = .off }, - .{ .msg = "operand argument to overflow builtin must be an integer ('{s}' invalid)", .extra = .str, .kind = .@"error" }, - .{ .msg = "result argument to overflow builtin must be a pointer to a non-const integer ('{s}' invalid)", .extra = .str, .kind = .@"error" }, - .{ .msg = "TODO: implement '{s}' attribute for {s}", .extra = .attribute_todo, .kind = .@"error" }, - .{ .msg = "non-integral type '{s}' is an invalid underlying type", .extra = .str, .kind = .@"error" }, - .{ .msg = "variable '{s}' declared with deduced type '__auto_type' cannot appear in its own initializer", .extra = .str, .kind = .@"error" }, - }; -}; -}; -} diff --git a/lib/compiler/aro/aro/Driver.zig b/lib/compiler/aro/aro/Driver.zig index bd1663d71749..3fd85b8756d1 100644 --- a/lib/compiler/aro/aro/Driver.zig +++ b/lib/compiler/aro/aro/Driver.zig @@ -2,17 +2,24 @@ const std = @import("std"); const mem = std.mem; const Allocator = mem.Allocator; const process = std.process; + const backend = @import("../backend.zig"); +const Assembly = backend.Assembly; const Ir = backend.Ir; const Object = backend.Object; + const Compilation = @import("Compilation.zig"); const Diagnostics = @import("Diagnostics.zig"); +const DepFile = @import("DepFile.zig"); +const GCCVersion = @import("Driver/GCCVersion.zig"); const LangOpts = @import("LangOpts.zig"); const Preprocessor = @import("Preprocessor.zig"); const Source = @import("Source.zig"); -const Toolchain = @import("Toolchain.zig"); const target_util = @import("target.zig"); -const GCCVersion = @import("Driver/GCCVersion.zig"); +const Toolchain = @import("Toolchain.zig"); +const Tree = @import("Tree.zig"); + +const AsmCodeGenFn = fn (target: std.Target, tree: *const Tree) Compilation.Error!Assembly; pub const Linker = enum { ld, @@ -22,13 +29,27 @@ pub const Linker = enum { mold, }; +const pic_related_options = std.StaticStringMap(void).initComptime(.{ + .{"-fpic"}, + .{"-fno-pic"}, + .{"-fPIC"}, + .{"-fno-PIC"}, + .{"-fpie"}, + .{"-fno-pie"}, + .{"-fPIE"}, + .{"-fno-PIE"}, +}); + const Driver = @This(); comp: *Compilation, -inputs: std.ArrayListUnmanaged(Source) = .empty, -link_objects: std.ArrayListUnmanaged([]const u8) = .empty, +diagnostics: *Diagnostics, + +inputs: std.ArrayList(Source) = .empty, +link_objects: std.ArrayList([]const u8) = .empty, output_name: ?[]const u8 = null, sysroot: ?[]const u8 = null, +resource_dir: ?[]const u8 = null, system_defines: Compilation.SystemDefinesMode = .include_system_defines, temp_file_count: u32 = 0, /// If false, do not emit line directives in -E mode @@ -43,10 +64,15 @@ verbose_ast: bool = false, verbose_pp: bool = false, verbose_ir: bool = false, verbose_linker_args: bool = false, -color: ?bool = null, nobuiltininc: bool = false, nostdinc: bool = false, nostdlibinc: bool = false, +apple_kext: bool = false, +mkernel: bool = false, +mabicalls: ?bool = null, +dynamic_nopic: ?bool = null, +ropi: bool = false, +rwpi: bool = false, debug_dump_letters: packed struct(u3) { d: bool = false, m: bool = false, @@ -61,15 +87,26 @@ debug_dump_letters: packed struct(u3) { return .result_only; } } = .{}, +dependencies: struct { + m: bool = false, + md: bool = false, + format: DepFile.Format = .make, + file: ?[]const u8 = null, +} = .{}, /// Full path to the aro executable aro_name: []const u8 = "", -/// Value of --triple= passed via CLI +/// Value of -target passed via CLI raw_target_triple: ?[]const u8 = null, +/// Value of -mcpu passed via CLI +raw_cpu: ?[]const u8 = null, + +/// Non-optimizing assembly backend is currently selected by passing `-O0` +use_assembly_backend: bool = false, + // linker options -use_linker: ?[]const u8 = null, linker_path: ?[]const u8 = null, nodefaultlibs: bool = false, nolibc: bool = false, @@ -101,20 +138,36 @@ pub const usage = \\Usage {s}: [options] file.. \\ \\General options: - \\ -h, --help Print this message. - \\ -v, --version Print aro version. + \\ --help Print this message + \\ --version Print aro version \\ - \\Compile options: - \\ -c, --compile Only run preprocess, compile, and assemble steps + \\Preprocessor options: + \\ -C Do not discard comments + \\ -CC Do not discard comments, including in macro expansions \\ -dM Output #define directives for all the macros defined during the execution of the preprocessor \\ -dD Like -dM except that it outputs both the #define directives and the result of preprocessing \\ -dN Like -dD, but emit only the macro names, not their expansions. \\ -D = Define to (defaults to 1) \\ -E Only run the preprocessor + \\ -fdollars-in-identifiers + \\ Allow '$' in identifiers + \\ -fno-dollars-in-identifiers + \\ Disallow '$' in identifiers + \\ -M Output dependency file instead of preprocessing result + \\ -MD Like -M except -E is not implied + \\ -MF Write dependency file to + \\ -MV Use NMake/Jom format for dependency file + \\ -P, --no-line-commands Disable linemarker output in -E mode + \\ + \\Compile options: + \\ -c, --compile Only run preprocess, compile, and assemble steps + \\ -fapple-kext Use Apple's kernel extensions ABI \\ -fchar8_t Enable char8_t (enabled by default in C23 and later) \\ -fno-char8_t Disable char8_t (disabled by default for pre-C23) \\ -fcolor-diagnostics Enable colors in diagnostics \\ -fno-color-diagnostics Disable colors in diagnostics + \\ -fcommon Place uninitialized global variables in a common block + \\ -fno-common Place uninitialized global variables in the BSS section of the object file \\ -fdeclspec Enable support for __declspec attributes \\ -fgnuc-version= Controls value of __GNUC__ and related macros. Set to 0 or empty to disable them. \\ -fno-declspec Disable support for __declspec attributes @@ -126,15 +179,20 @@ pub const usage = \\ -fhosted Compilation in a hosted environment \\ -fms-extensions Enable support for Microsoft extensions \\ -fno-ms-extensions Disable support for Microsoft extensions - \\ -fdollars-in-identifiers - \\ Allow '$' in identifiers - \\ -fno-dollars-in-identifiers - \\ Disallow '$' in identifiers + \\ -g Generate debug information \\ -fmacro-backtrace-limit= \\ Set limit on how many macro expansion traces are shown in errors (default 6) \\ -fnative-half-type Use the native half type for __fp16 instead of promoting to float \\ -fnative-half-arguments-and-returns \\ Allow half-precision function arguments and return values + \\ -fpic Generate position-independent code (PIC) suitable for use in a shared library, if supported for the target machine + \\ -fPIC Similar to -fpic but avoid any limit on the size of the global offset table + \\ -fpie Similar to -fpic, but the generated position-independent code can only be linked into executables + \\ -fPIE Similar to -fPIC, but the generated position-independent code can only be linked into executables + \\ -frwpi Generate read-write position independent code (ARM only) + \\ -fno-rwpi Disable generate read-write position independent code (ARM only). + \\ -fropi Generate read-only position independent code (ARM only) + \\ -fno-ropi Disable generate read-only position independent code (ARM only). \\ -fshort-enums Use the narrowest possible integer type for enums \\ -fno-short-enums Use "int" as the tag type for enums \\ -fsigned-char "char" is signed @@ -146,16 +204,26 @@ pub const usage = \\ -fno-use-line-directives \\ Use `# ` linemarkers in preprocessed output \\ -I Add directory to include search path - \\ -isystem Add directory to SYSTEM include search path + \\ -idirafter Add directory to AFTER include search path + \\ -isystem Add directory to SYSTEM include search path + \\ -F Add directory to macOS framework search path + \\ -iframework Add directory to SYSTEM macOS framework search path + \\ --embed-dir= Add directory to `#embed` search path \\ --emulate=[clang|gcc|msvc] \\ Select which C compiler to emulate (default clang) + \\ -mabicalls Enable SVR4-style position-independent code (Mips only) + \\ -mno-abicalls Disable SVR4-style position-independent code (Mips only) + \\ -mcmodel= Generate code for the given code model + \\ -mcpu [cpu] Specify target CPU and feature set + \\ -mkernel Enable kernel development mode \\ -nobuiltininc Do not search the compiler's builtin directory for include files + \\ -resource-dir Override the path to the compiler's builtin resource directory \\ -nostdinc, --no-standard-includes \\ Do not search the standard system directories or compiler builtin directories for include files. \\ -nostdlibinc Do not search the standard system directories for include files, but do search compiler builtin include directories \\ -o Write output to - \\ -P, --no-line-commands Disable linemarker output in -E mode \\ -pedantic Warn on language extensions + \\ -pedantic-errors Error on language extensions \\ --rtlib= Compiler runtime library to use (libgcc or compiler-rt) \\ -std= Specify language standard \\ -S, --assemble Only run preprocess and compilation steps @@ -163,6 +231,7 @@ pub const usage = \\ --target= Generate code for the given target \\ -U Undefine \\ -undef Do not predefine any system-specific macros. Standard predefined macros remain defined. + \\ -w Ignore all warnings \\ -Werror Treat all warnings as errors \\ -Werror= Treat warning as error \\ -W Enable the specified warning @@ -199,33 +268,37 @@ pub const usage = /// Process command line arguments, returns true if something was written to std_out. pub fn parseArgs( d: *Driver, - std_out: anytype, - macro_buf: anytype, + stdout: *std.Io.Writer, + macro_buf: *std.ArrayList(u8), args: []const []const u8, -) !bool { +) (Compilation.Error || std.Io.Writer.Error)!bool { var i: usize = 1; var comment_arg: []const u8 = ""; var hosted: ?bool = null; var gnuc_version: []const u8 = "4.2.1"; // default value set by clang + var pic_arg: []const u8 = ""; + var declspec_attrs: ?bool = null; + var ms_extensions: ?bool = null; + var strip = true; + var debug: ?backend.CodeGenOptions.DebugFormat = null; + var emulate: ?LangOpts.Compiler = null; while (i < args.len) : (i += 1) { const arg = args[i]; - if (mem.startsWith(u8, arg, "-") and arg.len > 1) { - if (mem.eql(u8, arg, "-h") or mem.eql(u8, arg, "--help")) { - std_out.print(usage, .{args[0]}) catch |er| { - return d.fatal("unable to print usage: {s}", .{errorDescription(er)}); - }; + if (arg.len > 1 and arg[0] == '-') { + if (mem.eql(u8, arg, "--help")) { + try stdout.print(usage, .{args[0]}); + try stdout.flush(); return true; - } else if (mem.eql(u8, arg, "-v") or mem.eql(u8, arg, "--version")) { - std_out.writeAll(@import("../backend.zig").version_str ++ "\n") catch |er| { - return d.fatal("unable to print version: {s}", .{errorDescription(er)}); - }; + } else if (mem.eql(u8, arg, "--version")) { + try stdout.writeAll(@import("../backend.zig").version_str ++ "\n"); + try stdout.flush(); return true; } else if (mem.startsWith(u8, arg, "-D")) { var macro = arg["-D".len..]; if (macro.len == 0) { i += 1; if (i >= args.len) { - try d.err("expected argument after -I"); + try d.err("expected argument after -D", .{}); continue; } macro = args[i]; @@ -235,18 +308,26 @@ pub fn parseArgs( value = macro[some + 1 ..]; macro = macro[0..some]; } - try macro_buf.print("#define {s} {s}\n", .{ macro, value }); + try macro_buf.print(d.comp.gpa, "#define {s} {s}\n", .{ macro, value }); } else if (mem.startsWith(u8, arg, "-U")) { var macro = arg["-U".len..]; if (macro.len == 0) { i += 1; if (i >= args.len) { - try d.err("expected argument after -I"); + try d.err("expected argument after -U", .{}); continue; } macro = args[i]; } - try macro_buf.print("#undef {s}\n", .{macro}); + try macro_buf.print(d.comp.gpa, "#undef {s}\n", .{macro}); + } else if (mem.eql(u8, arg, "-O")) { + d.comp.code_gen_options.optimization_level = .@"1"; + } else if (mem.startsWith(u8, arg, "-O")) { + d.comp.code_gen_options.optimization_level = backend.CodeGenOptions.OptimizationLevel.fromString(arg["-O".len..]) orelse { + try d.err("invalid optimization level '{s}'", .{arg}); + continue; + }; + d.use_assembly_backend = d.comp.code_gen_options.optimization_level == .@"0"; } else if (mem.eql(u8, arg, "-undef")) { d.system_defines = .no_system_defines; } else if (mem.eql(u8, arg, "-c") or mem.eql(u8, arg, "--compile")) { @@ -265,38 +346,124 @@ pub fn parseArgs( d.use_line_directives = true; } else if (mem.eql(u8, arg, "-fno-use-line-directives")) { d.use_line_directives = false; + } else if (mem.eql(u8, arg, "-fapple-kext")) { + d.apple_kext = true; + } else if (option(arg, "-mcmodel=")) |cmodel| { + d.comp.cmodel = std.meta.stringToEnum(std.builtin.CodeModel, cmodel) orelse + return d.fatal("unsupported machine code model: '{s}'", .{arg}); + } else if (mem.eql(u8, arg, "-mkernel")) { + d.mkernel = true; + } else if (mem.eql(u8, arg, "-mdynamic-no-pic")) { + d.dynamic_nopic = true; + } else if (mem.eql(u8, arg, "-mabicalls")) { + d.mabicalls = true; + } else if (mem.eql(u8, arg, "-mno-abicalls")) { + d.mabicalls = false; + } else if (mem.eql(u8, arg, "-mcpu")) { + i += 1; + if (i >= args.len) { + try d.err("expected argument after -mcpu", .{}); + continue; + } + d.raw_cpu = args[i]; + } else if (option(arg, "-mcpu=")) |cpu| { + d.raw_cpu = cpu; + } else if (mem.eql(u8, arg, "-M") or mem.eql(u8, arg, "--dependencies")) { + d.dependencies.m = true; + // -M implies -w and -E + d.diagnostics.state.ignore_warnings = true; + d.only_preprocess = true; + } else if (mem.eql(u8, arg, "-MD") or mem.eql(u8, arg, "--write-dependencies")) { + d.dependencies.md = true; + } else if (mem.startsWith(u8, arg, "-MF")) { + var path = arg["-MF".len..]; + if (path.len == 0) { + i += 1; + if (i >= args.len) { + try d.err("expected argument after -MF", .{}); + continue; + } + path = args[i]; + } + d.dependencies.file = path; + } else if (mem.eql(u8, arg, "-MV")) { + d.dependencies.format = .nmake; } else if (mem.eql(u8, arg, "-fchar8_t")) { d.comp.langopts.has_char8_t_override = true; } else if (mem.eql(u8, arg, "-fno-char8_t")) { d.comp.langopts.has_char8_t_override = false; } else if (mem.eql(u8, arg, "-fcolor-diagnostics")) { - d.color = true; + d.diagnostics.color = true; } else if (mem.eql(u8, arg, "-fno-color-diagnostics")) { - d.color = false; + d.diagnostics.color = false; + } else if (mem.eql(u8, arg, "-fcaret-diagnostics")) { + d.diagnostics.details = true; + } else if (mem.eql(u8, arg, "-fno-caret-diagnostics")) { + d.diagnostics.details = false; + } else if (mem.eql(u8, arg, "-fcommon")) { + d.comp.code_gen_options.common = true; + } else if (mem.eql(u8, arg, "-fno-common")) { + d.comp.code_gen_options.common = false; } else if (mem.eql(u8, arg, "-fdollars-in-identifiers")) { d.comp.langopts.dollars_in_identifiers = true; } else if (mem.eql(u8, arg, "-fno-dollars-in-identifiers")) { d.comp.langopts.dollars_in_identifiers = false; + } else if (mem.eql(u8, arg, "-g")) { + strip = false; + } else if (mem.eql(u8, arg, "-g0")) { + strip = true; + } else if (mem.eql(u8, arg, "-gcodeview")) { + debug = .code_view; + } else if (mem.eql(u8, arg, "-gdwarf32")) { + debug = .{ .dwarf = .@"32" }; + } else if (mem.eql(u8, arg, "-gdwarf64")) { + debug = .{ .dwarf = .@"64" }; + } else if (mem.eql(u8, arg, "-gdwarf") or + mem.eql(u8, arg, "-gdwarf-2") or + mem.eql(u8, arg, "-gdwarf-3") or + mem.eql(u8, arg, "-gdwarf-4") or + mem.eql(u8, arg, "-gdwarf-5")) + { + d.comp.code_gen_options.dwarf_version = switch (arg[arg.len - 1]) { + '2' => .@"2", + '3' => .@"3", + '4' => .@"4", + '5' => .@"5", + else => .@"0", + }; + if (debug == null or debug.? != .dwarf) { + debug = .{ .dwarf = .@"32" }; + } } else if (mem.eql(u8, arg, "-fdigraphs")) { d.comp.langopts.digraphs = true; + } else if (mem.eql(u8, arg, "-fno-digraphs")) { + d.comp.langopts.digraphs = false; } else if (mem.eql(u8, arg, "-fgnu-inline-asm")) { d.comp.langopts.gnu_asm = true; } else if (mem.eql(u8, arg, "-fno-gnu-inline-asm")) { d.comp.langopts.gnu_asm = false; - } else if (mem.eql(u8, arg, "-fno-digraphs")) { - d.comp.langopts.digraphs = false; } else if (option(arg, "-fmacro-backtrace-limit=")) |limit_str| { var limit = std.fmt.parseInt(u32, limit_str, 10) catch { - try d.err("-fmacro-backtrace-limit takes a number argument"); + try d.err("-fmacro-backtrace-limit takes a number argument", .{}); continue; }; if (limit == 0) limit = std.math.maxInt(u32); - d.comp.diagnostics.macro_backtrace_limit = limit; + d.diagnostics.macro_backtrace_limit = limit; } else if (mem.eql(u8, arg, "-fnative-half-type")) { d.comp.langopts.use_native_half_type = true; } else if (mem.eql(u8, arg, "-fnative-half-arguments-and-returns")) { d.comp.langopts.allow_half_args_and_returns = true; + } else if (pic_related_options.has(arg)) { + pic_arg = arg; + } else if (mem.eql(u8, arg, "-fropi")) { + d.ropi = true; + } else if (mem.eql(u8, arg, "-fno-ropi")) { + d.ropi = false; + } else if (mem.eql(u8, arg, "-frwpi")) { + d.rwpi = true; + } else if (mem.eql(u8, arg, "-fno-rwpi")) { + d.rwpi = false; } else if (mem.eql(u8, arg, "-fshort-enums")) { d.comp.langopts.short_enums = true; } else if (mem.eql(u8, arg, "-fno-short-enums")) { @@ -310,59 +477,92 @@ pub fn parseArgs( } else if (mem.eql(u8, arg, "-fno-unsigned-char")) { d.comp.langopts.setCharSignedness(.signed); } else if (mem.eql(u8, arg, "-fdeclspec")) { - d.comp.langopts.declspec_attrs = true; + declspec_attrs = true; } else if (mem.eql(u8, arg, "-fno-declspec")) { - d.comp.langopts.declspec_attrs = false; + declspec_attrs = false; } else if (mem.eql(u8, arg, "-ffreestanding")) { hosted = false; } else if (mem.eql(u8, arg, "-fhosted")) { hosted = true; } else if (mem.eql(u8, arg, "-fms-extensions")) { - d.comp.langopts.enableMSExtensions(); + ms_extensions = true; } else if (mem.eql(u8, arg, "-fno-ms-extensions")) { - d.comp.langopts.disableMSExtensions(); + ms_extensions = false; + } else if (mem.eql(u8, arg, "-fsyntax-only")) { + d.only_syntax = true; + } else if (mem.eql(u8, arg, "-fno-syntax-only")) { + d.only_syntax = false; + } else if (mem.eql(u8, arg, "-fgnuc-version=")) { + gnuc_version = "0"; + } else if (option(arg, "-fgnuc-version=")) |version| { + gnuc_version = version; } else if (mem.startsWith(u8, arg, "-I")) { var path = arg["-I".len..]; if (path.len == 0) { i += 1; if (i >= args.len) { - try d.err("expected argument after -I"); + try d.err("expected argument after -I", .{}); continue; } path = args[i]; } try d.comp.include_dirs.append(d.comp.gpa, path); - } else if (mem.startsWith(u8, arg, "-fsyntax-only")) { - d.only_syntax = true; - } else if (mem.startsWith(u8, arg, "-fno-syntax-only")) { - d.only_syntax = false; - } else if (mem.eql(u8, arg, "-fgnuc-version=")) { - gnuc_version = "0"; - } else if (option(arg, "-fgnuc-version=")) |version| { - gnuc_version = version; + } else if (mem.startsWith(u8, arg, "-idirafter")) { + var path = arg["-idirafter".len..]; + if (path.len == 0) { + i += 1; + if (i >= args.len) { + try d.err("expected argument after -idirafter", .{}); + continue; + } + path = args[i]; + } + try d.comp.after_include_dirs.append(d.comp.gpa, path); } else if (mem.startsWith(u8, arg, "-isystem")) { var path = arg["-isystem".len..]; if (path.len == 0) { i += 1; if (i >= args.len) { - try d.err("expected argument after -isystem"); + try d.err("expected argument after -isystem", .{}); continue; } path = args[i]; } - const duped = try d.comp.gpa.dupe(u8, path); - errdefer d.comp.gpa.free(duped); - try d.comp.system_include_dirs.append(d.comp.gpa, duped); + try d.comp.system_include_dirs.append(d.comp.gpa, path); + } else if (mem.startsWith(u8, arg, "-F")) { + var path = arg["-F".len..]; + if (path.len == 0) { + i += 1; + if (i >= args.len) { + try d.err("expected argument after -F", .{}); + continue; + } + path = args[i]; + } + try d.comp.framework_dirs.append(d.comp.gpa, path); + } else if (mem.startsWith(u8, arg, "-iframework")) { + var path = arg["-iframework".len..]; + if (path.len == 0) { + i += 1; + if (i >= args.len) { + try d.err("expected argument after -iframework", .{}); + continue; + } + path = args[i]; + } + try d.comp.system_framework_dirs.append(d.comp.gpa, path); + } else if (option(arg, "--embed-dir=")) |path| { + try d.comp.embed_dirs.append(d.comp.gpa, path); } else if (option(arg, "--emulate=")) |compiler_str| { const compiler = std.meta.stringToEnum(LangOpts.Compiler, compiler_str) orelse { - try d.comp.addDiagnostic(.{ .tag = .cli_invalid_emulate, .extra = .{ .str = arg } }, &.{}); + try d.err("invalid compiler '{s}'", .{arg}); continue; }; - d.comp.langopts.setEmulatedCompiler(compiler); + emulate = compiler; } else if (option(arg, "-ffp-eval-method=")) |fp_method_str| { const fp_eval_method = std.meta.stringToEnum(LangOpts.FPEvalMethod, fp_method_str) orelse .indeterminate; if (fp_eval_method == .indeterminate) { - try d.comp.addDiagnostic(.{ .tag = .cli_invalid_fp_eval_method, .extra = .{ .str = fp_method_str } }, &.{}); + try d.err("unsupported argument '{s}' to option '-ffp-eval-method='; expected 'source', 'double', or 'extended'", .{fp_method_str}); continue; } d.comp.langopts.setFpEvalMethod(fp_eval_method); @@ -371,7 +571,7 @@ pub fn parseArgs( if (file.len == 0) { i += 1; if (i >= args.len) { - try d.err("expected argument after -o"); + try d.err("expected argument after -o", .{}); continue; } file = args[i]; @@ -380,39 +580,58 @@ pub fn parseArgs( } else if (option(arg, "--sysroot=")) |sysroot| { d.sysroot = sysroot; } else if (mem.eql(u8, arg, "-pedantic")) { - d.comp.diagnostics.options.pedantic = .warning; + d.diagnostics.state.extensions = .warning; + } else if (mem.eql(u8, arg, "-pedantic-errors")) { + d.diagnostics.state.extensions = .@"error"; + } else if (mem.eql(u8, arg, "-w")) { + d.diagnostics.state.ignore_warnings = true; } else if (option(arg, "--rtlib=")) |rtlib| { if (mem.eql(u8, rtlib, "compiler-rt") or mem.eql(u8, rtlib, "libgcc") or mem.eql(u8, rtlib, "platform")) { d.rtlib = rtlib; } else { - try d.comp.addDiagnostic(.{ .tag = .invalid_rtlib, .extra = .{ .str = rtlib } }, &.{}); + try d.err("invalid runtime library name '{s}'", .{rtlib}); } - } else if (option(arg, "-Werror=")) |err_name| { - try d.comp.diagnostics.set(err_name, .@"error"); } else if (mem.eql(u8, arg, "-Wno-fatal-errors")) { - d.comp.diagnostics.fatal_errors = false; - } else if (option(arg, "-Wno-")) |err_name| { - try d.comp.diagnostics.set(err_name, .off); + d.diagnostics.state.fatal_errors = false; } else if (mem.eql(u8, arg, "-Wfatal-errors")) { - d.comp.diagnostics.fatal_errors = true; + d.diagnostics.state.fatal_errors = true; + } else if (mem.eql(u8, arg, "-Wno-everything")) { + d.diagnostics.state.enable_all_warnings = false; + } else if (mem.eql(u8, arg, "-Weverything")) { + d.diagnostics.state.enable_all_warnings = true; + } else if (mem.eql(u8, arg, "-Wno-system-headers")) { + d.diagnostics.state.suppress_system_headers = true; + } else if (mem.eql(u8, arg, "-Wsystem-headers")) { + d.diagnostics.state.suppress_system_headers = false; + } else if (mem.eql(u8, arg, "-Werror")) { + d.diagnostics.state.error_warnings = true; + } else if (mem.eql(u8, arg, "-Wno-error")) { + d.diagnostics.state.error_warnings = false; + } else if (option(arg, "-Werror=")) |err_name| { + try d.diagnostics.set(err_name, .@"error"); + } else if (option(arg, "-Wno-error=")) |err_name| { + // TODO this should not set to warning if the option has not been specified. + try d.diagnostics.set(err_name, .warning); + } else if (option(arg, "-Wno-")) |err_name| { + try d.diagnostics.set(err_name, .off); } else if (option(arg, "-W")) |err_name| { - try d.comp.diagnostics.set(err_name, .warning); + try d.diagnostics.set(err_name, .warning); } else if (option(arg, "-std=")) |standard| { d.comp.langopts.setStandard(standard) catch - try d.comp.addDiagnostic(.{ .tag = .cli_invalid_standard, .extra = .{ .str = arg } }, &.{}); + try d.err("invalid standard '{s}'", .{arg}); } else if (mem.eql(u8, arg, "-S") or mem.eql(u8, arg, "--assemble")) { d.only_preprocess_and_compile = true; - } else if (option(arg, "--target=")) |triple| { - const query = std.Target.Query.parse(.{ .arch_os_abi = triple }) catch { - try d.comp.addDiagnostic(.{ .tag = .cli_invalid_target, .extra = .{ .str = arg } }, &.{}); + } else if (mem.eql(u8, arg, "-target")) { + i += 1; + if (i >= args.len) { + try d.err("expected argument after -target", .{}); continue; - }; - const target = std.zig.system.resolveTargetQuery(query) catch |e| { - return d.fatal("unable to resolve target: {s}", .{errorDescription(e)}); - }; - d.comp.target = target; - d.comp.langopts.setEmulatedCompiler(target_util.systemCompiler(target)); + } + d.raw_target_triple = args[i]; + emulate = null; + } else if (option(arg, "--target=")) |triple| { d.raw_target_triple = triple; + emulate = null; } else if (mem.eql(u8, arg, "--verbose-ast")) { d.verbose_ast = true; } else if (mem.eql(u8, arg, "--verbose-pp")) { @@ -428,10 +647,6 @@ pub fn parseArgs( d.comp.langopts.preserve_comments = true; d.comp.langopts.preserve_comments_in_macros = true; comment_arg = arg; - } else if (option(arg, "-fuse-ld=")) |linker_name| { - d.use_linker = linker_name; - } else if (mem.eql(u8, arg, "-fuse-ld=")) { - d.use_linker = null; } else if (option(arg, "--ld-path=")) |linker_path| { d.linker_path = linker_path; } else if (mem.eql(u8, arg, "-r")) { @@ -460,6 +675,13 @@ pub fn parseArgs( d.nolibc = true; } else if (mem.eql(u8, arg, "-nobuiltininc")) { d.nobuiltininc = true; + } else if (mem.eql(u8, arg, "-resource-dir")) { + i += 1; + if (i >= args.len) { + try d.err("expected argument after -resource-dir", .{}); + continue; + } + d.resource_dir = args[i]; } else if (mem.eql(u8, arg, "-nostdinc") or mem.eql(u8, arg, "--no-standard-includes")) { d.nostdinc = true; } else if (mem.eql(u8, arg, "-nostdlibinc")) { @@ -476,10 +698,37 @@ pub fn parseArgs( break; } } else { - try d.comp.addDiagnostic(.{ .tag = .invalid_unwindlib, .extra = .{ .str = unwindlib } }, &.{}); + try d.err("invalid unwind library name '{s}'", .{unwindlib}); + } + } else if (mem.startsWith(u8, arg, "-x")) { + var lang = arg["-x".len..]; + if (lang.len == 0) { + i += 1; + if (i >= args.len) { + try d.err("expected argument after -x", .{}); + continue; + } + lang = args[i]; + } + if (!mem.eql(u8, lang, "none") and !mem.eql(u8, lang, "c")) { + try d.err("language not recognized: '{s}'", .{lang}); + } + } else if (mem.startsWith(u8, arg, "-flto")) { + const rest = arg["-flto".len..]; + if (rest.len == 0 or + mem.eql(u8, rest, "=auto") or + mem.eql(u8, rest, "=full") or + mem.eql(u8, rest, "=jobserver") or + mem.eql(u8, rest, "=thin")) + { + try d.warn("lto not supported", .{}); + } else { + return d.fatal("invalid lto mode: '{s}'", .{arg}); } + } else if (mem.eql(u8, arg, "-fno-lto")) { + // nothing to do } else { - try d.comp.addDiagnostic(.{ .tag = .cli_unknown_arg, .extra = .{ .str = arg } }, &.{}); + try d.warn("unknown argument '{s}'", .{arg}); } } else if (std.mem.endsWith(u8, arg, ".o") or std.mem.endsWith(u8, arg, ".obj")) { try d.link_objects.append(d.comp.gpa, arg); @@ -490,6 +739,39 @@ pub fn parseArgs( try d.inputs.append(d.comp.gpa, source); } } + { + var diags: std.Target.Query.ParseOptions.Diagnostics = .{}; + const opts: std.Target.Query.ParseOptions = .{ + .arch_os_abi = d.raw_target_triple orelse "native", + .cpu_features = d.raw_cpu, + .diagnostics = &diags, + }; + const query = std.Target.Query.parse(opts) catch |er| switch (er) { + error.UnknownCpuModel => { + return d.fatal("unknown CPU: '{s}'", .{diags.cpu_name.?}); + }, + error.UnknownCpuFeature => { + return d.fatal("unknown CPU feature: '{s}'", .{diags.unknown_feature_name.?}); + }, + error.UnknownArchitecture => { + return d.fatal("unknown architecture: '{s}'", .{diags.unknown_architecture_name.?}); + }, + else => |e| return d.fatal("unable to parse target query '{s}': {s}", .{ + opts.arch_os_abi, @errorName(e), + }), + }; + d.comp.target = std.zig.system.resolveTargetQuery(query) catch |e| { + return d.fatal("unable to resolve target: {s}", .{errorDescription(e)}); + }; + } + if (emulate != null or d.raw_target_triple != null) { + d.comp.langopts.setEmulatedCompiler(emulate orelse target_util.systemCompiler(d.comp.target)); + switch (d.comp.langopts.emulate) { + .clang => try d.diagnostics.set("clang", .off), + .gcc => try d.diagnostics.set("gnu", .off), + .msvc => try d.diagnostics.set("microsoft", .off), + } + } if (d.comp.langopts.preserve_comments and !d.only_preprocess) { return d.fatal("invalid argument '{s}' only allowed with '-E'", .{comment_arg}); } @@ -507,6 +789,24 @@ pub fn parseArgs( return d.fatal("invalid value '{0s}' in '-fgnuc-version={0s}'", .{gnuc_version}); } d.comp.langopts.gnuc_version = version.toUnsigned(); + const pic_level, const is_pie = try d.getPICMode(pic_arg); + d.comp.code_gen_options.pic_level = pic_level; + d.comp.code_gen_options.is_pie = is_pie; + d.comp.code_gen_options.debug = debug: { + if (strip) break :debug .strip; + if (debug) |explicit| break :debug explicit; + break :debug switch (d.comp.target.ofmt) { + .elf, .goff, .macho, .wasm, .xcoff => .{ .dwarf = .@"32" }, + .coff => .code_view, + .c => switch (d.comp.target.os.tag) { + .windows, .uefi => .code_view, + else => .{ .dwarf = .@"32" }, + }, + .spirv, .hex, .raw, .plan9 => .strip, + }; + }; + if (declspec_attrs) |some| d.comp.langopts.declspec_attrs = some; + if (ms_extensions) |some| d.comp.langopts.setMSExtensions(some); return false; } @@ -519,40 +819,71 @@ fn option(arg: []const u8, name: []const u8) ?[]const u8 { fn addSource(d: *Driver, path: []const u8) !Source { if (mem.eql(u8, "-", path)) { - const stdin = std.fs.File.stdin().deprecatedReader(); - const input = try stdin.readAllAlloc(d.comp.gpa, std.math.maxInt(u32)); - defer d.comp.gpa.free(input); - return d.comp.addSourceFromBuffer("", input); + return d.comp.addSourceFromFile(.stdin(), "", .user); } return d.comp.addSourceFromPath(path); } -pub fn err(d: *Driver, msg: []const u8) !void { - try d.comp.addDiagnostic(.{ .tag = .cli_error, .extra = .{ .str = msg } }, &.{}); +pub fn err(d: *Driver, fmt: []const u8, args: anytype) Compilation.Error!void { + var sf = std.heap.stackFallback(1024, d.comp.gpa); + var allocating: std.Io.Writer.Allocating = .init(sf.get()); + defer allocating.deinit(); + + Diagnostics.formatArgs(&allocating.writer, fmt, args) catch return error.OutOfMemory; + try d.diagnostics.add(.{ .kind = .@"error", .text = allocating.written(), .location = null }); +} + +pub fn warn(d: *Driver, fmt: []const u8, args: anytype) Compilation.Error!void { + var sf = std.heap.stackFallback(1024, d.comp.gpa); + var allocating: std.Io.Writer.Allocating = .init(sf.get()); + defer allocating.deinit(); + + Diagnostics.formatArgs(&allocating.writer, fmt, args) catch return error.OutOfMemory; + try d.diagnostics.add(.{ .kind = .warning, .text = allocating.written(), .location = null }); +} + +pub fn unsupportedOptionForTarget(d: *Driver, target: std.Target, opt: []const u8) Compilation.Error!void { + try d.err( + "unsupported option '{s}' for target '{s}-{s}-{s}'", + .{ opt, @tagName(target.cpu.arch), @tagName(target.os.tag), @tagName(target.abi) }, + ); } pub fn fatal(d: *Driver, comptime fmt: []const u8, args: anytype) error{ FatalError, OutOfMemory } { - try d.comp.diagnostics.list.append(d.comp.gpa, .{ - .tag = .cli_error, - .kind = .@"fatal error", - .extra = .{ .str = try std.fmt.allocPrint(d.comp.diagnostics.arena.allocator(), fmt, args) }, - }); - return error.FatalError; + var sf = std.heap.stackFallback(1024, d.comp.gpa); + var allocating: std.Io.Writer.Allocating = .init(sf.get()); + defer allocating.deinit(); + + Diagnostics.formatArgs(&allocating.writer, fmt, args) catch return error.OutOfMemory; + try d.diagnostics.add(.{ .kind = .@"fatal error", .text = allocating.written(), .location = null }); + unreachable; } -pub fn renderErrors(d: *Driver) void { - Diagnostics.render(d.comp, d.detectConfig(std.fs.File.stderr())); +pub fn printDiagnosticsStats(d: *Driver) void { + if (!d.diagnostics.details) return; + const warnings = d.diagnostics.warnings; + const errors = d.diagnostics.errors; + + const w_s: []const u8 = if (warnings == 1) "" else "s"; + const e_s: []const u8 = if (errors == 1) "" else "s"; + if (errors != 0 and warnings != 0) { + std.debug.print("{d} warning{s} and {d} error{s} generated.\n", .{ warnings, w_s, errors, e_s }); + } else if (warnings != 0) { + std.debug.print("{d} warning{s} generated.\n", .{ warnings, w_s }); + } else if (errors != 0) { + std.debug.print("{d} error{s} generated.\n", .{ errors, e_s }); + } } -pub fn detectConfig(d: *Driver, file: std.fs.File) std.io.tty.Config { - if (d.color == true) return .escape_codes; - if (d.color == false) return .no_color; +pub fn detectConfig(d: *Driver, file: std.fs.File) std.Io.tty.Config { + if (d.diagnostics.color == false) return .no_color; + const force_color = d.diagnostics.color == true; if (file.supportsAnsiEscapeCodes()) return .escape_codes; if (@import("builtin").os.tag == .windows and file.isTty()) { var info: std.os.windows.CONSOLE_SCREEN_BUFFER_INFO = undefined; - if (std.os.windows.kernel32.GetConsoleScreenBufferInfo(file.handle, &info) != std.os.windows.TRUE) { - return .no_color; + if (std.os.windows.kernel32.GetConsoleScreenBufferInfo(file.handle, &info) == std.os.windows.FALSE) { + return if (force_color) .escape_codes else .no_color; } return .{ .windows_api = .{ .handle = file.handle, @@ -560,7 +891,7 @@ pub fn detectConfig(d: *Driver, file: std.fs.File) std.io.tty.Config { } }; } - return .no_color; + return if (force_color) .escape_codes else .no_color; } pub fn errorDescription(e: anyerror) []const u8 { @@ -585,16 +916,28 @@ pub fn errorDescription(e: anyerror) []const u8 { }; } -var stdout_buffer: [4096]u8 = undefined; - /// The entry point of the Aro compiler. /// **MAY call `exit` if `fast_exit` is set.** -pub fn main(d: *Driver, tc: *Toolchain, args: []const []const u8, comptime fast_exit: bool) !void { - var macro_buf = std.array_list.Managed(u8).init(d.comp.gpa); - defer macro_buf.deinit(); +pub fn main(d: *Driver, tc: *Toolchain, args: []const []const u8, comptime fast_exit: bool, asm_gen_fn: ?AsmCodeGenFn) Compilation.Error!void { + const user_macros = macros: { + var macro_buf: std.ArrayList(u8) = .empty; + defer macro_buf.deinit(d.comp.gpa); + + var stdout_buf: [256]u8 = undefined; + var stdout = std.fs.File.stdout().writer(&stdout_buf); + if (parseArgs(d, &stdout.interface, ¯o_buf, args) catch |er| switch (er) { + error.WriteFailed => return d.fatal("failed to write to stdout: {s}", .{errorDescription(er)}), + error.OutOfMemory => return error.OutOfMemory, + error.FatalError => return error.FatalError, + }) return; + if (macro_buf.items.len > std.math.maxInt(u32)) { + return d.fatal("user provided macro source exceeded max size", .{}); + } + const contents = try macro_buf.toOwnedSlice(d.comp.gpa); + errdefer d.comp.gpa.free(contents); - const std_out = std.fs.File.stdout().deprecatedWriter(); - if (try parseArgs(d, std_out, macro_buf.writer(), args)) return; + break :macros try d.comp.addSourceFromOwnedBuffer("", contents, .user); + }; const linking = !(d.only_preprocess or d.only_syntax or d.only_compile or d.only_preprocess_and_compile); @@ -605,38 +948,31 @@ pub fn main(d: *Driver, tc: *Toolchain, args: []const []const u8, comptime fast_ } if (!linking) for (d.link_objects.items) |obj| { - try d.comp.addDiagnostic(.{ .tag = .cli_unused_link_object, .extra = .{ .str = obj } }, &.{}); + try d.err("{s}: linker input file unused because linking not done", .{obj}); }; - try tc.discover(); + tc.discover() catch |er| switch (er) { + error.OutOfMemory => return error.OutOfMemory, + error.TooManyMultilibs => return d.fatal("found more than one multilib with the same priority", .{}), + }; tc.defineSystemIncludes() catch |er| switch (er) { error.OutOfMemory => return error.OutOfMemory, error.AroIncludeNotFound => return d.fatal("unable to find Aro builtin headers", .{}), }; - const builtin = try d.comp.generateBuiltinMacros(d.system_defines); - const user_macros = try d.comp.addSourceFromBuffer("", macro_buf.items); - + const builtin_macros = d.comp.generateBuiltinMacros(d.system_defines) catch |er| switch (er) { + error.FileTooBig => return d.fatal("builtin macro source exceeded max size", .{}), + else => |e| return e, + }; if (fast_exit and d.inputs.items.len == 1) { - d.processSource(tc, d.inputs.items[0], builtin, user_macros, fast_exit) catch |e| switch (e) { - error.FatalError => { - d.renderErrors(); - d.exitWithCleanup(1); - }, - else => |er| return er, - }; + try d.processSource(tc, d.inputs.items[0], builtin_macros, user_macros, fast_exit, asm_gen_fn); unreachable; } for (d.inputs.items) |source| { - d.processSource(tc, source, builtin, user_macros, fast_exit) catch |e| switch (e) { - error.FatalError => { - d.renderErrors(); - }, - else => |er| return er, - }; + try d.processSource(tc, source, builtin_macros, user_macros, fast_exit, asm_gen_fn); } - if (d.comp.diagnostics.errors != 0) { + if (d.diagnostics.errors != 0) { if (fast_exit) d.exitWithCleanup(1); return; } @@ -646,6 +982,111 @@ pub fn main(d: *Driver, tc: *Toolchain, args: []const []const u8, comptime fast_ if (fast_exit) std.process.exit(0); } +/// Initializes a DepFile if requested by driver options. +pub fn initDepFile( + d: *Driver, + source: Source, + buf: *[std.fs.max_name_bytes]u8, + omit_source: bool, +) Compilation.Error!?DepFile { + if (!d.dependencies.m and !d.dependencies.md) return null; + var dep_file: DepFile = .{ + .target = undefined, + .format = d.dependencies.format, + }; + + if (d.dependencies.md and d.output_name != null) { + dep_file.target = d.output_name.?; + } else { + const args = .{ + std.fs.path.stem(source.path), + d.comp.target.ofmt.fileExt(d.comp.target.cpu.arch), + }; + dep_file.target = std.fmt.bufPrint(buf, "{s}{s}", args) catch + return d.fatal("dependency file name too long for filesystem '{s}{s}'", args); + } + + if (!omit_source) try dep_file.addDependency(d.comp.gpa, source.path); + errdefer comptime unreachable; + + return dep_file; +} + +/// Returns name requested for the dependency file or null for stdout. +pub fn getDepFileName(d: *Driver, source: Source, buf: *[std.fs.max_name_bytes]u8) Compilation.Error!?[]const u8 { + if (d.dependencies.file) |file| { + if (std.mem.eql(u8, file, "-")) return null; + return file; + } + if (!d.dependencies.md) { + if (d.output_name) |name| return name; + return null; + } + + const base_name = std.fs.path.stem(d.output_name orelse source.path); + return std.fmt.bufPrint(buf, "{s}.d", .{base_name}) catch + return d.fatal("dependency file name too long for filesystem: {s}.d", .{base_name}); +} + +fn getRandomFilename(d: *Driver, buf: *[std.fs.max_name_bytes]u8, extension: []const u8) ![]const u8 { + const random_bytes_count = 12; + const sub_path_len = comptime std.fs.base64_encoder.calcSize(random_bytes_count); + + var random_bytes: [random_bytes_count]u8 = undefined; + std.crypto.random.bytes(&random_bytes); + var random_name: [sub_path_len]u8 = undefined; + _ = std.fs.base64_encoder.encode(&random_name, &random_bytes); + + const fmt_template = "/tmp/{s}{s}"; + const fmt_args = .{ + random_name, + extension, + }; + return std.fmt.bufPrint(buf, fmt_template, fmt_args) catch return d.fatal("Filename too long for filesystem: " ++ fmt_template, fmt_args); +} + +/// If it's used, buf will either hold a filename or `/tmp/<12 random bytes with base-64 encoding>.` +/// both of which should fit into max_name_bytes for all systems +fn getOutFileName(d: *Driver, source: Source, buf: *[std.fs.max_name_bytes]u8) ![]const u8 { + if (d.only_compile or d.only_preprocess_and_compile) { + const fmt_template = "{s}{s}"; + const fmt_args = .{ + std.fs.path.stem(source.path), + if (d.only_preprocess_and_compile) ".s" else d.comp.target.ofmt.fileExt(d.comp.target.cpu.arch), + }; + return d.output_name orelse + std.fmt.bufPrint(buf, fmt_template, fmt_args) catch return d.fatal("Filename too long for filesystem: " ++ fmt_template, fmt_args); + } + + return d.getRandomFilename(buf, d.comp.target.ofmt.fileExt(d.comp.target.cpu.arch)); +} + +fn invokeAssembler(d: *Driver, tc: *Toolchain, input_path: []const u8, output_path: []const u8) !void { + var assembler_path_buf: [std.fs.max_path_bytes]u8 = undefined; + const assembler_path = try tc.getAssemblerPath(&assembler_path_buf); + const argv = [_][]const u8{ assembler_path, input_path, "-o", output_path }; + + var child = std.process.Child.init(&argv, d.comp.gpa); + // TODO handle better + child.stdin_behavior = .Inherit; + child.stdout_behavior = .Inherit; + child.stderr_behavior = .Inherit; + + const term = child.spawnAndWait() catch |er| { + return d.fatal("unable to spawn linker: {s}", .{errorDescription(er)}); + }; + switch (term) { + .Exited => |code| if (code != 0) { + const e = d.fatal("assembler exited with an error code", .{}); + return e; + }, + else => { + const e = d.fatal("assembler crashed", .{}); + return e; + }, + } +} + fn processSource( d: *Driver, tc: *Toolchain, @@ -653,11 +1094,20 @@ fn processSource( builtin: Source, user_macros: Source, comptime fast_exit: bool, + asm_gen_fn: ?AsmCodeGenFn, ) !void { d.comp.generated_buf.items.len = 0; + const prev_total = d.diagnostics.errors; + var pp = try Preprocessor.initDefault(d.comp); defer pp.deinit(); + var name_buf: [std.fs.max_name_bytes]u8 = undefined; + var opt_dep_file = try d.initDepFile(source, &name_buf, false); + defer if (opt_dep_file) |*dep_file| dep_file.deinit(d.comp.gpa); + + if (opt_dep_file) |*dep_file| pp.dep_file = dep_file; + if (d.comp.langopts.ms_extensions) { d.comp.ms_cwd_source_id = source.id; } @@ -676,28 +1126,46 @@ fn processSource( try pp.preprocessSources(&.{ source, builtin, user_macros }); + var writer_buf: [4096]u8 = undefined; + if (opt_dep_file) |dep_file| { + const dep_file_name = try d.getDepFileName(source, writer_buf[0..std.fs.max_name_bytes]); + + const file = if (dep_file_name) |path| + d.comp.cwd.createFile(path, .{}) catch |er| + return d.fatal("unable to create dependency file '{s}': {s}", .{ path, errorDescription(er) }) + else + std.fs.File.stdout(); + defer if (dep_file_name != null) file.close(); + + var file_writer = file.writer(&writer_buf); + dep_file.write(&file_writer.interface) catch + return d.fatal("unable to write dependency file: {s}", .{errorDescription(file_writer.err.?)}); + } + if (d.only_preprocess) { - d.renderErrors(); + d.printDiagnosticsStats(); - if (d.comp.diagnostics.errors != 0) { + if (d.diagnostics.errors != prev_total) { + if (fast_exit) std.process.exit(1); // Not linking, no need for cleanup. + return; + } + + if (d.dependencies.m and !d.dependencies.md) { if (fast_exit) std.process.exit(1); // Not linking, no need for cleanup. return; } const file = if (d.output_name) |some| - std.fs.cwd().createFile(some, .{}) catch |er| + d.comp.cwd.createFile(some, .{}) catch |er| return d.fatal("unable to create output file '{s}': {s}", .{ some, errorDescription(er) }) else std.fs.File.stdout(); defer if (d.output_name != null) file.close(); - var file_buffer: [1024]u8 = undefined; - var file_writer = file.writer(&file_buffer); - pp.prettyPrintTokens(&file_writer.interface, dump_mode) catch |er| - return d.fatal("unable to write result: {s}", .{errorDescription(er)}); + var file_writer = file.writer(&writer_buf); + pp.prettyPrintTokens(&file_writer.interface, dump_mode) catch + return d.fatal("unable to write result: {s}", .{errorDescription(file_writer.err.?)}); - file_writer.interface.flush() catch |er| - return d.fatal("unable to write result: {s}", .{errorDescription(er)}); if (fast_exit) std.process.exit(0); // Not linking, no need for cleanup. return; } @@ -706,15 +1174,13 @@ fn processSource( defer tree.deinit(); if (d.verbose_ast) { - var stdout_writer = std.fs.File.stdout().writer(&stdout_buffer); - tree.dump(d.detectConfig(.stdout()), &stdout_writer.interface) catch {}; - stdout_writer.interface.flush() catch {}; + var stdout = std.fs.File.stdout().writer(&writer_buf); + tree.dump(d.detectConfig(stdout.file), &stdout.interface) catch {}; } - const prev_errors = d.comp.diagnostics.errors; - d.renderErrors(); + d.printDiagnosticsStats(); - if (d.comp.diagnostics.errors != prev_errors) { + if (d.diagnostics.errors != prev_total) { if (fast_exit) d.exitWithCleanup(1); return; // do not compile if there were errors } @@ -731,69 +1197,78 @@ fn processSource( ); } - var ir = try tree.genIr(); - defer ir.deinit(d.comp.gpa); + const out_file_name = try d.getOutFileName(source, &name_buf); - if (d.verbose_ir) { - var stdout_writer = std.fs.File.stdout().writer(&stdout_buffer); - ir.dump(d.comp.gpa, d.detectConfig(.stdout()), &stdout_writer.interface) catch {}; - stdout_writer.interface.flush() catch {}; - } + if (d.use_assembly_backend) { + const asm_fn = asm_gen_fn orelse return d.fatal( + "Assembly codegen not supported", + .{}, + ); - var render_errors: Ir.Renderer.ErrorList = .{}; - defer { - for (render_errors.values()) |msg| d.comp.gpa.free(msg); - render_errors.deinit(d.comp.gpa); - } + const assembly = try asm_fn(d.comp.target, &tree); + defer assembly.deinit(d.comp.gpa); - var obj = ir.render(d.comp.gpa, d.comp.target, &render_errors) catch |e| switch (e) { - error.OutOfMemory => return error.OutOfMemory, - error.LowerFail => { - return d.fatal( - "unable to render Ir to machine code: {s}", - .{render_errors.values()[0]}, - ); - }, - }; - defer obj.deinit(); + if (d.only_preprocess_and_compile) { + const out_file = d.comp.cwd.createFile(out_file_name, .{}) catch |er| + return d.fatal("unable to create output file '{s}': {s}", .{ out_file_name, errorDescription(er) }); + defer out_file.close(); - // If it's used, name_buf will either hold a filename or `/tmp/<12 random bytes with base-64 encoding>.` - // both of which should fit into max_name_bytes for all systems - var name_buf: [std.fs.max_name_bytes]u8 = undefined; + assembly.writeToFile(out_file) catch |er| + return d.fatal("unable to write to output file '{s}': {s}", .{ out_file_name, errorDescription(er) }); + if (fast_exit) std.process.exit(0); // Not linking, no need for cleanup. + return; + } - const out_file_name = if (d.only_compile) blk: { - const fmt_template = "{s}{s}"; - const fmt_args = .{ - std.fs.path.stem(source.path), - d.comp.target.ofmt.fileExt(d.comp.target.cpu.arch), - }; - break :blk d.output_name orelse - std.fmt.bufPrint(&name_buf, fmt_template, fmt_args) catch return d.fatal("Filename too long for filesystem: " ++ fmt_template, fmt_args); - } else blk: { - const random_bytes_count = 12; - const sub_path_len = comptime std.fs.base64_encoder.calcSize(random_bytes_count); - - var random_bytes: [random_bytes_count]u8 = undefined; - std.crypto.random.bytes(&random_bytes); - var random_name: [sub_path_len]u8 = undefined; - _ = std.fs.base64_encoder.encode(&random_name, &random_bytes); - - const fmt_template = "/tmp/{s}{s}"; - const fmt_args = .{ - random_name, - d.comp.target.ofmt.fileExt(d.comp.target.cpu.arch), + // write to assembly_out_file_name + // then assemble to out_file_name + var assembly_name_buf: [std.fs.max_name_bytes]u8 = undefined; + const assembly_out_file_name = try d.getRandomFilename(&assembly_name_buf, ".s"); + const out_file = d.comp.cwd.createFile(assembly_out_file_name, .{}) catch |er| + return d.fatal("unable to create output file '{s}': {s}", .{ assembly_out_file_name, errorDescription(er) }); + defer out_file.close(); + assembly.writeToFile(out_file) catch |er| + return d.fatal("unable to write to output file '{s}': {s}", .{ assembly_out_file_name, errorDescription(er) }); + try d.invokeAssembler(tc, assembly_out_file_name, out_file_name); + if (d.only_compile) { + if (fast_exit) std.process.exit(0); // Not linking, no need for cleanup. + return; + } + } else { + var ir = try tree.genIr(); + defer ir.deinit(d.comp.gpa); + + if (d.verbose_ir) { + var stdout = std.fs.File.stdout().writer(&writer_buf); + ir.dump(d.comp.gpa, d.detectConfig(stdout.file), &stdout.interface) catch {}; + } + + var render_errors: Ir.Renderer.ErrorList = .{}; + defer { + for (render_errors.values()) |msg| d.comp.gpa.free(msg); + render_errors.deinit(d.comp.gpa); + } + + var obj = ir.render(d.comp.gpa, d.comp.target, &render_errors) catch |e| switch (e) { + error.OutOfMemory => return error.OutOfMemory, + error.LowerFail => { + return d.fatal( + "unable to render Ir to machine code: {s}", + .{render_errors.values()[0]}, + ); + }, }; - break :blk std.fmt.bufPrint(&name_buf, fmt_template, fmt_args) catch return d.fatal("Filename too long for filesystem: " ++ fmt_template, fmt_args); - }; + defer obj.deinit(); - const out_file = std.fs.cwd().createFile(out_file_name, .{}) catch |er| - return d.fatal("unable to create output file '{s}': {s}", .{ out_file_name, errorDescription(er) }); - defer out_file.close(); + const out_file = d.comp.cwd.createFile(out_file_name, .{}) catch |er| + return d.fatal("unable to create output file '{s}': {s}", .{ out_file_name, errorDescription(er) }); + defer out_file.close(); - obj.finish(out_file) catch |er| - return d.fatal("could not output to object file '{s}': {s}", .{ out_file_name, errorDescription(er) }); + var file_writer = out_file.writer(&writer_buf); + obj.finish(&file_writer.interface) catch + return d.fatal("could not output to object file '{s}': {s}", .{ out_file_name, errorDescription(file_writer.err.?) }); + } - if (d.only_compile) { + if (d.only_compile or d.only_preprocess_and_compile) { if (fast_exit) std.process.exit(0); // Not linking, no need for cleanup. return; } @@ -805,30 +1280,33 @@ fn processSource( } } -fn dumpLinkerArgs(items: []const []const u8) !void { - const stdout = std.fs.File.stdout().deprecatedWriter(); +fn dumpLinkerArgs(w: *std.Io.Writer, items: []const []const u8) !void { for (items, 0..) |item, i| { - if (i > 0) try stdout.writeByte(' '); - try stdout.print("\"{f}\"", .{std.zig.fmtString(item)}); + if (i > 0) try w.writeByte(' '); + try w.print("\"{f}\"", .{std.zig.fmtString(item)}); } - try stdout.writeByte('\n'); + try w.writeByte('\n'); + try w.flush(); } /// The entry point of the Aro compiler. /// **MAY call `exit` if `fast_exit` is set.** -pub fn invokeLinker(d: *Driver, tc: *Toolchain, comptime fast_exit: bool) !void { - var argv = std.array_list.Managed([]const u8).init(d.comp.gpa); - defer argv.deinit(); +pub fn invokeLinker(d: *Driver, tc: *Toolchain, comptime fast_exit: bool) Compilation.Error!void { + const gpa = d.comp.gpa; + var argv: std.ArrayList([]const u8) = .empty; + defer argv.deinit(gpa); var linker_path_buf: [std.fs.max_path_bytes]u8 = undefined; const linker_path = try tc.getLinkerPath(&linker_path_buf); - try argv.append(linker_path); + try argv.append(gpa, linker_path); try tc.buildLinkerArgs(&argv); if (d.verbose_linker_args) { - dumpLinkerArgs(argv.items) catch |er| { - return d.fatal("unable to dump linker args: {s}", .{errorDescription(er)}); + var stdout_buf: [4096]u8 = undefined; + var stdout = std.fs.File.stdout().writer(&stdout_buf); + dumpLinkerArgs(&stdout.interface, argv.items) catch { + return d.fatal("unable to dump linker args: {s}", .{errorDescription(stdout.err.?)}); }; } var child = std.process.Child.init(argv.items, d.comp.gpa); @@ -861,3 +1339,162 @@ fn exitWithCleanup(d: *Driver, code: u8) noreturn { } std.process.exit(code); } + +/// Parses the various -fpic/-fPIC/-fpie/-fPIE arguments. +/// Then, smooshes them together with platform defaults, to decide whether +/// this compile should be using PIC mode or not. +pub fn getPICMode(d: *Driver, lastpic: []const u8) Compilation.Error!struct { backend.CodeGenOptions.PicLevel, bool } { + const eqlIgnoreCase = std.ascii.eqlIgnoreCase; + + const target = d.comp.target; + + const is_pie_default = switch (target_util.isPIEDefault(target)) { + .yes => true, + .no => false, + .depends_on_linker => false, + }; + const is_pic_default = switch (target_util.isPICdefault(target)) { + .yes => true, + .no => false, + .depends_on_linker => false, + }; + + var pie: bool = is_pie_default; + var pic: bool = pie or is_pic_default; + // The Darwin/MachO default to use PIC does not apply when using -static. + if (target.ofmt == .macho and d.static) { + pic, pie = .{ false, false }; + } + var is_piclevel_two = pic; + + const kernel_or_kext: bool = d.mkernel or d.apple_kext; + + // Android-specific defaults for PIC/PIE + if (target.abi.isAndroid()) { + switch (target.cpu.arch) { + .arm, + .armeb, + .thumb, + .thumbeb, + .aarch64, + .mips, + .mipsel, + .mips64, + .mips64el, + => pic = true, // "-fpic" + + .x86, .x86_64 => { + pic = true; // "-fPIC" + is_piclevel_two = true; + }, + else => {}, + } + } + + // OHOS-specific defaults for PIC/PIE + if (target.abi == .ohos and target.cpu.arch == .aarch64) + pic = true; + + // OpenBSD-specific defaults for PIE + if (target.os.tag == .openbsd) { + switch (target.cpu.arch) { + .arm, .aarch64, .mips64, .mips64el, .x86, .x86_64 => is_piclevel_two = false, // "-fpie" + .powerpc, .sparc64 => is_piclevel_two = true, // "-fPIE" + else => {}, + } + } + + // The last argument relating to either PIC or PIE wins, and no + // other argument is used. If the last argument is any flavor of the + // '-fno-...' arguments, both PIC and PIE are disabled. Any PIE + // option implicitly enables PIC at the same level. + if (target.os.tag == .windows and + !target_util.isCygwinMinGW(target) and + (eqlIgnoreCase(lastpic, "-fpic") or eqlIgnoreCase(lastpic, "-fpie"))) // -fpic/-fPIC, -fpie/-fPIE + { + try d.unsupportedOptionForTarget(target, lastpic); + if (target.cpu.arch == .x86_64) + return .{ .two, false }; + return .{ .none, false }; + } + + // Check whether the tool chain trumps the PIC-ness decision. If the PIC-ness + // is forced, then neither PIC nor PIE flags will have no effect. + const forced = switch (target_util.isPICDefaultForced(target)) { + .yes => true, + .no => false, + .depends_on_linker => false, + }; + if (!forced) { + // -fpic/-fPIC, -fpie/-fPIE + if (eqlIgnoreCase(lastpic, "-fpic") or eqlIgnoreCase(lastpic, "-fpie")) { + pie = eqlIgnoreCase(lastpic, "-fpie"); + pic = pie or eqlIgnoreCase(lastpic, "-fpic"); + is_piclevel_two = mem.eql(u8, lastpic, "-fPIE") or mem.eql(u8, lastpic, "-fPIC"); + } else { + pic, pie = .{ false, false }; + if (target_util.isPS(target)) { + if (d.comp.cmodel != .kernel) { + pic = true; + try d.warn( + "option '{s}' was ignored by the {s} toolchain, using '-fPIC'", + .{ lastpic, if (target.os.tag == .ps4) "PS4" else "PS5" }, + ); + } + } + } + } + + if (pic and (target.os.tag.isDarwin() or target_util.isPS(target))) { + is_piclevel_two = is_piclevel_two or is_pic_default; + } + + // This kernel flags are a trump-card: they will disable PIC/PIE + // generation, independent of the argument order. + if (kernel_or_kext and + (!(target.os.tag != .ios) or (target.os.isAtLeast(.ios, .{ .major = 6, .minor = 0, .patch = 0 }) orelse false)) and + !(target.os.tag != .watchos) and + !(target.os.tag != .driverkit)) + { + pie, pic = .{ false, false }; + } + + if (d.dynamic_nopic == true) { + if (!target.os.tag.isDarwin()) { + try d.unsupportedOptionForTarget(target, "-mdynamic-no-pic"); + } + pic = is_pic_default or forced; + return .{ if (pic) .two else .none, false }; + } + + const embedded_pi_supported = target.cpu.arch.isArm(); + if (!embedded_pi_supported) { + if (d.ropi) try d.unsupportedOptionForTarget(target, "-fropi"); + if (d.rwpi) try d.unsupportedOptionForTarget(target, "-frwpi"); + } + + // ROPI and RWPI are not compatible with PIC or PIE. + if ((d.ropi or d.rwpi) and (pic or pie)) { + try d.err("embedded and GOT-based position independence are incompatible", .{}); + } + + if (target.cpu.arch.isMIPS()) { + // When targeting the N64 ABI, PIC is the default, except in the case + // when the -mno-abicalls option is used. In that case we exit + // at next check regardless of PIC being set below. + // TODO: implement incomplete!! + if (target.cpu.arch.isMIPS64()) + pic = true; + + // When targettng MIPS with -mno-abicalls, it's always static. + if (d.mabicalls == false) + return .{ .none, false }; + + // Unlike other architectures, MIPS, even with -fPIC/-mxgot/multigot, + // does not use PIC level 2 for historical reasons. + is_piclevel_two = false; + } + + if (pic) return .{ if (is_piclevel_two) .two else .one, pie }; + return .{ .none, false }; +} diff --git a/lib/compiler/aro/aro/Driver/Filesystem.zig b/lib/compiler/aro/aro/Driver/Filesystem.zig index 07cbeac03c72..87092cb23513 100644 --- a/lib/compiler/aro/aro/Driver/Filesystem.zig +++ b/lib/compiler/aro/aro/Driver/Filesystem.zig @@ -96,7 +96,7 @@ fn findProgramByNamePosix(name: []const u8, path: ?[]const u8, buf: []u8) ?[]con } pub const Filesystem = union(enum) { - real: void, + real: std.fs.Dir, fake: []const Entry, const Entry = struct { @@ -172,8 +172,8 @@ pub const Filesystem = union(enum) { pub fn exists(fs: Filesystem, path: []const u8) bool { switch (fs) { - .real => { - std.fs.cwd().access(path, .{}) catch return false; + .real => |cwd| { + cwd.access(path, .{}) catch return false; return true; }, .fake => |paths| return existsFake(paths, path), @@ -210,8 +210,8 @@ pub const Filesystem = union(enum) { /// Otherwise returns a slice of `buf`. If the file is larger than `buf` partial contents are returned pub fn readFile(fs: Filesystem, path: []const u8, buf: []u8) ?[]const u8 { return switch (fs) { - .real => { - const file = std.fs.cwd().openFile(path, .{}) catch return null; + .real => |cwd| { + const file = cwd.openFile(path, .{}) catch return null; defer file.close(); const bytes_read = file.readAll(buf) catch return null; @@ -223,7 +223,7 @@ pub const Filesystem = union(enum) { pub fn openDir(fs: Filesystem, dir_name: []const u8) std.fs.Dir.OpenError!Dir { return switch (fs) { - .real => .{ .dir = try std.fs.cwd().openDir(dir_name, .{ .access_sub_paths = false, .iterate = true }) }, + .real => |cwd| .{ .dir = try cwd.openDir(dir_name, .{ .access_sub_paths = false, .iterate = true }) }, .fake => |entries| .{ .fake = .{ .entries = entries, .path = dir_name } }, }; } diff --git a/lib/compiler/aro/aro/Driver/GCCDetector.zig b/lib/compiler/aro/aro/Driver/GCCDetector.zig deleted file mode 100644 index e7d67aeed470..000000000000 --- a/lib/compiler/aro/aro/Driver/GCCDetector.zig +++ /dev/null @@ -1,634 +0,0 @@ -const std = @import("std"); -const Toolchain = @import("../Toolchain.zig"); -const target_util = @import("../target.zig"); -const system_defaults = @import("system_defaults"); -const GCCVersion = @import("GCCVersion.zig"); -const Multilib = @import("Multilib.zig"); - -const GCCDetector = @This(); - -is_valid: bool = false, -install_path: []const u8 = "", -parent_lib_path: []const u8 = "", -version: GCCVersion = .{}, -gcc_triple: []const u8 = "", -selected: Multilib = .{}, -biarch_sibling: ?Multilib = null, - -pub fn deinit(self: *GCCDetector) void { - if (!self.is_valid) return; -} - -pub fn appendToolPath(self: *const GCCDetector, tc: *Toolchain) !void { - if (!self.is_valid) return; - return tc.addPathFromComponents(&.{ - self.parent_lib_path, - "..", - self.gcc_triple, - "bin", - }, .program); -} - -fn addDefaultGCCPrefixes(prefixes: *std.ArrayListUnmanaged([]const u8), tc: *const Toolchain) !void { - const sysroot = tc.getSysroot(); - const target = tc.getTarget(); - if (sysroot.len == 0 and target.os.tag == .linux and tc.filesystem.exists("/opt/rh")) { - prefixes.appendAssumeCapacity("/opt/rh/gcc-toolset-12/root/usr"); - prefixes.appendAssumeCapacity("/opt/rh/gcc-toolset-11/root/usr"); - prefixes.appendAssumeCapacity("/opt/rh/gcc-toolset-10/root/usr"); - prefixes.appendAssumeCapacity("/opt/rh/devtoolset-12/root/usr"); - prefixes.appendAssumeCapacity("/opt/rh/devtoolset-11/root/usr"); - prefixes.appendAssumeCapacity("/opt/rh/devtoolset-10/root/usr"); - prefixes.appendAssumeCapacity("/opt/rh/devtoolset-9/root/usr"); - prefixes.appendAssumeCapacity("/opt/rh/devtoolset-8/root/usr"); - prefixes.appendAssumeCapacity("/opt/rh/devtoolset-7/root/usr"); - prefixes.appendAssumeCapacity("/opt/rh/devtoolset-6/root/usr"); - prefixes.appendAssumeCapacity("/opt/rh/devtoolset-4/root/usr"); - prefixes.appendAssumeCapacity("/opt/rh/devtoolset-3/root/usr"); - prefixes.appendAssumeCapacity("/opt/rh/devtoolset-2/root/usr"); - } - if (sysroot.len == 0) { - prefixes.appendAssumeCapacity("/usr"); - } else { - var usr_path = try tc.arena.alloc(u8, 4 + sysroot.len); - @memcpy(usr_path[0..4], "/usr"); - @memcpy(usr_path[4..], sysroot); - prefixes.appendAssumeCapacity(usr_path); - } -} - -fn collectLibDirsAndTriples( - tc: *Toolchain, - lib_dirs: *std.ArrayListUnmanaged([]const u8), - triple_aliases: *std.ArrayListUnmanaged([]const u8), - biarch_libdirs: *std.ArrayListUnmanaged([]const u8), - biarch_triple_aliases: *std.ArrayListUnmanaged([]const u8), -) !void { - const AArch64LibDirs: [2][]const u8 = .{ "/lib64", "/lib" }; - const AArch64Triples: [4][]const u8 = .{ "aarch64-none-linux-gnu", "aarch64-linux-gnu", "aarch64-redhat-linux", "aarch64-suse-linux" }; - const AArch64beLibDirs: [1][]const u8 = .{"/lib"}; - const AArch64beTriples: [2][]const u8 = .{ "aarch64_be-none-linux-gnu", "aarch64_be-linux-gnu" }; - - const ARMLibDirs: [1][]const u8 = .{"/lib"}; - const ARMTriples: [1][]const u8 = .{"arm-linux-gnueabi"}; - const ARMHFTriples: [4][]const u8 = .{ "arm-linux-gnueabihf", "armv7hl-redhat-linux-gnueabi", "armv6hl-suse-linux-gnueabi", "armv7hl-suse-linux-gnueabi" }; - - const ARMebLibDirs: [1][]const u8 = .{"/lib"}; - const ARMebTriples: [1][]const u8 = .{"armeb-linux-gnueabi"}; - const ARMebHFTriples: [2][]const u8 = .{ "armeb-linux-gnueabihf", "armebv7hl-redhat-linux-gnueabi" }; - - const AVRLibDirs: [1][]const u8 = .{"/lib"}; - const AVRTriples: [1][]const u8 = .{"avr"}; - - const CSKYLibDirs: [1][]const u8 = .{"/lib"}; - const CSKYTriples: [3][]const u8 = .{ "csky-linux-gnuabiv2", "csky-linux-uclibcabiv2", "csky-elf-noneabiv2" }; - - const X86_64LibDirs: [2][]const u8 = .{ "/lib64", "/lib" }; - const X86_64Triples: [11][]const u8 = .{ - "x86_64-linux-gnu", "x86_64-unknown-linux-gnu", - "x86_64-pc-linux-gnu", "x86_64-redhat-linux6E", - "x86_64-redhat-linux", "x86_64-suse-linux", - "x86_64-manbo-linux-gnu", "x86_64-linux-gnu", - "x86_64-slackware-linux", "x86_64-unknown-linux", - "x86_64-amazon-linux", - }; - const X32Triples: [2][]const u8 = .{ "x86_64-linux-gnux32", "x86_64-pc-linux-gnux32" }; - const X32LibDirs: [2][]const u8 = .{ "/libx32", "/lib" }; - const X86LibDirs: [2][]const u8 = .{ "/lib32", "/lib" }; - const X86Triples: [9][]const u8 = .{ - "i586-linux-gnu", "i686-linux-gnu", "i686-pc-linux-gnu", - "i386-redhat-linux6E", "i686-redhat-linux", "i386-redhat-linux", - "i586-suse-linux", "i686-montavista-linux", "i686-gnu", - }; - - const LoongArch64LibDirs: [2][]const u8 = .{ "/lib64", "/lib" }; - const LoongArch64Triples: [2][]const u8 = .{ "loongarch64-linux-gnu", "loongarch64-unknown-linux-gnu" }; - - const M68kLibDirs: [1][]const u8 = .{"/lib"}; - const M68kTriples: [3][]const u8 = .{ "m68k-linux-gnu", "m68k-unknown-linux-gnu", "m68k-suse-linux" }; - - const MIPSLibDirs: [2][]const u8 = .{ "/libo32", "/lib" }; - const MIPSTriples: [5][]const u8 = .{ - "mips-linux-gnu", "mips-mti-linux", - "mips-mti-linux-gnu", "mips-img-linux-gnu", - "mipsisa32r6-linux-gnu", - }; - const MIPSELLibDirs: [2][]const u8 = .{ "/libo32", "/lib" }; - const MIPSELTriples: [3][]const u8 = .{ "mipsel-linux-gnu", "mips-img-linux-gnu", "mipsisa32r6el-linux-gnu" }; - - const MIPS64LibDirs: [2][]const u8 = .{ "/lib64", "/lib" }; - const MIPS64Triples: [6][]const u8 = .{ - "mips64-linux-gnu", "mips-mti-linux-gnu", - "mips-img-linux-gnu", "mips64-linux-gnuabi64", - "mipsisa64r6-linux-gnu", "mipsisa64r6-linux-gnuabi64", - }; - const MIPS64ELLibDirs: [2][]const u8 = .{ "/lib64", "/lib" }; - const MIPS64ELTriples: [6][]const u8 = .{ - "mips64el-linux-gnu", "mips-mti-linux-gnu", - "mips-img-linux-gnu", "mips64el-linux-gnuabi64", - "mipsisa64r6el-linux-gnu", "mipsisa64r6el-linux-gnuabi64", - }; - - const MIPSN32LibDirs: [1][]const u8 = .{"/lib32"}; - const MIPSN32Triples: [2][]const u8 = .{ "mips64-linux-gnuabin32", "mipsisa64r6-linux-gnuabin32" }; - const MIPSN32ELLibDirs: [1][]const u8 = .{"/lib32"}; - const MIPSN32ELTriples: [2][]const u8 = .{ "mips64el-linux-gnuabin32", "mipsisa64r6el-linux-gnuabin32" }; - - const MSP430LibDirs: [1][]const u8 = .{"/lib"}; - const MSP430Triples: [1][]const u8 = .{"msp430-elf"}; - - const PPCLibDirs: [2][]const u8 = .{ "/lib32", "/lib" }; - const PPCTriples: [5][]const u8 = .{ - "powerpc-linux-gnu", "powerpc-unknown-linux-gnu", "powerpc-linux-gnuspe", - // On 32-bit PowerPC systems running SUSE Linux, gcc is configured as a - // 64-bit compiler which defaults to "-m32", hence "powerpc64-suse-linux". - "powerpc64-suse-linux", "powerpc-montavista-linuxspe", - }; - const PPCLELibDirs: [2][]const u8 = .{ "/lib32", "/lib" }; - const PPCLETriples: [3][]const u8 = .{ "powerpcle-linux-gnu", "powerpcle-unknown-linux-gnu", "powerpcle-linux-musl" }; - - const PPC64LibDirs: [2][]const u8 = .{ "/lib64", "/lib" }; - const PPC64Triples: [4][]const u8 = .{ - "powerpc64-linux-gnu", "powerpc64-unknown-linux-gnu", - "powerpc64-suse-linux", "ppc64-redhat-linux", - }; - const PPC64LELibDirs: [2][]const u8 = .{ "/lib64", "/lib" }; - const PPC64LETriples: [5][]const u8 = .{ - "powerpc64le-linux-gnu", "powerpc64le-unknown-linux-gnu", - "powerpc64le-none-linux-gnu", "powerpc64le-suse-linux", - "ppc64le-redhat-linux", - }; - - const RISCV32LibDirs: [2][]const u8 = .{ "/lib32", "/lib" }; - const RISCV32Triples: [3][]const u8 = .{ "riscv32-unknown-linux-gnu", "riscv32-linux-gnu", "riscv32-unknown-elf" }; - const RISCV64LibDirs: [2][]const u8 = .{ "/lib64", "/lib" }; - const RISCV64Triples: [3][]const u8 = .{ - "riscv64-unknown-linux-gnu", - "riscv64-linux-gnu", - "riscv64-unknown-elf", - }; - - const SPARCv8LibDirs: [2][]const u8 = .{ "/lib32", "/lib" }; - const SPARCv8Triples: [2][]const u8 = .{ "sparc-linux-gnu", "sparcv8-linux-gnu" }; - const SPARCv9LibDirs: [2][]const u8 = .{ "/lib64", "/lib" }; - const SPARCv9Triples: [2][]const u8 = .{ "sparc64-linux-gnu", "sparcv9-linux-gnu" }; - - const SystemZLibDirs: [2][]const u8 = .{ "/lib64", "/lib" }; - const SystemZTriples: [5][]const u8 = .{ - "s390x-linux-gnu", "s390x-unknown-linux-gnu", "s390x-ibm-linux-gnu", - "s390x-suse-linux", "s390x-redhat-linux", - }; - const target = tc.getTarget(); - if (target.os.tag == .solaris) { - // TODO - return; - } - if (target.abi.isAndroid()) { - const AArch64AndroidTriples: [1][]const u8 = .{"aarch64-linux-android"}; - const ARMAndroidTriples: [1][]const u8 = .{"arm-linux-androideabi"}; - const MIPSELAndroidTriples: [1][]const u8 = .{"mipsel-linux-android"}; - const MIPS64ELAndroidTriples: [1][]const u8 = .{"mips64el-linux-android"}; - const X86AndroidTriples: [1][]const u8 = .{"i686-linux-android"}; - const X86_64AndroidTriples: [1][]const u8 = .{"x86_64-linux-android"}; - - switch (target.cpu.arch) { - .aarch64 => { - lib_dirs.appendSliceAssumeCapacity(&AArch64LibDirs); - triple_aliases.appendSliceAssumeCapacity(&AArch64AndroidTriples); - }, - .arm, - .thumb, - => { - lib_dirs.appendSliceAssumeCapacity(&ARMLibDirs); - triple_aliases.appendSliceAssumeCapacity(&ARMAndroidTriples); - }, - .mipsel => { - lib_dirs.appendSliceAssumeCapacity(&MIPSELLibDirs); - triple_aliases.appendSliceAssumeCapacity(&MIPSELAndroidTriples); - biarch_libdirs.appendSliceAssumeCapacity(&MIPS64ELLibDirs); - biarch_triple_aliases.appendSliceAssumeCapacity(&MIPS64ELAndroidTriples); - }, - .mips64el => { - lib_dirs.appendSliceAssumeCapacity(&MIPS64ELLibDirs); - triple_aliases.appendSliceAssumeCapacity(&MIPS64ELAndroidTriples); - biarch_libdirs.appendSliceAssumeCapacity(&MIPSELLibDirs); - biarch_triple_aliases.appendSliceAssumeCapacity(&MIPSELAndroidTriples); - }, - .x86_64 => { - lib_dirs.appendSliceAssumeCapacity(&X86_64LibDirs); - triple_aliases.appendSliceAssumeCapacity(&X86_64AndroidTriples); - biarch_libdirs.appendSliceAssumeCapacity(&X86LibDirs); - biarch_triple_aliases.appendSliceAssumeCapacity(&X86AndroidTriples); - }, - .x86 => { - lib_dirs.appendSliceAssumeCapacity(&X86LibDirs); - triple_aliases.appendSliceAssumeCapacity(&X86AndroidTriples); - biarch_libdirs.appendSliceAssumeCapacity(&X86_64LibDirs); - biarch_triple_aliases.appendSliceAssumeCapacity(&X86_64AndroidTriples); - }, - else => {}, - } - return; - } - switch (target.cpu.arch) { - .aarch64 => { - lib_dirs.appendSliceAssumeCapacity(&AArch64LibDirs); - triple_aliases.appendSliceAssumeCapacity(&AArch64Triples); - biarch_libdirs.appendSliceAssumeCapacity(&AArch64LibDirs); - biarch_triple_aliases.appendSliceAssumeCapacity(&AArch64Triples); - }, - .aarch64_be => { - lib_dirs.appendSliceAssumeCapacity(&AArch64beLibDirs); - triple_aliases.appendSliceAssumeCapacity(&AArch64beTriples); - biarch_libdirs.appendSliceAssumeCapacity(&AArch64beLibDirs); - biarch_triple_aliases.appendSliceAssumeCapacity(&AArch64beTriples); - }, - .arm, .thumb => { - lib_dirs.appendSliceAssumeCapacity(&ARMLibDirs); - if (target.abi == .gnueabihf) { - triple_aliases.appendSliceAssumeCapacity(&ARMHFTriples); - } else { - triple_aliases.appendSliceAssumeCapacity(&ARMTriples); - } - }, - .armeb, .thumbeb => { - lib_dirs.appendSliceAssumeCapacity(&ARMebLibDirs); - if (target.abi == .gnueabihf) { - triple_aliases.appendSliceAssumeCapacity(&ARMebHFTriples); - } else { - triple_aliases.appendSliceAssumeCapacity(&ARMebTriples); - } - }, - .avr => { - lib_dirs.appendSliceAssumeCapacity(&AVRLibDirs); - triple_aliases.appendSliceAssumeCapacity(&AVRTriples); - }, - .csky => { - lib_dirs.appendSliceAssumeCapacity(&CSKYLibDirs); - triple_aliases.appendSliceAssumeCapacity(&CSKYTriples); - }, - .x86_64 => { - if (target.abi == .gnux32 or target.abi == .muslx32) { - lib_dirs.appendSliceAssumeCapacity(&X32LibDirs); - triple_aliases.appendSliceAssumeCapacity(&X32Triples); - biarch_libdirs.appendSliceAssumeCapacity(&X86_64LibDirs); - biarch_triple_aliases.appendSliceAssumeCapacity(&X86_64Triples); - } else { - lib_dirs.appendSliceAssumeCapacity(&X86_64LibDirs); - triple_aliases.appendSliceAssumeCapacity(&X86_64Triples); - biarch_libdirs.appendSliceAssumeCapacity(&X32LibDirs); - biarch_triple_aliases.appendSliceAssumeCapacity(&X32Triples); - } - biarch_libdirs.appendSliceAssumeCapacity(&X86LibDirs); - biarch_triple_aliases.appendSliceAssumeCapacity(&X86Triples); - }, - .x86 => { - lib_dirs.appendSliceAssumeCapacity(&X86LibDirs); - triple_aliases.appendSliceAssumeCapacity(&X86Triples); - biarch_libdirs.appendSliceAssumeCapacity(&X86_64LibDirs); - biarch_triple_aliases.appendSliceAssumeCapacity(&X86_64Triples); - biarch_libdirs.appendSliceAssumeCapacity(&X32LibDirs); - biarch_triple_aliases.appendSliceAssumeCapacity(&X32Triples); - }, - .loongarch64 => { - lib_dirs.appendSliceAssumeCapacity(&LoongArch64LibDirs); - triple_aliases.appendSliceAssumeCapacity(&LoongArch64Triples); - }, - .m68k => { - lib_dirs.appendSliceAssumeCapacity(&M68kLibDirs); - triple_aliases.appendSliceAssumeCapacity(&M68kTriples); - }, - .mips => { - lib_dirs.appendSliceAssumeCapacity(&MIPSLibDirs); - triple_aliases.appendSliceAssumeCapacity(&MIPSTriples); - biarch_libdirs.appendSliceAssumeCapacity(&MIPS64LibDirs); - biarch_triple_aliases.appendSliceAssumeCapacity(&MIPS64Triples); - biarch_libdirs.appendSliceAssumeCapacity(&MIPSN32LibDirs); - biarch_triple_aliases.appendSliceAssumeCapacity(&MIPSN32Triples); - }, - .mipsel => { - lib_dirs.appendSliceAssumeCapacity(&MIPSELLibDirs); - triple_aliases.appendSliceAssumeCapacity(&MIPSELTriples); - triple_aliases.appendSliceAssumeCapacity(&MIPSTriples); - biarch_libdirs.appendSliceAssumeCapacity(&MIPS64ELLibDirs); - biarch_triple_aliases.appendSliceAssumeCapacity(&MIPS64ELTriples); - biarch_libdirs.appendSliceAssumeCapacity(&MIPSN32ELLibDirs); - biarch_triple_aliases.appendSliceAssumeCapacity(&MIPSN32ELTriples); - }, - .mips64 => { - lib_dirs.appendSliceAssumeCapacity(&MIPS64LibDirs); - triple_aliases.appendSliceAssumeCapacity(&MIPS64Triples); - biarch_libdirs.appendSliceAssumeCapacity(&MIPSLibDirs); - biarch_triple_aliases.appendSliceAssumeCapacity(&MIPSTriples); - biarch_libdirs.appendSliceAssumeCapacity(&MIPSN32LibDirs); - biarch_triple_aliases.appendSliceAssumeCapacity(&MIPSN32Triples); - }, - .mips64el => { - lib_dirs.appendSliceAssumeCapacity(&MIPS64ELLibDirs); - triple_aliases.appendSliceAssumeCapacity(&MIPS64ELTriples); - biarch_libdirs.appendSliceAssumeCapacity(&MIPSELLibDirs); - biarch_triple_aliases.appendSliceAssumeCapacity(&MIPSELTriples); - biarch_libdirs.appendSliceAssumeCapacity(&MIPSN32ELLibDirs); - biarch_triple_aliases.appendSliceAssumeCapacity(&MIPSN32ELTriples); - biarch_triple_aliases.appendSliceAssumeCapacity(&MIPSTriples); - }, - .msp430 => { - lib_dirs.appendSliceAssumeCapacity(&MSP430LibDirs); - triple_aliases.appendSliceAssumeCapacity(&MSP430Triples); - }, - .powerpc => { - lib_dirs.appendSliceAssumeCapacity(&PPCLibDirs); - triple_aliases.appendSliceAssumeCapacity(&PPCTriples); - biarch_libdirs.appendSliceAssumeCapacity(&PPC64LibDirs); - biarch_triple_aliases.appendSliceAssumeCapacity(&PPC64Triples); - }, - .powerpcle => { - lib_dirs.appendSliceAssumeCapacity(&PPCLELibDirs); - triple_aliases.appendSliceAssumeCapacity(&PPCLETriples); - biarch_libdirs.appendSliceAssumeCapacity(&PPC64LELibDirs); - biarch_triple_aliases.appendSliceAssumeCapacity(&PPC64LETriples); - }, - .powerpc64 => { - lib_dirs.appendSliceAssumeCapacity(&PPC64LibDirs); - triple_aliases.appendSliceAssumeCapacity(&PPC64Triples); - biarch_libdirs.appendSliceAssumeCapacity(&PPCLibDirs); - biarch_triple_aliases.appendSliceAssumeCapacity(&PPCTriples); - }, - .powerpc64le => { - lib_dirs.appendSliceAssumeCapacity(&PPC64LELibDirs); - triple_aliases.appendSliceAssumeCapacity(&PPC64LETriples); - biarch_libdirs.appendSliceAssumeCapacity(&PPCLELibDirs); - biarch_triple_aliases.appendSliceAssumeCapacity(&PPCLETriples); - }, - .riscv32 => { - lib_dirs.appendSliceAssumeCapacity(&RISCV32LibDirs); - triple_aliases.appendSliceAssumeCapacity(&RISCV32Triples); - biarch_libdirs.appendSliceAssumeCapacity(&RISCV64LibDirs); - biarch_triple_aliases.appendSliceAssumeCapacity(&RISCV64Triples); - }, - .riscv64 => { - lib_dirs.appendSliceAssumeCapacity(&RISCV64LibDirs); - triple_aliases.appendSliceAssumeCapacity(&RISCV64Triples); - biarch_libdirs.appendSliceAssumeCapacity(&RISCV32LibDirs); - biarch_triple_aliases.appendSliceAssumeCapacity(&RISCV32Triples); - }, - .sparc => { - lib_dirs.appendSliceAssumeCapacity(&SPARCv8LibDirs); - triple_aliases.appendSliceAssumeCapacity(&SPARCv8Triples); - biarch_libdirs.appendSliceAssumeCapacity(&SPARCv9LibDirs); - biarch_triple_aliases.appendSliceAssumeCapacity(&SPARCv9Triples); - }, - .sparc64 => { - lib_dirs.appendSliceAssumeCapacity(&SPARCv9LibDirs); - triple_aliases.appendSliceAssumeCapacity(&SPARCv9Triples); - biarch_libdirs.appendSliceAssumeCapacity(&SPARCv8LibDirs); - biarch_triple_aliases.appendSliceAssumeCapacity(&SPARCv8Triples); - }, - .s390x => { - lib_dirs.appendSliceAssumeCapacity(&SystemZLibDirs); - triple_aliases.appendSliceAssumeCapacity(&SystemZTriples); - }, - else => {}, - } -} - -pub fn discover(self: *GCCDetector, tc: *Toolchain) !void { - var path_buf: [std.fs.max_path_bytes]u8 = undefined; - var fib = std.heap.FixedBufferAllocator.init(&path_buf); - - const target = tc.getTarget(); - const biarch_variant_target = if (target.ptrBitWidth() == 32) - target_util.get64BitArchVariant(target) - else - target_util.get32BitArchVariant(target); - - var candidate_lib_dirs_buffer: [16][]const u8 = undefined; - var candidate_lib_dirs = std.ArrayListUnmanaged([]const u8).initBuffer(&candidate_lib_dirs_buffer); - - var candidate_triple_aliases_buffer: [16][]const u8 = undefined; - var candidate_triple_aliases = std.ArrayListUnmanaged([]const u8).initBuffer(&candidate_triple_aliases_buffer); - - var candidate_biarch_lib_dirs_buffer: [16][]const u8 = undefined; - var candidate_biarch_lib_dirs = std.ArrayListUnmanaged([]const u8).initBuffer(&candidate_biarch_lib_dirs_buffer); - - var candidate_biarch_triple_aliases_buffer: [16][]const u8 = undefined; - var candidate_biarch_triple_aliases = std.ArrayListUnmanaged([]const u8).initBuffer(&candidate_biarch_triple_aliases_buffer); - - try collectLibDirsAndTriples( - tc, - &candidate_lib_dirs, - &candidate_triple_aliases, - &candidate_biarch_lib_dirs, - &candidate_biarch_triple_aliases, - ); - - var target_buf: [64]u8 = undefined; - const triple_str = target_util.toLLVMTriple(target, &target_buf); - candidate_triple_aliases.appendAssumeCapacity(triple_str); - - // Also include the multiarch variant if it's different. - var biarch_buf: [64]u8 = undefined; - if (biarch_variant_target) |biarch_target| { - const biarch_triple_str = target_util.toLLVMTriple(biarch_target, &biarch_buf); - if (!std.mem.eql(u8, biarch_triple_str, triple_str)) { - candidate_triple_aliases.appendAssumeCapacity(biarch_triple_str); - } - } - - var prefixes_buf: [16][]const u8 = undefined; - var prefixes = std.ArrayListUnmanaged([]const u8).initBuffer(&prefixes_buf); - const gcc_toolchain_dir = gccToolchainDir(tc); - if (gcc_toolchain_dir.len != 0) { - const adjusted = if (gcc_toolchain_dir[gcc_toolchain_dir.len - 1] == '/') - gcc_toolchain_dir[0 .. gcc_toolchain_dir.len - 1] - else - gcc_toolchain_dir; - prefixes.appendAssumeCapacity(adjusted); - } else { - const sysroot = tc.getSysroot(); - if (sysroot.len > 0) { - prefixes.appendAssumeCapacity(sysroot); - try addDefaultGCCPrefixes(&prefixes, tc); - } - - if (sysroot.len == 0) { - try addDefaultGCCPrefixes(&prefixes, tc); - } - // TODO: Special-case handling for Gentoo - } - - const v0 = GCCVersion.parse("0.0.0"); - for (prefixes.items) |prefix| { - if (!tc.filesystem.exists(prefix)) continue; - - for (candidate_lib_dirs.items) |suffix| { - defer fib.reset(); - const lib_dir = std.fs.path.join(fib.allocator(), &.{ prefix, suffix }) catch continue; - if (!tc.filesystem.exists(lib_dir)) continue; - - const gcc_dir_exists = tc.filesystem.joinedExists(&.{ lib_dir, "/gcc" }); - const gcc_cross_dir_exists = tc.filesystem.joinedExists(&.{ lib_dir, "/gcc-cross" }); - - try self.scanLibDirForGCCTriple(tc, target, lib_dir, triple_str, false, gcc_dir_exists, gcc_cross_dir_exists); - for (candidate_triple_aliases.items) |candidate| { - try self.scanLibDirForGCCTriple(tc, target, lib_dir, candidate, false, gcc_dir_exists, gcc_cross_dir_exists); - } - } - for (candidate_biarch_lib_dirs.items) |suffix| { - const lib_dir = std.fs.path.join(fib.allocator(), &.{ prefix, suffix }) catch continue; - if (!tc.filesystem.exists(lib_dir)) continue; - - const gcc_dir_exists = tc.filesystem.joinedExists(&.{ lib_dir, "/gcc" }); - const gcc_cross_dir_exists = tc.filesystem.joinedExists(&.{ lib_dir, "/gcc-cross" }); - for (candidate_biarch_triple_aliases.items) |candidate| { - try self.scanLibDirForGCCTriple(tc, target, lib_dir, candidate, true, gcc_dir_exists, gcc_cross_dir_exists); - } - } - if (self.version.order(v0) == .gt) break; - } -} - -fn findBiarchMultilibs( - tc: *const Toolchain, - result: *Multilib.Detected, - target: std.Target, - path: [2][]const u8, - needs_biarch_suffix: bool, -) !bool { - const suff64 = if (target.os.tag == .solaris) switch (target.cpu.arch) { - .x86, .x86_64 => "/amd64", - .sparc => "/sparcv9", - else => "/64", - } else "/64"; - - const alt_64 = Multilib.init(suff64, suff64, &.{ "-m32", "+m64", "-mx32" }); - const alt_32 = Multilib.init("/32", "/32", &.{ "+m32", "-m64", "-mx32" }); - const alt_x32 = Multilib.init("/x32", "/x32", &.{ "-m32", "-m64", "+mx32" }); - - const multilib_filter = Multilib.Filter{ - .base = path, - .file = "crtbegin.o", - }; - - const Want = enum { - want32, - want64, - wantx32, - }; - const is_x32 = target.abi == .gnux32 or target.abi == .muslx32; - const target_ptr_width = target.ptrBitWidth(); - const want: Want = if (target_ptr_width == 32 and multilib_filter.exists(alt_32, tc.filesystem)) - .want64 - else if (target_ptr_width == 64 and is_x32 and multilib_filter.exists(alt_x32, tc.filesystem)) - .want64 - else if (target_ptr_width == 64 and !is_x32 and multilib_filter.exists(alt_64, tc.filesystem)) - .want32 - else if (target_ptr_width == 32) - if (needs_biarch_suffix) .want64 else .want32 - else if (is_x32) - if (needs_biarch_suffix) .want64 else .wantx32 - else if (needs_biarch_suffix) .want32 else .want64; - - const default = switch (want) { - .want32 => Multilib.init("", "", &.{ "+m32", "-m64", "-mx32" }), - .want64 => Multilib.init("", "", &.{ "-m32", "+m64", "-mx32" }), - .wantx32 => Multilib.init("", "", &.{ "-m32", "-m64", "+mx32" }), - }; - result.multilibs.appendSliceAssumeCapacity(&.{ - default, - alt_64, - alt_32, - alt_x32, - }); - result.filter(multilib_filter, tc.filesystem); - var flags: Multilib.Flags = .{}; - flags.appendAssumeCapacity(if (target_ptr_width == 64 and !is_x32) "+m64" else "-m64"); - flags.appendAssumeCapacity(if (target_ptr_width == 32) "+m32" else "-m32"); - flags.appendAssumeCapacity(if (target_ptr_width == 64 and is_x32) "+mx32" else "-mx32"); - - return result.select(flags); -} - -fn scanGCCForMultilibs( - self: *GCCDetector, - tc: *const Toolchain, - target: std.Target, - path: [2][]const u8, - needs_biarch_suffix: bool, -) !bool { - var detected: Multilib.Detected = .{}; - if (target.cpu.arch == .csky) { - // TODO - } else if (target.cpu.arch.isMIPS()) { - // TODO - } else if (target.cpu.arch.isRISCV()) { - // TODO - } else if (target.cpu.arch == .msp430) { - // TODO - } else if (target.cpu.arch == .avr) { - // No multilibs - } else if (!try findBiarchMultilibs(tc, &detected, target, path, needs_biarch_suffix)) { - return false; - } - self.selected = detected.selected; - self.biarch_sibling = detected.biarch_sibling; - return true; -} - -fn scanLibDirForGCCTriple( - self: *GCCDetector, - tc: *const Toolchain, - target: std.Target, - lib_dir: []const u8, - candidate_triple: []const u8, - needs_biarch_suffix: bool, - gcc_dir_exists: bool, - gcc_cross_dir_exists: bool, -) !void { - var path_buf: [std.fs.max_path_bytes]u8 = undefined; - var fib = std.heap.FixedBufferAllocator.init(&path_buf); - for (0..2) |i| { - if (i == 0 and !gcc_dir_exists) continue; - if (i == 1 and !gcc_cross_dir_exists) continue; - defer fib.reset(); - - const base: []const u8 = if (i == 0) "gcc" else "gcc-cross"; - var lib_suffix_buf: [64]u8 = undefined; - var suffix_buf_fib = std.heap.FixedBufferAllocator.init(&lib_suffix_buf); - const lib_suffix = std.fs.path.join(suffix_buf_fib.allocator(), &.{ base, candidate_triple }) catch continue; - - const dir_name = std.fs.path.join(fib.allocator(), &.{ lib_dir, lib_suffix }) catch continue; - var parent_dir = tc.filesystem.openDir(dir_name) catch continue; - defer parent_dir.close(); - - var it = parent_dir.iterate(); - while (it.next() catch continue) |entry| { - if (entry.kind != .directory) continue; - - const version_text = entry.name; - const candidate_version = GCCVersion.parse(version_text); - if (candidate_version.major != -1) { - // TODO: cache path so we're not repeatedly scanning - } - if (candidate_version.isLessThan(4, 1, 1, "")) continue; - switch (candidate_version.order(self.version)) { - .lt, .eq => continue, - .gt => {}, - } - - if (!try self.scanGCCForMultilibs(tc, target, .{ dir_name, version_text }, needs_biarch_suffix)) continue; - - self.version = candidate_version; - self.gcc_triple = try tc.arena.dupe(u8, candidate_triple); - self.install_path = try std.fs.path.join(tc.arena, &.{ lib_dir, lib_suffix, version_text }); - self.parent_lib_path = try std.fs.path.join(tc.arena, &.{ self.install_path, "..", "..", ".." }); - self.is_valid = true; - } - } -} - -fn gccToolchainDir(tc: *const Toolchain) []const u8 { - const sysroot = tc.getSysroot(); - if (sysroot.len != 0) return ""; - return system_defaults.gcc_install_prefix; -} diff --git a/lib/compiler/aro/aro/Driver/Multilib.zig b/lib/compiler/aro/aro/Driver/Multilib.zig index 1486cf47bbbb..7de1bf5a10ec 100644 --- a/lib/compiler/aro/aro/Driver/Multilib.zig +++ b/lib/compiler/aro/aro/Driver/Multilib.zig @@ -1,47 +1,50 @@ const std = @import("std"); const Filesystem = @import("Filesystem.zig").Filesystem; -pub const Flags = std.BoundedArray([]const u8, 6); - /// Large enough for GCCDetector for Linux; may need to be increased to support other toolchains. const max_multilibs = 4; -const MultilibArray = std.BoundedArray(Multilib, max_multilibs); - pub const Detected = struct { - multilibs: MultilibArray = .{}, + multilib_buf: [max_multilibs]Multilib = undefined, + multilib_count: u8 = 0, selected: Multilib = .{}, biarch_sibling: ?Multilib = null, - pub fn filter(self: *Detected, multilib_filter: Filter, fs: Filesystem) void { - var found_count: usize = 0; - for (self.multilibs.constSlice()) |multilib| { + pub fn filter(d: *Detected, multilib_filter: Filter, fs: Filesystem) void { + var found_count: u8 = 0; + for (d.multilibs()) |multilib| { if (multilib_filter.exists(multilib, fs)) { - self.multilibs.set(found_count, multilib); + d.multilib_buf[found_count] = multilib; found_count += 1; } } - self.multilibs.resize(found_count) catch unreachable; + d.multilib_count = found_count; } - pub fn select(self: *Detected, flags: Flags) !bool { - var filtered: MultilibArray = .{}; - for (self.multilibs.constSlice()) |multilib| { - for (multilib.flags.constSlice()) |multilib_flag| { - const matched = for (flags.constSlice()) |arg_flag| { + pub fn select(d: *Detected, check_flags: []const []const u8) !bool { + var selected: ?Multilib = null; + + for (d.multilibs()) |multilib| { + for (multilib.flags()) |multilib_flag| { + const matched = for (check_flags) |arg_flag| { if (std.mem.eql(u8, arg_flag[1..], multilib_flag[1..])) break arg_flag; } else multilib_flag; if (matched[0] != multilib_flag[0]) break; + } else if (selected != null) { + return error.TooManyMultilibs; } else { - filtered.appendAssumeCapacity(multilib); + selected = multilib; } } - if (filtered.len == 0) return false; - if (filtered.len == 1) { - self.selected = filtered.get(0); + if (selected) |multilib| { + d.selected = multilib; return true; } - return error.TooManyMultilibs; + return false; + } + + pub fn multilibs(d: *const Detected) []const Multilib { + return d.multilib_buf[0..d.multilib_count]; } }; @@ -58,14 +61,20 @@ const Multilib = @This(); gcc_suffix: []const u8 = "", os_suffix: []const u8 = "", include_suffix: []const u8 = "", -flags: Flags = .{}, +flag_buf: [6][]const u8 = undefined, +flag_count: u8 = 0, priority: u32 = 0, -pub fn init(gcc_suffix: []const u8, os_suffix: []const u8, flags: []const []const u8) Multilib { +pub fn init(gcc_suffix: []const u8, os_suffix: []const u8, init_flags: []const []const u8) Multilib { var self: Multilib = .{ .gcc_suffix = gcc_suffix, .os_suffix = os_suffix, + .flag_count = @intCast(init_flags.len), }; - self.flags.appendSliceAssumeCapacity(flags); + @memcpy(self.flag_buf[0..init_flags.len], init_flags); return self; } + +pub fn flags(m: *const Multilib) []const []const u8 { + return m.flag_buf[0..m.flag_count]; +} diff --git a/lib/compiler/aro/aro/Hideset.zig b/lib/compiler/aro/aro/Hideset.zig index 98712e41e2f4..5c6e9534bd8d 100644 --- a/lib/compiler/aro/aro/Hideset.zig +++ b/lib/compiler/aro/aro/Hideset.zig @@ -10,8 +10,9 @@ const std = @import("std"); const mem = std.mem; const Allocator = mem.Allocator; -const Source = @import("Source.zig"); + const Compilation = @import("Compilation.zig"); +const Source = @import("Source.zig"); const Tokenizer = @import("Tokenizer.zig"); pub const Hideset = @This(); @@ -51,10 +52,10 @@ pub const Index = enum(u32) { _, }; -map: std.AutoHashMapUnmanaged(Identifier, Index) = .empty, +map: std.AutoHashMapUnmanaged(Identifier, Index) = .{}, /// Used for computing union/intersection of two lists; stored here so that allocations can be retained /// until hideset is deinit'ed -tmp_map: std.AutoHashMapUnmanaged(Identifier, void) = .empty, +tmp_map: std.AutoHashMapUnmanaged(Identifier, void) = .{}, linked_list: Item.List = .{}, comp: *const Compilation, diff --git a/lib/compiler/aro/aro/InitList.zig b/lib/compiler/aro/aro/InitList.zig index d1d8066dd207..9d8af869d758 100644 --- a/lib/compiler/aro/aro/InitList.zig +++ b/lib/compiler/aro/aro/InitList.zig @@ -3,17 +3,16 @@ const std = @import("std"); const Allocator = std.mem.Allocator; const testing = std.testing; + +const Diagnostics = @import("Diagnostics.zig"); +const Parser = @import("Parser.zig"); const Tree = @import("Tree.zig"); const Token = Tree.Token; const TokenIndex = Tree.TokenIndex; -const NodeIndex = Tree.NodeIndex; -const Type = @import("Type.zig"); -const Diagnostics = @import("Diagnostics.zig"); -const NodeList = std.array_list.Managed(NodeIndex); -const Parser = @import("Parser.zig"); +const Node = Tree.Node; const Item = struct { - list: InitList = .{}, + list: InitList, index: u64, fn order(_: void, a: Item, b: Item) std.math.Order { @@ -23,8 +22,8 @@ const Item = struct { const InitList = @This(); -list: std.ArrayListUnmanaged(Item) = .empty, -node: NodeIndex = .none, +list: std.ArrayList(Item) = .empty, +node: Node.OptIndex = .null, tok: TokenIndex = 0, /// Deinitialize freeing all memory. @@ -34,50 +33,6 @@ pub fn deinit(il: *InitList, gpa: Allocator) void { il.* = undefined; } -/// Insert initializer at index, returning previous entry if one exists. -pub fn put(il: *InitList, gpa: Allocator, index: usize, node: NodeIndex, tok: TokenIndex) !?TokenIndex { - const items = il.list.items; - var left: usize = 0; - var right: usize = items.len; - - // Append new value to empty list - if (left == right) { - const item = try il.list.addOne(gpa); - item.* = .{ - .list = .{ .node = node, .tok = tok }, - .index = index, - }; - return null; - } - - while (left < right) { - // Avoid overflowing in the midpoint calculation - const mid = left + (right - left) / 2; - // Compare the key with the midpoint element - switch (std.math.order(index, items[mid].index)) { - .eq => { - // Replace previous entry. - const prev = items[mid].list.tok; - items[mid].list.deinit(gpa); - items[mid] = .{ - .list = .{ .node = node, .tok = tok }, - .index = index, - }; - return prev; - }, - .gt => left = mid + 1, - .lt => right = mid, - } - } - - // Insert a new value into a sorted position. - try il.list.insert(gpa, left, .{ - .list = .{ .node = node, .tok = tok }, - .index = index, - }); - return null; -} - /// Find item at index, create new if one does not exist. pub fn find(il: *InitList, gpa: Allocator, index: u64) !*InitList { const items = il.list.items; @@ -85,13 +40,21 @@ pub fn find(il: *InitList, gpa: Allocator, index: u64) !*InitList { var right: usize = items.len; // Append new value to empty list - if (left == right) { + if (il.list.items.len == 0) { const item = try il.list.addOne(gpa); item.* = .{ - .list = .{ .node = .none, .tok = 0 }, + .list = .{}, .index = index, }; return &item.list; + } else if (il.list.items[il.list.items.len - 1].index < index) { + // Append a new value to the end of the list. + const new = try il.list.addOne(gpa); + new.* = .{ + .list = .{}, + .index = index, + }; + return &new.list; } while (left < right) { @@ -107,7 +70,7 @@ pub fn find(il: *InitList, gpa: Allocator, index: u64) !*InitList { // Insert a new value into a sorted position. try il.list.insert(gpa, left, .{ - .list = .{ .node = .none, .tok = 0 }, + .list = .{}, .index = index, }); return &il.list.items[left].list; @@ -118,22 +81,6 @@ test "basic usage" { var il: InitList = .{}; defer il.deinit(gpa); - { - var i: usize = 0; - while (i < 5) : (i += 1) { - const prev = try il.put(gpa, i, .none, 0); - try testing.expect(prev == null); - } - } - - { - const failing = testing.failing_allocator; - var i: usize = 0; - while (i < 5) : (i += 1) { - _ = try il.find(failing, i); - } - } - { var item = try il.find(gpa, 0); var i: usize = 1; diff --git a/lib/compiler/aro/aro/LangOpts.zig b/lib/compiler/aro/aro/LangOpts.zig index e7b2ebf6c0de..811b6bf8bdbb 100644 --- a/lib/compiler/aro/aro/LangOpts.zig +++ b/lib/compiler/aro/aro/LangOpts.zig @@ -1,6 +1,7 @@ const std = @import("std"); -const DiagnosticTag = @import("Diagnostics.zig").Tag; + const char_info = @import("char_info.zig"); +const DiagnosticTag = @import("Diagnostics.zig").Tag; pub const Compiler = enum { clang, @@ -144,14 +145,9 @@ pub fn setStandard(self: *LangOpts, name: []const u8) error{InvalidStandard}!voi self.standard = Standard.NameMap.get(name) orelse return error.InvalidStandard; } -pub fn enableMSExtensions(self: *LangOpts) void { - self.declspec_attrs = true; - self.ms_extensions = true; -} - -pub fn disableMSExtensions(self: *LangOpts) void { - self.declspec_attrs = false; - self.ms_extensions = true; +pub fn setMSExtensions(self: *LangOpts, enabled: bool) void { + self.declspec_attrs = enabled; + self.ms_extensions = enabled; } pub fn hasChar8_T(self: *const LangOpts) bool { @@ -164,7 +160,7 @@ pub fn hasDigraphs(self: *const LangOpts) bool { pub fn setEmulatedCompiler(self: *LangOpts, compiler: Compiler) void { self.emulate = compiler; - if (compiler == .msvc) self.enableMSExtensions(); + self.setMSExtensions(compiler == .msvc); } pub fn setFpEvalMethod(self: *LangOpts, fp_eval_method: FPEvalMethod) void { diff --git a/lib/compiler/aro/aro/Parser.zig b/lib/compiler/aro/aro/Parser.zig index 14cd70fdfdb3..05f89c9a18d8 100644 --- a/lib/compiler/aro/aro/Parser.zig +++ b/lib/compiler/aro/aro/Parser.zig @@ -3,39 +3,41 @@ const mem = std.mem; const Allocator = mem.Allocator; const assert = std.debug.assert; const big = std.math.big; + +const Attribute = @import("Attribute.zig"); +const Builtins = @import("Builtins.zig"); +const Builtin = Builtins.Builtin; +const evalBuiltin = @import("Builtins/eval.zig").eval; +const char_info = @import("char_info.zig"); const Compilation = @import("Compilation.zig"); +const Diagnostics = @import("Diagnostics.zig"); +const InitList = @import("InitList.zig"); +const Preprocessor = @import("Preprocessor.zig"); +const record_layout = @import("record_layout.zig"); const Source = @import("Source.zig"); +const StringId = @import("StringInterner.zig").StringId; +const SymbolStack = @import("SymbolStack.zig"); +const Symbol = SymbolStack.Symbol; +const target_util = @import("target.zig"); +const text_literal = @import("text_literal.zig"); const Tokenizer = @import("Tokenizer.zig"); -const Preprocessor = @import("Preprocessor.zig"); const Tree = @import("Tree.zig"); const Token = Tree.Token; const NumberPrefix = Token.NumberPrefix; const NumberSuffix = Token.NumberSuffix; const TokenIndex = Tree.TokenIndex; -const NodeIndex = Tree.NodeIndex; -const Type = @import("Type.zig"); -const Diagnostics = @import("Diagnostics.zig"); -const NodeList = std.array_list.Managed(NodeIndex); -const InitList = @import("InitList.zig"); -const Attribute = @import("Attribute.zig"); -const char_info = @import("char_info.zig"); -const text_literal = @import("text_literal.zig"); +const Node = Tree.Node; +const TypeStore = @import("TypeStore.zig"); +const Type = TypeStore.Type; +const QualType = TypeStore.QualType; const Value = @import("Value.zig"); -const SymbolStack = @import("SymbolStack.zig"); -const Symbol = SymbolStack.Symbol; -const record_layout = @import("record_layout.zig"); -const StrInt = @import("StringInterner.zig"); -const StringId = StrInt.StringId; -const Builtins = @import("Builtins.zig"); -const Builtin = Builtins.Builtin; -const evalBuiltin = @import("Builtins/eval.zig").eval; -const target_util = @import("target.zig"); +const NodeList = std.ArrayList(Node.Index); const Switch = struct { default: ?TokenIndex = null, - ranges: std.array_list.Managed(Range), - ty: Type, - comp: *Compilation, + ranges: std.ArrayList(Range) = .empty, + qt: QualType, + comp: *const Compilation, const Range = struct { first: Value, @@ -43,13 +45,13 @@ const Switch = struct { tok: TokenIndex, }; - fn add(self: *Switch, first: Value, last: Value, tok: TokenIndex) !?Range { - for (self.ranges.items) |range| { - if (last.compare(.gte, range.first, self.comp) and first.compare(.lte, range.last, self.comp)) { + fn add(s: *Switch, first: Value, last: Value, tok: TokenIndex) !?Range { + for (s.ranges.items) |range| { + if (last.compare(.gte, range.first, s.comp) and first.compare(.lte, range.last, s.comp)) { return range; // They overlap. } } - try self.ranges.append(.{ + try s.ranges.append(s.comp.gpa, .{ .first = first, .last = last, .tok = tok, @@ -63,6 +65,15 @@ const Label = union(enum) { label: TokenIndex, }; +const InitContext = enum { + /// inits do not need to be compile-time constants + runtime, + /// constexpr variable, could be any scope but inits must be compile-time constants + constexpr, + /// static and global variables, inits must be compile-time constants + static, +}; + pub const Error = Compilation.Error || error{ParsingFailed}; /// An attribute that has been parsed but not yet validated in its context @@ -89,28 +100,30 @@ const Parser = @This(); // values from preprocessor pp: *Preprocessor, comp: *Compilation, -gpa: mem.Allocator, +diagnostics: *Diagnostics, tok_ids: []const Token.Id, tok_i: TokenIndex = 0, -// values of the incomplete Tree -arena: Allocator, -nodes: Tree.Node.List = .{}, -data: NodeList, -value_map: Tree.ValueMap, +/// The AST being constructed. +tree: Tree, // buffers used during compilation syms: SymbolStack = .{}, -strings: std.array_list.AlignedManaged(u8, .@"4"), -labels: std.array_list.Managed(Label), -list_buf: NodeList, -decl_buf: NodeList, -param_buf: std.array_list.Managed(Type.Func.Param), -enum_buf: std.array_list.Managed(Type.Enum.Field), -record_buf: std.array_list.Managed(Type.Record.Field), -attr_buf: std.MultiArrayList(TentativeAttribute) = .{}, -attr_application_buf: std.ArrayListUnmanaged(Attribute) = .empty, -field_attr_buf: std.array_list.Managed([]const Attribute), +strings: std.array_list.Aligned(u8, .@"4") = .empty, +labels: std.ArrayList(Label) = .empty, +list_buf: NodeList = .empty, +decl_buf: NodeList = .empty, +/// Function type parameters, also used for generic selection association +/// duplicate checking. +param_buf: std.ArrayList(Type.Func.Param) = .empty, +/// Enum type fields. +enum_buf: std.ArrayList(Type.Enum.Field) = .empty, +/// Record type fields. +record_buf: std.ArrayList(Type.Record.Field) = .empty, +/// Attributes that have been parsed but not yet validated or applied. +attr_buf: std.MultiArrayList(TentativeAttribute) = .empty, +/// Used to store validated attributes before they are applied to types. +attr_application_buf: std.ArrayList(Attribute) = .empty, /// type name -> variable name location for tentative definitions (top-level defs with thus-far-incomplete types) /// e.g. `struct Foo bar;` where `struct Foo` is not defined yet. /// The key is the StringId of `Foo` and the value is the TokenIndex of `bar` @@ -135,46 +148,51 @@ computed_goto_tok: ?TokenIndex = null, /// so that it is not used in its own initializer. auto_type_decl_name: StringId = .empty, +init_context: InitContext = .runtime, + /// Various variables that are different for each function. func: struct { - /// null if not in function, will always be plain func, var_args_func or old_style_func - ty: ?Type = null, + /// null if not in function, will always be plain func + qt: ?QualType = null, name: TokenIndex = 0, ident: ?Result = null, pretty_ident: ?Result = null, } = .{}, + /// Various variables that are different for each record. record: struct { // invalid means we're not parsing a record kind: Token.Id = .invalid, flexible_field: ?TokenIndex = null, start: usize = 0, - field_attr_start: usize = 0, fn addField(r: @This(), p: *Parser, name: StringId, tok: TokenIndex) Error!void { var i = p.record_members.items.len; while (i > r.start) { i -= 1; if (p.record_members.items[i].name == name) { - try p.errStr(.duplicate_member, tok, p.tokSlice(tok)); - try p.errTok(.previous_definition, p.record_members.items[i].tok); + try p.err(tok, .duplicate_member, .{p.tokSlice(tok)}); + try p.err(p.record_members.items[i].tok, .previous_definition, .{}); break; } } - try p.record_members.append(p.gpa, .{ .name = name, .tok = tok }); + try p.record_members.append(p.comp.gpa, .{ .name = name, .tok = tok }); } - fn addFieldsFromAnonymous(r: @This(), p: *Parser, ty: Type) Error!void { - for (ty.getRecord().?.fields) |f| { - if (f.isAnonymousRecord()) { - try r.addFieldsFromAnonymous(p, f.ty.canonicalize(.standard)); - } else if (f.name_tok != 0) { + fn addFieldsFromAnonymous(r: @This(), p: *Parser, record_ty: Type.Record) Error!void { + for (record_ty.fields) |f| { + if (f.name_tok == 0) { + if (f.qt.getRecord(p.comp)) |field_record_ty| { + try r.addFieldsFromAnonymous(p, field_record_ty); + } + } else { try r.addField(p, f.name, f.name_tok); } } } } = .{}, -record_members: std.ArrayListUnmanaged(struct { tok: TokenIndex, name: StringId }) = .empty, +record_members: std.ArrayList(struct { tok: TokenIndex, name: StringId }) = .empty, + @"switch": ?*Switch = null, in_loop: bool = false, pragma_pack: ?u8 = null, @@ -189,32 +207,49 @@ string_ids: struct { /// Checks codepoint for various pedantic warnings /// Returns true if diagnostic issued -fn checkIdentifierCodepointWarnings(comp: *Compilation, codepoint: u21, loc: Source.Location) Compilation.Error!bool { +fn checkIdentifierCodepointWarnings(p: *Parser, codepoint: u21, loc: Source.Location) Compilation.Error!bool { assert(codepoint >= 0x80); - const err_start = comp.diagnostics.list.items.len; + const prev_total = p.diagnostics.total; + var sf = std.heap.stackFallback(1024, p.comp.gpa); + var allocating: std.Io.Writer.Allocating = .init(sf.get()); + defer allocating.deinit(); if (!char_info.isC99IdChar(codepoint)) { - try comp.addDiagnostic(.{ - .tag = .c99_compat, - .loc = loc, - }, &.{}); + const diagnostic: Diagnostic = .c99_compat; + try p.diagnostics.add(.{ + .kind = diagnostic.kind, + .text = diagnostic.fmt, + .extension = diagnostic.extension, + .opt = diagnostic.opt, + .location = loc.expand(p.comp), + }); } if (char_info.isInvisible(codepoint)) { - try comp.addDiagnostic(.{ - .tag = .unicode_zero_width, - .loc = loc, - .extra = .{ .actual_codepoint = codepoint }, - }, &.{}); + const diagnostic: Diagnostic = .unicode_zero_width; + p.formatArgs(&allocating.writer, diagnostic.fmt, .{Codepoint.init(codepoint)}) catch return error.OutOfMemory; + + try p.diagnostics.add(.{ + .kind = diagnostic.kind, + .text = allocating.written(), + .extension = diagnostic.extension, + .opt = diagnostic.opt, + .location = loc.expand(p.comp), + }); } if (char_info.homoglyph(codepoint)) |resembles| { - try comp.addDiagnostic(.{ - .tag = .unicode_homoglyph, - .loc = loc, - .extra = .{ .codepoints = .{ .actual = codepoint, .resembles = resembles } }, - }, &.{}); + const diagnostic: Diagnostic = .unicode_homoglyph; + p.formatArgs(&allocating.writer, diagnostic.fmt, .{ Codepoint.init(codepoint), resembles }) catch return error.OutOfMemory; + + try p.diagnostics.add(.{ + .kind = diagnostic.kind, + .text = allocating.written(), + .extension = diagnostic.extension, + .opt = diagnostic.opt, + .location = loc.expand(p.comp), + }); } - return comp.diagnostics.list.items.len != err_start; + return p.diagnostics.total != prev_total; } /// Issues diagnostics for the current extended identifier token @@ -226,7 +261,7 @@ fn validateExtendedIdentifier(p: *Parser) !bool { const slice = p.tokSlice(p.tok_i); const view = std.unicode.Utf8View.init(slice) catch { - try p.errTok(.invalid_utf8, p.tok_i); + try p.err(p.tok_i, .invalid_utf8, .{}); return error.FatalError; }; var it = view.iterator(); @@ -247,10 +282,16 @@ fn validateExtendedIdentifier(p: *Parser) !bool { } if (codepoint == '$') { warned = true; - if (p.comp.langopts.dollars_in_identifiers) try p.comp.addDiagnostic(.{ - .tag = .dollar_in_identifier_extension, - .loc = loc, - }, &.{}); + if (p.comp.langopts.dollars_in_identifiers) { + const diagnostic: Diagnostic = .dollar_in_identifier_extension; + try p.diagnostics.add(.{ + .kind = diagnostic.kind, + .text = diagnostic.fmt, + .extension = diagnostic.extension, + .opt = diagnostic.opt, + .location = loc.expand(p.comp), + }); + } } if (codepoint <= 0x7F) continue; @@ -264,7 +305,7 @@ fn validateExtendedIdentifier(p: *Parser) !bool { } if (!warned) { - warned = try checkIdentifierCodepointWarnings(p.comp, codepoint, loc); + warned = try p.checkIdentifierCodepointWarnings(codepoint, loc); } // Check NFC normalization. @@ -274,22 +315,22 @@ fn validateExtendedIdentifier(p: *Parser) !bool { canonical_class != .not_reordered) { normalized = false; - try p.errStr(.identifier_not_normalized, p.tok_i, slice); + try p.err(p.tok_i, .identifier_not_normalized, .{slice}); continue; } if (char_info.isNormalized(codepoint) != .yes) { normalized = false; - try p.errExtra(.identifier_not_normalized, p.tok_i, .{ .normalized = slice }); + try p.err(p.tok_i, .identifier_not_normalized, .{Normalized.init(slice)}); } last_canonical_class = canonical_class; } if (!valid_identifier) { if (len == 1) { - try p.errExtra(.unexpected_character, p.tok_i, .{ .actual_codepoint = invalid_char }); + try p.err(p.tok_i, .unexpected_character, .{Codepoint.init(invalid_char)}); return false; } else { - try p.errExtra(.invalid_identifier_start_char, p.tok_i, .{ .actual_codepoint = invalid_char }); + try p.err(p.tok_i, .invalid_identifier_start_char, .{Codepoint.init(invalid_char)}); } } @@ -312,7 +353,7 @@ fn eatIdentifier(p: *Parser) !?TokenIndex { // Handle illegal '$' characters in identifiers if (!p.comp.langopts.dollars_in_identifiers) { if (p.tok_ids[p.tok_i] == .invalid and p.tokSlice(p.tok_i)[0] == '$') { - try p.err(.dollars_in_identifiers); + try p.err(p.tok_i, .dollars_in_identifiers, .{}); p.tok_i += 1; return error.ParsingFailed; } @@ -362,40 +403,33 @@ pub fn tokSlice(p: *Parser, tok: TokenIndex) []const u8 { fn expectClosing(p: *Parser, opening: TokenIndex, id: Token.Id) Error!void { _ = p.expectToken(id) catch |e| { if (e == error.ParsingFailed) { - try p.errTok(switch (id) { + try p.err(opening, switch (id) { .r_paren => .to_match_paren, .r_brace => .to_match_brace, .r_bracket => .to_match_brace, else => unreachable, - }, opening); + }, .{}); } return e; }; } -fn errOverflow(p: *Parser, op_tok: TokenIndex, res: Result) !void { - try p.errStr(.overflow, op_tok, try res.str(p)); -} +pub const Diagnostic = @import("Parser/Diagnostic.zig"); -fn errExpectedToken(p: *Parser, expected: Token.Id, actual: Token.Id) Error { - switch (actual) { - .invalid => try p.errExtra(.expected_invalid, p.tok_i, .{ .tok_id_expected = expected }), - .eof => try p.errExtra(.expected_eof, p.tok_i, .{ .tok_id_expected = expected }), - else => try p.errExtra(.expected_token, p.tok_i, .{ .tok_id = .{ - .expected = expected, - .actual = actual, - } }), +pub fn err(p: *Parser, tok_i: TokenIndex, diagnostic: Diagnostic, args: anytype) Compilation.Error!void { + if (p.extension_suppressed) { + if (diagnostic.extension and diagnostic.kind == .off) return; } - return error.ParsingFailed; -} + if (diagnostic.suppress_version) |some| if (p.comp.langopts.standard.atLeast(some)) return; + if (diagnostic.suppress_unless_version) |some| if (!p.comp.langopts.standard.atLeast(some)) return; + if (p.diagnostics.effectiveKind(diagnostic) == .off) return; -pub fn errStr(p: *Parser, tag: Diagnostics.Tag, tok_i: TokenIndex, str: []const u8) Compilation.Error!void { - @branchHint(.cold); - return p.errExtra(tag, tok_i, .{ .str = str }); -} + var sf = std.heap.stackFallback(1024, p.comp.gpa); + var allocating: std.Io.Writer.Allocating = .init(sf.get()); + defer allocating.deinit(); + + p.formatArgs(&allocating.writer, diagnostic.fmt, args) catch return error.OutOfMemory; -pub fn errExtra(p: *Parser, tag: Diagnostics.Tag, tok_i: TokenIndex, extra: Diagnostics.Message.Extra) Compilation.Error!void { - @branchHint(.cold); const tok = p.pp.tokens.get(tok_i); var loc = tok.loc; if (tok_i != 0 and tok.id == .eof) { @@ -404,158 +438,232 @@ pub fn errExtra(p: *Parser, tag: Diagnostics.Tag, tok_i: TokenIndex, extra: Diag loc = prev.loc; loc.byte_offset += @intCast(p.tokSlice(tok_i - 1).len); } - try p.comp.addDiagnostic(.{ - .tag = tag, - .loc = loc, - .extra = extra, - }, p.pp.expansionSlice(tok_i)); -} - -pub fn errTok(p: *Parser, tag: Diagnostics.Tag, tok_i: TokenIndex) Compilation.Error!void { - @branchHint(.cold); - return p.errExtra(tag, tok_i, .{ .none = {} }); -} + try p.diagnostics.addWithLocation(p.comp, .{ + .kind = diagnostic.kind, + .text = allocating.written(), + .opt = diagnostic.opt, + .extension = diagnostic.extension, + .location = loc.expand(p.comp), + }, p.pp.expansionSlice(tok_i), true); +} + +fn formatArgs(p: *Parser, w: *std.Io.Writer, fmt: []const u8, args: anytype) !void { + var i: usize = 0; + inline for (std.meta.fields(@TypeOf(args))) |arg_info| { + const arg = @field(args, arg_info.name); + i += switch (@TypeOf(arg)) { + []const u8 => try Diagnostics.formatString(w, fmt[i..], arg), + Tree.Token.Id => try formatTokenId(w, fmt[i..], arg), + QualType => try p.formatQualType(w, fmt[i..], arg), + text_literal.Ascii => try arg.format(w, fmt[i..]), + Result => try p.formatResult(w, fmt[i..], arg), + *Result => try p.formatResult(w, fmt[i..], arg.*), + Enumerator, *Enumerator => try p.formatResult(w, fmt[i..], .{ + .node = undefined, + .val = arg.val, + .qt = arg.qt, + }), + Codepoint => try arg.format(w, fmt[i..]), + Normalized => try arg.format(w, fmt[i..]), + Escaped => try arg.format(w, fmt[i..]), + else => switch (@typeInfo(@TypeOf(arg))) { + .int, .comptime_int => try Diagnostics.formatInt(w, fmt[i..], arg), + .pointer => try Diagnostics.formatString(w, fmt[i..], arg), + else => unreachable, + }, + }; + } + try w.writeAll(fmt[i..]); +} + +fn formatTokenId(w: *std.Io.Writer, fmt: []const u8, tok_id: Tree.Token.Id) !usize { + const template = "{tok_id}"; + const i = std.mem.indexOf(u8, fmt, template).?; + try w.writeAll(fmt[0..i]); + try w.writeAll(tok_id.symbol()); + return i + template.len; +} + +fn formatQualType(p: *Parser, w: *std.Io.Writer, fmt: []const u8, qt: QualType) !usize { + const template = "{qt}"; + const i = std.mem.indexOf(u8, fmt, template).?; + try w.writeAll(fmt[0..i]); + try w.writeByte('\''); + try qt.print(p.comp, w); + try w.writeByte('\''); + + if (qt.isC23Auto()) return i + template.len; + if (qt.get(p.comp, .vector)) |vector_ty| { + try w.print(" (vector of {d} '", .{vector_ty.len}); + try vector_ty.elem.printDesugared(p.comp, w); + try w.writeAll("' values)"); + } else if (qt.shouldDesugar(p.comp)) { + try w.writeAll(" (aka '"); + try qt.printDesugared(p.comp, w); + try w.writeAll("')"); + } + return i + template.len; +} + +fn formatResult(p: *Parser, w: *std.Io.Writer, fmt: []const u8, res: Result) !usize { + const template = "{value}"; + const i = std.mem.indexOf(u8, fmt, template).?; + try w.writeAll(fmt[0..i]); + + switch (res.val.opt_ref) { + .none => try w.writeAll("(none)"), + .null => try w.writeAll("nullptr_t"), + else => if (try res.val.print(res.qt, p.comp, w)) |nested| switch (nested) { + .pointer => |ptr| { + const ptr_node: Node.Index = @enumFromInt(ptr.node); + const decl_name = p.tree.tokSlice(ptr_node.tok(&p.tree)); + try ptr.offset.printPointer(decl_name, p.comp, w); + }, + }, + } -pub fn err(p: *Parser, tag: Diagnostics.Tag) Compilation.Error!void { - @branchHint(.cold); - return p.errExtra(tag, p.tok_i, .{ .none = {} }); + return i + template.len; } -pub fn todo(p: *Parser, msg: []const u8) Error { - try p.errStr(.todo, p.tok_i, msg); - return error.ParsingFailed; -} +const Normalized = struct { + str: []const u8, -pub fn removeNull(p: *Parser, str: Value) !Value { - const strings_top = p.strings.items.len; - defer p.strings.items.len = strings_top; - { - const bytes = p.comp.interner.get(str.ref()).bytes; - try p.strings.appendSlice(bytes[0 .. bytes.len - 1]); + fn init(str: []const u8) Normalized { + return .{ .str = str }; } - return Value.intern(p.comp, .{ .bytes = p.strings.items[strings_top..] }); -} -pub fn typeStr(p: *Parser, ty: Type) ![]const u8 { - if (@import("builtin").mode != .Debug) { - if (ty.is(.invalid)) { - return "Tried to render invalid type - this is an aro bug."; + pub fn format(ctx: Normalized, w: *std.Io.Writer, fmt_str: []const u8) !usize { + const template = "{normalized}"; + const i = std.mem.indexOf(u8, fmt_str, template).?; + try w.writeAll(fmt_str[0..i]); + var it: std.unicode.Utf8Iterator = .{ + .bytes = ctx.str, + .i = 0, + }; + while (it.nextCodepoint()) |codepoint| { + if (codepoint < 0x7F) { + try w.writeByte(@intCast(codepoint)); + } else if (codepoint < 0xFFFF) { + try w.writeAll("\\u"); + try w.printInt(codepoint, 16, .upper, .{ + .fill = '0', + .width = 4, + }); + } else { + try w.writeAll("\\U"); + try w.printInt(codepoint, 16, .upper, .{ + .fill = '0', + .width = 8, + }); + } } + return i + template.len; } - if (Type.Builder.fromType(ty).str(p.comp.langopts)) |str| return str; - const strings_top = p.strings.items.len; - defer p.strings.items.len = strings_top; +}; - const mapper = p.comp.string_interner.getSlowTypeMapper(); - try ty.print(mapper, p.comp.langopts, p.strings.writer()); - return try p.comp.diagnostics.arena.allocator().dupe(u8, p.strings.items[strings_top..]); -} +const Codepoint = struct { + codepoint: u21, -pub fn typePairStr(p: *Parser, a: Type, b: Type) ![]const u8 { - return p.typePairStrExtra(a, " and ", b); -} + fn init(codepoint: u21) Codepoint { + return .{ .codepoint = codepoint }; + } -pub fn typePairStrExtra(p: *Parser, a: Type, msg: []const u8, b: Type) ![]const u8 { - if (@import("builtin").mode != .Debug) { - if (a.is(.invalid) or b.is(.invalid)) { - return "Tried to render invalid type - this is an aro bug."; - } + pub fn format(ctx: Codepoint, w: *std.Io.Writer, fmt_str: []const u8) !usize { + const template = "{codepoint}"; + const i = std.mem.indexOf(u8, fmt_str, template).?; + try w.writeAll(fmt_str[0..i]); + try w.print("{X:0>4}", .{ctx.codepoint}); + return i + template.len; } - const strings_top = p.strings.items.len; - defer p.strings.items.len = strings_top; +}; - try p.strings.append('\''); - const mapper = p.comp.string_interner.getSlowTypeMapper(); - try a.print(mapper, p.comp.langopts, p.strings.writer()); - try p.strings.append('\''); - try p.strings.appendSlice(msg); - try p.strings.append('\''); - try b.print(mapper, p.comp.langopts, p.strings.writer()); - try p.strings.append('\''); - return try p.comp.diagnostics.arena.allocator().dupe(u8, p.strings.items[strings_top..]); -} +const Escaped = struct { + str: []const u8, -pub fn valueChangedStr(p: *Parser, res: *Result, old_value: Value, int_ty: Type) ![]const u8 { - const strings_top = p.strings.items.len; - defer p.strings.items.len = strings_top; + fn init(str: []const u8) Escaped { + return .{ .str = str }; + } - var w = p.strings.writer(); - const type_pair_str = try p.typePairStrExtra(res.ty, " to ", int_ty); - try w.writeAll(type_pair_str); + pub fn format(ctx: Escaped, w: *std.Io.Writer, fmt_str: []const u8) !usize { + const template = "{s}"; + const i = std.mem.indexOf(u8, fmt_str, template).?; + try w.writeAll(fmt_str[0..i]); + try std.zig.stringEscape(ctx.str, w); + return i + template.len; + } +}; - try w.writeAll(" changes "); - if (res.val.isZero(p.comp)) try w.writeAll("non-zero "); - try w.writeAll("value from "); - try old_value.print(res.ty, p.comp, w); - try w.writeAll(" to "); - try res.val.print(int_ty, p.comp, w); +pub fn todo(p: *Parser, msg: []const u8) Error { + try p.err(p.tok_i, .todo, .{msg}); + return error.ParsingFailed; +} - return try p.comp.diagnostics.arena.allocator().dupe(u8, p.strings.items[strings_top..]); +pub fn removeNull(p: *Parser, str: Value) !Value { + const strings_top = p.strings.items.len; + defer p.strings.items.len = strings_top; + { + const bytes = p.comp.interner.get(str.ref()).bytes; + try p.strings.appendSlice(p.comp.gpa, bytes[0 .. bytes.len - 1]); + } + return Value.intern(p.comp, .{ .bytes = p.strings.items[strings_top..] }); } -fn checkDeprecatedUnavailable(p: *Parser, ty: Type, usage_tok: TokenIndex, decl_tok: TokenIndex) !void { - if (ty.getAttribute(.@"error")) |@"error"| { - const strings_top = p.strings.items.len; - defer p.strings.items.len = strings_top; +pub fn errValueChanged(p: *Parser, tok_i: TokenIndex, diagnostic: Diagnostic, res: Result, old_val: Value, int_qt: QualType) !void { + const zero_str = if (res.val.isZero(p.comp)) "non-zero " else ""; + const old_res: Result = .{ + .node = undefined, + .val = old_val, + .qt = res.qt, + }; + const new_res: Result = .{ + .node = undefined, + .val = res.val, + .qt = int_qt, + }; + try p.err(tok_i, diagnostic, .{ res.qt, int_qt, zero_str, old_res, new_res }); +} - const w = p.strings.writer(); +fn checkDeprecatedUnavailable(p: *Parser, ty: QualType, usage_tok: TokenIndex, decl_tok: TokenIndex) !void { + if (ty.getAttribute(p.comp, .@"error")) |@"error"| { const msg_str = p.comp.interner.get(@"error".msg.ref()).bytes; - try w.print("call to '{s}' declared with attribute error: {f}", .{ - p.tokSlice(@"error".__name_tok), std.zig.fmtString(msg_str), - }); - const str = try p.comp.diagnostics.arena.allocator().dupe(u8, p.strings.items[strings_top..]); - try p.errStr(.error_attribute, usage_tok, str); + try p.err(usage_tok, .error_attribute, .{ p.tokSlice(@"error".__name_tok), std.zig.fmtString(msg_str) }); } - if (ty.getAttribute(.warning)) |warning| { - const strings_top = p.strings.items.len; - defer p.strings.items.len = strings_top; - - const w = p.strings.writer(); + if (ty.getAttribute(p.comp, .warning)) |warning| { const msg_str = p.comp.interner.get(warning.msg.ref()).bytes; - try w.print("call to '{s}' declared with attribute warning: {f}", .{ - p.tokSlice(warning.__name_tok), std.zig.fmtString(msg_str), - }); - const str = try p.comp.diagnostics.arena.allocator().dupe(u8, p.strings.items[strings_top..]); - try p.errStr(.warning_attribute, usage_tok, str); + try p.err(usage_tok, .warning_attribute, .{ p.tokSlice(warning.__name_tok), std.zig.fmtString(msg_str) }); } - if (ty.getAttribute(.unavailable)) |unavailable| { - try p.errDeprecated(.unavailable, usage_tok, unavailable.msg); - try p.errStr(.unavailable_note, unavailable.__name_tok, p.tokSlice(decl_tok)); + if (ty.getAttribute(p.comp, .unavailable)) |unavailable| { + try p.errDeprecated(usage_tok, .unavailable, unavailable.msg); + try p.err(unavailable.__name_tok, .unavailable_note, .{p.tokSlice(decl_tok)}); return error.ParsingFailed; - } else if (ty.getAttribute(.deprecated)) |deprecated| { - try p.errDeprecated(.deprecated_declarations, usage_tok, deprecated.msg); - try p.errStr(.deprecated_note, deprecated.__name_tok, p.tokSlice(decl_tok)); + } + if (ty.getAttribute(p.comp, .deprecated)) |deprecated| { + try p.errDeprecated(usage_tok, .deprecated_declarations, deprecated.msg); + try p.err(deprecated.__name_tok, .deprecated_note, .{p.tokSlice(decl_tok)}); } } -fn errDeprecated(p: *Parser, tag: Diagnostics.Tag, tok_i: TokenIndex, msg: ?Value) Compilation.Error!void { - const strings_top = p.strings.items.len; - defer p.strings.items.len = strings_top; +fn errDeprecated(p: *Parser, tok_i: TokenIndex, diagnostic: Diagnostic, msg: ?Value) Compilation.Error!void { + const colon_str: []const u8 = if (msg != null) ": " else ""; + const msg_str: []const u8 = if (msg) |m| p.comp.interner.get(m.ref()).bytes else ""; + return p.err(tok_i, diagnostic, .{ p.tokSlice(tok_i), colon_str, Escaped.init(msg_str) }); +} - const w = p.strings.writer(); - try w.print("'{s}' is ", .{p.tokSlice(tok_i)}); - const reason: []const u8 = switch (tag) { - .unavailable => "unavailable", - .deprecated_declarations => "deprecated", - else => unreachable, - }; - try w.writeAll(reason); - if (msg) |m| { - const str = p.comp.interner.get(m.ref()).bytes; - try w.print(": {f}", .{std.zig.fmtString(str)}); - } - const str = try p.comp.diagnostics.arena.allocator().dupe(u8, p.strings.items[strings_top..]); - return p.errStr(tag, tok_i, str); +fn addNode(p: *Parser, node: Tree.Node) Allocator.Error!Node.Index { + if (p.in_macro) return undefined; + return p.tree.addNode(node); } -fn addNode(p: *Parser, node: Tree.Node) Allocator.Error!NodeIndex { - if (p.in_macro) return .none; - const res = p.nodes.len; - try p.nodes.append(p.gpa, node); - return @enumFromInt(res); +fn errExpectedToken(p: *Parser, expected: Token.Id, actual: Token.Id) Error { + switch (actual) { + .invalid => try p.err(p.tok_i, .expected_invalid, .{expected}), + .eof => try p.err(p.tok_i, .expected_eof, .{expected}), + else => try p.err(p.tok_i, .expected_token, .{ expected, actual }), + } + return error.ParsingFailed; } -fn addList(p: *Parser, nodes: []const NodeIndex) Allocator.Error!Tree.Node.Range { +fn addList(p: *Parser, nodes: []const Node.Index) Allocator.Error!Tree.Node.Range { if (p.in_macro) return Tree.Node.Range{ .start = 0, .end = 0 }; const start: u32 = @intCast(p.data.items.len); try p.data.appendSlice(nodes); @@ -563,6 +671,51 @@ fn addList(p: *Parser, nodes: []const NodeIndex) Allocator.Error!Tree.Node.Range return Tree.Node.Range{ .start = start, .end = end }; } +/// Recursively sets the defintion field of `tentative_decl` to `definition`. +pub fn setTentativeDeclDefinition(p: *Parser, tentative_decl: Node.Index, definition: Node.Index) void { + const node_data = &p.tree.nodes.items(.data)[@intFromEnum(tentative_decl)]; + switch (p.tree.nodes.items(.tag)[@intFromEnum(tentative_decl)]) { + .fn_proto => {}, + .variable => {}, + else => return, + } + + const prev: Node.OptIndex = @enumFromInt(node_data[2]); + + node_data[2] = @intFromEnum(definition); + if (prev.unpack()) |some| { + p.setTentativeDeclDefinition(some, definition); + } +} + +/// Clears the defintion field of declarations that were not defined so that +/// the field always contains a _def if present. +fn clearNonTentativeDefinitions(p: *Parser) void { + const tags = p.tree.nodes.items(.tag); + const data = p.tree.nodes.items(.data); + for (p.tree.root_decls.items) |root_decl| { + switch (tags[@intFromEnum(root_decl)]) { + .fn_proto => { + const node_data = &data[@intFromEnum(root_decl)]; + if (node_data[2] != @intFromEnum(Node.OptIndex.null)) { + if (tags[node_data[2]] != .fn_def) { + node_data[2] = @intFromEnum(Node.OptIndex.null); + } + } + }, + .variable => { + const node_data = &data[@intFromEnum(root_decl)]; + if (node_data[2] != @intFromEnum(Node.OptIndex.null)) { + if (tags[node_data[2]] != .variable_def) { + node_data[2] = @intFromEnum(Node.OptIndex.null); + } + } + }, + else => {}, + } + } +} + fn findLabel(p: *Parser, name: []const u8) ?TokenIndex { for (p.labels.items) |item| { switch (item) { @@ -573,64 +726,36 @@ fn findLabel(p: *Parser, name: []const u8) ?TokenIndex { return null; } -fn nodeIs(p: *Parser, node: NodeIndex, tag: Tree.Tag) bool { +fn nodeIs(p: *Parser, node: Node.Index, comptime tag: std.meta.Tag(Tree.Node)) bool { return p.getNode(node, tag) != null; } -pub fn getDecayedStringLiteral(p: *Parser, node: NodeIndex) ?Value { - const cast_node = p.getNode(node, .implicit_cast) orelse return null; - const data = p.nodes.items(.data)[@intFromEnum(cast_node)]; - if (data.cast.kind != .array_to_pointer) return null; - const literal_node = p.getNode(data.cast.operand, .string_literal_expr) orelse return null; - return p.value_map.get(literal_node); -} - -fn getNode(p: *Parser, node: NodeIndex, tag: Tree.Tag) ?NodeIndex { +pub fn getDecayedStringLiteral(p: *Parser, node: Node.Index) ?Value { var cur = node; - const tags = p.nodes.items(.tag); - const data = p.nodes.items(.data); while (true) { - const cur_tag = tags[@intFromEnum(cur)]; - if (cur_tag == .paren_expr) { - cur = data[@intFromEnum(cur)].un; - } else if (cur_tag == tag) { - return cur; - } else { - return null; + switch (cur.get(&p.tree)) { + .paren_expr => |un| cur = un.operand, + .string_literal_expr => return p.tree.value_map.get(cur), + .cast => |cast| switch (cast.kind) { + .no_op, .bitcast, .array_to_pointer => cur = cast.operand, + else => return null, + }, + else => return null, } } } -fn nodeIsCompoundLiteral(p: *Parser, node: NodeIndex) bool { +fn getNode(p: *Parser, node: Node.Index, comptime tag: std.meta.Tag(Tree.Node)) ?@FieldType(Node, @tagName(tag)) { var cur = node; - const tags = p.nodes.items(.tag); - const data = p.nodes.items(.data); while (true) { - switch (tags[@intFromEnum(cur)]) { - .paren_expr => cur = data[@intFromEnum(cur)].un, - .compound_literal_expr, - .static_compound_literal_expr, - .thread_local_compound_literal_expr, - .static_thread_local_compound_literal_expr, - => return true, - else => return false, + switch (cur.get(&p.tree)) { + .paren_expr => |un| cur = un.operand, + tag => |data| return data, + else => return null, } } } -fn tmpTree(p: *Parser) Tree { - return .{ - .nodes = p.nodes.slice(), - .data = p.data.items, - .value_map = p.value_map, - .comp = p.comp, - .arena = undefined, - .generated = undefined, - .tokens = undefined, - .root_decls = undefined, - }; -} - fn pragma(p: *Parser) Compilation.Error!bool { var found_pragma = false; while (p.eatToken(.keyword_pragma)) |_| { @@ -653,118 +778,95 @@ fn pragma(p: *Parser) Compilation.Error!bool { fn diagnoseIncompleteDefinitions(p: *Parser) !void { @branchHint(.cold); - const node_slices = p.nodes.slice(); - const tags = node_slices.items(.tag); - const tys = node_slices.items(.ty); - const data = node_slices.items(.data); - - for (p.decl_buf.items) |decl_node| { - const idx = @intFromEnum(decl_node); - switch (tags[idx]) { - .struct_forward_decl, .union_forward_decl, .enum_forward_decl => {}, + for (p.decl_buf.items) |decl_index| { + const node = decl_index.get(&p.tree); + const forward = switch (node) { + .struct_forward_decl, .union_forward_decl, .enum_forward_decl => |forward| forward, else => continue, - } + }; - const ty = tys[idx]; - const decl_type_name = if (ty.getRecord()) |rec| - rec.name - else if (ty.get(.@"enum")) |en| - en.data.@"enum".name - else - unreachable; + const decl_type_name = switch (forward.container_qt.base(p.comp).type) { + .@"struct", .@"union" => |record_ty| record_ty.name, + .@"enum" => |enum_ty| enum_ty.name, + else => unreachable, + }; const tentative_def_tok = p.tentative_defs.get(decl_type_name) orelse continue; - const type_str = try p.typeStr(ty); - try p.errStr(.tentative_definition_incomplete, tentative_def_tok, type_str); - try p.errStr(.forward_declaration_here, data[idx].decl_ref, type_str); + try p.err(tentative_def_tok, .tentative_definition_incomplete, .{forward.container_qt}); + try p.err(forward.name_or_kind_tok, .forward_declaration_here, .{forward.container_qt}); } } /// root : (decl | assembly ';' | staticAssert)* pub fn parse(pp: *Preprocessor) Compilation.Error!Tree { + const gpa = pp.comp.gpa; assert(pp.linemarkers == .none); pp.comp.pragmaEvent(.before_parse); - var arena = std.heap.ArenaAllocator.init(pp.comp.gpa); - errdefer arena.deinit(); - var p = Parser{ + const expected_implicit_typedef_max = 7; + try pp.tokens.ensureUnusedCapacity(gpa, expected_implicit_typedef_max); + + var p: Parser = .{ .pp = pp, .comp = pp.comp, - .gpa = pp.comp.gpa, - .arena = arena.allocator(), + .diagnostics = pp.diagnostics, + .tree = .{ + .comp = pp.comp, + .tokens = undefined, // Set after implicit typedefs + }, .tok_ids = pp.tokens.items(.id), - .strings = std.array_list.AlignedManaged(u8, .@"4").init(pp.comp.gpa), - .value_map = Tree.ValueMap.init(pp.comp.gpa), - .data = NodeList.init(pp.comp.gpa), - .labels = std.array_list.Managed(Label).init(pp.comp.gpa), - .list_buf = NodeList.init(pp.comp.gpa), - .decl_buf = NodeList.init(pp.comp.gpa), - .param_buf = std.array_list.Managed(Type.Func.Param).init(pp.comp.gpa), - .enum_buf = std.array_list.Managed(Type.Enum.Field).init(pp.comp.gpa), - .record_buf = std.array_list.Managed(Type.Record.Field).init(pp.comp.gpa), - .field_attr_buf = std.array_list.Managed([]const Attribute).init(pp.comp.gpa), .string_ids = .{ - .declspec_id = try StrInt.intern(pp.comp, "__declspec"), - .main_id = try StrInt.intern(pp.comp, "main"), - .file = try StrInt.intern(pp.comp, "FILE"), - .jmp_buf = try StrInt.intern(pp.comp, "jmp_buf"), - .sigjmp_buf = try StrInt.intern(pp.comp, "sigjmp_buf"), - .ucontext_t = try StrInt.intern(pp.comp, "ucontext_t"), + .declspec_id = try pp.comp.internString("__declspec"), + .main_id = try pp.comp.internString("main"), + .file = try pp.comp.internString("FILE"), + .jmp_buf = try pp.comp.internString("jmp_buf"), + .sigjmp_buf = try pp.comp.internString("sigjmp_buf"), + .ucontext_t = try pp.comp.internString("ucontext_t"), }, }; - errdefer { - p.nodes.deinit(pp.comp.gpa); - p.value_map.deinit(); - } + errdefer p.tree.deinit(); defer { - p.data.deinit(); - p.labels.deinit(); - p.strings.deinit(); - p.syms.deinit(pp.comp.gpa); - p.list_buf.deinit(); - p.decl_buf.deinit(); - p.param_buf.deinit(); - p.enum_buf.deinit(); - p.record_buf.deinit(); - p.record_members.deinit(pp.comp.gpa); - p.attr_buf.deinit(pp.comp.gpa); - p.attr_application_buf.deinit(pp.comp.gpa); - p.tentative_defs.deinit(pp.comp.gpa); - assert(p.field_attr_buf.items.len == 0); - p.field_attr_buf.deinit(); + p.labels.deinit(gpa); + p.strings.deinit(gpa); + p.syms.deinit(gpa); + p.list_buf.deinit(gpa); + p.decl_buf.deinit(gpa); + p.param_buf.deinit(gpa); + p.enum_buf.deinit(gpa); + p.record_buf.deinit(gpa); + p.record_members.deinit(gpa); + p.attr_buf.deinit(gpa); + p.attr_application_buf.deinit(gpa); + p.tentative_defs.deinit(gpa); } try p.syms.pushScope(&p); defer p.syms.popScope(); - // NodeIndex 0 must be invalid - _ = try p.addNode(.{ .tag = .invalid, .ty = undefined, .data = undefined, .loc = undefined }); - { if (p.comp.langopts.hasChar8_T()) { - try p.syms.defineTypedef(&p, try StrInt.intern(p.comp, "char8_t"), .{ .specifier = .uchar }, 0, .none); + try p.addImplicitTypedef("char8_t", .uchar); } - try p.syms.defineTypedef(&p, try StrInt.intern(p.comp, "__int128_t"), .{ .specifier = .int128 }, 0, .none); - try p.syms.defineTypedef(&p, try StrInt.intern(p.comp, "__uint128_t"), .{ .specifier = .uint128 }, 0, .none); + try p.addImplicitTypedef("__int128_t", .int128); + try p.addImplicitTypedef("__uint128_t", .uint128); - const elem_ty = try p.arena.create(Type); - elem_ty.* = .{ .specifier = .char }; - try p.syms.defineTypedef(&p, try StrInt.intern(p.comp, "__builtin_ms_va_list"), .{ - .specifier = .pointer, - .data = .{ .sub_type = elem_ty }, - }, 0, .none); + try p.addImplicitTypedef("__builtin_ms_va_list", .char_pointer); - const ty = &pp.comp.types.va_list; - try p.syms.defineTypedef(&p, try StrInt.intern(p.comp, "__builtin_va_list"), ty.*, 0, .none); + const va_list_qt = pp.comp.type_store.va_list; + try p.addImplicitTypedef("__builtin_va_list", va_list_qt); + pp.comp.type_store.va_list = try va_list_qt.decay(pp.comp); - if (ty.isArray()) ty.decayArray(); - - try p.syms.defineTypedef(&p, try StrInt.intern(p.comp, "__NSConstantString"), pp.comp.types.ns_constant_string.ty, 0, .none); + try p.addImplicitTypedef("__NSConstantString", pp.comp.type_store.ns_constant_string); if (p.comp.float80Type()) |float80_ty| { - try p.syms.defineTypedef(&p, try StrInt.intern(p.comp, "__float80"), float80_ty, 0, .none); + try p.addImplicitTypedef("__float80", float80_ty); } + + // Set here so that the newly generated tokens are included. + p.tree.tokens = p.pp.tokens.slice(); } + const implicit_typedef_count = p.decl_buf.items.len; + assert(implicit_typedef_count <= expected_implicit_typedef_max); while (p.eatToken(.eof) == null) { if (try p.pragma()) continue; @@ -786,7 +888,7 @@ pub fn parse(pp: *Preprocessor) Compilation.Error!Tree { .keyword_asm1, .keyword_asm2, => {}, - else => try p.err(.expected_external_decl), + else => try p.err(p.tok_i, .expected_external_decl, .{}), } continue; } @@ -797,39 +899,68 @@ pub fn parse(pp: *Preprocessor) Compilation.Error!Tree { }, else => |e| return e, }) |node| { - try p.decl_buf.append(node); + try p.decl_buf.append(gpa, node); continue; } if (p.eatToken(.semicolon)) |tok| { - try p.errTok(.extra_semi, tok); + try p.err(tok, .extra_semi, .{}); + const empty = try p.tree.addNode(.{ .empty_decl = .{ + .semicolon = tok, + } }); + try p.decl_buf.append(gpa, empty); continue; } - try p.err(.expected_external_decl); - p.tok_i += 1; + try p.err(p.tok_i, .expected_external_decl, .{}); + p.nextExternDecl(); } if (p.tentative_defs.count() > 0) { try p.diagnoseIncompleteDefinitions(); } - const root_decls = try p.decl_buf.toOwnedSlice(); - errdefer pp.comp.gpa.free(root_decls); - if (root_decls.len == 0) { - try p.errTok(.empty_translation_unit, p.tok_i - 1); + p.tree.root_decls = p.decl_buf; + p.decl_buf = .empty; + + if (p.tree.root_decls.items.len == implicit_typedef_count) { + try p.err(p.tok_i - 1, .empty_translation_unit, .{}); } pp.comp.pragmaEvent(.after_parse); - const data = try p.data.toOwnedSlice(); - errdefer pp.comp.gpa.free(data); - return Tree{ - .comp = pp.comp, - .tokens = pp.tokens.slice(), - .arena = arena, - .generated = pp.comp.generated_buf.items, - .nodes = p.nodes.toOwnedSlice(), - .data = data, - .root_decls = root_decls, - .value_map = p.value_map, - }; + p.clearNonTentativeDefinitions(); + + return p.tree; +} + +fn addImplicitTypedef(p: *Parser, name: []const u8, qt: QualType) !void { + const gpa = p.comp.gpa; + const start = p.comp.generated_buf.items.len; + try p.comp.generated_buf.ensureUnusedCapacity(gpa, name.len + 1); + p.comp.generated_buf.appendSliceAssumeCapacity(name); + p.comp.generated_buf.appendAssumeCapacity('\n'); + + const name_tok: u32 = @intCast(p.pp.tokens.len); + p.pp.tokens.appendAssumeCapacity(.{ .id = .identifier, .loc = .{ + .id = .generated, + .byte_offset = @intCast(start), + .line = p.pp.generated_line, + } }); + p.pp.generated_line += 1; + + const node = try p.addNode(.{ + .typedef = .{ + .name_tok = name_tok, + .qt = qt, + .implicit = true, + }, + }); + + const interned_name = try p.comp.internString(name); + const typedef_qt = (try p.comp.type_store.put(gpa, .{ .typedef = .{ + .base = qt, + .name = interned_name, + .decl_node = node, + } })).withQualifiers(qt); + try p.syms.defineTypedef(p, interned_name, typedef_qt, name_tok, node); + try p.decl_buf.append(gpa, node); } fn skipToPragmaSentinel(p: *Parser) void { @@ -857,9 +988,7 @@ fn nextExternDecl(p: *Parser) void { while (true) : (p.tok_i += 1) { switch (p.tok_ids[p.tok_i]) { .l_paren, .l_brace, .l_bracket => parens += 1, - .r_paren, .r_brace, .r_bracket => if (parens != 0) { - parens -= 1; - }, + .r_paren, .r_brace, .r_bracket => parens -|= 1, .keyword_typedef, .keyword_extern, .keyword_static, @@ -931,15 +1060,15 @@ fn skipTo(p: *Parser, id: Token.Id) void { } /// Called after a typedef is defined -fn typedefDefined(p: *Parser, name: StringId, ty: Type) void { +fn typedefDefined(p: *Parser, name: StringId, ty: QualType) void { if (name == p.string_ids.file) { - p.comp.types.file = ty; + p.comp.type_store.file = ty; } else if (name == p.string_ids.jmp_buf) { - p.comp.types.jmp_buf = ty; + p.comp.type_store.jmp_buf = ty; } else if (name == p.string_ids.sigjmp_buf) { - p.comp.types.sigjmp_buf = ty; + p.comp.type_store.sigjmp_buf = ty; } else if (name == p.string_ids.ucontext_t) { - p.comp.types.ucontext_t = ty; + p.comp.type_store.ucontext_t = ty; } } @@ -949,6 +1078,7 @@ fn typedefDefined(p: *Parser, name: StringId, ty: Type) void { /// : declSpec (initDeclarator ( ',' initDeclarator)*)? ';' /// | declSpec declarator decl* compoundStmt fn decl(p: *Parser) Error!bool { + const gpa = p.comp.gpa; _ = try p.pragma(); const first_tok = p.tok_i; const attr_buf_top = p.attr_buf.len; @@ -956,97 +1086,120 @@ fn decl(p: *Parser) Error!bool { try p.attributeSpecifier(); - var decl_spec = if (try p.declSpec()) |some| some else blk: { - if (p.func.ty != null) { + var decl_spec = (try p.declSpec()) orelse blk: { + if (p.func.qt != null) { p.tok_i = first_tok; return false; } switch (p.tok_ids[first_tok]) { - .asterisk, .l_paren, .identifier, .extended_identifier => {}, + .asterisk, .l_paren => {}, + .identifier, .extended_identifier => switch (p.tok_ids[first_tok + 1]) { + .identifier, .extended_identifier => { + // The most likely reason for `identifier identifier` is + // an unknown type name. + try p.err(p.tok_i, .unknown_type_name, .{p.tokSlice(p.tok_i)}); + p.tok_i += 1; + break :blk DeclSpec{ .qt = .invalid }; + }, + else => {}, + }, else => if (p.tok_i != first_tok) { - try p.err(.expected_ident_or_l_paren); + try p.err(p.tok_i, .expected_ident_or_l_paren, .{}); return error.ParsingFailed; } else return false, } - var spec: Type.Builder = .{}; - break :blk DeclSpec{ .ty = try spec.finish(p) }; + var builder: TypeStore.Builder = .{ .parser = p }; + break :blk DeclSpec{ .qt = try builder.finish() }; }; if (decl_spec.noreturn) |tok| { const attr = Attribute{ .tag = .noreturn, .args = .{ .noreturn = .{} }, .syntax = .keyword }; - try p.attr_buf.append(p.gpa, .{ .attr = attr, .tok = tok }); + try p.attr_buf.append(gpa, .{ .attr = attr, .tok = tok }); } - var init_d = (try p.initDeclarator(&decl_spec, attr_buf_top)) orelse { + + var decl_node = try p.tree.addNode(.{ .empty_decl = .{ + .semicolon = first_tok, + } }); + var init_d = (try p.initDeclarator(&decl_spec, attr_buf_top, decl_node)) orelse { _ = try p.expectToken(.semicolon); - if (decl_spec.ty.is(.@"enum") or - (decl_spec.ty.isRecord() and !decl_spec.ty.isAnonymousRecord(p.comp) and - !decl_spec.ty.isTypeof())) // we follow GCC and clang's behavior here - { - const specifier = decl_spec.ty.canonicalize(.standard).specifier; - const attrs = p.attr_buf.items(.attr)[attr_buf_top..]; - const toks = p.attr_buf.items(.tok)[attr_buf_top..]; - for (attrs, toks) |attr, tok| { - try p.errExtra(.ignored_record_attr, tok, .{ - .ignored_record_attr = .{ .tag = attr.tag, .specifier = switch (specifier) { - .@"enum" => .@"enum", - .@"struct" => .@"struct", - .@"union" => .@"union", - else => unreachable, - } }, - }); + + missing_decl: { + if (decl_spec.qt.type(p.comp) == .typeof) { + // we follow GCC and clang's behavior here + try p.err(first_tok, .missing_declaration, .{}); + return true; } + switch (decl_spec.qt.base(p.comp).type) { + .@"enum" => break :missing_decl, + .@"struct", .@"union" => |record_ty| if (!record_ty.isAnonymous(p.comp)) break :missing_decl, + else => {}, + } + + try p.err(first_tok, .missing_declaration, .{}); return true; } - try p.errTok(.missing_declaration, first_tok); + const attrs = p.attr_buf.items(.attr)[attr_buf_top..]; + const toks = p.attr_buf.items(.tok)[attr_buf_top..]; + for (attrs, toks) |attr, tok| { + try p.err(tok, .ignored_record_attr, .{ + @tagName(attr.tag), @tagName(decl_spec.qt.base(p.comp).type), + }); + } return true; }; // Check for function definition. - if (init_d.d.func_declarator != null and init_d.initializer.node == .none and init_d.d.ty.isFunc()) fn_def: { - if (decl_spec.auto_type) |tok_i| { - try p.errStr(.auto_type_not_allowed, tok_i, "function return type"); - return error.ParsingFailed; - } - + if (init_d.d.declarator_type == .func and init_d.initializer == null) fn_def: { switch (p.tok_ids[p.tok_i]) { .comma, .semicolon => break :fn_def, .l_brace => {}, else => if (init_d.d.old_style_func == null) { - try p.err(.expected_fn_body); + try p.err(p.tok_i - 1, .expected_fn_body, .{}); return true; }, } - if (p.func.ty != null) try p.err(.func_not_in_root); - - const node = try p.addNode(undefined); // reserve space - const interned_declarator_name = try StrInt.intern(p.comp, p.tokSlice(init_d.d.name)); - try p.syms.defineSymbol(p, interned_declarator_name, init_d.d.ty, init_d.d.name, node, .{}, false); + if (p.func.qt != null) try p.err(p.tok_i, .func_not_in_root, .{}); + const interned_declarator_name = try p.comp.internString(p.tokSlice(init_d.d.name)); + try p.syms.defineSymbol(p, interned_declarator_name, init_d.d.qt, init_d.d.name, decl_node, .{}, false); const func = p.func; p.func = .{ - .ty = init_d.d.ty, + .qt = init_d.d.qt, .name = init_d.d.name, }; - if (interned_declarator_name == p.string_ids.main_id and !init_d.d.ty.returnType().is(.int)) { - try p.errTok(.main_return_type, init_d.d.name); - } defer p.func = func; + // Check return type of 'main' function. + if (interned_declarator_name == p.string_ids.main_id) { + const func_ty = init_d.d.qt.get(p.comp, .func).?; + const int_ty = func_ty.return_type.get(p.comp, .int); + if (int_ty == null or int_ty.? != .int) { + try p.err(init_d.d.name, .main_return_type, .{}); + } + } + try p.syms.pushScope(p); defer p.syms.popScope(); // Collect old style parameter declarations. if (init_d.d.old_style_func != null) { - var base_ty = init_d.d.ty.base(); - base_ty.specifier = .func; - const param_buf_top = p.param_buf.items.len; defer p.param_buf.items.len = param_buf_top; + // We cannot refer to the function type here because the pointer to + // type_store.extra might get invalidated while parsing the param decls. + const func_qt = init_d.d.qt.base(p.comp).qt; + const params_len = func_qt.get(p.comp, .func).?.params.len; + + const new_params = try p.param_buf.addManyAsSlice(gpa, params_len); + for (new_params) |*new_param| { + new_param.name = .empty; + } + param_loop: while (true) { const param_decl_spec = (try p.declSpec()) orelse break; if (p.eatToken(.semicolon)) |semi| { - try p.errTok(.missing_declaration, semi); + try p.err(semi, .missing_declaration, .{}); continue :param_loop; } @@ -1054,97 +1207,140 @@ fn decl(p: *Parser) Error!bool { const attr_buf_top_declarator = p.attr_buf.len; defer p.attr_buf.len = attr_buf_top_declarator; - var d = (try p.declarator(param_decl_spec.ty, .param)) orelse { - try p.errTok(.missing_declaration, first_tok); + var param_d = (try p.declarator(param_decl_spec.qt, .param)) orelse { + try p.err(first_tok, .missing_declaration, .{}); _ = try p.expectToken(.semicolon); continue :param_loop; }; try p.attributeSpecifier(); - if (d.ty.hasIncompleteSize() and !d.ty.is(.void)) try p.errStr(.parameter_incomplete_ty, d.name, try p.typeStr(d.ty)); - if (d.ty.isFunc()) { - // Params declared as functions are converted to function pointers. - const elem_ty = try p.arena.create(Type); - elem_ty.* = d.ty; - d.ty = Type{ - .specifier = .pointer, - .data = .{ .sub_type = elem_ty }, - }; - } else if (d.ty.isArray()) { - // params declared as arrays are converted to pointers - d.ty.decayArray(); - } else if (d.ty.is(.void)) { - try p.errTok(.invalid_void_param, d.name); + if (param_d.qt.hasIncompleteSize(p.comp)) { + if (param_d.qt.is(p.comp, .void)) { + try p.err(param_d.name, .invalid_void_param, .{}); + } else { + try p.err(param_d.name, .parameter_incomplete_ty, .{param_d.qt}); + } + } else { + // Decay params declared as functions or arrays to pointer. + param_d.qt = try param_d.qt.decay(p.comp); } + const attributed_qt = try Attribute.applyParameterAttributes(p, param_d.qt, attr_buf_top_declarator, .alignas_on_param); + + try param_decl_spec.validateParam(p); + const param_node = try p.addNode(.{ + .param = .{ + .name_tok = param_d.name, + .qt = attributed_qt, + .storage_class = switch (param_decl_spec.storage_class) { + .none => .auto, + .register => .register, + else => .auto, // Error reported in `validateParam` + }, + }, + }); + + const name_str = p.tokSlice(param_d.name); + const interned_name = try p.comp.internString(name_str); + try p.syms.defineParam(p, interned_name, attributed_qt, param_d.name, param_node); + // find and correct parameter types - // TODO check for missing declarations and redefinitions - const name_str = p.tokSlice(d.name); - const interned_name = try StrInt.intern(p.comp, name_str); - for (init_d.d.ty.params()) |*param| { + for (func_qt.get(p.comp, .func).?.params, new_params) |param, *new_param| { if (param.name == interned_name) { - param.ty = d.ty; + new_param.* = .{ + .qt = attributed_qt, + .name = param.name, + .node = .pack(param_node), + .name_tok = param.name_tok, + }; break; } } else { - try p.errStr(.parameter_missing, d.name, name_str); + try p.err(param_d.name, .parameter_missing, .{name_str}); } - d.ty = try Attribute.applyParameterAttributes(p, d.ty, attr_buf_top_declarator, .alignas_on_param); - - // bypass redefinition check to avoid duplicate errors - try p.syms.define(p.gpa, .{ - .kind = .def, - .name = interned_name, - .tok = d.name, - .ty = d.ty, - .val = .{}, - }); + if (p.eatToken(.comma) == null) break; } _ = try p.expectToken(.semicolon); } - } else { - for (init_d.d.ty.params()) |param| { - if (param.ty.hasUnboundVLA()) try p.errTok(.unbound_vla, param.name_tok); - if (param.ty.hasIncompleteSize() and !param.ty.is(.void) and param.ty.specifier != .invalid) try p.errStr(.parameter_incomplete_ty, param.name_tok, try p.typeStr(param.ty)); + const func_ty = func_qt.get(p.comp, .func).?; + for (func_ty.params, new_params) |param, *new_param| { + if (new_param.name == .empty) { + try p.err(param.name_tok, .param_not_declared, .{param.name.lookup(p.comp)}); + new_param.* = .{ + .name = param.name, + .name_tok = param.name_tok, + .node = param.node, + .qt = .int, + }; + } + } + // Update the functio type to contain the declared parameters. + p.func.qt = try p.comp.type_store.put(gpa, .{ .func = .{ + .kind = .normal, + .params = new_params, + .return_type = func_ty.return_type, + } }); + } else if (init_d.d.qt.get(p.comp, .func)) |func_ty| { + for (func_ty.params) |param| { if (param.name == .empty) { - try p.errTok(.omitting_parameter_name, param.name_tok); + try p.err(param.name_tok, .omitting_parameter_name, .{}); continue; } // bypass redefinition check to avoid duplicate errors - try p.syms.define(p.gpa, .{ + try p.syms.define(gpa, .{ .kind = .def, .name = param.name, .tok = param.name_tok, - .ty = param.ty, + .qt = param.qt, .val = .{}, + .node = param.node, }); + if (param.qt.isInvalid()) continue; + + if (param.qt.get(p.comp, .pointer)) |pointer_ty| { + if (pointer_ty.decayed) |decayed_qt| { + if (decayed_qt.get(p.comp, .array)) |array_ty| { + if (array_ty.len == .unspecified_variable) { + try p.err(param.name_tok, .unbound_vla, .{}); + } + } + } + } + if (param.qt.hasIncompleteSize(p.comp) and !param.qt.is(p.comp, .void)) { + try p.err(param.name_tok, .parameter_incomplete_ty, .{param.qt}); + } } } const body = (try p.compoundStmt(true, null)) orelse { assert(init_d.d.old_style_func != null); - try p.err(.expected_fn_body); + try p.err(p.tok_i, .expected_fn_body, .{}); return true; }; - p.nodes.set(@intFromEnum(node), .{ - .ty = init_d.d.ty, - .tag = try decl_spec.validateFnDef(p), - .data = .{ .decl = .{ .name = init_d.d.name, .node = body } }, - .loc = @enumFromInt(init_d.d.name), - }); - try p.decl_buf.append(node); + + try decl_spec.validateFnDef(p); + try p.tree.setNode(.{ .function = .{ + .name_tok = init_d.d.name, + .@"inline" = decl_spec.@"inline" != null, + .static = decl_spec.storage_class == .static, + .qt = p.func.qt.?, + .body = body, + .definition = null, + } }, @intFromEnum(decl_node)); + + try p.decl_buf.append(gpa, decl_node); // check gotos - if (func.ty == null) { + if (func.qt == null) { for (p.labels.items) |item| { if (item == .unresolved_goto) - try p.errStr(.undeclared_label, item.unresolved_goto, p.tokSlice(item.unresolved_goto)); + try p.err(item.unresolved_goto, .undeclared_label, .{p.tokSlice(item.unresolved_goto)}); } if (p.computed_goto_tok) |goto_tok| { - if (!p.contains_address_of_label) try p.errTok(.invalid_computed_goto, goto_tok); + if (!p.contains_address_of_label) try p.err(goto_tok, .invalid_computed_goto, .{}); } p.labels.items.len = 0; p.label_count = 0; @@ -1157,59 +1353,110 @@ fn decl(p: *Parser) Error!bool { // Declare all variable/typedef declarators. var warned_auto = false; while (true) { - if (init_d.d.old_style_func) |tok_i| try p.errTok(.invalid_old_style_params, tok_i); - const tag = try decl_spec.validate(p, &init_d.d.ty, init_d.initializer.node != .none); + if (init_d.d.old_style_func) |tok_i| try p.err(tok_i, .invalid_old_style_params, .{}); - const tok = switch (decl_spec.storage_class) { - .auto, .@"extern", .register, .static, .typedef => |tok| tok, - .none => init_d.d.name, - }; - const node = try p.addNode(.{ - .ty = init_d.d.ty, - .tag = tag, - .data = .{ - .decl = .{ .name = init_d.d.name, .node = init_d.initializer.node }, - }, - .loc = @enumFromInt(tok), - }); - try p.decl_buf.append(node); + if (decl_spec.storage_class == .typedef) { + try decl_spec.validateDecl(p); + try p.tree.setNode(.{ .typedef = .{ + .name_tok = init_d.d.name, + .qt = init_d.d.qt, + .implicit = false, + } }, @intFromEnum(decl_node)); + } else if (init_d.d.declarator_type == .func or init_d.d.qt.is(p.comp, .func)) { + try decl_spec.validateFnDecl(p); + try p.tree.setNode(.{ .function = .{ + .name_tok = init_d.d.name, + .qt = init_d.d.qt, + .static = decl_spec.storage_class == .static, + .@"inline" = decl_spec.@"inline" != null, + .body = null, + .definition = null, + } }, @intFromEnum(decl_node)); + } else { + try decl_spec.validateDecl(p); + var node_qt = init_d.d.qt; + if (p.func.qt == null and decl_spec.storage_class != .@"extern") { + if (node_qt.get(p.comp, .array)) |array_ty| { + if (array_ty.len == .incomplete) { + // Create tentative array node with fixed type. + node_qt = try p.comp.type_store.put(gpa, .{ .array = .{ + .elem = array_ty.elem, + .len = .{ .fixed = 1 }, + } }); + } + } + } - const interned_name = try StrInt.intern(p.comp, p.tokSlice(init_d.d.name)); + try p.tree.setNode(.{ + .variable = .{ + .name_tok = init_d.d.name, + .qt = node_qt, + .thread_local = decl_spec.thread_local != null, + .implicit = false, + .storage_class = switch (decl_spec.storage_class) { + .auto => .auto, + .register => .register, + .static => .static, + .@"extern" => if (init_d.initializer == null) .@"extern" else .auto, + else => .auto, // Error reported in `validate` + }, + .initializer = if (init_d.initializer) |some| some.node else null, + .definition = null, + }, + }, @intFromEnum(decl_node)); + } + try p.decl_buf.append(gpa, decl_node); + + const interned_name = try p.comp.internString(p.tokSlice(init_d.d.name)); if (decl_spec.storage_class == .typedef) { - try p.syms.defineTypedef(p, interned_name, init_d.d.ty, init_d.d.name, node); - p.typedefDefined(interned_name, init_d.d.ty); - } else if (init_d.initializer.node != .none or - (p.func.ty != null and decl_spec.storage_class != .@"extern")) - { + const typedef_qt = if (init_d.d.qt.isInvalid()) + init_d.d.qt + else + (try p.comp.type_store.put(gpa, .{ .typedef = .{ + .base = init_d.d.qt, + .name = interned_name, + .decl_node = decl_node, + } })).withQualifiers(init_d.d.qt); + try p.syms.defineTypedef(p, interned_name, typedef_qt, init_d.d.name, decl_node); + p.typedefDefined(interned_name, typedef_qt); + } else if (init_d.initializer) |init| { // TODO validate global variable/constexpr initializer comptime known try p.syms.defineSymbol( p, interned_name, - init_d.d.ty, + init_d.d.qt, init_d.d.name, - node, - if (init_d.d.ty.isConst() or decl_spec.constexpr != null) init_d.initializer.val else .{}, + decl_node, + if (init_d.d.qt.@"const" or decl_spec.constexpr != null) init.val else .{}, decl_spec.constexpr != null, ); + } else if (init_d.d.qt.is(p.comp, .func)) { + try p.syms.declareSymbol(p, interned_name, init_d.d.qt, init_d.d.name, decl_node); + } else if (p.func.qt != null and decl_spec.storage_class != .@"extern") { + try p.syms.defineSymbol(p, interned_name, init_d.d.qt, init_d.d.name, decl_node, .{}, false); } else { - try p.syms.declareSymbol(p, interned_name, init_d.d.ty, init_d.d.name, node); + try p.syms.declareSymbol(p, interned_name, init_d.d.qt, init_d.d.name, decl_node); } if (p.eatToken(.comma) == null) break; if (!warned_auto) { + // TODO these are warnings in clang if (decl_spec.auto_type) |tok_i| { - try p.errTok(.auto_type_requires_single_declarator, tok_i); + try p.err(tok_i, .auto_type_requires_single_declarator, .{}); warned_auto = true; } - if (p.comp.langopts.standard.atLeast(.c23) and decl_spec.storage_class == .auto) { - try p.errTok(.c23_auto_single_declarator, decl_spec.storage_class.auto); + if (decl_spec.c23_auto) |tok_i| { + try p.err(tok_i, .c23_auto_single_declarator, .{}); warned_auto = true; } } - init_d = (try p.initDeclarator(&decl_spec, attr_buf_top)) orelse { - try p.err(.expected_ident_or_l_paren); + decl_node = try p.tree.addNode(.{ .empty_decl = .{ + .semicolon = p.tok_i - 1, + } }); + init_d = (try p.initDeclarator(&decl_spec, attr_buf_top, decl_node)) orelse { + try p.err(p.tok_i, .expected_ident_or_l_paren, .{}); continue; }; } @@ -1218,44 +1465,39 @@ fn decl(p: *Parser) Error!bool { return true; } -fn staticAssertMessage(p: *Parser, cond_node: NodeIndex, message: Result) !?[]const u8 { - const cond_tag = p.nodes.items(.tag)[@intFromEnum(cond_node)]; - if (cond_tag != .builtin_types_compatible_p and message.node == .none) return null; - - var buf = std.array_list.Managed(u8).init(p.gpa); - defer buf.deinit(); +fn staticAssertMessage(p: *Parser, cond_node: Node.Index, maybe_message: ?Result, allocating: *std.Io.Writer.Allocating) !?[]const u8 { + const w = &allocating.writer; - if (cond_tag == .builtin_types_compatible_p) { - const mapper = p.comp.string_interner.getSlowTypeMapper(); - const data = p.nodes.items(.data)[@intFromEnum(cond_node)].bin; + const cond = cond_node.get(&p.tree); + if (cond == .builtin_types_compatible_p) { + try w.writeAll("'__builtin_types_compatible_p("); - try buf.appendSlice("'__builtin_types_compatible_p("); + const lhs_ty = cond.builtin_types_compatible_p.lhs; + try lhs_ty.print(p.comp, w); + try w.writeAll(", "); - const lhs_ty = p.nodes.items(.ty)[@intFromEnum(data.lhs)]; - try lhs_ty.print(mapper, p.comp.langopts, buf.writer()); - try buf.appendSlice(", "); + const rhs_ty = cond.builtin_types_compatible_p.rhs; + try rhs_ty.print(p.comp, w); - const rhs_ty = p.nodes.items(.ty)[@intFromEnum(data.rhs)]; - try rhs_ty.print(mapper, p.comp.langopts, buf.writer()); + try w.writeAll(")'"); + } else if (maybe_message == null) return null; - try buf.appendSlice(")'"); - } - if (message.node != .none) { - assert(p.nodes.items(.tag)[@intFromEnum(message.node)] == .string_literal_expr); - if (buf.items.len > 0) { - try buf.append(' '); + if (maybe_message) |message| { + assert(message.node.get(&p.tree) == .string_literal_expr); + if (allocating.written().len > 0) { + try w.writeByte(' '); } const bytes = p.comp.interner.get(message.val.ref()).bytes; - try buf.ensureUnusedCapacity(bytes.len); - try Value.printString(bytes, message.ty, p.comp, buf.writer()); + try Value.printString(bytes, message.qt, p.comp, w); } - return try p.comp.diagnostics.arena.allocator().dupe(u8, buf.items); + return allocating.written(); } /// staticAssert /// : keyword_static_assert '(' integerConstExpr (',' STRING_LITERAL)? ')' ';' /// | keyword_c23_static_assert '(' integerConstExpr (',' STRING_LITERAL)? ')' ';' fn staticAssert(p: *Parser) Error!bool { + const gpa = p.comp.gpa; const static_assert = p.eatToken(.keyword_static_assert) orelse p.eatToken(.keyword_c23_static_assert) orelse return false; const l_paren = try p.expectToken(.l_paren); const res_token = p.tok_i; @@ -1271,52 +1513,50 @@ fn staticAssert(p: *Parser) Error!bool { .unterminated_string_literal, => try p.stringLiteral(), else => { - try p.err(.expected_str_literal); + try p.err(p.tok_i, .expected_str_literal, .{}); return error.ParsingFailed; }, } else - Result{}; + null; try p.expectClosing(l_paren, .r_paren); _ = try p.expectToken(.semicolon); - if (str.node == .none) { - try p.errTok(.static_assert_missing_message, static_assert); - try p.errStr(.pre_c23_compat, static_assert, "'_Static_assert' with no message"); + if (str == null) { + try p.err(static_assert, .static_assert_missing_message, .{}); + try p.err(static_assert, .pre_c23_compat, .{"'_Static_assert' with no message"}); } - // Array will never be zero; a value of zero for a pointer is a null pointer constant - if ((res.ty.isArray() or res.ty.isPtr()) and !res.val.isZero(p.comp)) { - const err_start = p.comp.diagnostics.list.items.len; - try p.errTok(.const_decl_folded, res_token); - if (res.ty.isPtr() and err_start != p.comp.diagnostics.list.items.len) { - // Don't show the note if the .const_decl_folded diagnostic was not added - try p.errTok(.constant_expression_conversion_not_allowed, res_token); - } + const is_int_expr = res.qt.isInvalid() or res.qt.isInt(p.comp); + try res.castToBool(p, .bool, res_token); + if (!is_int_expr) { + res.val = .{}; } - try res.boolCast(p, .{ .specifier = .bool }, res_token); if (res.val.opt_ref == .none) { - if (res.ty.specifier != .invalid) { - try p.errTok(.static_assert_not_constant, res_token); + if (!res.qt.isInvalid()) { + try p.err(res_token, .static_assert_not_constant, .{}); } } else { if (!res.val.toBool(p.comp)) { - if (try p.staticAssertMessage(res_node, str)) |message| { - try p.errStr(.static_assert_failure_message, static_assert, message); + var sf = std.heap.stackFallback(1024, gpa); + var allocating: std.Io.Writer.Allocating = .init(sf.get()); + defer allocating.deinit(); + + if (p.staticAssertMessage(res_node, str, &allocating) catch return error.OutOfMemory) |message| { + try p.err(static_assert, .static_assert_failure_message, .{message}); } else { - try p.errTok(.static_assert_failure, static_assert); + try p.err(static_assert, .static_assert_failure, .{}); } } } const node = try p.addNode(.{ - .tag = .static_assert, - .data = .{ .bin = .{ - .lhs = res.node, - .rhs = str.node, - } }, - .loc = @enumFromInt(static_assert), + .static_assert = .{ + .assert_tok = static_assert, + .cond = res.node, + .message = if (str) |some| some.node else null, + }, }); - try p.decl_buf.append(node); + try p.decl_buf.append(gpa, node); return true; } @@ -1334,95 +1574,63 @@ pub const DeclSpec = struct { @"inline": ?TokenIndex = null, noreturn: ?TokenIndex = null, auto_type: ?TokenIndex = null, - ty: Type, + c23_auto: ?TokenIndex = null, + qt: QualType, - fn validateParam(d: DeclSpec, p: *Parser, ty: *Type) Error!void { + fn validateParam(d: DeclSpec, p: *Parser) Error!void { switch (d.storage_class) { - .none => {}, - .register => ty.qual.register = true, - .auto, .@"extern", .static, .typedef => |tok_i| try p.errTok(.invalid_storage_on_param, tok_i), - } - if (d.thread_local) |tok_i| try p.errTok(.threadlocal_non_var, tok_i); - if (d.@"inline") |tok_i| try p.errStr(.func_spec_non_func, tok_i, "inline"); - if (d.noreturn) |tok_i| try p.errStr(.func_spec_non_func, tok_i, "_Noreturn"); - if (d.constexpr) |tok_i| try p.errTok(.invalid_storage_on_param, tok_i); - if (d.auto_type) |tok_i| { - try p.errStr(.auto_type_not_allowed, tok_i, "function prototype"); - ty.* = Type.invalid; + .none, .register => {}, + .auto, .@"extern", .static, .typedef => |tok_i| try p.err(tok_i, .invalid_storage_on_param, .{}), } + if (d.thread_local) |tok_i| try p.err(tok_i, .threadlocal_non_var, .{}); + if (d.@"inline") |tok_i| try p.err(tok_i, .func_spec_non_func, .{"inline"}); + if (d.noreturn) |tok_i| try p.err(tok_i, .func_spec_non_func, .{"_Noreturn"}); + if (d.constexpr) |tok_i| try p.err(tok_i, .invalid_storage_on_param, .{}); } - fn validateFnDef(d: DeclSpec, p: *Parser) Error!Tree.Tag { + fn validateFnDef(d: DeclSpec, p: *Parser) Error!void { switch (d.storage_class) { .none, .@"extern", .static => {}, - .auto, .register, .typedef => |tok_i| try p.errTok(.illegal_storage_on_func, tok_i), + .auto, .register, .typedef => |tok_i| try p.err(tok_i, .illegal_storage_on_func, .{}), } - if (d.thread_local) |tok_i| try p.errTok(.threadlocal_non_var, tok_i); - if (d.constexpr) |tok_i| try p.errTok(.illegal_storage_on_func, tok_i); + if (d.thread_local) |tok_i| try p.err(tok_i, .threadlocal_non_var, .{}); + if (d.constexpr) |tok_i| try p.err(tok_i, .illegal_storage_on_func, .{}); + } - const is_static = d.storage_class == .static; - const is_inline = d.@"inline" != null; - if (is_static) { - if (is_inline) return .inline_static_fn_def; - return .static_fn_def; - } else { - if (is_inline) return .inline_fn_def; - return .fn_def; + fn validateFnDecl(d: DeclSpec, p: *Parser) Error!void { + switch (d.storage_class) { + .none, .@"extern" => {}, + .static => |tok_i| if (p.func.qt != null) try p.err(tok_i, .static_func_not_global, .{}), + .typedef => unreachable, + .auto, .register => |tok_i| try p.err(tok_i, .illegal_storage_on_func, .{}), } + if (d.thread_local) |tok_i| try p.err(tok_i, .threadlocal_non_var, .{}); + if (d.constexpr) |tok_i| try p.err(tok_i, .illegal_storage_on_func, .{}); } - fn validate(d: DeclSpec, p: *Parser, ty: *Type, has_init: bool) Error!Tree.Tag { - const is_static = d.storage_class == .static; - if (ty.isFunc() and d.storage_class != .typedef) { - switch (d.storage_class) { - .none, .@"extern" => {}, - .static => |tok_i| if (p.func.ty != null) try p.errTok(.static_func_not_global, tok_i), - .typedef => unreachable, - .auto, .register => |tok_i| try p.errTok(.illegal_storage_on_func, tok_i), - } - if (d.thread_local) |tok_i| try p.errTok(.threadlocal_non_var, tok_i); - if (d.constexpr) |tok_i| try p.errTok(.illegal_storage_on_func, tok_i); + fn validateDecl(d: DeclSpec, p: *Parser) Error!void { + if (d.@"inline") |tok_i| try p.err(tok_i, .func_spec_non_func, .{"inline"}); + // TODO move to attribute validation + if (d.noreturn) |tok_i| try p.err(tok_i, .func_spec_non_func, .{"_Noreturn"}); + switch (d.storage_class) { + .auto => std.debug.assert(!p.comp.langopts.standard.atLeast(.c23)), + .register => if (p.func.qt == null) try p.err(p.tok_i, .illegal_storage_on_global, .{}), + else => {}, + } + } - const is_inline = d.@"inline" != null; - if (is_static) { - if (is_inline) return .inline_static_fn_proto; - return .static_fn_proto; - } else { - if (is_inline) return .inline_fn_proto; - return .fn_proto; - } - } else { - if (d.@"inline") |tok_i| try p.errStr(.func_spec_non_func, tok_i, "inline"); - // TODO move to attribute validation - if (d.noreturn) |tok_i| try p.errStr(.func_spec_non_func, tok_i, "_Noreturn"); - switch (d.storage_class) { - .auto => if (p.func.ty == null and !p.comp.langopts.standard.atLeast(.c23)) { - try p.err(.illegal_storage_on_global); - }, - .register => if (p.func.ty == null) try p.err(.illegal_storage_on_global), - .typedef => return .typedef, - else => {}, - } - ty.qual.register = d.storage_class == .register; - - const is_extern = d.storage_class == .@"extern" and !has_init; - if (d.thread_local != null) { - if (is_static) return .threadlocal_static_var; - if (is_extern) return .threadlocal_extern_var; - return .threadlocal_var; - } else { - if (is_static) return .static_var; - if (is_extern) return .extern_var; - return .@"var"; - } - } + fn initContext(d: DeclSpec, p: *Parser) InitContext { + if (d.constexpr != null) return .constexpr; + if (p.func.qt == null or d.storage_class == .static) return .static; + return .runtime; } }; /// typeof /// : keyword_typeof '(' typeName ')' /// | keyword_typeof '(' expr ')' -fn typeof(p: *Parser) Error!?Type { +fn typeof(p: *Parser) Error!?QualType { + const gpa = p.comp.gpa; var unqual = false; switch (p.tok_ids[p.tok_i]) { .keyword_typeof, .keyword_typeof1, .keyword_typeof2 => p.tok_i += 1, @@ -1433,92 +1641,85 @@ fn typeof(p: *Parser) Error!?Type { else => return null, } const l_paren = try p.expectToken(.l_paren); - if (try p.typeName()) |ty| { + if (try p.typeName()) |qt| { try p.expectClosing(l_paren, .r_paren); - if (ty.is(.invalid)) return null; + if (qt.isInvalid()) return null; - const typeof_ty = try p.arena.create(Type); - typeof_ty.* = .{ - .data = ty.data, - .qual = if (unqual) .{} else ty.qual.inheritFromTypeof(), - .specifier = ty.specifier, - }; - - return Type{ - .data = .{ .sub_type = typeof_ty }, - .specifier = .typeof_type, - }; + return (try p.comp.type_store.put(gpa, .{ .typeof = .{ + .base = qt, + .expr = null, + } })).withQualifiers(qt); } const typeof_expr = try p.parseNoEval(expr); - try typeof_expr.expect(p); try p.expectClosing(l_paren, .r_paren); - // Special case nullptr_t since it's defined as typeof(nullptr) - if (typeof_expr.ty.is(.nullptr_t)) { - return Type{ - .specifier = .nullptr_t, - .qual = if (unqual) .{} else typeof_expr.ty.qual.inheritFromTypeof(), - }; - } else if (typeof_expr.ty.is(.invalid)) { - return null; - } - - const inner = try p.arena.create(Type.Expr); - inner.* = .{ - .node = typeof_expr.node, - .ty = .{ - .data = typeof_expr.ty.data, - .qual = if (unqual) .{} else typeof_expr.ty.qual.inheritFromTypeof(), - .specifier = typeof_expr.ty.specifier, - .decayed = typeof_expr.ty.decayed, - }, - }; + if (typeof_expr.qt.isInvalid()) return null; - return Type{ - .data = .{ .expr = inner }, - .specifier = .typeof_expr, - .decayed = typeof_expr.ty.decayed, - }; + const typeof_qt = try p.comp.type_store.put(gpa, .{ .typeof = .{ + .base = typeof_expr.qt, + .expr = typeof_expr.node, + } }); + if (unqual) return typeof_qt; + return typeof_qt.withQualifiers(typeof_expr.qt); } -/// declSpec: (storageClassSpec | typeSpec | typeQual | funcSpec | alignSpec)+ +/// declSpec: (storageClassSpec | typeSpec | funcSpec | autoTypeSpec)+ /// funcSpec : keyword_inline | keyword_noreturn +/// autoTypeSpec : keyword_auto_type fn declSpec(p: *Parser) Error!?DeclSpec { - var d: DeclSpec = .{ .ty = .{ .specifier = undefined } }; - var spec: Type.Builder = .{}; + var d: DeclSpec = .{ .qt = .invalid }; + var builder: TypeStore.Builder = .{ .parser = p }; - var combined_auto = !p.comp.langopts.standard.atLeast(.c23); const start = p.tok_i; while (true) { - if (!combined_auto and d.storage_class == .auto) { - try spec.combine(p, .c23_auto, d.storage_class.auto); - combined_auto = true; - } - if (try p.storageClassSpec(&d)) continue; - if (try p.typeSpec(&spec)) continue; const id = p.tok_ids[p.tok_i]; switch (id) { .keyword_inline, .keyword_inline1, .keyword_inline2 => { if (d.@"inline" != null) { - try p.errStr(.duplicate_decl_spec, p.tok_i, "inline"); + try p.err(p.tok_i, .duplicate_decl_spec, .{"inline"}); } d.@"inline" = p.tok_i; + p.tok_i += 1; + continue; }, .keyword_noreturn => { if (d.noreturn != null) { - try p.errStr(.duplicate_decl_spec, p.tok_i, "_Noreturn"); + try p.err(p.tok_i, .duplicate_decl_spec, .{"_Noreturn"}); } d.noreturn = p.tok_i; + p.tok_i += 1; + continue; }, - else => break, + .keyword_auto_type => { + try p.err(p.tok_i, .auto_type_extension, .{}); + try builder.combine(.auto_type, p.tok_i); + if (builder.type == .auto_type) d.auto_type = p.tok_i; + p.tok_i += 1; + continue; + }, + .keyword_auto => if (p.comp.langopts.standard.atLeast(.c23)) { + try builder.combine(.c23_auto, p.tok_i); + if (builder.type == .c23_auto) d.c23_auto = p.tok_i; + p.tok_i += 1; + continue; + }, + .keyword_forceinline, .keyword_forceinline2 => { + try p.attr_buf.append(p.comp.gpa, .{ + .attr = .{ .tag = .always_inline, .args = .{ .always_inline = .{} }, .syntax = .keyword }, + .tok = p.tok_i, + }); + p.tok_i += 1; + continue; + }, + else => {}, } - p.tok_i += 1; - } - if (p.tok_i == start) return null; + if (try p.storageClassSpec(&d)) continue; + if (try p.typeSpec(&builder)) continue; + if (p.tok_i == start) return null; - d.ty = try spec.finish(p); - d.auto_type = spec.auto_type_tok; - return d; + d.qt = try builder.finish(); + return d; + } } /// storageClassSpec: @@ -1540,22 +1741,22 @@ fn storageClassSpec(p: *Parser, d: *DeclSpec) Error!bool { .keyword_register, => { if (d.storage_class != .none) { - try p.errStr(.multiple_storage_class, p.tok_i, @tagName(d.storage_class)); + try p.err(p.tok_i, .multiple_storage_class, .{@tagName(d.storage_class)}); return error.ParsingFailed; } if (d.thread_local != null) { switch (id) { .keyword_extern, .keyword_static => {}, - else => try p.errStr(.cannot_combine_spec, p.tok_i, id.lexeme().?), + else => try p.err(p.tok_i, .cannot_combine_spec, .{id.lexeme().?}), } - if (d.constexpr) |tok| try p.errStr(.cannot_combine_spec, p.tok_i, p.tok_ids[tok].lexeme().?); + if (d.constexpr) |tok| try p.err(p.tok_i, .cannot_combine_spec, .{p.tok_ids[tok].lexeme().?}); } if (d.constexpr != null) { switch (id) { .keyword_auto, .keyword_register, .keyword_static => {}, - else => try p.errStr(.cannot_combine_spec, p.tok_i, id.lexeme().?), + else => try p.err(p.tok_i, .cannot_combine_spec, .{id.lexeme().?}), } - if (d.thread_local) |tok| try p.errStr(.cannot_combine_spec, p.tok_i, p.tok_ids[tok].lexeme().?); + if (d.thread_local) |tok| try p.err(p.tok_i, .cannot_combine_spec, .{p.tok_ids[tok].lexeme().?}); } switch (id) { .keyword_typedef => d.storage_class = .{ .typedef = p.tok_i }, @@ -1570,23 +1771,23 @@ fn storageClassSpec(p: *Parser, d: *DeclSpec) Error!bool { .keyword_c23_thread_local, => { if (d.thread_local != null) { - try p.errStr(.duplicate_decl_spec, p.tok_i, id.lexeme().?); + try p.err(p.tok_i, .duplicate_decl_spec, .{id.lexeme().?}); } - if (d.constexpr) |tok| try p.errStr(.cannot_combine_spec, p.tok_i, p.tok_ids[tok].lexeme().?); + if (d.constexpr) |tok| try p.err(p.tok_i, .cannot_combine_spec, .{p.tok_ids[tok].lexeme().?}); switch (d.storage_class) { .@"extern", .none, .static => {}, - else => try p.errStr(.cannot_combine_spec, p.tok_i, @tagName(d.storage_class)), + else => try p.err(p.tok_i, .cannot_combine_spec, .{@tagName(d.storage_class)}), } d.thread_local = p.tok_i; }, .keyword_constexpr => { if (d.constexpr != null) { - try p.errStr(.duplicate_decl_spec, p.tok_i, id.lexeme().?); + try p.err(p.tok_i, .duplicate_decl_spec, .{id.lexeme().?}); } - if (d.thread_local) |tok| try p.errStr(.cannot_combine_spec, p.tok_i, p.tok_ids[tok].lexeme().?); + if (d.thread_local) |tok| try p.err(p.tok_i, .cannot_combine_spec, .{p.tok_ids[tok].lexeme().?}); switch (d.storage_class) { .auto, .register, .none, .static => {}, - else => try p.errStr(.cannot_combine_spec, p.tok_i, @tagName(d.storage_class)), + else => try p.err(p.tok_i, .cannot_combine_spec, .{@tagName(d.storage_class)}), } d.constexpr = p.tok_i; }, @@ -1597,7 +1798,7 @@ fn storageClassSpec(p: *Parser, d: *DeclSpec) Error!bool { return p.tok_i != start; } -const InitDeclarator = struct { d: Declarator, initializer: Result = .{} }; +const InitDeclarator = struct { d: Declarator, initializer: ?Result = null }; /// attribute /// : attrIdentifier @@ -1606,15 +1807,16 @@ const InitDeclarator = struct { d: Declarator, initializer: Result = .{} }; /// | attrIdentifier '(' (expr (',' expr)*)? ')' fn attribute(p: *Parser, kind: Attribute.Kind, namespace: ?[]const u8) Error!?TentativeAttribute { const name_tok = p.tok_i; - switch (p.tok_ids[p.tok_i]) { - .keyword_const, .keyword_const1, .keyword_const2 => p.tok_i += 1, - else => _ = try p.expectIdentifier(), + if (!p.tok_ids[p.tok_i].isMacroIdentifier()) { + return p.errExpectedToken(.identifier, p.tok_ids[p.tok_i]); } + _ = (try p.eatIdentifier()) orelse { + p.tok_i += 1; + }; const name = p.tokSlice(name_tok); const attr = Attribute.fromString(kind, namespace, name) orelse { - const tag: Diagnostics.Tag = if (kind == .declspec) .declspec_attr_not_supported else .unknown_attribute; - try p.errStr(tag, name_tok, name); + try p.err(name_tok, if (kind == .declspec) .declspec_attr_not_supported else .unknown_attribute, .{name}); if (p.eatToken(.l_paren)) |_| p.skipTo(.r_paren); return null; }; @@ -1631,21 +1833,18 @@ fn attribute(p: *Parser, kind: Attribute.Kind, namespace: ?[]const u8) Error!?Te if (Attribute.wantsIdentEnum(attr)) { if (try p.eatIdentifier()) |ident| { - if (Attribute.diagnoseIdent(attr, &arguments, p.tokSlice(ident))) |msg| { - try p.errExtra(msg.tag, ident, msg.extra); + if (try Attribute.diagnoseIdent(attr, &arguments, ident, p)) { p.skipTo(.r_paren); return error.ParsingFailed; } } else { - try p.errExtra(.attribute_requires_identifier, name_tok, .{ .str = name }); + try p.err(name_tok, .attribute_requires_identifier, .{name}); return error.ParsingFailed; } } else { const arg_start = p.tok_i; - var first_expr = try p.assignExpr(); - try first_expr.expect(p); - if (try p.diagnose(attr, &arguments, arg_idx, first_expr)) |msg| { - try p.errExtra(msg.tag, arg_start, msg.extra); + const first_expr = try p.expect(assignExpr); + if (try p.diagnose(attr, &arguments, arg_idx, first_expr, arg_start)) { p.skipTo(.r_paren); return error.ParsingFailed; } @@ -1655,10 +1854,8 @@ fn attribute(p: *Parser, kind: Attribute.Kind, namespace: ?[]const u8) Error!?Te _ = try p.expectToken(.comma); const arg_start = p.tok_i; - var arg_expr = try p.assignExpr(); - try arg_expr.expect(p); - if (try p.diagnose(attr, &arguments, arg_idx, arg_expr)) |msg| { - try p.errExtra(msg.tag, arg_start, msg.extra); + const arg_expr = try p.expect(assignExpr); + if (try p.diagnose(attr, &arguments, arg_idx, arg_expr, arg_start)) { p.skipTo(.r_paren); return error.ParsingFailed; } @@ -1667,28 +1864,30 @@ fn attribute(p: *Parser, kind: Attribute.Kind, namespace: ?[]const u8) Error!?Te else => {}, } if (arg_idx < required_count) { - try p.errExtra(.attribute_not_enough_args, name_tok, .{ .attr_arg_count = .{ .attribute = attr, .expected = required_count } }); + try p.err(name_tok, .attribute_not_enough_args, .{ + @tagName(attr), required_count, + }); return error.ParsingFailed; } return TentativeAttribute{ .attr = .{ .tag = attr, .args = arguments, .syntax = kind.toSyntax() }, .tok = name_tok }; } -fn diagnose(p: *Parser, attr: Attribute.Tag, arguments: *Attribute.Arguments, arg_idx: u32, res: Result) !?Diagnostics.Message { +fn diagnose(p: *Parser, attr: Attribute.Tag, arguments: *Attribute.Arguments, arg_idx: u32, res: Result, arg_start: TokenIndex) !bool { if (Attribute.wantsAlignment(attr, arg_idx)) { - return Attribute.diagnoseAlignment(attr, arguments, arg_idx, res, p); + return Attribute.diagnoseAlignment(attr, arguments, arg_idx, res, arg_start, p); } - const node = p.nodes.get(@intFromEnum(res.node)); - return Attribute.diagnose(attr, arguments, arg_idx, res, node, p); + return Attribute.diagnose(attr, arguments, arg_idx, res, arg_start, res.node.get(&p.tree), p); } /// attributeList : (attribute (',' attribute)*)? fn gnuAttributeList(p: *Parser) Error!void { if (p.tok_ids[p.tok_i] == .r_paren) return; + const gpa = p.comp.gpa; - if (try p.attribute(.gnu, null)) |attr| try p.attr_buf.append(p.gpa, attr); + if (try p.attribute(.gnu, null)) |attr| try p.attr_buf.append(gpa, attr); while (p.tok_ids[p.tok_i] != .r_paren) { _ = try p.expectToken(.comma); - if (try p.attribute(.gnu, null)) |attr| try p.attr_buf.append(p.gpa, attr); + if (try p.attribute(.gnu, null)) |attr| try p.attr_buf.append(gpa, attr); } } @@ -1701,14 +1900,14 @@ fn c23AttributeList(p: *Parser) Error!void { } else { p.tok_i -= 1; } - if (try p.attribute(.c23, namespace)) |attr| try p.attr_buf.append(p.gpa, attr); + if (try p.attribute(.c23, namespace)) |attr| try p.attr_buf.append(p.comp.gpa, attr); _ = p.eatToken(.comma); } } fn msvcAttributeList(p: *Parser) Error!void { while (p.tok_ids[p.tok_i] != .r_paren) { - if (try p.attribute(.declspec, null)) |attr| try p.attr_buf.append(p.gpa, attr); + if (try p.attribute(.declspec, null)) |attr| try p.attr_buf.append(p.comp.gpa, attr); _ = p.eatToken(.comma); } } @@ -1766,8 +1965,8 @@ fn attributeSpecifierExtra(p: *Parser, declarator_name: ?TokenIndex) Error!void const attr_buf_top = p.attr_buf.len; if (try p.msvcAttribute()) { if (declarator_name) |name_tok| { - try p.errTok(.declspec_not_allowed_after_declarator, maybe_declspec_tok); - try p.errTok(.declarator_name_tok, name_tok); + try p.err(maybe_declspec_tok, .declspec_not_allowed_after_declarator, .{}); + try p.err(name_tok, .declarator_name_tok, .{}); p.attr_buf.len = attr_buf_top; } continue; @@ -1777,130 +1976,181 @@ fn attributeSpecifierExtra(p: *Parser, declarator_name: ?TokenIndex) Error!void } /// initDeclarator : declarator assembly? attributeSpecifier? ('=' initializer)? -fn initDeclarator(p: *Parser, decl_spec: *DeclSpec, attr_buf_top: usize) Error!?InitDeclarator { +fn initDeclarator(p: *Parser, decl_spec: *DeclSpec, attr_buf_top: usize, decl_node: Node.Index) Error!?InitDeclarator { const this_attr_buf_top = p.attr_buf.len; defer p.attr_buf.len = this_attr_buf_top; + const gpa = p.comp.gpa; var init_d = InitDeclarator{ - .d = (try p.declarator(decl_spec.ty, .normal)) orelse return null, + .d = (try p.declarator(decl_spec.qt, .normal)) orelse return null, }; - if (decl_spec.ty.is(.c23_auto) and !init_d.d.ty.is(.c23_auto)) { - try p.errTok(.c23_auto_plain_declarator, decl_spec.storage_class.auto); - return error.ParsingFailed; - } - try p.attributeSpecifierExtra(init_d.d.name); _ = try p.assembly(.decl_label); try p.attributeSpecifierExtra(init_d.d.name); + switch (init_d.d.declarator_type) { + .func => { + if (decl_spec.auto_type) |tok_i| { + try p.err(tok_i, .auto_type_not_allowed, .{"function return type"}); + init_d.d.qt = .invalid; + } else if (decl_spec.c23_auto) |tok_i| { + try p.err(tok_i, .c23_auto_not_allowed, .{"function return type"}); + init_d.d.qt = .invalid; + } + }, + .array => { + if (decl_spec.auto_type) |tok_i| { + try p.err(tok_i, .auto_type_array, .{p.tokSlice(init_d.d.name)}); + init_d.d.qt = .invalid; + } else if (decl_spec.c23_auto) |tok_i| { + try p.err(tok_i, .c23_auto_array, .{p.tokSlice(init_d.d.name)}); + init_d.d.qt = .invalid; + } + }, + .pointer => { + if (decl_spec.auto_type != null or decl_spec.c23_auto != null) { + // TODO this is not a hard error in clang + try p.err(p.tok_i, .auto_type_requires_plain_declarator, .{}); + init_d.d.qt = .invalid; + } + }, + .other => if (decl_spec.storage_class == .typedef) { + if (decl_spec.auto_type) |tok_i| { + try p.err(tok_i, .auto_type_not_allowed, .{"typedef"}); + init_d.d.qt = .invalid; + } else if (decl_spec.c23_auto) |tok_i| { + try p.err(tok_i, .c23_auto_not_allowed, .{"typedef"}); + init_d.d.qt = .invalid; + } + }, + } + var apply_var_attributes = false; if (decl_spec.storage_class == .typedef) { - if (decl_spec.auto_type) |tok_i| { - try p.errStr(.auto_type_not_allowed, tok_i, "typedef"); - return error.ParsingFailed; - } - init_d.d.ty = try Attribute.applyTypeAttributes(p, init_d.d.ty, attr_buf_top, null); - } else if (init_d.d.ty.isFunc()) { - init_d.d.ty = try Attribute.applyFunctionAttributes(p, init_d.d.ty, attr_buf_top); + init_d.d.qt = try Attribute.applyTypeAttributes(p, init_d.d.qt, attr_buf_top, null); + } else if (init_d.d.declarator_type == .func or init_d.d.qt.is(p.comp, .func)) { + init_d.d.qt = try Attribute.applyFunctionAttributes(p, init_d.d.qt, attr_buf_top); } else { apply_var_attributes = true; } - const c23_auto = init_d.d.ty.is(.c23_auto); - const auto_type = init_d.d.ty.is(.auto_type); - if (p.eatToken(.equal)) |eq| init: { + if (p.eatToken(.equal)) |eq| { if (decl_spec.storage_class == .typedef or - (init_d.d.func_declarator != null and init_d.d.ty.isFunc())) + (init_d.d.declarator_type == .func and init_d.d.qt.is(p.comp, .func))) { - try p.errTok(.illegal_initializer, eq); - } else if (init_d.d.ty.is(.variable_len_array)) { - try p.errTok(.vla_init, eq); + try p.err(eq, .illegal_initializer, .{}); + } else if (init_d.d.qt.get(p.comp, .array)) |array_ty| { + if (array_ty.len == .variable) try p.err(eq, .vla_init, .{}); } else if (decl_spec.storage_class == .@"extern") { - try p.err(.extern_initializer); + try p.err(p.tok_i, .extern_initializer, .{}); decl_spec.storage_class = .none; } - if (init_d.d.ty.hasIncompleteSize() and !init_d.d.ty.is(.incomplete_array)) { - try p.errStr(.variable_incomplete_ty, init_d.d.name, try p.typeStr(init_d.d.ty)); - return error.ParsingFailed; - } - if (p.tok_ids[p.tok_i] == .l_brace and init_d.d.ty.is(.c23_auto)) { - try p.errTok(.c23_auto_scalar_init, decl_spec.storage_class.auto); - return error.ParsingFailed; + incomplete: { + if (init_d.d.qt.isInvalid()) break :incomplete; + if (init_d.d.qt.isC23Auto()) break :incomplete; + if (init_d.d.qt.isAutoType()) break :incomplete; + if (!init_d.d.qt.hasIncompleteSize(p.comp)) break :incomplete; + if (init_d.d.qt.get(p.comp, .array)) |array_ty| { + if (array_ty.len == .incomplete) break :incomplete; + } + try p.err(init_d.d.name, .variable_incomplete_ty, .{init_d.d.qt}); + init_d.d.qt = .invalid; } try p.syms.pushScope(p); defer p.syms.popScope(); - const interned_name = try StrInt.intern(p.comp, p.tokSlice(init_d.d.name)); - try p.syms.declareSymbol(p, interned_name, init_d.d.ty, init_d.d.name, .none); - if (c23_auto or auto_type) { + const interned_name = try p.comp.internString(p.tokSlice(init_d.d.name)); + try p.syms.declareSymbol(p, interned_name, init_d.d.qt, init_d.d.name, decl_node); + + // TODO this should be a stack of auto type names because of statement expressions. + if (init_d.d.qt.isAutoType() or init_d.d.qt.isC23Auto()) { p.auto_type_decl_name = interned_name; } defer p.auto_type_decl_name = .empty; - var init_list_expr = try p.initializer(init_d.d.ty); + const init_context = p.init_context; + defer p.init_context = init_context; + p.init_context = decl_spec.initContext(p); + var init_list_expr = try p.initializer(init_d.d.qt); init_d.initializer = init_list_expr; - if (!init_list_expr.ty.isArray()) break :init; - if (init_d.d.ty.is(.incomplete_array)) { - init_d.d.ty.setIncompleteArrayLen(init_list_expr.ty.arrayLen() orelse break :init); + + // Set incomplete array length if possible. + if (init_d.d.qt.get(p.comp, .array)) |base_array_ty| { + if (base_array_ty.len == .incomplete) if (init_list_expr.qt.get(p.comp, .array)) |init_array_ty| { + switch (init_array_ty.len) { + .fixed, .static => |len| { + init_d.d.qt = (try p.comp.type_store.put(gpa, .{ .array = .{ + .elem = base_array_ty.elem, + .len = .{ .fixed = len }, + } })).withQualifiers(init_d.d.qt); + }, + else => {}, + } + }; } } const name = init_d.d.name; - if (auto_type or c23_auto) { - if (init_d.initializer.node == .none) { - init_d.d.ty = Type.invalid; - if (c23_auto) { - try p.errStr(.c32_auto_requires_initializer, decl_spec.storage_class.auto, p.tokSlice(name)); + if (init_d.d.qt.isAutoType() or init_d.d.qt.isC23Auto()) { + if (init_d.initializer) |some| { + init_d.d.qt = some.qt.withQualifiers(init_d.d.qt); + } else { + if (init_d.d.qt.isC23Auto()) { + try p.err(name, .c23_auto_requires_initializer, .{}); } else { - try p.errStr(.auto_type_requires_initializer, name, p.tokSlice(name)); + try p.err(name, .auto_type_requires_initializer, .{p.tokSlice(name)}); } + init_d.d.qt = .invalid; return init_d; - } else { - init_d.d.ty.specifier = init_d.initializer.ty.specifier; - init_d.d.ty.data = init_d.initializer.ty.data; - init_d.d.ty.decayed = init_d.initializer.ty.decayed; } } if (apply_var_attributes) { - init_d.d.ty = try Attribute.applyVariableAttributes(p, init_d.d.ty, attr_buf_top, null); + init_d.d.qt = try Attribute.applyVariableAttributes(p, init_d.d.qt, attr_buf_top, null); } - if (decl_spec.storage_class != .typedef and init_d.d.ty.hasIncompleteSize()) incomplete: { - const specifier = init_d.d.ty.canonicalize(.standard).specifier; - if (decl_spec.storage_class == .@"extern") switch (specifier) { + + incomplete: { + if (decl_spec.storage_class == .typedef) break :incomplete; + if (init_d.d.qt.isInvalid()) break :incomplete; + if (!init_d.d.qt.hasIncompleteSize(p.comp)) break :incomplete; + + const init_type = init_d.d.qt.base(p.comp).type; + if (decl_spec.storage_class == .@"extern") switch (init_type) { .@"struct", .@"union", .@"enum" => break :incomplete, - .incomplete_array => { - init_d.d.ty.decayArray(); - break :incomplete; - }, + .array => |array_ty| if (array_ty.len == .incomplete) break :incomplete, else => {}, }; // if there was an initializer expression it must have contained an error - if (init_d.initializer.node != .none) break :incomplete; - - if (p.func.ty == null) { - if (specifier == .incomplete_array) { - // TODO properly check this after finishing parsing - try p.errStr(.tentative_array, name, try p.typeStr(init_d.d.ty)); - break :incomplete; - } else if (init_d.d.ty.getRecord()) |record| { - _ = try p.tentative_defs.getOrPutValue(p.gpa, record.name, init_d.d.name); - break :incomplete; - } else if (init_d.d.ty.get(.@"enum")) |en| { - _ = try p.tentative_defs.getOrPutValue(p.gpa, en.data.@"enum".name, init_d.d.name); - break :incomplete; + if (init_d.initializer != null) break :incomplete; + + if (p.func.qt == null) { + switch (init_type) { + .array => |array_ty| if (array_ty.len == .incomplete) { + // TODO properly check this after finishing parsing + try p.err(name, .tentative_array, .{}); + break :incomplete; + }, + .@"struct", .@"union" => |record_ty| { + _ = try p.tentative_defs.getOrPutValue(gpa, record_ty.name, init_d.d.name); + break :incomplete; + }, + .@"enum" => |enum_ty| { + _ = try p.tentative_defs.getOrPutValue(gpa, enum_ty.name, init_d.d.name); + break :incomplete; + }, + else => {}, } } - try p.errStr(.variable_incomplete_ty, name, try p.typeStr(init_d.d.ty)); + try p.err(name, .variable_incomplete_ty, .{init_d.d.qt}); + init_d.d.qt = .invalid; } return init_d; } /// typeSpec /// : keyword_void -/// | keyword_auto_type /// | keyword_char /// | keyword_short /// | keyword_int @@ -1914,53 +2164,48 @@ fn initDeclarator(p: *Parser, decl_spec: *DeclSpec, attr_buf_top: usize) Error!? /// | keyword_bool /// | keyword_c23_bool /// | keyword_complex -/// | atomicTypeSpec +/// | keyword_atomic '(' typeName ')' /// | recordSpec /// | enumSpec /// | typedef // IDENTIFIER /// | typeof /// | keyword_bit_int '(' integerConstExpr ')' -/// atomicTypeSpec : keyword_atomic '(' typeName ')' -/// alignSpec -/// : keyword_alignas '(' typeName ')' -/// | keyword_alignas '(' integerConstExpr ')' -/// | keyword_c23_alignas '(' typeName ')' -/// | keyword_c23_alignas '(' integerConstExpr ')' -fn typeSpec(p: *Parser, ty: *Type.Builder) Error!bool { +/// | typeQual +/// | keyword_alignas '(' typeName ')' +/// | keyword_alignas '(' integerConstExpr ')' +/// | keyword_c23_alignas '(' typeName ')' +/// | keyword_c23_alignas '(' integerConstExpr ')' +fn typeSpec(p: *Parser, builder: *TypeStore.Builder) Error!bool { const start = p.tok_i; while (true) { try p.attributeSpecifier(); - if (try p.typeof()) |inner_ty| { - try ty.combineFromTypeof(p, inner_ty, start); + if (try p.typeof()) |typeof_qt| { + try builder.combineFromTypeof(typeof_qt, start); continue; } - if (try p.typeQual(&ty.qual)) continue; + if (try p.typeQual(builder, true)) continue; switch (p.tok_ids[p.tok_i]) { - .keyword_void => try ty.combine(p, .void, p.tok_i), - .keyword_auto_type => { - try p.errTok(.auto_type_extension, p.tok_i); - try ty.combine(p, .auto_type, p.tok_i); - }, - .keyword_bool, .keyword_c23_bool => try ty.combine(p, .bool, p.tok_i), - .keyword_int8, .keyword_int8_2, .keyword_char => try ty.combine(p, .char, p.tok_i), - .keyword_int16, .keyword_int16_2, .keyword_short => try ty.combine(p, .short, p.tok_i), - .keyword_int32, .keyword_int32_2, .keyword_int => try ty.combine(p, .int, p.tok_i), - .keyword_long => try ty.combine(p, .long, p.tok_i), - .keyword_int64, .keyword_int64_2 => try ty.combine(p, .long_long, p.tok_i), - .keyword_int128 => try ty.combine(p, .int128, p.tok_i), - .keyword_signed, .keyword_signed1, .keyword_signed2 => try ty.combine(p, .signed, p.tok_i), - .keyword_unsigned => try ty.combine(p, .unsigned, p.tok_i), - .keyword_fp16 => try ty.combine(p, .fp16, p.tok_i), - .keyword_float16 => try ty.combine(p, .float16, p.tok_i), - .keyword_float => try ty.combine(p, .float, p.tok_i), - .keyword_double => try ty.combine(p, .double, p.tok_i), - .keyword_complex => try ty.combine(p, .complex, p.tok_i), + .keyword_void => try builder.combine(.void, p.tok_i), + .keyword_bool, .keyword_c23_bool => try builder.combine(.bool, p.tok_i), + .keyword_int8, .keyword_int8_2, .keyword_char => try builder.combine(.char, p.tok_i), + .keyword_int16, .keyword_int16_2, .keyword_short => try builder.combine(.short, p.tok_i), + .keyword_int32, .keyword_int32_2, .keyword_int => try builder.combine(.int, p.tok_i), + .keyword_long => try builder.combine(.long, p.tok_i), + .keyword_int64, .keyword_int64_2 => try builder.combine(.long_long, p.tok_i), + .keyword_int128 => try builder.combine(.int128, p.tok_i), + .keyword_signed, .keyword_signed1, .keyword_signed2 => try builder.combine(.signed, p.tok_i), + .keyword_unsigned => try builder.combine(.unsigned, p.tok_i), + .keyword_fp16 => try builder.combine(.fp16, p.tok_i), + .keyword_float16 => try builder.combine(.float16, p.tok_i), + .keyword_float => try builder.combine(.float, p.tok_i), + .keyword_double => try builder.combine(.double, p.tok_i), + .keyword_complex => try builder.combine(.complex, p.tok_i), .keyword_float128_1, .keyword_float128_2 => { if (!p.comp.hasFloat128()) { - try p.errStr(.type_not_supported_on_target, p.tok_i, p.tok_ids[p.tok_i].lexeme().?); + try p.err(p.tok_i, .type_not_supported_on_target, .{p.tok_ids[p.tok_i].lexeme().?}); } - try ty.combine(p, .float128, p.tok_i); + try builder.combine(.float128, p.tok_i); }, .keyword_atomic => { const atomic_tok = p.tok_i; @@ -1970,19 +2215,19 @@ fn typeSpec(p: *Parser, ty: *Type.Builder) Error!bool { p.tok_i = atomic_tok; break; }; - const inner_ty = (try p.typeName()) orelse { - try p.err(.expected_type); + const base_qt = (try p.typeName()) orelse { + try p.err(p.tok_i, .expected_type, .{}); return error.ParsingFailed; }; try p.expectClosing(l_paren, .r_paren); - const new_spec = Type.Builder.fromType(inner_ty); - try ty.combine(p, new_spec, atomic_tok); + if (base_qt.isQualified() and !base_qt.isInvalid()) { + try p.err(atomic_tok, .atomic_qualified, .{base_qt}); + builder.type = .{ .other = .invalid }; + continue; + } - if (ty.qual.atomic != null) - try p.errStr(.duplicate_decl_spec, atomic_tok, "atomic") - else - ty.qual.atomic = atomic_tok; + try builder.combineAtomic(base_qt, atomic_tok); continue; }, .keyword_alignas, @@ -1990,14 +2235,15 @@ fn typeSpec(p: *Parser, ty: *Type.Builder) Error!bool { => { const align_tok = p.tok_i; p.tok_i += 1; + const gpa = p.comp.gpa; const l_paren = try p.expectToken(.l_paren); const typename_start = p.tok_i; - if (try p.typeName()) |inner_ty| { - if (!inner_ty.alignable()) { - try p.errStr(.invalid_alignof, typename_start, try p.typeStr(inner_ty)); + if (try p.typeName()) |inner_qt| { + if (!inner_qt.alignable(p.comp)) { + try p.err(typename_start, .invalid_alignof, .{inner_qt}); } - const alignment = Attribute.Alignment{ .requested = inner_ty.alignof(p.comp) }; - try p.attr_buf.append(p.gpa, .{ + const alignment = Attribute.Alignment{ .requested = inner_qt.alignof(p.comp) }; + try p.attr_buf.append(gpa, .{ .attr = .{ .tag = .aligned, .args = .{ .aligned = .{ .alignment = alignment, .__name_tok = align_tok }, }, .syntax = .keyword }, @@ -2008,13 +2254,12 @@ fn typeSpec(p: *Parser, ty: *Type.Builder) Error!bool { const res = try p.integerConstExpr(.no_const_decl_folding); if (!res.val.isZero(p.comp)) { var args = Attribute.initArguments(.aligned, align_tok); - if (try p.diagnose(.aligned, &args, 0, res)) |msg| { - try p.errExtra(msg.tag, arg_start, msg.extra); + if (try p.diagnose(.aligned, &args, 0, res, arg_start)) { p.skipTo(.r_paren); return error.ParsingFailed; } - args.aligned.alignment.?.node = res.node; - try p.attr_buf.append(p.gpa, .{ + args.aligned.alignment.?.node = .pack(res.node); + try p.attr_buf.append(gpa, .{ .attr = .{ .tag = .aligned, .args = args, .syntax = .keyword }, .tok = align_tok, }); @@ -2023,47 +2268,24 @@ fn typeSpec(p: *Parser, ty: *Type.Builder) Error!bool { try p.expectClosing(l_paren, .r_paren); continue; }, - .keyword_stdcall, - .keyword_stdcall2, - .keyword_thiscall, - .keyword_thiscall2, - .keyword_vectorcall, - .keyword_vectorcall2, - => try p.attr_buf.append(p.gpa, .{ - .attr = .{ .tag = .calling_convention, .args = .{ - .calling_convention = .{ .cc = switch (p.tok_ids[p.tok_i]) { - .keyword_stdcall, - .keyword_stdcall2, - => .stdcall, - .keyword_thiscall, - .keyword_thiscall2, - => .thiscall, - .keyword_vectorcall, - .keyword_vectorcall2, - => .vectorcall, - else => unreachable, - } }, - }, .syntax = .keyword }, - .tok = p.tok_i, - }), .keyword_struct, .keyword_union => { const tag_tok = p.tok_i; const record_ty = try p.recordSpec(); - try ty.combine(p, Type.Builder.fromType(record_ty), tag_tok); + try builder.combine(.{ .other = record_ty }, tag_tok); continue; }, .keyword_enum => { const tag_tok = p.tok_i; const enum_ty = try p.enumSpec(); - try ty.combine(p, Type.Builder.fromType(enum_ty), tag_tok); + try builder.combine(.{ .other = enum_ty }, tag_tok); continue; }, .identifier, .extended_identifier => { - var interned_name = try StrInt.intern(p.comp, p.tokSlice(p.tok_i)); + var interned_name = try p.comp.internString(p.tokSlice(p.tok_i)); var declspec_found = false; if (interned_name == p.string_ids.declspec_id) { - try p.errTok(.declspec_not_enabled, p.tok_i); + try p.err(p.tok_i, .declspec_not_enabled, .{}); p.tok_i += 1; if (p.eatToken(.l_paren)) |_| { p.skipTo(.r_paren); @@ -2071,15 +2293,14 @@ fn typeSpec(p: *Parser, ty: *Type.Builder) Error!bool { } declspec_found = true; } - if (ty.typedef != null) break; if (declspec_found) { - interned_name = try StrInt.intern(p.comp, p.tokSlice(p.tok_i)); + interned_name = try p.comp.internString(p.tokSlice(p.tok_i)); } - const typedef = (try p.syms.findTypedef(p, interned_name, p.tok_i, ty.specifier != .none)) orelse break; - if (!ty.combineTypedef(p, typedef.ty, typedef.tok)) break; + const typedef = (try p.syms.findTypedef(p, interned_name, p.tok_i, builder.type != .none)) orelse break; + if (!builder.combineTypedef(typedef.qt)) break; }, .keyword_bit_int => { - try p.err(.bit_int); + try p.err(p.tok_i, .bit_int, .{}); const bit_int_tok = p.tok_i; p.tok_i += 1; const l_paren = try p.expectToken(.l_paren); @@ -2088,15 +2309,15 @@ fn typeSpec(p: *Parser, ty: *Type.Builder) Error!bool { var bits: u64 = undefined; if (res.val.opt_ref == .none) { - try p.errTok(.expected_integer_constant_expr, bit_int_tok); + try p.err(bit_int_tok, .expected_integer_constant_expr, .{}); return error.ParsingFailed; - } else if (res.val.compare(.lte, Value.zero, p.comp)) { + } else if (res.val.compare(.lte, .zero, p.comp)) { bits = 0; } else { bits = res.val.toInt(u64, p.comp) orelse std.math.maxInt(u64); } - try ty.combine(p, .{ .bit_int = bits }, bit_int_tok); + try builder.combine(.{ .bit_int = bits }, bit_int_tok); continue; }, else => break, @@ -2117,18 +2338,21 @@ fn getAnonymousName(p: *Parser, kind_tok: TokenIndex) !StringId { else => "record field", }; + var arena = p.comp.type_store.anon_name_arena.promote(p.comp.gpa); + defer p.comp.type_store.anon_name_arena = arena.state; const str = try std.fmt.allocPrint( - p.arena, + arena.allocator(), "(anonymous {s} at {s}:{d}:{d})", .{ kind_str, source.path, line_col.line_no, line_col.col }, ); - return StrInt.intern(p.comp, str); + return p.comp.internString(str); } /// recordSpec -/// : (keyword_struct | keyword_union) IDENTIFIER? { recordDecl* } +/// : (keyword_struct | keyword_union) IDENTIFIER? { recordDecls } /// | (keyword_struct | keyword_union) IDENTIFIER -fn recordSpec(p: *Parser) Error!Type { +fn recordSpec(p: *Parser) Error!QualType { + const gpa = p.comp.gpa; const starting_pragma_pack = p.pragma_pack; const kind_tok = p.tok_i; const is_struct = p.tok_ids[kind_tok] == .keyword_struct; @@ -2137,37 +2361,51 @@ fn recordSpec(p: *Parser) Error!Type { defer p.attr_buf.len = attr_buf_top; try p.attributeSpecifier(); + const reserved_index = try p.tree.nodes.addOne(gpa); + const maybe_ident = try p.eatIdentifier(); const l_brace = p.eatToken(.l_brace) orelse { const ident = maybe_ident orelse { - try p.err(.ident_or_l_brace); + try p.err(p.tok_i, .ident_or_l_brace, .{}); return error.ParsingFailed; }; // check if this is a reference to a previous type - const interned_name = try StrInt.intern(p.comp, p.tokSlice(ident)); + const interned_name = try p.comp.internString(p.tokSlice(ident)); if (try p.syms.findTag(p, interned_name, p.tok_ids[kind_tok], ident, p.tok_ids[p.tok_i])) |prev| { - return prev.ty; + return prev.qt; } else { - // this is a forward declaration, create a new record Type. - const record_ty = try Type.Record.create(p.arena, interned_name); - const ty = try Attribute.applyTypeAttributes(p, .{ - .specifier = if (is_struct) .@"struct" else .@"union", - .data = .{ .record = record_ty }, - }, attr_buf_top, null); - try p.syms.define(p.gpa, .{ + // this is a forward declaration, create a new record type. + const record_ty: Type.Record = .{ + .name = interned_name, + .layout = null, + .decl_node = @enumFromInt(reserved_index), + .fields = &.{}, + }; + const record_qt = try p.comp.type_store.put(gpa, if (is_struct) + .{ .@"struct" = record_ty } + else + .{ .@"union" = record_ty }); + + const attributed_qt = try Attribute.applyTypeAttributes(p, record_qt, attr_buf_top, null); + try p.syms.define(gpa, .{ .kind = if (is_struct) .@"struct" else .@"union", .name = interned_name, .tok = ident, - .ty = ty, + .qt = attributed_qt, .val = .{}, }); - try p.decl_buf.append(try p.addNode(.{ - .tag = if (is_struct) .struct_forward_decl else .union_forward_decl, - .ty = ty, - .data = .{ .decl_ref = ident }, - .loc = @enumFromInt(ident), - })); - return ty; + + const fw: Node.ContainerForwardDecl = .{ + .name_or_kind_tok = ident, + .container_qt = attributed_qt, + .definition = null, + }; + try p.tree.setNode(if (is_struct) + .{ .struct_forward_decl = fw } + else + .{ .union_forward_decl = fw }, reserved_index); + try p.decl_buf.append(gpa, @enumFromInt(reserved_index)); + return attributed_qt; } }; @@ -2175,44 +2413,52 @@ fn recordSpec(p: *Parser) Error!Type { errdefer if (!done) p.skipTo(.r_brace); // Get forward declared type or create a new one - var defined = false; - const record_ty: *Type.Record = if (maybe_ident) |ident| record_ty: { - const ident_str = p.tokSlice(ident); - const interned_name = try StrInt.intern(p.comp, ident_str); - if (try p.syms.defineTag(p, interned_name, p.tok_ids[kind_tok], ident)) |prev| { - if (!prev.ty.hasIncompleteSize()) { - // if the record isn't incomplete, this is a redefinition - try p.errStr(.redefinition, ident, ident_str); - try p.errTok(.previous_definition, prev.tok); - } else { - defined = true; - break :record_ty prev.ty.get(if (is_struct) .@"struct" else .@"union").?.data.record; + var record_ty: Type.Record, const qt: QualType = blk: { + const interned_name = if (maybe_ident) |ident| interned: { + const ident_str = p.tokSlice(ident); + const interned_name = try p.comp.internString(ident_str); + if (try p.syms.defineTag(p, interned_name, p.tok_ids[kind_tok], ident)) |prev| { + const record_ty = prev.qt.getRecord(p.comp).?; + if (record_ty.layout != null) { + // if the record isn't incomplete, this is a redefinition + try p.err(ident, .redefinition, .{ident_str}); + try p.err(prev.tok, .previous_definition, .{}); + } else { + break :blk .{ record_ty, prev.qt }; + } } + break :interned interned_name; + } else try p.getAnonymousName(kind_tok); + + // Initially create ty as a regular non-attributed type, since attributes for a record + // can be specified after the closing rbrace, which we haven't encountered yet. + const record_ty: Type.Record = .{ + .name = interned_name, + .decl_node = @enumFromInt(reserved_index), + .layout = null, + .fields = &.{}, + }; + const record_qt = try p.comp.type_store.put(gpa, if (is_struct) + .{ .@"struct" = record_ty } + else + .{ .@"union" = record_ty }); + + // declare a symbol for the type + // We need to replace the symbol's type if it has attributes + if (maybe_ident != null) { + try p.syms.define(gpa, .{ + .kind = if (is_struct) .@"struct" else .@"union", + .name = record_ty.name, + .tok = maybe_ident.?, + .qt = record_qt, + .val = .{}, + }); } - break :record_ty try Type.Record.create(p.arena, interned_name); - } else try Type.Record.create(p.arena, try p.getAnonymousName(kind_tok)); - // Initially create ty as a regular non-attributed type, since attributes for a record - // can be specified after the closing rbrace, which we haven't encountered yet. - var ty = Type{ - .specifier = if (is_struct) .@"struct" else .@"union", - .data = .{ .record = record_ty }, + break :blk .{ record_ty, record_qt }; }; - // declare a symbol for the type - // We need to replace the symbol's type if it has attributes - if (maybe_ident != null and !defined) { - try p.syms.define(p.gpa, .{ - .kind = if (is_struct) .@"struct" else .@"union", - .name = record_ty.name, - .tok = maybe_ident.?, - .ty = ty, - .val = .{}, - }); - } - - // reserve space for this record - try p.decl_buf.append(.none); + try p.decl_buf.append(gpa, @enumFromInt(reserved_index)); const decl_buf_top = p.decl_buf.items.len; const record_buf_top = p.record_buf.items.len; errdefer p.decl_buf.items.len = decl_buf_top - 1; @@ -2223,100 +2469,121 @@ fn recordSpec(p: *Parser) Error!Type { const old_record = p.record; const old_members = p.record_members.items.len; - const old_field_attr_start = p.field_attr_buf.items.len; p.record = .{ .kind = p.tok_ids[kind_tok], .start = p.record_members.items.len, - .field_attr_start = p.field_attr_buf.items.len, }; defer p.record = old_record; defer p.record_members.items.len = old_members; - defer p.field_attr_buf.items.len = old_field_attr_start; try p.recordDecls(); - if (p.record.flexible_field) |some| { - if (p.record_buf.items[record_buf_top..].len == 1 and is_struct) { - try p.errTok(.flexible_in_empty, some); - } - } + const fields = p.record_buf.items[record_buf_top..]; - for (p.record_buf.items[record_buf_top..]) |field| { - if (field.ty.hasIncompleteSize() and !field.ty.is(.incomplete_array)) break; - } else { - record_ty.fields = try p.arena.dupe(Type.Record.Field, p.record_buf.items[record_buf_top..]); - } - const attr_count = p.field_attr_buf.items.len - old_field_attr_start; - const record_decls = p.decl_buf.items[decl_buf_top..]; - if (attr_count > 0) { - if (attr_count != record_decls.len) { - // A mismatch here means that non-field decls were parsed. This can happen if there were - // parse errors during attribute parsing. Bail here because if there are any field attributes, - // there must be exactly one per field. - return error.ParsingFailed; + if (p.record.flexible_field) |some| { + if (fields.len == 1 and is_struct) { + if (p.comp.langopts.emulate == .msvc) { + try p.err(some, .flexible_in_empty_msvc, .{}); + } else { + try p.err(some, .flexible_in_empty, .{}); + } } - const field_attr_slice = p.field_attr_buf.items[old_field_attr_start..]; - const duped = try p.arena.dupe([]const Attribute, field_attr_slice); - record_ty.field_attributes = duped.ptr; } if (p.record_buf.items.len == record_buf_top) { - try p.errStr(.empty_record, kind_tok, p.tokSlice(kind_tok)); - try p.errStr(.empty_record_size, kind_tok, p.tokSlice(kind_tok)); + try p.err(kind_tok, .empty_record, .{p.tokSlice(kind_tok)}); + try p.err(kind_tok, .empty_record_size, .{p.tokSlice(kind_tok)}); } try p.expectClosing(l_brace, .r_brace); done = true; try p.attributeSpecifier(); - ty = try Attribute.applyTypeAttributes(p, .{ - .specifier = if (is_struct) .@"struct" else .@"union", - .data = .{ .record = record_ty }, - }, attr_buf_top, null); - if (ty.specifier == .attributed and maybe_ident != null) { + const any_incomplete = blk: { + for (fields) |field| { + if (field.qt.hasIncompleteSize(p.comp) and !field.qt.is(p.comp, .array)) break :blk true; + } + // Set fields and a dummy layout before addign attributes. + record_ty.fields = fields; + record_ty.layout = .{ + .size_bits = 8, + .field_alignment_bits = 8, + .pointer_alignment_bits = 8, + .required_alignment_bits = 8, + }; + record_ty.decl_node = @enumFromInt(reserved_index); + + const base_type = qt.base(p.comp); + if (is_struct) { + std.debug.assert(base_type.type.@"struct".name == record_ty.name); + try p.comp.type_store.set(gpa, .{ .@"struct" = record_ty }, @intFromEnum(base_type.qt._index)); + } else { + std.debug.assert(base_type.type.@"union".name == record_ty.name); + try p.comp.type_store.set(gpa, .{ .@"union" = record_ty }, @intFromEnum(base_type.qt._index)); + } + break :blk false; + }; + + const attributed_qt = try Attribute.applyTypeAttributes(p, qt, attr_buf_top, null); + + // Make sure the symbol for this record points to the attributed type. + if (attributed_qt != qt and maybe_ident != null) { const ident_str = p.tokSlice(maybe_ident.?); - const interned_name = try StrInt.intern(p.comp, ident_str); + const interned_name = try p.comp.internString(ident_str); const ptr = p.syms.getPtr(interned_name, .tags); - ptr.ty = ty; + ptr.qt = attributed_qt; } - if (!ty.hasIncompleteSize()) { + if (!any_incomplete) { const pragma_pack_value = switch (p.comp.langopts.emulate) { .clang => starting_pragma_pack, .gcc => p.pragma_pack, // TODO: msvc considers `#pragma pack` on a per-field basis .msvc => p.pragma_pack, }; - record_layout.compute(record_ty, ty, p.comp, pragma_pack_value) catch |er| switch (er) { - error.Overflow => try p.errStr(.record_too_large, maybe_ident orelse kind_tok, try p.typeStr(ty)), - }; + if (record_layout.compute(fields, attributed_qt, p.comp, pragma_pack_value)) |layout| { + record_ty.fields = fields; + record_ty.layout = layout; + } else |er| switch (er) { + error.Overflow => try p.err(maybe_ident orelse kind_tok, .record_too_large, .{qt}), + } + + // Override previous incomplete layout and fields. + const base_qt = qt.base(p.comp).qt; + const ts = &p.comp.type_store; + var extra_index = ts.types.items(.data)[@intFromEnum(base_qt._index)][1]; + + const layout_size = 5; + comptime std.debug.assert(@sizeOf(Type.Record.Layout) == @sizeOf(u32) * layout_size); + const field_size = 10; + comptime std.debug.assert(@sizeOf(Type.Record.Field) == @sizeOf(u32) * field_size); + + extra_index += 1; // For decl_node + const casted_layout: *const [layout_size]u32 = @ptrCast(&record_ty.layout); + ts.extra.items[extra_index..][0..layout_size].* = casted_layout.*; + extra_index += layout_size; + extra_index += 1; // For field length + + for (record_ty.fields) |*field| { + const casted: *const [field_size]u32 = @ptrCast(field); + ts.extra.items[extra_index..][0..field_size].* = casted.*; + extra_index += field_size; + } } // finish by creating a node - var node: Tree.Node = .{ - .tag = if (is_struct) .struct_decl_two else .union_decl_two, - .ty = ty, - .data = .{ .two = .{ .none, .none } }, - .loc = @enumFromInt(maybe_ident orelse kind_tok), + const cd: Node.ContainerDecl = .{ + .name_or_kind_tok = maybe_ident orelse kind_tok, + .container_qt = attributed_qt, + .fields = p.decl_buf.items[decl_buf_top..], }; - switch (record_decls.len) { - 0 => {}, - 1 => node.data = .{ .two = .{ record_decls[0], .none } }, - 2 => node.data = .{ .two = .{ record_decls[0], record_decls[1] } }, - else => { - node.tag = if (is_struct) .struct_decl else .union_decl; - node.data = .{ .range = try p.addList(record_decls) }; - }, - } - p.decl_buf.items[decl_buf_top - 1] = try p.addNode(node); - if (p.func.ty == null) { + try p.tree.setNode(if (is_struct) .{ .struct_decl = cd } else .{ .union_decl = cd }, reserved_index); + if (p.func.qt == null) { _ = p.tentative_defs.remove(record_ty.name); } - return ty; + return attributed_qt; } -/// recordDecl -/// : specQual (recordDeclarator (',' recordDeclarator)*)? ; -/// | staticAssert +/// recordDecls : (keyword_extension? recordDecl | staticAssert)* fn recordDecls(p: *Parser) Error!void { while (true) { if (try p.pragma()) continue; @@ -2326,23 +2593,60 @@ fn recordDecls(p: *Parser) Error!void { defer p.extension_suppressed = saved_extension; p.extension_suppressed = true; - if (try p.parseOrNextDecl(recordDeclarator)) continue; - try p.err(.expected_type); + if (try p.parseOrNextDecl(recordDecl)) continue; + try p.err(p.tok_i, .expected_type, .{}); p.nextExternDecl(); continue; } - if (try p.parseOrNextDecl(recordDeclarator)) continue; + if (try p.parseOrNextDecl(recordDecl)) continue; break; } } -/// recordDeclarator : keyword_extension? declarator (':' integerConstExpr)? -fn recordDeclarator(p: *Parser) Error!bool { +/// recordDecl : typeSpec+ (recordDeclarator (',' recordDeclarator)*)? +/// recordDeclarator : declarator (':' integerConstExpr)? +fn recordDecl(p: *Parser) Error!bool { + const gpa = p.comp.gpa; const attr_buf_top = p.attr_buf.len; defer p.attr_buf.len = attr_buf_top; - const base_ty = (try p.specQual()) orelse return false; + + const base_qt: QualType = blk: { + const start = p.tok_i; + var builder: TypeStore.Builder = .{ .parser = p }; + while (true) { + if (try p.typeSpec(&builder)) continue; + const id = p.tok_ids[p.tok_i]; + switch (id) { + .keyword_auto => { + if (!p.comp.langopts.standard.atLeast(.c23)) break; + + try p.err(p.tok_i, .c23_auto_not_allowed, .{if (p.record.kind == .keyword_struct) "struct member" else "union member"}); + try builder.combine(.c23_auto, p.tok_i); + }, + .keyword_auto_type => { + try p.err(p.tok_i, .auto_type_extension, .{}); + try p.err(p.tok_i, .auto_type_not_allowed, .{if (p.record.kind == .keyword_struct) "struct member" else "union member"}); + try builder.combine(.auto_type, p.tok_i); + }, + .identifier, .extended_identifier => { + if (builder.type != .none) break; + try p.err(p.tok_i, .unknown_type_name, .{p.tokSlice(p.tok_i)}); + builder.type = .{ .other = .invalid }; + }, + else => break, + } + p.tok_i += 1; + break; + } + if (p.tok_i == start) return false; + break :blk switch (builder.type) { + .auto_type, .c23_auto => .invalid, + else => try builder.finish(), + }; + }; try p.attributeSpecifier(); // .record + var error_on_unnamed = false; while (true) { const this_decl_top = p.attr_buf.len; defer p.attr_buf.len = this_decl_top; @@ -2351,43 +2655,40 @@ fn recordDeclarator(p: *Parser) Error!bool { // 0 means unnamed var name_tok: TokenIndex = 0; - var ty = base_ty; - if (ty.is(.auto_type)) { - try p.errStr(.auto_type_not_allowed, p.tok_i, if (p.record.kind == .keyword_struct) "struct member" else "union member"); - ty = Type.invalid; - } - var bits_node: NodeIndex = .none; + var qt = base_qt; + var bits_node: ?Node.Index = null; var bits: ?u32 = null; const first_tok = p.tok_i; - if (try p.declarator(ty, .record)) |d| { + if (try p.declarator(qt, .record)) |d| { name_tok = d.name; - ty = d.ty; + qt = d.qt; + error_on_unnamed = true; } if (p.eatToken(.colon)) |_| bits: { const bits_tok = p.tok_i; const res = try p.integerConstExpr(.gnu_folding_extension); - if (!ty.isInt()) { - try p.errStr(.non_int_bitfield, first_tok, try p.typeStr(ty)); + if (!qt.isInvalid() and !qt.isRealInt(p.comp)) { + try p.err(first_tok, .non_int_bitfield, .{qt}); break :bits; } if (res.val.opt_ref == .none) { - try p.errTok(.expected_integer_constant_expr, bits_tok); + try p.err(bits_tok, .expected_integer_constant_expr, .{}); break :bits; - } else if (res.val.compare(.lt, Value.zero, p.comp)) { - try p.errStr(.negative_bitwidth, first_tok, try res.str(p)); + } else if (res.val.compare(.lt, .zero, p.comp)) { + try p.err(first_tok, .negative_bitwidth, .{res}); break :bits; } // incomplete size error is reported later - const bit_size = ty.bitSizeof(p.comp) orelse break :bits; + const bit_size = qt.bitSizeofOrNull(p.comp) orelse break :bits; const bits_unchecked = res.val.toInt(u32, p.comp) orelse std.math.maxInt(u32); if (bits_unchecked > bit_size) { - try p.errTok(.bitfield_too_big, name_tok); + try p.err(name_tok, .bitfield_too_big, .{}); break :bits; } else if (bits_unchecked == 0 and name_tok != 0) { - try p.errTok(.zero_width_named_field, name_tok); + try p.err(name_tok, .zero_width_named_field, .{}); break :bits; } @@ -2396,85 +2697,126 @@ fn recordDeclarator(p: *Parser) Error!bool { } try p.attributeSpecifier(); // .record - const to_append = try Attribute.applyFieldAttributes(p, &ty, attr_buf_top); - const any_fields_have_attrs = p.field_attr_buf.items.len > p.record.field_attr_start; + const to_append = try Attribute.applyFieldAttributes(p, &qt, attr_buf_top); - if (any_fields_have_attrs) { - try p.field_attr_buf.append(to_append); - } else { - if (to_append.len > 0) { - const preceding = p.record_members.items.len - p.record.start; - if (preceding > 0) { - try p.field_attr_buf.appendNTimes(&.{}, preceding); - } - try p.field_attr_buf.append(to_append); - } - } + const attr_index: u32 = @intCast(p.comp.type_store.attributes.items.len); + const attr_len: u32 = @intCast(to_append.len); + try p.comp.type_store.attributes.appendSlice(gpa, to_append); - if (name_tok == 0 and bits_node == .none) unnamed: { - if (ty.is(.@"enum") or ty.hasIncompleteSize()) break :unnamed; - if (ty.isAnonymousRecord(p.comp)) { - // An anonymous record appears as indirect fields on the parent - try p.record_buf.append(.{ - .name = try p.getAnonymousName(first_tok), - .ty = ty, - }); - const node = try p.addNode(.{ - .tag = .indirect_record_field_decl, - .ty = ty, - .data = undefined, - .loc = @enumFromInt(first_tok), - }); - try p.decl_buf.append(node); - try p.record.addFieldsFromAnonymous(p, ty); - break; // must be followed by a semicolon + if (name_tok == 0 and bits == null) unnamed: { + var is_typedef = false; + if (!qt.isInvalid()) loop: switch (qt.type(p.comp)) { + .attributed => |attributed_ty| continue :loop attributed_ty.base.type(p.comp), + .typedef => |typedef_ty| { + is_typedef = true; + continue :loop typedef_ty.base.type(p.comp); + }, + // typeof intentionally ignored here + .@"enum" => break :unnamed, + .@"struct", .@"union" => |record_ty| if ((record_ty.isAnonymous(p.comp) and !is_typedef) or + (p.comp.langopts.ms_extensions and is_typedef)) + { + if (!(record_ty.isAnonymous(p.comp) and !is_typedef)) { + try p.err(first_tok, .anonymous_struct, .{}); + } + // An anonymous record appears as indirect fields on the parent + try p.record_buf.append(gpa, .{ + .name = try p.getAnonymousName(first_tok), + .qt = qt, + ._attr_index = attr_index, + ._attr_len = attr_len, + }); + + const node = try p.addNode(.{ + .record_field = .{ + .name_or_first_tok = name_tok, + .qt = qt, + .bit_width = null, + }, + }); + try p.decl_buf.append(gpa, node); + try p.record.addFieldsFromAnonymous(p, record_ty); + break; // must be followed by a semicolon + }, + else => {}, + }; + if (error_on_unnamed) { + try p.err(first_tok, .expected_member_name, .{}); + } else { + try p.err(p.tok_i, .missing_declaration, .{}); } - try p.err(.missing_declaration); + if (p.eatToken(.comma) == null) break; + continue; } else { - const interned_name = if (name_tok != 0) try StrInt.intern(p.comp, p.tokSlice(name_tok)) else try p.getAnonymousName(first_tok); - try p.record_buf.append(.{ + const interned_name = if (name_tok != 0) try p.comp.internString(p.tokSlice(name_tok)) else try p.getAnonymousName(first_tok); + try p.record_buf.append(gpa, .{ .name = interned_name, - .ty = ty, + .qt = qt, .name_tok = name_tok, - .bit_width = bits, + .bit_width = if (bits) |some| @enumFromInt(some) else .null, + ._attr_index = attr_index, + ._attr_len = attr_len, }); if (name_tok != 0) try p.record.addField(p, interned_name, name_tok); const node = try p.addNode(.{ - .tag = .record_field_decl, - .ty = ty, - .data = .{ .decl = .{ .name = name_tok, .node = bits_node } }, - .loc = @enumFromInt(if (name_tok != 0) name_tok else first_tok), + .record_field = .{ + .name_or_first_tok = name_tok, + .qt = qt, + .bit_width = bits_node, + }, }); - try p.decl_buf.append(node); + try p.decl_buf.append(gpa, node); } - if (ty.isFunc()) { - try p.errTok(.func_field, first_tok); - } else if (ty.is(.variable_len_array)) { - try p.errTok(.vla_field, first_tok); - } else if (ty.is(.incomplete_array)) { - if (p.record.kind == .keyword_union) { - try p.errTok(.flexible_in_union, first_tok); - } - if (p.record.flexible_field) |some| { - if (p.record.kind == .keyword_struct) { - try p.errTok(.flexible_non_final, some); - } + if (!qt.isInvalid()) { + const field_type = qt.base(p.comp); + switch (field_type.type) { + .func => { + try p.err(first_tok, .func_field, .{}); + qt = .invalid; + }, + .array => |array_ty| switch (array_ty.len) { + .static, .unspecified_variable => unreachable, + .variable => { + try p.err(first_tok, .vla_field, .{}); + qt = .invalid; + }, + .fixed => {}, + .incomplete => { + if (p.record.kind == .keyword_union) { + if (p.comp.langopts.emulate == .msvc) { + try p.err(first_tok, .flexible_in_union_msvc, .{}); + } else { + try p.err(first_tok, .flexible_in_union, .{}); + qt = .invalid; + } + } + if (p.record.flexible_field) |some| { + if (p.record.kind == .keyword_struct) { + try p.err(some, .flexible_non_final, .{}); + } + } + p.record.flexible_field = first_tok; + }, + }, + else => if (field_type.qt.hasIncompleteSize(p.comp)) { + try p.err(first_tok, .field_incomplete_ty, .{qt}); + } else if (p.record.flexible_field) |some| { + std.debug.assert(some != first_tok); + if (p.record.kind == .keyword_struct) try p.err(some, .flexible_non_final, .{}); + }, } - p.record.flexible_field = first_tok; - } else if (ty.specifier != .invalid and ty.hasIncompleteSize()) { - try p.errStr(.field_incomplete_ty, first_tok, try p.typeStr(ty)); - } else if (p.record.flexible_field) |some| { - if (some != first_tok and p.record.kind == .keyword_struct) try p.errTok(.flexible_non_final, some); } + if (p.eatToken(.comma) == null) break; + error_on_unnamed = true; } if (p.eatToken(.semicolon) == null) { const tok_id = p.tok_ids[p.tok_i]; if (tok_id == .r_brace) { - try p.err(.missing_semicolon); + try p.err(p.tok_i, .missing_semicolon, .{}); } else { return p.errExpectedToken(.semicolon, tok_id); } @@ -2483,11 +2825,11 @@ fn recordDeclarator(p: *Parser) Error!bool { return true; } -/// specQual : (typeSpec | typeQual | alignSpec)+ -fn specQual(p: *Parser) Error!?Type { - var spec: Type.Builder = .{}; - if (try p.typeSpec(&spec)) { - return try spec.finish(p); +/// specQual : typeSpec+ +fn specQual(p: *Parser) Error!?QualType { + var builder: TypeStore.Builder = .{ .parser = p }; + if (try p.typeSpec(&builder)) { + return try builder.finish(); } return null; } @@ -2495,7 +2837,8 @@ fn specQual(p: *Parser) Error!?Type { /// enumSpec /// : keyword_enum IDENTIFIER? (: typeName)? { enumerator (',' enumerator)? ',') } /// | keyword_enum IDENTIFIER (: typeName)? -fn enumSpec(p: *Parser) Error!Type { +fn enumSpec(p: *Parser) Error!QualType { + const gpa = p.comp.gpa; const enum_tok = p.tok_i; p.tok_i += 1; const attr_buf_top = p.attr_buf.len; @@ -2503,7 +2846,7 @@ fn enumSpec(p: *Parser) Error!Type { try p.attributeSpecifier(); const maybe_ident = try p.eatIdentifier(); - const fixed_ty = if (p.eatToken(.colon)) |colon| fixed: { + const fixed_qt = if (p.eatToken(.colon)) |colon| fixed: { const ty_start = p.tok_i; const fixed = (try p.specQual()) orelse { if (p.record.kind != .invalid) { @@ -2511,53 +2854,60 @@ fn enumSpec(p: *Parser) Error!Type { p.tok_i -= 1; break :fixed null; } - try p.err(.expected_type); - try p.errTok(.enum_fixed, colon); + try p.err(p.tok_i, .expected_type, .{}); + try p.err(colon, .enum_fixed, .{}); break :fixed null; }; - if (!fixed.isInt() or fixed.is(.@"enum")) { - try p.errStr(.invalid_type_underlying_enum, ty_start, try p.typeStr(fixed)); - break :fixed Type.int; + const fixed_sk = fixed.scalarKind(p.comp); + if (fixed_sk == .@"enum" or !fixed_sk.isInt() or !fixed_sk.isReal()) { + try p.err(ty_start, .invalid_type_underlying_enum, .{fixed}); + break :fixed null; } - try p.errTok(.enum_fixed, colon); + try p.err(colon, .enum_fixed, .{}); break :fixed fixed; } else null; + const reserved_index = try p.tree.nodes.addOne(gpa); + const l_brace = p.eatToken(.l_brace) orelse { const ident = maybe_ident orelse { - try p.err(.ident_or_l_brace); + try p.err(p.tok_i, .ident_or_l_brace, .{}); return error.ParsingFailed; }; // check if this is a reference to a previous type - const interned_name = try StrInt.intern(p.comp, p.tokSlice(ident)); - if (try p.syms.findTag(p, interned_name, .keyword_enum, ident, p.tok_ids[p.tok_i])) |prev| { + const interned_name = try p.comp.internString(p.tokSlice(ident)); + if (try p.syms.findTag(p, interned_name, p.tok_ids[enum_tok], ident, p.tok_ids[p.tok_i])) |prev| { // only check fixed underlying type in forward declarations and not in references. if (p.tok_ids[p.tok_i] == .semicolon) - try p.checkEnumFixedTy(fixed_ty, ident, prev); - return prev.ty; + try p.checkEnumFixedTy(fixed_qt, ident, prev); + return prev.qt; } else { - // this is a forward declaration, create a new enum Type. - const enum_ty = try Type.Enum.create(p.arena, interned_name, fixed_ty); - const ty = try Attribute.applyTypeAttributes(p, .{ - .specifier = .@"enum", - .data = .{ .@"enum" = enum_ty }, - }, attr_buf_top, null); - try p.syms.define(p.gpa, .{ + const enum_qt = try p.comp.type_store.put(gpa, .{ .@"enum" = .{ + .name = interned_name, + .tag = fixed_qt, + .fixed = fixed_qt != null, + .incomplete = true, + .decl_node = @enumFromInt(reserved_index), + .fields = &.{}, + } }); + + const attributed_qt = try Attribute.applyTypeAttributes(p, enum_qt, attr_buf_top, null); + try p.syms.define(gpa, .{ .kind = .@"enum", .name = interned_name, .tok = ident, - .ty = ty, + .qt = attributed_qt, .val = .{}, }); - try p.decl_buf.append(try p.addNode(.{ - .tag = .enum_forward_decl, - .ty = ty, - .data = .{ .decl_ref = ident }, - .loc = @enumFromInt(ident), - })); - return ty; + + try p.decl_buf.append(gpa, try p.addNode(.{ .enum_forward_decl = .{ + .name_or_kind_tok = ident, + .container_qt = attributed_qt, + .definition = null, + } })); + return attributed_qt; } }; @@ -2566,26 +2916,41 @@ fn enumSpec(p: *Parser) Error!Type { // Get forward declared type or create a new one var defined = false; - const enum_ty: *Type.Enum = if (maybe_ident) |ident| enum_ty: { - const ident_str = p.tokSlice(ident); - const interned_name = try StrInt.intern(p.comp, ident_str); - if (try p.syms.defineTag(p, interned_name, .keyword_enum, ident)) |prev| { - const enum_ty = prev.ty.get(.@"enum").?.data.@"enum"; - if (!enum_ty.isIncomplete() and !enum_ty.fixed) { - // if the enum isn't incomplete, this is a redefinition - try p.errStr(.redefinition, ident, ident_str); - try p.errTok(.previous_definition, prev.tok); - } else { - try p.checkEnumFixedTy(fixed_ty, ident, prev); - defined = true; - break :enum_ty enum_ty; + var enum_ty: Type.Enum, const qt: QualType = blk: { + const interned_name = if (maybe_ident) |ident| interned: { + const ident_str = p.tokSlice(ident); + const interned_name = try p.comp.internString(ident_str); + if (try p.syms.defineTag(p, interned_name, p.tok_ids[enum_tok], ident)) |prev| { + const enum_ty = prev.qt.get(p.comp, .@"enum").?; + if (!enum_ty.incomplete) { + // if the record isn't incomplete, this is a redefinition + try p.err(ident, .redefinition, .{ident_str}); + try p.err(prev.tok, .previous_definition, .{}); + } else { + try p.checkEnumFixedTy(fixed_qt, ident, prev); + defined = true; + break :blk .{ enum_ty, prev.qt }; + } } - } - break :enum_ty try Type.Enum.create(p.arena, interned_name, fixed_ty); - } else try Type.Enum.create(p.arena, try p.getAnonymousName(enum_tok), fixed_ty); + break :interned interned_name; + } else try p.getAnonymousName(enum_tok); + + // Initially create ty as a regular non-attributed type, since attributes for a record + // can be specified after the closing rbrace, which we haven't encountered yet. + const enum_ty: Type.Enum = .{ + .name = interned_name, + .decl_node = @enumFromInt(reserved_index), + .tag = fixed_qt, + .incomplete = true, + .fixed = fixed_qt != null, + .fields = &.{}, + }; + const enum_qt = try p.comp.type_store.put(gpa, .{ .@"enum" = enum_ty }); + break :blk .{ enum_ty, enum_qt }; + }; // reserve space for this enum - try p.decl_buf.append(.none); + try p.decl_buf.append(gpa, @enumFromInt(reserved_index)); const decl_buf_top = p.decl_buf.items.len; const list_buf_top = p.list_buf.items.len; const enum_buf_top = p.enum_buf.items.len; @@ -2596,187 +2961,190 @@ fn enumSpec(p: *Parser) Error!Type { p.enum_buf.items.len = enum_buf_top; } - var e = Enumerator.init(fixed_ty); + var e = Enumerator.init(fixed_qt); while (try p.enumerator(&e)) |field_and_node| { - try p.enum_buf.append(field_and_node.field); - try p.list_buf.append(field_and_node.node); + try p.enum_buf.append(gpa, field_and_node.field); + try p.list_buf.append(gpa, field_and_node.node); if (p.eatToken(.comma) == null) break; } - if (p.enum_buf.items.len == enum_buf_top) try p.err(.empty_enum); + if (p.enum_buf.items.len == enum_buf_top) try p.err(p.tok_i, .empty_enum, .{}); try p.expectClosing(l_brace, .r_brace); done = true; try p.attributeSpecifier(); - const ty = try Attribute.applyTypeAttributes(p, .{ - .specifier = .@"enum", - .data = .{ .@"enum" = enum_ty }, - }, attr_buf_top, null); + const attributed_qt = try Attribute.applyTypeAttributes(p, qt, attr_buf_top, null); if (!enum_ty.fixed) { - const tag_specifier = try e.getTypeSpecifier(p, ty.enumIsPacked(p.comp), maybe_ident orelse enum_tok); - enum_ty.tag_ty = .{ .specifier = tag_specifier }; + enum_ty.tag = try e.getTypeSpecifier(p, attributed_qt.enumIsPacked(p.comp), maybe_ident orelse enum_tok); } const enum_fields = p.enum_buf.items[enum_buf_top..]; const field_nodes = p.list_buf.items[list_buf_top..]; - if (fixed_ty == null) { - for (enum_fields, 0..) |*field, i| { - if (field.ty.eql(Type.int, p.comp, false)) continue; + if (fixed_qt == null) { + // Coerce all fields to final type. + for (enum_fields, field_nodes) |*field, field_node| { + if (field.qt.eql(.int, p.comp)) continue; const sym = p.syms.get(field.name, .vars) orelse continue; if (sym.kind != .enumeration) continue; // already an error - var res = Result{ .node = field.node, .ty = field.ty, .val = sym.val }; - const dest_ty = if (p.comp.fixedEnumTagSpecifier()) |some| - Type{ .specifier = some } - else if (try res.intFitsInType(p, Type.int)) - Type.int - else if (!res.ty.eql(enum_ty.tag_ty, p.comp, false)) - enum_ty.tag_ty + var res: Result = .{ .node = undefined, .qt = field.qt, .val = sym.val }; + const dest_ty: QualType = if (p.comp.fixedEnumTagType()) |some| + some + else if (try res.intFitsInType(p, .int)) + .int + else if (!res.qt.eql(enum_ty.tag.?, p.comp)) + enum_ty.tag.? else continue; const symbol = p.syms.getPtr(field.name, .vars); _ = try symbol.val.intCast(dest_ty, p.comp); - symbol.ty = dest_ty; - p.nodes.items(.ty)[@intFromEnum(field_nodes[i])] = dest_ty; - field.ty = dest_ty; - res.ty = dest_ty; + try p.tree.value_map.put(gpa, field_node, symbol.val); + + symbol.qt = dest_ty; + field.qt = dest_ty; + res.qt = dest_ty; - if (res.node != .none) { - try res.implicitCast(p, .int_cast); - field.node = res.node; - p.nodes.items(.data)[@intFromEnum(field_nodes[i])].decl.node = res.node; + // Create a new enum_field node with the correct type. + var new_field_node = field_node.get(&p.tree); + new_field_node.enum_field.qt = dest_ty; + + if (new_field_node.enum_field.init) |some| { + res.node = some; + try res.implicitCast(p, .int_cast, some.tok(&p.tree)); + new_field_node.enum_field.init = res.node; } + + try p.tree.setNode(new_field_node, @intFromEnum(field_node)); } } - enum_ty.fields = try p.arena.dupe(Type.Enum.Field, enum_fields); + { // Override previous incomplete type + enum_ty.fields = enum_fields; + enum_ty.incomplete = false; + enum_ty.decl_node = @enumFromInt(reserved_index); + const base_type = attributed_qt.base(p.comp); + std.debug.assert(base_type.type.@"enum".name == enum_ty.name); + try p.comp.type_store.set(gpa, .{ .@"enum" = enum_ty }, @intFromEnum(base_type.qt._index)); + } // declare a symbol for the type if (maybe_ident != null and !defined) { - try p.syms.define(p.gpa, .{ + try p.syms.define(gpa, .{ .kind = .@"enum", .name = enum_ty.name, - .ty = ty, + .qt = attributed_qt, .tok = maybe_ident.?, .val = .{}, }); } // finish by creating a node - var node: Tree.Node = .{ - .tag = .enum_decl_two, - .ty = ty, - .data = .{ - .two = .{ .none, .none }, - }, - .loc = @enumFromInt(maybe_ident orelse enum_tok), - }; - switch (field_nodes.len) { - 0 => {}, - 1 => node.data = .{ .two = .{ field_nodes[0], .none } }, - 2 => node.data = .{ .two = .{ field_nodes[0], field_nodes[1] } }, - else => { - node.tag = .enum_decl; - node.data = .{ .range = try p.addList(field_nodes) }; - }, - } - p.decl_buf.items[decl_buf_top - 1] = try p.addNode(node); - if (p.func.ty == null) { + try p.tree.setNode(.{ .enum_decl = .{ + .name_or_kind_tok = maybe_ident orelse enum_tok, + .container_qt = attributed_qt, + .fields = field_nodes, + } }, reserved_index); + + if (p.func.qt == null) { _ = p.tentative_defs.remove(enum_ty.name); } - return ty; + return attributed_qt; } -fn checkEnumFixedTy(p: *Parser, fixed_ty: ?Type, ident_tok: TokenIndex, prev: Symbol) !void { - const enum_ty = prev.ty.get(.@"enum").?.data.@"enum"; - if (fixed_ty) |some| { +fn checkEnumFixedTy(p: *Parser, fixed_qt: ?QualType, ident_tok: TokenIndex, prev: Symbol) !void { + const enum_ty = prev.qt.get(p.comp, .@"enum").?; + if (fixed_qt) |some| { if (!enum_ty.fixed) { - try p.errTok(.enum_prev_nonfixed, ident_tok); - try p.errTok(.previous_definition, prev.tok); + try p.err(ident_tok, .enum_prev_nonfixed, .{}); + try p.err(prev.tok, .previous_definition, .{}); return error.ParsingFailed; } - if (!enum_ty.tag_ty.eql(some, p.comp, false)) { - const str = try p.typePairStrExtra(some, " (was ", enum_ty.tag_ty); - try p.errStr(.enum_different_explicit_ty, ident_tok, str); - try p.errTok(.previous_definition, prev.tok); + if (!enum_ty.tag.?.eql(some, p.comp)) { + try p.err(ident_tok, .enum_different_explicit_ty, .{ some, enum_ty.tag.? }); + try p.err(prev.tok, .previous_definition, .{}); return error.ParsingFailed; } } else if (enum_ty.fixed) { - try p.errTok(.enum_prev_fixed, ident_tok); - try p.errTok(.previous_definition, prev.tok); + try p.err(ident_tok, .enum_prev_fixed, .{}); + try p.err(prev.tok, .previous_definition, .{}); return error.ParsingFailed; } } const Enumerator = struct { - res: Result, + val: Value = .{}, + qt: QualType, num_positive_bits: usize = 0, num_negative_bits: usize = 0, fixed: bool, - fn init(fixed_ty: ?Type) Enumerator { + fn init(fixed_ty: ?QualType) Enumerator { return .{ - .res = .{ .ty = fixed_ty orelse .{ .specifier = .int } }, + .qt = fixed_ty orelse .int, .fixed = fixed_ty != null, }; } /// Increment enumerator value adjusting type if needed. fn incr(e: *Enumerator, p: *Parser, tok: TokenIndex) !void { - e.res.node = .none; - const old_val = e.res.val; + const old_val = e.val; if (old_val.opt_ref == .none) { // First enumerator, set to 0 fits in all types. - e.res.val = Value.zero; + e.val = .zero; return; } - if (try e.res.val.add(e.res.val, Value.one, e.res.ty, p.comp)) { + if (try e.val.add(e.val, .one, e.qt, p.comp)) { if (e.fixed) { - try p.errStr(.enum_not_representable_fixed, tok, try p.typeStr(e.res.ty)); + try p.err(tok, .enum_not_representable_fixed, .{e.qt}); return; } - const new_ty = if (p.comp.nextLargestIntSameSign(e.res.ty)) |larger| blk: { - try p.errTok(.enumerator_overflow, tok); - break :blk larger; - } else blk: { - const signed = !e.res.ty.isUnsignedInt(p.comp); - const bit_size: u8 = @intCast(e.res.ty.bitSizeof(p.comp).? - @intFromBool(signed)); - try p.errExtra(.enum_not_representable, tok, .{ .pow_2_as_string = bit_size }); - break :blk Type{ .specifier = .ulong_long }; - }; - e.res.ty = new_ty; - _ = try e.res.val.add(old_val, Value.one, e.res.ty, p.comp); + if (p.comp.nextLargestIntSameSign(e.qt)) |larger| { + try p.err(tok, .enumerator_overflow, .{}); + e.qt = larger; + } else { + const signed = e.qt.signedness(p.comp) == .signed; + const bit_size = e.qt.bitSizeof(p.comp) - @intFromBool(signed); + try p.err(tok, .enum_not_representable, .{switch (bit_size) { + 63 => "9223372036854775808", + 64 => "18446744073709551616", + 127 => "170141183460469231731687303715884105728", + 128 => "340282366920938463463374607431768211456", + else => unreachable, + }}); + e.qt = .ulong_long; + } + _ = try e.val.add(old_val, .one, e.qt, p.comp); } } /// Set enumerator value to specified value. - fn set(e: *Enumerator, p: *Parser, res: Result, tok: TokenIndex) !void { - if (res.ty.specifier == .invalid) return; - if (e.fixed and !res.ty.eql(e.res.ty, p.comp, false)) { - if (!try res.intFitsInType(p, e.res.ty)) { - try p.errStr(.enum_not_representable_fixed, tok, try p.typeStr(e.res.ty)); + fn set(e: *Enumerator, p: *Parser, res: *Result, tok: TokenIndex) !void { + if (res.qt.isInvalid()) return; + if (e.fixed and !res.qt.eql(e.qt, p.comp)) { + if (!try res.intFitsInType(p, e.qt)) { + try p.err(tok, .enum_not_representable_fixed, .{e.qt}); return error.ParsingFailed; } - var copy = res; - copy.ty = e.res.ty; - try copy.implicitCast(p, .int_cast); - e.res = copy; + res.qt = e.qt; + try res.implicitCast(p, .int_cast, tok); + e.val = res.val; } else { - e.res = res; - try e.res.intCast(p, e.res.ty.integerPromotion(p.comp), tok); + try res.castToInt(p, res.qt.promoteInt(p.comp), tok); + e.qt = res.qt; + e.val = res.val; } } - fn getTypeSpecifier(e: *const Enumerator, p: *Parser, is_packed: bool, tok: TokenIndex) !Type.Specifier { - if (p.comp.fixedEnumTagSpecifier()) |tag_specifier| return tag_specifier; + fn getTypeSpecifier(e: *const Enumerator, p: *Parser, is_packed: bool, tok: TokenIndex) !QualType { + if (p.comp.fixedEnumTagType()) |tag_specifier| return tag_specifier; - const char_width = (Type{ .specifier = .schar }).sizeof(p.comp).? * 8; - const short_width = (Type{ .specifier = .short }).sizeof(p.comp).? * 8; - const int_width = (Type{ .specifier = .int }).sizeof(p.comp).? * 8; + const char_width = Type.Int.schar.bits(p.comp); + const short_width = Type.Int.short.bits(p.comp); + const int_width = Type.Int.int.bits(p.comp); if (e.num_negative_bits > 0) { if (is_packed and e.num_negative_bits <= char_width and e.num_positive_bits < char_width) { return .schar; @@ -2785,13 +3153,13 @@ const Enumerator = struct { } else if (e.num_negative_bits <= int_width and e.num_positive_bits < int_width) { return .int; } - const long_width = (Type{ .specifier = .long }).sizeof(p.comp).? * 8; + const long_width = Type.Int.long.bits(p.comp); if (e.num_negative_bits <= long_width and e.num_positive_bits < long_width) { return .long; } - const long_long_width = (Type{ .specifier = .long_long }).sizeof(p.comp).? * 8; + const long_long_width = Type.Int.long_long.bits(p.comp); if (e.num_negative_bits > long_long_width or e.num_positive_bits >= long_long_width) { - try p.errTok(.enum_too_large, tok); + try p.err(tok, .enum_too_large, .{}); } return .long_long; } @@ -2801,21 +3169,21 @@ const Enumerator = struct { return .ushort; } else if (e.num_positive_bits <= int_width) { return .uint; - } else if (e.num_positive_bits <= (Type{ .specifier = .long }).sizeof(p.comp).? * 8) { + } else if (e.num_positive_bits <= Type.Int.long.bits(p.comp)) { return .ulong; } return .ulong_long; } }; -const EnumFieldAndNode = struct { field: Type.Enum.Field, node: NodeIndex }; +const EnumFieldAndNode = struct { field: Type.Enum.Field, node: Node.Index }; /// enumerator : IDENTIFIER ('=' integerConstExpr) fn enumerator(p: *Parser, e: *Enumerator) Error!?EnumFieldAndNode { _ = try p.pragma(); const name_tok = (try p.eatIdentifier()) orelse { if (p.tok_ids[p.tok_i] == .r_brace) return null; - try p.err(.expected_identifier); + try p.err(p.tok_i, .expected_identifier, .{}); p.skipTo(.r_brace); return error.ParsingFailed; }; @@ -2823,83 +3191,85 @@ fn enumerator(p: *Parser, e: *Enumerator) Error!?EnumFieldAndNode { defer p.attr_buf.len = attr_buf_top; try p.attributeSpecifier(); - const err_start = p.comp.diagnostics.list.items.len; - if (p.eatToken(.equal)) |_| { - const specified = try p.integerConstExpr(.gnu_folding_extension); + const prev_total = p.diagnostics.total; + const field_init = if (p.eatToken(.equal)) |_| blk: { + var specified = try p.integerConstExpr(.gnu_folding_extension); if (specified.val.opt_ref == .none) { - try p.errTok(.enum_val_unavailable, name_tok + 2); + try p.err(name_tok + 2, .enum_val_unavailable, .{}); try e.incr(p, name_tok); + break :blk null; } else { - try e.set(p, specified, name_tok); + try e.set(p, &specified, name_tok); + break :blk specified.node; } - } else { + } else blk: { try e.incr(p, name_tok); - } - - var res = e.res; - res.ty = try Attribute.applyEnumeratorAttributes(p, res.ty, attr_buf_top); + break :blk null; + }; - if (res.ty.isUnsignedInt(p.comp) or res.val.compare(.gte, Value.zero, p.comp)) { - e.num_positive_bits = @max(e.num_positive_bits, res.val.minUnsignedBits(p.comp)); + if (e.qt.signedness(p.comp) == .unsigned or e.val.compare(.gte, .zero, p.comp)) { + e.num_positive_bits = @max(e.num_positive_bits, e.val.minUnsignedBits(p.comp)); } else { - e.num_negative_bits = @max(e.num_negative_bits, res.val.minSignedBits(p.comp)); + e.num_negative_bits = @max(e.num_negative_bits, e.val.minSignedBits(p.comp)); } - if (err_start == p.comp.diagnostics.list.items.len) { + if (prev_total == p.diagnostics.total) { // only do these warnings if we didn't already warn about overflow or non-representable values - if (e.res.val.compare(.lt, Value.zero, p.comp)) { - const min_val = try Value.minInt(Type.int, p.comp); - if (e.res.val.compare(.lt, min_val, p.comp)) { - try p.errStr(.enumerator_too_small, name_tok, try e.res.str(p)); + if (e.val.compare(.lt, .zero, p.comp)) { + const min_val = try Value.minInt(.int, p.comp); + if (e.val.compare(.lt, min_val, p.comp)) { + try p.err(name_tok, .enumerator_too_small, .{e}); } } else { - const max_val = try Value.maxInt(Type.int, p.comp); - if (e.res.val.compare(.gt, max_val, p.comp)) { - try p.errStr(.enumerator_too_large, name_tok, try e.res.str(p)); + const max_val = try Value.maxInt(.int, p.comp); + if (e.val.compare(.gt, max_val, p.comp)) { + try p.err(name_tok, .enumerator_too_large, .{e}); } } } - const interned_name = try StrInt.intern(p.comp, p.tokSlice(name_tok)); - try p.syms.defineEnumeration(p, interned_name, res.ty, name_tok, e.res.val); + const attributed_qt = try Attribute.applyEnumeratorAttributes(p, e.qt, attr_buf_top); const node = try p.addNode(.{ - .tag = .enum_field_decl, - .ty = res.ty, - .data = .{ .decl = .{ - .name = name_tok, - .node = res.node, - } }, - .loc = @enumFromInt(name_tok), + .enum_field = .{ + .name_tok = name_tok, + .qt = attributed_qt, + .init = field_init, + }, }); - try p.value_map.put(node, e.res.val); - return EnumFieldAndNode{ .field = .{ + try p.tree.value_map.put(p.comp.gpa, node, e.val); + + const interned_name = try p.comp.internString(p.tokSlice(name_tok)); + try p.syms.defineEnumeration(p, interned_name, attributed_qt, name_tok, e.val, node); + + return .{ .field = .{ .name = interned_name, - .ty = res.ty, + .qt = attributed_qt, .name_tok = name_tok, - .node = res.node, }, .node = node }; } /// typeQual : keyword_const | keyword_restrict | keyword_volatile | keyword_atomic -fn typeQual(p: *Parser, b: *Type.Qualifiers.Builder) Error!bool { +fn typeQual(p: *Parser, b: *TypeStore.Builder, allow_attr: bool) Error!bool { var any = false; while (true) { + if (allow_attr and try p.msTypeAttribute()) continue; + if (allow_attr) try p.attributeSpecifier(); switch (p.tok_ids[p.tok_i]) { .keyword_restrict, .keyword_restrict1, .keyword_restrict2 => { if (b.restrict != null) - try p.errStr(.duplicate_decl_spec, p.tok_i, "restrict") + try p.err(p.tok_i, .duplicate_decl_spec, .{"restrict"}) else b.restrict = p.tok_i; }, .keyword_const, .keyword_const1, .keyword_const2 => { if (b.@"const" != null) - try p.errStr(.duplicate_decl_spec, p.tok_i, "const") + try p.err(p.tok_i, .duplicate_decl_spec, .{"const"}) else b.@"const" = p.tok_i; }, .keyword_volatile, .keyword_volatile1, .keyword_volatile2 => { if (b.@"volatile" != null) - try p.errStr(.duplicate_decl_spec, p.tok_i, "volatile") + try p.err(p.tok_i, .duplicate_decl_spec, .{"volatile"}) else b.@"volatile" = p.tok_i; }, @@ -2907,10 +3277,51 @@ fn typeQual(p: *Parser, b: *Type.Qualifiers.Builder) Error!bool { // _Atomic(typeName) instead of just _Atomic if (p.tok_ids[p.tok_i + 1] == .l_paren) break; if (b.atomic != null) - try p.errStr(.duplicate_decl_spec, p.tok_i, "atomic") + try p.err(p.tok_i, .duplicate_decl_spec, .{"atomic"}) else b.atomic = p.tok_i; }, + .keyword_unaligned, .keyword_unaligned2 => { + if (b.unaligned != null) + try p.err(p.tok_i, .duplicate_decl_spec, .{"__unaligned"}) + else + b.unaligned = p.tok_i; + }, + .keyword_nonnull, .keyword_nullable, .keyword_nullable_result, .keyword_null_unspecified => |tok_id| { + const sym_str = p.tok_ids[p.tok_i].symbol(); + try p.err(p.tok_i, .nullability_extension, .{sym_str}); + const new: @FieldType(TypeStore.Builder, "nullability") = switch (tok_id) { + .keyword_nonnull => .{ .nonnull = p.tok_i }, + .keyword_nullable => .{ .nullable = p.tok_i }, + .keyword_nullable_result => .{ .nullable_result = p.tok_i }, + .keyword_null_unspecified => .{ .null_unspecified = p.tok_i }, + else => unreachable, + }; + if (std.meta.activeTag(b.nullability) == new) { + try p.err(p.tok_i, .duplicate_nullability, .{sym_str}); + } else switch (b.nullability) { + .none => { + b.nullability = new; + try p.attr_buf.append(p.comp.gpa, .{ + .attr = .{ .tag = .nullability, .args = .{ + .nullability = .{ .kind = switch (tok_id) { + .keyword_nonnull => .nonnull, + .keyword_nullable => .nullable, + .keyword_nullable_result => .nullable_result, + .keyword_null_unspecified => .unspecified, + else => unreachable, + } }, + }, .syntax = .keyword }, + .tok = p.tok_i, + }); + }, + .nonnull, + .nullable, + .nullable_result, + .null_unspecified, + => |prev| try p.err(p.tok_i, .conflicting_nullability, .{ p.tok_ids[p.tok_i], p.tok_ids[prev] }), + } + }, else => break, } p.tok_i += 1; @@ -2919,61 +3330,271 @@ fn typeQual(p: *Parser, b: *Type.Qualifiers.Builder) Error!bool { return any; } +fn msTypeAttribute(p: *Parser) !bool { + var any = false; + while (true) { + switch (p.tok_ids[p.tok_i]) { + .keyword_stdcall, + .keyword_stdcall2, + .keyword_thiscall, + .keyword_thiscall2, + .keyword_vectorcall, + .keyword_vectorcall2, + .keyword_fastcall, + .keyword_fastcall2, + .keyword_regcall, + .keyword_cdecl, + .keyword_cdecl2, + => { + try p.attr_buf.append(p.comp.gpa, .{ + .attr = .{ .tag = .calling_convention, .args = .{ + .calling_convention = .{ .cc = switch (p.tok_ids[p.tok_i]) { + .keyword_stdcall, + .keyword_stdcall2, + => .stdcall, + .keyword_thiscall, + .keyword_thiscall2, + => .thiscall, + .keyword_vectorcall, + .keyword_vectorcall2, + => .vectorcall, + .keyword_fastcall, + .keyword_fastcall2, + => .fastcall, + .keyword_regcall, + => .regcall, + .keyword_cdecl, + .keyword_cdecl2, + => .c, + else => unreachable, + } }, + }, .syntax = .keyword }, + .tok = p.tok_i, + }); + any = true; + p.tok_i += 1; + }, + else => break, + } + } + return any; +} + const Declarator = struct { name: TokenIndex, - ty: Type, - func_declarator: ?TokenIndex = null, + qt: QualType, old_style_func: ?TokenIndex = null, -}; -const DeclaratorKind = enum { normal, abstract, param, record }; -/// declarator : pointer? (IDENTIFIER | '(' declarator ')') directDeclarator* -/// abstractDeclarator + /// What kind of a type did this declarator declare? + /// Used redundantly with `qt` in case it was set to `.invalid` by `validate`. + declarator_type: enum { other, func, array, pointer } = .other, + + const Kind = enum { normal, abstract, param, record }; + + fn validate(d: *Declarator, p: *Parser, source_tok: TokenIndex) Parser.Error!void { + switch (try validateExtra(p, d.qt, source_tok)) { + .normal => return, + .nested_invalid => if (d.declarator_type == .func) return, + .nested_auto => { + if (d.declarator_type == .func) return; + if (d.qt.isAutoType() or d.qt.isC23Auto()) return; + }, + .declarator_combine => return, + } + d.qt = .invalid; + } + + const ValidationResult = enum { + nested_invalid, + nested_auto, + declarator_combine, + normal, + }; + + fn validateExtra(p: *Parser, cur: QualType, source_tok: TokenIndex) Parser.Error!ValidationResult { + if (cur.isInvalid()) return .nested_invalid; + if (cur.isAutoType()) return .nested_auto; + if (cur.isC23Auto()) return .nested_auto; + if (cur._index == .declarator_combine) return .declarator_combine; + + switch (cur.type(p.comp)) { + .pointer => |pointer_ty| { + return validateExtra(p, pointer_ty.child, source_tok); + }, + .atomic => |atomic_ty| { + return validateExtra(p, atomic_ty, source_tok); + }, + .array => |array_ty| { + const elem_qt = array_ty.elem; + const child_res = try validateExtra(p, elem_qt, source_tok); + if (child_res != .normal) return child_res; + + if (elem_qt.hasIncompleteSize(p.comp)) { + try p.err(source_tok, .array_incomplete_elem, .{elem_qt}); + return .nested_invalid; + } + switch (array_ty.len) { + .fixed, .static => |len| { + const elem_size = elem_qt.sizeofOrNull(p.comp) orelse 1; + const max_elems = p.comp.maxArrayBytes() / @max(1, elem_size); + if (len > max_elems) { + try p.err(source_tok, .array_too_large, .{}); + return .nested_invalid; + } + }, + else => {}, + } + + if (elem_qt.is(p.comp, .func)) { + try p.err(source_tok, .array_func_elem, .{}); + return .nested_invalid; + } + if (elem_qt.get(p.comp, .array)) |elem_array_ty| { + if (elem_array_ty.len == .static) { + try p.err(source_tok, .static_non_outermost_array, .{}); + } + if (elem_qt.isQualified()) { + try p.err(source_tok, .qualifier_non_outermost_array, .{}); + } + } + return .normal; + }, + .func => |func_ty| { + const ret_qt = func_ty.return_type; + const child_res = try validateExtra(p, ret_qt, source_tok); + if (child_res != .normal) return child_res; + + if (ret_qt.is(p.comp, .array)) try p.err(source_tok, .func_cannot_return_array, .{}); + if (ret_qt.is(p.comp, .func)) try p.err(source_tok, .func_cannot_return_func, .{}); + if (ret_qt.@"const") { + try p.err(source_tok, .qual_on_ret_type, .{"const"}); + } + if (ret_qt.@"volatile") { + try p.err(source_tok, .qual_on_ret_type, .{"volatile"}); + } + if (ret_qt.get(p.comp, .float)) |float| { + if (float == .fp16 and !p.comp.hasHalfPrecisionFloatABI()) { + try p.err(source_tok, .suggest_pointer_for_invalid_fp16, .{"function return value"}); + } + } + return .normal; + }, + else => return .normal, + } + } +}; + +/// declarator : pointer? (IDENTIFIER | '(' declarator ')') directDeclarator* +/// abstractDeclarator /// : pointer? ('(' abstractDeclarator ')')? directAbstractDeclarator* +/// pointer : '*' typeQual* pointer? fn declarator( p: *Parser, - base_type: Type, - kind: DeclaratorKind, + base_qt: QualType, + kind: Declarator.Kind, ) Error!?Declarator { - const start = p.tok_i; - var d = Declarator{ .name = 0, .ty = try p.pointer(base_type) }; - if (base_type.is(.auto_type) and !d.ty.is(.auto_type)) { - try p.errTok(.auto_type_requires_plain_declarator, start); - return error.ParsingFailed; + var d = Declarator{ .name = 0, .qt = base_qt }; + + // Parse potential pointer declarators first. + while (p.eatToken(.asterisk)) |_| { + d.declarator_type = .pointer; + var builder: TypeStore.Builder = .{ .parser = p }; + _ = try p.typeQual(&builder, true); + + const pointer_qt = try p.comp.type_store.put(p.comp.gpa, .{ .pointer = .{ + .child = d.qt, + .decayed = null, + } }); + d.qt = try builder.finishQuals(pointer_qt); } const maybe_ident = p.tok_i; if (kind != .abstract and (try p.eatIdentifier()) != null) { d.name = maybe_ident; const combine_tok = p.tok_i; - d.ty = try p.directDeclarator(d.ty, &d, kind); - try d.ty.validateCombinedType(p, combine_tok); + d.qt = try p.directDeclarator(&d, kind); + try d.validate(p, combine_tok); return d; } else if (p.eatToken(.l_paren)) |l_paren| blk: { - var res = (try p.declarator(.{ .specifier = .void }, kind)) orelse { + // C23 and declspec attributes are not allowed here + while (try p.gnuAttribute()) {} + + // Parse Microsoft keyword type attributes. + _ = try p.msTypeAttribute(); + + const special_marker: QualType = .{ ._index = .declarator_combine }; + var res = (try p.declarator(special_marker, kind)) orelse { p.tok_i = l_paren; break :blk; }; try p.expectClosing(l_paren, .r_paren); const suffix_start = p.tok_i; - const outer = try p.directDeclarator(d.ty, &d, kind); - try res.ty.combine(outer); - try res.ty.validateCombinedType(p, suffix_start); - res.old_style_func = d.old_style_func; - if (d.func_declarator) |some| res.func_declarator = some; + const outer = try p.directDeclarator(&d, kind); + + // Correct the base type now that it is known. + // If res.qt is the special marker there was no inner type. + if (res.qt._index == .declarator_combine) { + res.qt = outer; + res.declarator_type = d.declarator_type; + } else if (outer.isInvalid() or res.qt.isInvalid()) { + res.qt = outer; + } else { + var cur = res.qt; + while (true) { + switch (cur.type(p.comp)) { + .pointer => |pointer_ty| if (pointer_ty.child._index != .declarator_combine) { + cur = pointer_ty.child; + continue; + }, + .atomic => |atomic_ty| if (atomic_ty._index != .declarator_combine) { + cur = atomic_ty; + continue; + }, + .array => |array_ty| if (array_ty.elem._index != .declarator_combine) { + cur = array_ty.elem; + continue; + }, + .func => |func_ty| if (func_ty.return_type._index != .declarator_combine) { + cur = func_ty.return_type; + continue; + }, + else => unreachable, + } + // Child type is always stored in repr.data[0] + p.comp.type_store.types.items(.data)[@intFromEnum(cur._index)][0] = @bitCast(outer); + break; + } + } + + try res.validate(p, suffix_start); return res; } const expected_ident = p.tok_i; - d.ty = try p.directDeclarator(d.ty, &d, kind); - - if (kind == .normal and !d.ty.isEnumOrRecord()) { - try p.errTok(.expected_ident_or_l_paren, expected_ident); - return error.ParsingFailed; + d.qt = try p.directDeclarator(&d, kind); + if (kind == .normal) { + var cur = d.qt; + while (true) { + // QualType.base inlined here because of potential + // .declarator_combine. + if (cur._index == .declarator_combine) break; + switch (cur.type(p.comp)) { + .typeof => |typeof_ty| cur = typeof_ty.base, + .typedef => |typedef_ty| cur = typedef_ty.base, + .attributed => |attributed_ty| cur = attributed_ty.base, + else => |ty| switch (ty) { + .@"enum", .@"struct", .@"union" => break, + else => { + try p.err(expected_ident, .expected_ident_or_l_paren, .{}); + return error.ParsingFailed; + }, + }, + } + } } - try d.ty.validateCombinedType(p, expected_ident); - if (start == p.tok_i) return null; + try d.validate(p, expected_ident); + if (d.qt == base_qt) return null; return d; } @@ -2990,212 +3611,192 @@ fn declarator( /// | '[' typeQual+ keyword_static assignExpr ']' /// | '[' '*' ']' /// | '(' paramDecls? ')' -fn directDeclarator(p: *Parser, base_type: Type, d: *Declarator, kind: DeclaratorKind) Error!Type { +fn directDeclarator( + p: *Parser, + base_declarator: *Declarator, + kind: Declarator.Kind, +) Error!QualType { + const gpa = p.comp.gpa; if (p.eatToken(.l_bracket)) |l_bracket| { + // Check for C23 attribute if (p.tok_ids[p.tok_i] == .l_bracket) { switch (kind) { .normal, .record => if (p.comp.langopts.standard.atLeast(.c23)) { p.tok_i -= 1; - return base_type; + return base_declarator.qt; }, .param, .abstract => {}, } - try p.err(.expected_expr); + try p.err(p.tok_i, .expected_expr, .{}); return error.ParsingFailed; } - var res_ty = Type{ - // so that we can get any restrict type that might be present - .specifier = .pointer, - }; - var quals = Type.Qualifiers.Builder{}; - var got_quals = try p.typeQual(&quals); + var builder: TypeStore.Builder = .{ .parser = p }; + + var got_quals = try p.typeQual(&builder, false); var static = p.eatToken(.keyword_static); - if (static != null and !got_quals) got_quals = try p.typeQual(&quals); + if (static != null and !got_quals) got_quals = try p.typeQual(&builder, false); var star = p.eatToken(.asterisk); const size_tok = p.tok_i; const const_decl_folding = p.const_decl_folding; p.const_decl_folding = .gnu_vla_folding_extension; - const size = if (star) |_| Result{} else try p.assignExpr(); + const opt_size = if (star) |_| null else try p.assignExpr(); p.const_decl_folding = const_decl_folding; try p.expectClosing(l_bracket, .r_bracket); if (star != null and static != null) { - try p.errTok(.invalid_static_star, static.?); + try p.err(static.?, .invalid_static_star, .{}); static = null; } if (kind != .param) { if (static != null) - try p.errTok(.static_non_param, l_bracket) + try p.err(l_bracket, .static_non_param, .{}) else if (got_quals) - try p.errTok(.array_qualifiers, l_bracket); - if (star) |some| try p.errTok(.star_non_param, some); + try p.err(l_bracket, .array_qualifiers, .{}); + if (star) |some| try p.err(some, .star_non_param, .{}); static = null; - quals = .{}; + builder = .{ .parser = p }; star = null; - } else { - try quals.finish(p, &res_ty); } - if (static) |_| try size.expect(p); + if (static) |_| _ = try p.expectResult(opt_size); - if (base_type.is(.auto_type)) { - try p.errStr(.array_of_auto_type, d.name, p.tokSlice(d.name)); - return error.ParsingFailed; - } + const outer = try p.directDeclarator(base_declarator, kind); - const outer = try p.directDeclarator(base_type, d, kind); + // Set after call to `directDeclarator` since we will return an + // array type from here. + base_declarator.declarator_type = .array; - if (!size.ty.isInt()) { - try p.errStr(.array_size_non_int, size_tok, try p.typeStr(size.ty)); + if (opt_size != null and !opt_size.?.qt.isInvalid() and !opt_size.?.qt.isRealInt(p.comp)) { + try p.err(size_tok, .array_size_non_int, .{opt_size.?.qt}); return error.ParsingFailed; } - if (base_type.is(.c23_auto) or outer.is(.invalid)) { - // issue error later - return Type.invalid; - } else if (size.val.opt_ref == .none) { - if (size.node != .none) { - try p.errTok(.vla, size_tok); - if (p.func.ty == null and kind != .param and p.record.kind == .invalid) { - try p.errTok(.variable_len_array_file_scope, d.name); + + if (opt_size) |size| { + if (size.val.opt_ref == .none) { + try p.err(size_tok, .vla, .{}); + if (p.func.qt == null and kind != .param and p.record.kind == .invalid) { + try p.err(base_declarator.name, .variable_len_array_file_scope, .{}); } - const expr_ty = try p.arena.create(Type.Expr); - expr_ty.ty = .{ .specifier = .void }; - expr_ty.node = size.node; - res_ty.data = .{ .expr = expr_ty }; - res_ty.specifier = .variable_len_array; - - if (static) |some| try p.errTok(.useless_static, some); - } else if (star) |_| { - const elem_ty = try p.arena.create(Type); - elem_ty.* = .{ .specifier = .void }; - res_ty.data = .{ .sub_type = elem_ty }; - res_ty.specifier = .unspecified_variable_len_array; + + const array_qt = try p.comp.type_store.put(gpa, .{ .array = .{ + .elem = outer, + .len = .{ .variable = size.node }, + } }); + + if (static) |some| try p.err(some, .useless_static, .{}); + return builder.finishQuals(array_qt); } else { - const arr_ty = try p.arena.create(Type.Array); - arr_ty.elem = .{ .specifier = .void }; - arr_ty.len = 0; - res_ty.data = .{ .array = arr_ty }; - res_ty.specifier = .incomplete_array; - } + if (size.val.isZero(p.comp)) { + try p.err(l_bracket, .zero_length_array, .{}); + } else if (size.val.compare(.lt, .zero, p.comp)) { + try p.err(l_bracket, .negative_array_size, .{}); + return error.ParsingFailed; + } + + const len = size.val.toInt(u64, p.comp) orelse std.math.maxInt(u64); + const array_qt = try p.comp.type_store.put(gpa, .{ .array = .{ + .elem = outer, + .len = if (static != null) + .{ .static = len } + else + .{ .fixed = len }, + } }); + return builder.finishQuals(array_qt); + } + } else if (star) |_| { + const array_qt = try p.comp.type_store.put(gpa, .{ .array = .{ + .elem = outer, + .len = .unspecified_variable, + } }); + return builder.finishQuals(array_qt); } else { - // `outer` is validated later so it may be invalid here - const outer_size = outer.sizeof(p.comp); - const max_elems = p.comp.maxArrayBytes() / @max(1, outer_size orelse 1); - - var size_val = size.val; - if (size_val.isZero(p.comp)) { - try p.errTok(.zero_length_array, l_bracket); - } else if (size_val.compare(.lt, Value.zero, p.comp)) { - try p.errTok(.negative_array_size, l_bracket); - return error.ParsingFailed; - } - const arr_ty = try p.arena.create(Type.Array); - arr_ty.elem = .{ .specifier = .void }; - arr_ty.len = size_val.toInt(u64, p.comp) orelse std.math.maxInt(u64); - if (arr_ty.len > max_elems) { - try p.errTok(.array_too_large, l_bracket); - arr_ty.len = max_elems; - } - res_ty.data = .{ .array = arr_ty }; - res_ty.specifier = if (static != null) .static_array else .array; + const array_qt = try p.comp.type_store.put(gpa, .{ .array = .{ + .elem = outer, + .len = .incomplete, + } }); + return builder.finishQuals(array_qt); } - - try res_ty.combine(outer); - return res_ty; } else if (p.eatToken(.l_paren)) |l_paren| { - d.func_declarator = l_paren; - - const func_ty = try p.arena.create(Type.Func); - func_ty.params = &.{}; - func_ty.return_type.specifier = .void; - var specifier: Type.Specifier = .func; + var func_ty: Type.Func = .{ + .kind = undefined, + .return_type = undefined, + .params = &.{}, + }; if (p.eatToken(.ellipsis)) |_| { - try p.err(.param_before_var_args); + try p.err(p.tok_i, .param_before_var_args, .{}); try p.expectClosing(l_paren, .r_paren); - var res_ty = Type{ .specifier = .func, .data = .{ .func = func_ty } }; + func_ty.kind = .variadic; + + func_ty.return_type = try p.directDeclarator(base_declarator, kind); - const outer = try p.directDeclarator(base_type, d, kind); - try res_ty.combine(outer); - return res_ty; + // Set after call to `directDeclarator` since we will return + // a function type from here. + base_declarator.declarator_type = .func; + return p.comp.type_store.put(gpa, .{ .func = func_ty }); } - if (try p.paramDecls(d)) |params| { + // Set here so the call to directDeclarator for the return type + // doesn't clobber this function type's parameters. + const param_buf_top = p.param_buf.items.len; + defer p.param_buf.items.len = param_buf_top; + + if (try p.paramDecls()) |params| { + func_ty.kind = .normal; func_ty.params = params; - if (p.eatToken(.ellipsis)) |_| specifier = .var_args_func; + if (p.eatToken(.ellipsis)) |_| func_ty.kind = .variadic; } else if (p.tok_ids[p.tok_i] == .r_paren) { - specifier = if (p.comp.langopts.standard.atLeast(.c23)) - .func + func_ty.kind = if (p.comp.langopts.standard.atLeast(.c23)) + .normal else - .old_style_func; + .old_style; } else if (p.tok_ids[p.tok_i] == .identifier or p.tok_ids[p.tok_i] == .extended_identifier) { - d.old_style_func = p.tok_i; - const param_buf_top = p.param_buf.items.len; + base_declarator.old_style_func = p.tok_i; try p.syms.pushScope(p); - defer { - p.param_buf.items.len = param_buf_top; - p.syms.popScope(); - } + defer p.syms.popScope(); - specifier = .old_style_func; + func_ty.kind = .old_style; while (true) { const name_tok = try p.expectIdentifier(); - const interned_name = try StrInt.intern(p.comp, p.tokSlice(name_tok)); - try p.syms.defineParam(p, interned_name, undefined, name_tok); - try p.param_buf.append(.{ + const interned_name = try p.comp.internString(p.tokSlice(name_tok)); + try p.syms.defineParam(p, interned_name, undefined, name_tok, null); + try p.param_buf.append(gpa, .{ .name = interned_name, .name_tok = name_tok, - .ty = .{ .specifier = .int }, + .qt = .int, + .node = .null, }); if (p.eatToken(.comma) == null) break; } - func_ty.params = try p.arena.dupe(Type.Func.Param, p.param_buf.items[param_buf_top..]); + func_ty.params = p.param_buf.items[param_buf_top..]; } else { - try p.err(.expected_param_decl); + try p.err(p.tok_i, .expected_param_decl, .{}); } try p.expectClosing(l_paren, .r_paren); - var res_ty = Type{ - .specifier = specifier, - .data = .{ .func = func_ty }, - }; + func_ty.return_type = try p.directDeclarator(base_declarator, kind); - const outer = try p.directDeclarator(base_type, d, kind); - try res_ty.combine(outer); - return res_ty; - } else return base_type; -} + // Set after call to `directDeclarator` since we will return + // a function type from here. + base_declarator.declarator_type = .func; -/// pointer : '*' typeQual* pointer? -fn pointer(p: *Parser, base_ty: Type) Error!Type { - var ty = base_ty; - while (p.eatToken(.asterisk)) |_| { - if (!ty.is(.invalid)) { - const elem_ty = try p.arena.create(Type); - elem_ty.* = ty; - ty = Type{ - .specifier = .pointer, - .data = .{ .sub_type = elem_ty }, - }; - } - var quals = Type.Qualifiers.Builder{}; - _ = try p.typeQual(&quals); - try quals.finish(p, &ty); - } - return ty; + return p.comp.type_store.put(gpa, .{ .func = func_ty }); + } else return base_declarator.qt; } /// paramDecls : paramDecl (',' paramDecl)* (',' '...') /// paramDecl : declSpec (declarator | abstractDeclarator) -fn paramDecls(p: *Parser, d: *Declarator) Error!?[]Type.Func.Param { +fn paramDecls(p: *Parser) Error!?[]Type.Func.Param { // TODO warn about visibility of types declared here - const param_buf_top = p.param_buf.items.len; - defer p.param_buf.items.len = param_buf_top; try p.syms.pushScope(p); defer p.syms.popScope(); + // Clearing the param buf is handled in directDeclarator. + const param_buf_top = p.param_buf.items.len; + const gpa = p.comp.gpa; + while (true) { const attr_buf_top = p.attr_buf.len; defer p.attr_buf.len = attr_buf_top; @@ -3206,13 +3807,13 @@ fn paramDecls(p: *Parser, d: *Declarator) Error!?[]Type.Func.Param { { // handle deprecated K&R style parameters const identifier = try p.expectIdentifier(); - try p.errStr(.unknown_type_name, identifier, p.tokSlice(identifier)); - if (d.old_style_func == null) d.old_style_func = identifier; + try p.err(identifier, .unknown_type_name, .{p.tokSlice(identifier)}); - try p.param_buf.append(.{ - .name = try StrInt.intern(p.comp, p.tokSlice(identifier)), + try p.param_buf.append(gpa, .{ + .name = try p.comp.internString(p.tokSlice(identifier)), .name_tok = identifier, - .ty = .{ .specifier = .int }, + .qt = .int, + .node = .null, }); if (p.eatToken(.comma) == null) break; @@ -3221,801 +3822,925 @@ fn paramDecls(p: *Parser, d: *Declarator) Error!?[]Type.Func.Param { } else if (p.param_buf.items.len == param_buf_top) { return null; } else blk: { - var spec: Type.Builder = .{}; - break :blk DeclSpec{ .ty = try spec.finish(p) }; + try p.err(p.tok_i, .missing_type_specifier, .{}); + break :blk DeclSpec{ .qt = .int }; }; var name_tok: TokenIndex = 0; + var interned_name: StringId = .empty; const first_tok = p.tok_i; - var param_ty = param_decl_spec.ty; - if (try p.declarator(param_decl_spec.ty, .param)) |some| { - if (some.old_style_func) |tok_i| try p.errTok(.invalid_old_style_params, tok_i); - try p.attributeSpecifier(); + var param_qt = param_decl_spec.qt; + if (param_decl_spec.auto_type) |tok_i| { + try p.err(tok_i, .auto_type_not_allowed, .{"function prototype"}); + param_qt = .invalid; + } + if (param_decl_spec.c23_auto) |tok_i| { + try p.err(tok_i, .c23_auto_not_allowed, .{"function prototype"}); + param_qt = .invalid; + } + if (try p.declarator(param_qt, .param)) |some| { + if (some.old_style_func) |tok_i| try p.err(tok_i, .invalid_old_style_params, .{}); + try p.attributeSpecifier(); name_tok = some.name; - param_ty = some.ty; - if (some.name != 0) { - const interned_name = try StrInt.intern(p.comp, p.tokSlice(name_tok)); - try p.syms.defineParam(p, interned_name, param_ty, name_tok); - } + param_qt = some.qt; } - param_ty = try Attribute.applyParameterAttributes(p, param_ty, attr_buf_top, .alignas_on_param); - if (param_ty.isFunc()) { - // params declared as functions are converted to function pointers - const elem_ty = try p.arena.create(Type); - elem_ty.* = param_ty; - param_ty = Type{ - .specifier = .pointer, - .data = .{ .sub_type = elem_ty }, - }; - } else if (param_ty.isArray()) { - // params declared as arrays are converted to pointers - param_ty.decayArray(); - } else if (param_ty.is(.void)) { + if (param_qt.is(p.comp, .void)) { // validate void parameters if (p.param_buf.items.len == param_buf_top) { if (p.tok_ids[p.tok_i] != .r_paren) { - try p.err(.void_only_param); - if (param_ty.anyQual()) try p.err(.void_param_qualified); + try p.err(p.tok_i, .void_only_param, .{}); + if (param_qt.isQualified()) try p.err(p.tok_i, .void_param_qualified, .{}); return error.ParsingFailed; } - return &[0]Type.Func.Param{}; + return &.{}; } - try p.err(.void_must_be_first_param); + try p.err(p.tok_i, .void_must_be_first_param, .{}); return error.ParsingFailed; + } else { + // Decay params declared as functions or arrays to pointer. + param_qt = try param_qt.decay(p.comp); + } + try param_decl_spec.validateParam(p); + param_qt = try Attribute.applyParameterAttributes(p, param_qt, attr_buf_top, .alignas_on_param); + + if (param_qt.get(p.comp, .float)) |float| { + if (float == .fp16 and !p.comp.hasHalfPrecisionFloatABI()) { + try p.err(first_tok, .suggest_pointer_for_invalid_fp16, .{"parameters"}); + } + } + + var param_node: Node.OptIndex = .null; + if (name_tok != 0) { + const node = try p.addNode(.{ + .param = .{ + .name_tok = name_tok, + .qt = param_qt, + .storage_class = switch (param_decl_spec.storage_class) { + .none => .auto, + .register => .register, + else => .auto, // Error reported in `validateParam` + }, + }, + }); + param_node = .pack(node); + interned_name = try p.comp.internString(p.tokSlice(name_tok)); + try p.syms.defineParam(p, interned_name, param_qt, name_tok, node); } - try param_decl_spec.validateParam(p, ¶m_ty); - try p.param_buf.append(.{ - .name = if (name_tok == 0) .empty else try StrInt.intern(p.comp, p.tokSlice(name_tok)), + try p.param_buf.append(gpa, .{ + .name = interned_name, .name_tok = if (name_tok == 0) first_tok else name_tok, - .ty = param_ty, + .qt = param_qt, + .node = param_node, }); if (p.eatToken(.comma) == null) break; if (p.tok_ids[p.tok_i] == .ellipsis) break; } - return try p.arena.dupe(Type.Func.Param, p.param_buf.items[param_buf_top..]); + return p.param_buf.items[param_buf_top..]; } /// typeName : specQual abstractDeclarator -fn typeName(p: *Parser) Error!?Type { +fn typeName(p: *Parser) Error!?QualType { const attr_buf_top = p.attr_buf.len; defer p.attr_buf.len = attr_buf_top; const ty = (try p.specQual()) orelse return null; if (try p.declarator(ty, .abstract)) |some| { - if (some.old_style_func) |tok_i| try p.errTok(.invalid_old_style_params, tok_i); - return try Attribute.applyTypeAttributes(p, some.ty, attr_buf_top, .align_ignored); + if (some.old_style_func) |tok_i| try p.err(tok_i, .invalid_old_style_params, .{}); + return try Attribute.applyTypeAttributes(p, some.qt, attr_buf_top, .align_ignored); } return try Attribute.applyTypeAttributes(p, ty, attr_buf_top, .align_ignored); } -fn complexInitializer(p: *Parser, init_ty: Type) Error!Result { - assert(p.tok_ids[p.tok_i] == .l_brace); - assert(init_ty.isComplex()); - - const real_ty = init_ty.makeReal(); - if (real_ty.isInt()) { - return p.todo("Complex integer initializers"); - } - const l_brace = p.tok_i; - p.tok_i += 1; - try p.errTok(.complex_component_init, l_brace); - - const first_tok = p.tok_i; - var first = try p.assignExpr(); - try first.expect(p); - try p.coerceInit(&first, first_tok, real_ty); - - var second: Result = .{ - .ty = real_ty, - .val = Value.zero, - }; - if (p.eatToken(.comma)) |_| { - const second_tok = p.tok_i; - const maybe_second = try p.assignExpr(); - if (!maybe_second.empty(p)) { - second = maybe_second; - try p.coerceInit(&second, second_tok, real_ty); - } - } - - // Eat excess initializers - var extra_tok: ?TokenIndex = null; - while (p.eatToken(.comma)) |_| { - if (p.tok_ids[p.tok_i] == .r_brace) break; - extra_tok = p.tok_i; - const extra = try p.assignExpr(); - if (extra.empty(p)) { - try p.errTok(.expected_expr, p.tok_i); - p.skipTo(.r_brace); - return error.ParsingFailed; - } - } - try p.expectClosing(l_brace, .r_brace); - if (extra_tok) |tok| { - try p.errTok(.excess_scalar_init, tok); - } - - const arr_init_node: Tree.Node = .{ - .tag = .array_init_expr_two, - .ty = init_ty, - .data = .{ .two = .{ first.node, second.node } }, - .loc = @enumFromInt(l_brace), - }; - var res: Result = .{ - .node = try p.addNode(arr_init_node), - .ty = init_ty, - }; - if (first.val.opt_ref != .none and second.val.opt_ref != .none) { - res.val = try Value.intern(p.comp, switch (real_ty.bitSizeof(p.comp).?) { - 32 => .{ .complex = .{ .cf32 = .{ first.val.toFloat(f32, p.comp), second.val.toFloat(f32, p.comp) } } }, - 64 => .{ .complex = .{ .cf64 = .{ first.val.toFloat(f64, p.comp), second.val.toFloat(f64, p.comp) } } }, - 80 => .{ .complex = .{ .cf80 = .{ first.val.toFloat(f80, p.comp), second.val.toFloat(f80, p.comp) } } }, - 128 => .{ .complex = .{ .cf128 = .{ first.val.toFloat(f128, p.comp), second.val.toFloat(f128, p.comp) } } }, - else => unreachable, - }); - } - return res; -} - /// initializer /// : assignExpr /// | '{' initializerItems '}' -fn initializer(p: *Parser, init_ty: Type) Error!Result { - // fast path for non-braced initializers - if (p.tok_ids[p.tok_i] != .l_brace) { +fn initializer(p: *Parser, init_qt: QualType) Error!Result { + const l_brace = p.eatToken(.l_brace) orelse { + // fast path for non-braced initializers const tok = p.tok_i; - var res = try p.assignExpr(); - try res.expect(p); - if (try p.coerceArrayInit(&res, tok, init_ty)) return res; - try p.coerceInit(&res, tok, init_ty); + var res = try p.expect(assignExpr); + if (try p.coerceArrayInit(res, tok, init_qt)) return res; + try p.coerceInit(&res, tok, init_qt); return res; - } - if (init_ty.is(.auto_type)) { - try p.err(.auto_type_with_init_list); - return error.ParsingFailed; - } + }; - if (init_ty.isComplex()) { - return p.complexInitializer(init_ty); + // We want to parse the initializer even if the target is + // invalidly inferred. + var final_init_qt = init_qt; + if (init_qt.isAutoType()) { + try p.err(l_brace, .auto_type_with_init_list, .{}); + final_init_qt = .invalid; + } else if (init_qt.isC23Auto()) { + try p.err(l_brace, .c23_auto_with_init_list, .{}); + final_init_qt = .invalid; } + var il: InitList = .{}; - defer il.deinit(p.gpa); + defer il.deinit(p.comp.gpa); - _ = try p.initializerItem(&il, init_ty); + try p.initializerItem(&il, final_init_qt, l_brace); - const res = try p.convertInitList(il, init_ty); - var res_ty = p.nodes.items(.ty)[@intFromEnum(res)]; - res_ty.qual = init_ty.qual; - return Result{ .ty = res_ty, .node = res }; + const list_node = try p.convertInitList(il, final_init_qt); + return .{ + .qt = list_node.qt(&p.tree).withQualifiers(final_init_qt), + .node = list_node, + .val = p.tree.value_map.get(list_node) orelse .{}, + }; } -/// initializerItems : designation? initializer (',' designation? initializer)* ','? -/// designation : designator+ '=' -/// designator -/// : '[' integerConstExpr ']' -/// | '.' identifier -fn initializerItem(p: *Parser, il: *InitList, init_ty: Type) Error!bool { - const l_brace = p.eatToken(.l_brace) orelse { - const tok = p.tok_i; - var res = try p.assignExpr(); - if (res.empty(p)) return false; +const IndexList = std.ArrayList(u64); - const arr = try p.coerceArrayInit(&res, tok, init_ty); - if (!arr) try p.coerceInit(&res, tok, init_ty); - if (il.tok != 0) { - try p.errTok(.initializer_overrides, tok); - try p.errTok(.previous_initializer, il.tok); - } - il.node = res.node; - il.tok = tok; - return true; - }; +/// initializerItems : designation? initializer (',' designation? initializer)* ','? +fn initializerItem(p: *Parser, il: *InitList, init_qt: QualType, l_brace: TokenIndex) Error!void { + const gpa = p.comp.gpa; + const is_scalar = !init_qt.isInvalid() and init_qt.scalarKind(p.comp) != .none; - const is_scalar = init_ty.isScalar(); - const is_complex = init_ty.isComplex(); - const scalar_inits_needed: usize = if (is_complex) 2 else 1; if (p.eatToken(.r_brace)) |_| { - if (is_scalar) try p.errTok(.empty_scalar_init, l_brace); - if (il.tok != 0) { - try p.errTok(.initializer_overrides, l_brace); - try p.errTok(.previous_initializer, il.tok); + try p.err(l_brace, .empty_initializer, .{}); + if (il.tok != 0 and !init_qt.isInvalid()) { + try p.err(l_brace, .initializer_overrides, .{}); + try p.err(il.tok, .previous_initializer, .{}); } - il.node = .none; + il.node = .null; il.tok = l_brace; - return true; + return; } - var count: u64 = 0; - var warned_excess = false; - var is_str_init = false; - var index_hint: ?u64 = null; - while (true) : (count += 1) { - errdefer p.skipTo(.r_brace); - - var first_tok = p.tok_i; - var cur_ty = init_ty; - var cur_il = il; - var designation = false; - var cur_index_hint: ?u64 = null; - while (true) { - if (p.eatToken(.l_bracket)) |l_bracket| { - if (!cur_ty.isArray()) { - try p.errStr(.invalid_array_designator, l_bracket, try p.typeStr(cur_ty)); - return error.ParsingFailed; - } - const expr_tok = p.tok_i; - const index_res = try p.integerConstExpr(.gnu_folding_extension); - try p.expectClosing(l_bracket, .r_bracket); + var index_list: IndexList = .empty; + defer index_list.deinit(gpa); - if (index_res.val.opt_ref == .none) { - try p.errTok(.expected_integer_constant_expr, expr_tok); - return error.ParsingFailed; - } else if (index_res.val.compare(.lt, Value.zero, p.comp)) { - try p.errStr(.negative_array_designator, l_bracket + 1, try index_res.str(p)); - return error.ParsingFailed; - } + var seen_any = false; + var warned_excess = init_qt.isInvalid(); + while (true) : (seen_any = true) { + errdefer p.skipTo(.r_brace); - const max_len = cur_ty.arrayLen() orelse std.math.maxInt(usize); - const index_int = index_res.val.toInt(u64, p.comp) orelse std.math.maxInt(u64); - if (index_int >= max_len) { - try p.errStr(.oob_array_designator, l_bracket + 1, try index_res.str(p)); - return error.ParsingFailed; - } - cur_index_hint = cur_index_hint orelse index_int; - - cur_il = try cur_il.find(p.gpa, index_int); - cur_ty = cur_ty.elemType(); - designation = true; - } else if (p.eatToken(.period)) |period| { - const field_tok = try p.expectIdentifier(); - const field_str = p.tokSlice(field_tok); - const field_name = try StrInt.intern(p.comp, field_str); - cur_ty = cur_ty.canonicalize(.standard); - if (!cur_ty.isRecord()) { - try p.errStr(.invalid_field_designator, period, try p.typeStr(cur_ty)); - return error.ParsingFailed; - } else if (!cur_ty.hasField(field_name)) { - try p.errStr(.no_such_field_designator, period, field_str); - return error.ParsingFailed; - } + const designated = try p.designation(il, init_qt, &index_list); + if (!designated and init_qt.hasAttribute(p.comp, .designated_init)) { + try p.err(p.tok_i, .designated_init_needed, .{}); + } - // TODO check if union already has field set - outer: while (true) { - for (cur_ty.data.record.fields, 0..) |f, i| { - if (f.isAnonymousRecord()) { - // Recurse into anonymous field if it has a field by the name. - if (!f.ty.hasField(field_name)) continue; - cur_ty = f.ty.canonicalize(.standard); - cur_il = try il.find(p.gpa, i); - cur_index_hint = cur_index_hint orelse i; - continue :outer; - } - if (field_name == f.name) { - cur_il = try cur_il.find(p.gpa, i); - cur_ty = f.ty; - cur_index_hint = cur_index_hint orelse i; - break :outer; - } - } - unreachable; // we already checked that the starting type has this field + const first_tok = p.tok_i; + if (p.eatToken(.l_brace)) |inner_l_brace| { + if (try p.findBracedInitializer(il, init_qt, first_tok, &index_list)) |item| { + if (item.il.tok != 0 and !init_qt.isInvalid()) { + try p.err(first_tok, .initializer_overrides, .{}); + try p.err(item.il.tok, .previous_initializer, .{}); + item.il.deinit(gpa); + item.il.* = .{}; } - designation = true; - } else break; - } - if (designation) index_hint = null; - defer index_hint = cur_index_hint orelse null; - - if (designation) _ = try p.expectToken(.equal); - - if (!designation and cur_ty.hasAttribute(.designated_init)) { - try p.err(.designated_init_needed); - } - - var saw = false; - if (is_str_init and p.isStringInit(init_ty)) { - // discard further strings - var tmp_il = InitList{}; - defer tmp_il.deinit(p.gpa); - saw = try p.initializerItem(&tmp_il, .{ .specifier = .void }); - } else if (count == 0 and p.isStringInit(init_ty)) { - is_str_init = true; - saw = try p.initializerItem(il, init_ty); - } else if (is_scalar and count >= scalar_inits_needed) { - // discard further scalars - var tmp_il = InitList{}; - defer tmp_il.deinit(p.gpa); - saw = try p.initializerItem(&tmp_il, .{ .specifier = .void }); - } else if (p.tok_ids[p.tok_i] == .l_brace) { - if (designation) { - // designation overrides previous value, let existing mechanism handle it - saw = try p.initializerItem(cur_il, cur_ty); - } else if (try p.findAggregateInitializer(&cur_il, &cur_ty, &index_hint)) { - saw = try p.initializerItem(cur_il, cur_ty); + try p.initializerItem(item.il, item.qt, inner_l_brace); } else { // discard further values - var tmp_il = InitList{}; - defer tmp_il.deinit(p.gpa); - saw = try p.initializerItem(&tmp_il, .{ .specifier = .void }); - if (!warned_excess) try p.errTok(if (init_ty.isArray()) .excess_array_init else .excess_struct_init, first_tok); + var tmp_il: InitList = .{}; + defer tmp_il.deinit(gpa); + try p.initializerItem(&tmp_il, .invalid, inner_l_brace); + if (!warned_excess) try p.err(first_tok, switch (init_qt.base(p.comp).type) { + .array => if (il.node != .null and p.isStringInit(init_qt, il.node.unpack().?)) + .excess_str_init + else + .excess_array_init, + .@"struct" => .excess_struct_init, + .@"union" => .excess_union_init, + .vector => .excess_vector_init, + else => .excess_scalar_init, + }, .{}); + warned_excess = true; } - } else single_item: { - first_tok = p.tok_i; - var res = try p.assignExpr(); - saw = !res.empty(p); - if (!saw) break :single_item; + } else if (try p.assignExpr()) |res| { + if (is_scalar and il.node != .null) { + if (!warned_excess) try p.err(first_tok, .excess_scalar_init, .{}); + warned_excess = true; + } else { + _ = try p.findScalarInitializer(il, init_qt, res, first_tok, &warned_excess, &index_list, 0); + } + } else if (designated or (seen_any and p.tok_ids[p.tok_i] != .r_brace)) { + try p.err(p.tok_i, .expected_expr, .{}); + } else break; - excess: { - if (index_hint) |*hint| { - if (try p.findScalarInitializerAt(&cur_il, &cur_ty, &res, first_tok, hint)) break :excess; - } else if (try p.findScalarInitializer(&cur_il, &cur_ty, &res, first_tok)) break :excess; + if (p.eatToken(.comma) == null) break; + } + try p.expectClosing(l_brace, .r_brace); - if (designation) break :excess; - if (!warned_excess) try p.errTok(if (init_ty.isArray()) .excess_array_init else .excess_struct_init, first_tok); - warned_excess = true; + if (il.tok == 0) il.tok = l_brace; +} - break :single_item; - } +fn setInitializer(p: *Parser, il: *InitList, init_qt: QualType, tok: TokenIndex, res: Result) !void { + var copy = res; + + const arr = try p.coerceArrayInit(copy, tok, init_qt); + if (!arr) try p.coerceInit(©, tok, init_qt); + if (il.tok != 0 and !init_qt.isInvalid()) { + try p.err(tok, .initializer_overrides, .{}); + try p.err(il.tok, .previous_initializer, .{}); + } + il.node = .pack(copy.node); + il.tok = tok; +} + +/// designation : designator+ '='? +/// designator +/// : '[' integerConstExpr ']' +/// | '.' identifier +fn designation(p: *Parser, il: *InitList, init_qt: QualType, index_list: *IndexList) !bool { + switch (p.tok_ids[p.tok_i]) { + .l_bracket, .period => index_list.items.len = 0, + else => return false, + } + const gpa = p.comp.gpa; + + var cur_qt = init_qt; + var cur_il = il; + while (true) { + if (p.eatToken(.l_bracket)) |l_bracket| { + const array_ty = cur_qt.get(p.comp, .array) orelse { + try p.err(l_bracket, .invalid_array_designator, .{cur_qt}); + return error.ParsingFailed; + }; + const expr_tok = p.tok_i; + const index_res = try p.integerConstExpr(.gnu_folding_extension); + try p.expectClosing(l_bracket, .r_bracket); + if (cur_qt.isInvalid()) continue; - const arr = try p.coerceArrayInit(&res, first_tok, cur_ty); - if (!arr) try p.coerceInit(&res, first_tok, cur_ty); - if (cur_il.tok != 0) { - try p.errTok(.initializer_overrides, first_tok); - try p.errTok(.previous_initializer, cur_il.tok); + if (index_res.val.opt_ref == .none) { + try p.err(expr_tok, .expected_integer_constant_expr, .{}); + return error.ParsingFailed; + } else if (index_res.val.compare(.lt, .zero, p.comp)) { + try p.err(l_bracket + 1, .negative_array_designator, .{index_res}); + return error.ParsingFailed; } - cur_il.node = res.node; - cur_il.tok = first_tok; - } - if (!saw) { - if (designation) { - try p.err(.expected_expr); + const max_len = switch (array_ty.len) { + .fixed, .static => |len| len, + else => std.math.maxInt(u64), + }; + const index_int = index_res.val.toInt(u64, p.comp) orelse std.math.maxInt(u64); + if (index_int >= max_len) { + try p.err(l_bracket + 1, .oob_array_designator, .{index_res}); return error.ParsingFailed; } - break; - } else if (count == 1) { - if (is_str_init) try p.errTok(.excess_str_init, first_tok); - if (is_scalar and !is_complex) try p.errTok(.excess_scalar_init, first_tok); - } else if (count == 2) { - if (is_scalar and is_complex) try p.errTok(.excess_scalar_init, first_tok); - } - if (p.eatToken(.comma) == null) break; - } - try p.expectClosing(l_brace, .r_brace); + try index_list.append(gpa, index_int); + cur_il = try cur_il.find(gpa, index_int); + cur_qt = array_ty.elem; + } else if (p.eatToken(.period)) |period| { + const field_tok = try p.expectIdentifier(); + if (cur_qt.isInvalid()) continue; + + const field_str = p.tokSlice(field_tok); + const target_name = try p.comp.internString(field_str); + var record_ty = cur_qt.getRecord(p.comp) orelse { + try p.err(period, .invalid_field_designator, .{cur_qt}); + return error.ParsingFailed; + }; - if (is_complex and count == 1) { // count of 1 means we saw exactly 2 items in the initializer list - try p.errTok(.complex_component_init, l_brace); + var field_index: u32 = 0; + while (field_index < record_ty.fields.len) { + const field = record_ty.fields[field_index]; + if (field.name_tok == 0) if (field.qt.getRecord(p.comp)) |field_record_ty| { + // Recurse into anonymous field if it has a field by the name. + if (!field_record_ty.hasField(p.comp, target_name)) continue; + try index_list.append(gpa, field_index); + cur_il = try il.find(gpa, field_index); + record_ty = field_record_ty; + field_index = 0; + continue; + }; + if (field.name == target_name) { + cur_qt = field.qt; + try index_list.append(gpa, field_index); + cur_il = try cur_il.find(gpa, field_index); + break; + } + field_index += 1; + } else { + try p.err(period, .no_such_field_designator, .{field_str}); + return error.ParsingFailed; + } + } else break; } - if (is_scalar or is_str_init) return true; - if (il.tok != 0) { - try p.errTok(.initializer_overrides, l_brace); - try p.errTok(.previous_initializer, il.tok); + + if (p.eatToken(.equal) == null) { + try p.err(p.tok_i, .gnu_missing_eq_designator, .{}); } - il.node = .none; - il.tok = l_brace; return true; } -/// Returns true if the value is unused. -fn findScalarInitializerAt(p: *Parser, il: **InitList, ty: *Type, res: *Result, first_tok: TokenIndex, start_index: *u64) Error!bool { - if (ty.isArray()) { - if (il.*.node != .none) return false; - start_index.* += 1; +/// Returns true if the item was filled. +fn findScalarInitializer( + p: *Parser, + il: *InitList, + qt: QualType, + res: Result, + first_tok: TokenIndex, + warned_excess: *bool, + index_list: *IndexList, + index_list_top: u32, +) Error!bool { + if (qt.isInvalid()) return false; + const gpa = p.comp.gpa; + if (index_list.items.len <= index_list_top) try index_list.append(gpa, 0); + const index = index_list.items[index_list_top]; + + switch (qt.base(p.comp).type) { + .complex => |complex_ty| { + if (il.node != .null or index >= 2) { + if (!warned_excess.*) try p.err(first_tok, .excess_scalar_init, .{}); + warned_excess.* = true; + return true; + } + if (res.qt.eql(qt, p.comp) and il.list.items.len == 0) { + try p.setInitializer(il, qt, first_tok, res); + return true; + } - const arr_ty = ty.*; - const elem_count = arr_ty.arrayLen() orelse std.math.maxInt(u64); - if (elem_count == 0) { - try p.errTok(.empty_aggregate_init_braces, first_tok); - return error.ParsingFailed; - } - const elem_ty = arr_ty.elemType(); - const arr_il = il.*; - if (start_index.* < elem_count) { - ty.* = elem_ty; - il.* = try arr_il.find(p.gpa, start_index.*); - _ = try p.findScalarInitializer(il, ty, res, first_tok); - return true; - } - return false; - } else if (ty.get(.@"struct")) |struct_ty| { - if (il.*.node != .none) return false; - start_index.* += 1; + const elem_il = try il.find(gpa, index); + if (try p.setInitializerIfEqual(elem_il, complex_ty, first_tok, res) or + try p.findScalarInitializer( + elem_il, + complex_ty, + res, + first_tok, + warned_excess, + index_list, + index_list_top + 1, + )) + { + const new_index = index + 1; + index_list.items[index_list_top] = new_index; + index_list.items.len = index_list_top + 1; + return new_index >= 2; + } + + return false; + }, + .vector => |vector_ty| { + if (il.node != .null or index >= vector_ty.len) { + if (!warned_excess.*) try p.err(first_tok, .excess_vector_init, .{}); + warned_excess.* = true; + return true; + } + if (il.list.items.len == 0 and (res.qt.eql(qt, p.comp) or + (res.qt.is(p.comp, .vector) and res.qt.sizeCompare(qt, p.comp) == .eq))) + { + try p.setInitializer(il, qt, first_tok, res); + return true; + } + + const elem_il = try il.find(gpa, index); + if (try p.setInitializerIfEqual(elem_il, vector_ty.elem, first_tok, res) or + try p.findScalarInitializer( + elem_il, + vector_ty.elem, + res, + first_tok, + warned_excess, + index_list, + index_list_top + 1, + )) + { + const new_index = index + 1; + index_list.items[index_list_top] = new_index; + index_list.items.len = index_list_top + 1; + return new_index >= vector_ty.len; + } + + return false; + }, + .array => |array_ty| { + const max_len = switch (array_ty.len) { + .fixed, .static => |len| len, + else => std.math.maxInt(u64), + }; + if (max_len == 0) { + try p.err(first_tok, .empty_aggregate_init_braces, .{}); + return true; + } + + if (il.node != .null or index >= max_len) { + if (!warned_excess.*) { + if (il.node.unpack()) |some| if (p.isStringInit(qt, some)) { + try p.err(first_tok, .excess_str_init, .{}); + warned_excess.* = true; + return true; + }; + try p.err(first_tok, .excess_array_init, .{}); + } + warned_excess.* = true; + return true; + } + if (il.list.items.len == 0 and p.isStringInit(qt, res.node) and + try p.coerceArrayInit(res, first_tok, qt)) + { + try p.setInitializer(il, qt, first_tok, res); + return true; + } + + const elem_il = try il.find(gpa, index); + if (try p.setInitializerIfEqual(elem_il, array_ty.elem, first_tok, res) or + try p.findScalarInitializer( + elem_il, + array_ty.elem, + res, + first_tok, + warned_excess, + index_list, + index_list_top + 1, + )) + { + const new_index = index + 1; + index_list.items[index_list_top] = new_index; + index_list.items.len = index_list_top + 1; + return new_index >= max_len; + } + + return false; + }, + .@"struct" => |struct_ty| { + if (struct_ty.fields.len == 0) { + try p.err(first_tok, .empty_aggregate_init_braces, .{}); + return true; + } + + if (il.node != .null or index >= struct_ty.fields.len) { + if (!warned_excess.*) try p.err(first_tok, .excess_struct_init, .{}); + warned_excess.* = true; + return true; + } + + const field = struct_ty.fields[@intCast(index)]; + const field_il = try il.find(gpa, index); + if (try p.setInitializerIfEqual(field_il, field.qt, first_tok, res) or + try p.findScalarInitializer( + field_il, + field.qt, + res, + first_tok, + warned_excess, + index_list, + index_list_top + 1, + )) + { + const new_index = index + 1; + index_list.items[index_list_top] = new_index; + index_list.items.len = index_list_top + 1; + return new_index >= struct_ty.fields.len; + } + + return false; + }, + .@"union" => |union_ty| { + if (union_ty.fields.len == 0) { + try p.err(first_tok, .empty_aggregate_init_braces, .{}); + return true; + } + + if (il.node != .null or il.list.items.len > 1 or + (il.list.items.len == 1 and il.list.items[0].index != index)) + { + if (!warned_excess.*) try p.err(first_tok, .excess_union_init, .{}); + warned_excess.* = true; + return true; + } + + const field = union_ty.fields[@intCast(index)]; + const field_il = try il.find(gpa, index); + if (try p.setInitializerIfEqual(field_il, field.qt, first_tok, res) or + try p.findScalarInitializer( + field_il, + field.qt, + res, + first_tok, + warned_excess, + index_list, + index_list_top + 1, + )) + { + const new_index = index + 1; + index_list.items[index_list_top] = new_index; + index_list.items.len = index_list_top + 1; + } - const fields = struct_ty.data.record.fields; - if (fields.len == 0) { - try p.errTok(.empty_aggregate_init_braces, first_tok); - return error.ParsingFailed; - } - const struct_il = il.*; - if (start_index.* < fields.len) { - const field = fields[@intCast(start_index.*)]; - ty.* = field.ty; - il.* = try struct_il.find(p.gpa, start_index.*); - _ = try p.findScalarInitializer(il, ty, res, first_tok); return true; - } - return false; - } else if (ty.get(.@"union")) |_| { - return false; + }, + else => { + try p.setInitializer(il, qt, first_tok, res); + return true; + }, } - return il.*.node == .none; } -/// Returns true if the value is unused. -fn findScalarInitializer(p: *Parser, il: **InitList, ty: *Type, res: *Result, first_tok: TokenIndex) Error!bool { - const actual_ty = res.ty; - if (ty.isArray() or ty.isComplex()) { - if (il.*.node != .none) return false; - if (try p.coerceArrayInitExtra(res, first_tok, ty.*, false)) return true; - const start_index = il.*.list.items.len; - var index = if (start_index != 0) il.*.list.items[start_index - 1].index else start_index; +fn setInitializerIfEqual(p: *Parser, il: *InitList, init_qt: QualType, tok: TokenIndex, res: Result) !bool { + if (!res.qt.eql(init_qt, p.comp)) return false; + try p.setInitializer(il, init_qt, tok, res); + return true; +} - const arr_ty = ty.*; - const elem_count: u64 = arr_ty.expectedInitListSize() orelse std.math.maxInt(u64); - if (elem_count == 0) { - try p.errTok(.empty_aggregate_init_braces, first_tok); - return error.ParsingFailed; - } - const elem_ty = arr_ty.elemType(); - const arr_il = il.*; - while (index < elem_count) : (index += 1) { - ty.* = elem_ty; - il.* = try arr_il.find(p.gpa, index); - if (il.*.node == .none and actual_ty.eql(elem_ty, p.comp, false)) return true; - if (try p.findScalarInitializer(il, ty, res, first_tok)) return true; - } - return false; - } else if (ty.get(.@"struct")) |struct_ty| { - if (il.*.node != .none) return false; - if (actual_ty.eql(ty.*, p.comp, false)) return true; - const start_index = il.*.list.items.len; - var index = if (start_index != 0) il.*.list.items[start_index - 1].index + 1 else start_index; - - const fields = struct_ty.data.record.fields; - if (fields.len == 0) { - try p.errTok(.empty_aggregate_init_braces, first_tok); - return error.ParsingFailed; - } - const struct_il = il.*; - while (index < fields.len) : (index += 1) { - const field = fields[@intCast(index)]; - ty.* = field.ty; - il.* = try struct_il.find(p.gpa, index); - if (il.*.node == .none and actual_ty.eql(field.ty, p.comp, false)) return true; - if (il.*.node == .none and try p.coerceArrayInitExtra(res, first_tok, ty.*, false)) return true; - if (try p.findScalarInitializer(il, ty, res, first_tok)) return true; - } - return false; - } else if (ty.get(.@"union")) |union_ty| { - if (il.*.node != .none) return false; - if (actual_ty.eql(ty.*, p.comp, false)) return true; - if (union_ty.data.record.fields.len == 0) { - try p.errTok(.empty_aggregate_init_braces, first_tok); - return error.ParsingFailed; - } - ty.* = union_ty.data.record.fields[0].ty; - il.* = try il.*.find(p.gpa, 0); - // if (il.*.node == .none and actual_ty.eql(ty, p.comp, false)) return true; - if (try p.coerceArrayInitExtra(res, first_tok, ty.*, false)) return true; - if (try p.findScalarInitializer(il, ty, res, first_tok)) return true; - return false; +const InitItem = struct { il: *InitList, qt: QualType }; + +fn findBracedInitializer( + p: *Parser, + il: *InitList, + qt: QualType, + first_tok: TokenIndex, + index_list: *IndexList, +) Error!?InitItem { + if (qt.isInvalid()) { + if (il.node != .null) return .{ .il = il, .qt = qt }; + return null; } - return il.*.node == .none; -} + const gpa = p.comp.gpa; + if (index_list.items.len == 0) try index_list.append(gpa, 0); + const index = index_list.items[0]; -fn findAggregateInitializer(p: *Parser, il: **InitList, ty: *Type, start_index: *?u64) Error!bool { - if (ty.isArray()) { - if (il.*.node != .none) return false; - const list_index = il.*.list.items.len; - const index = if (start_index.*) |*some| blk: { - some.* += 1; - break :blk some.*; - } else if (list_index != 0) - il.*.list.items[list_index - 1].index + 1 - else - list_index; - - const arr_ty = ty.*; - const elem_count = arr_ty.arrayLen() orelse std.math.maxInt(u64); - const elem_ty = arr_ty.elemType(); - if (index < elem_count) { - ty.* = elem_ty; - il.* = try il.*.find(p.gpa, index); - return true; - } - return false; - } else if (ty.get(.@"struct")) |struct_ty| { - if (il.*.node != .none) return false; - const list_index = il.*.list.items.len; - const index = if (start_index.*) |*some| blk: { - some.* += 1; - break :blk some.*; - } else if (list_index != 0) - il.*.list.items[list_index - 1].index + 1 - else - list_index; + switch (qt.base(p.comp).type) { + .complex => |complex_ty| { + if (il.node != .null) return null; - const field_count = struct_ty.data.record.fields.len; - if (index < field_count) { - ty.* = struct_ty.data.record.fields[@intCast(index)].ty; - il.* = try il.*.find(p.gpa, index); - return true; - } - return false; - } else if (ty.get(.@"union")) |union_ty| { - if (il.*.node != .none) return false; - if (start_index.*) |_| return false; // overrides - if (union_ty.data.record.fields.len == 0) return false; + if (index < 2) { + index_list.items[0] = index + 1; + index_list.items.len = 1; + return .{ .il = try il.find(gpa, index), .qt = complex_ty }; + } + }, + .vector => |vector_ty| { + if (il.node != .null) return null; - ty.* = union_ty.data.record.fields[0].ty; - il.* = try il.*.find(p.gpa, 0); - return true; - } else { - try p.err(.too_many_scalar_init_braces); - return il.*.node == .none; - } -} + if (index < vector_ty.len) { + index_list.items[0] = index + 1; + index_list.items.len = 1; + return .{ .il = try il.find(gpa, index), .qt = vector_ty.elem }; + } + }, + .array => |array_ty| { + if (il.node != .null) return null; -fn coerceArrayInit(p: *Parser, item: *Result, tok: TokenIndex, target: Type) !bool { - return p.coerceArrayInitExtra(item, tok, target, true); + const max_len = switch (array_ty.len) { + .fixed, .static => |len| len, + else => std.math.maxInt(u64), + }; + if (index < max_len) { + index_list.items[0] = index + 1; + index_list.items.len = 1; + return .{ .il = try il.find(gpa, index), .qt = array_ty.elem }; + } + }, + .@"struct" => |struct_ty| { + if (il.node != .null) return null; + + if (index < struct_ty.fields.len) { + index_list.items[0] = index + 1; + index_list.items.len = 1; + const field_qt = struct_ty.fields[@intCast(index)].qt; + return .{ .il = try il.find(gpa, index), .qt = field_qt }; + } + }, + .@"union" => |union_ty| { + if (il.node != .null) return null; + if (union_ty.fields.len == 0) return null; + + if (index < union_ty.fields.len) { + index_list.items[0] = index + 1; + index_list.items.len = 1; + const field_qt = union_ty.fields[@intCast(index)].qt; + return .{ .il = try il.find(gpa, index), .qt = field_qt }; + } + }, + else => { + try p.err(first_tok, .too_many_scalar_init_braces, .{}); + if (il.node == .null) return .{ .il = il, .qt = qt }; + }, + } + return null; } -fn coerceArrayInitExtra(p: *Parser, item: *Result, tok: TokenIndex, target: Type, report_err: bool) !bool { - if (!target.isArray()) return false; +fn coerceArrayInit(p: *Parser, item: Result, tok: TokenIndex, target: QualType) !bool { + if (target.isInvalid()) return false; + const target_array_ty = target.get(p.comp, .array) orelse return false; const is_str_lit = p.nodeIs(item.node, .string_literal_expr); - if (!is_str_lit and !p.nodeIsCompoundLiteral(item.node) or !item.ty.isArray()) { - if (!report_err) return false; - try p.errTok(.array_init_str, tok); + const maybe_item_array_ty = item.qt.get(p.comp, .array); + if (!is_str_lit and (!p.nodeIs(item.node, .compound_literal_expr) or maybe_item_array_ty == null)) { + try p.err(tok, .array_init_str, .{}); return true; // do not do further coercion } - const target_spec = target.elemType().canonicalize(.standard).specifier; - const item_spec = item.ty.elemType().canonicalize(.standard).specifier; + const target_elem = target_array_ty.elem; + const item_elem = maybe_item_array_ty.?.elem; + + const target_int = target_elem.get(p.comp, .int) orelse .int; // not int; string compat checks below will fail by design + const item_int = item_elem.get(p.comp, .int) orelse .int; // not int; string compat checks below will fail by design - const compatible = target.elemType().eql(item.ty.elemType(), p.comp, false) or - (is_str_lit and item_spec == .char and (target_spec == .uchar or target_spec == .schar)) or - (is_str_lit and item_spec == .uchar and (target_spec == .uchar or target_spec == .schar or target_spec == .char)); + const compatible = target_elem.eql(item_elem, p.comp) or + (is_str_lit and item_int == .char and (target_int == .uchar or target_int == .schar)) or + (is_str_lit and item_int == .uchar and (target_int == .uchar or target_int == .schar or target_int == .char)); if (!compatible) { - if (!report_err) return false; - const e_msg = " with array of type "; - try p.errStr(.incompatible_array_init, tok, try p.typePairStrExtra(target, e_msg, item.ty)); + try p.err(tok, .incompatible_array_init, .{ target, item.qt }); return true; // do not do further coercion } - if (target.get(.array)) |arr_ty| { - assert(item.ty.specifier == .array); - const len = item.ty.arrayLen().?; - const array_len = arr_ty.arrayLen().?; + if (target_array_ty.len == .fixed) { + const target_len = target_array_ty.len.fixed; + const item_len = switch (maybe_item_array_ty.?.len) { + .fixed, .static => |len| len, + else => unreachable, + }; + if (is_str_lit) { // the null byte of a string can be dropped - if (len - 1 > array_len and report_err) { - try p.errTok(.str_init_too_long, tok); - } - } else if (len > array_len and report_err) { - try p.errStr( - .arr_init_too_long, - tok, - try p.typePairStrExtra(target, " with array of type ", item.ty), - ); + if (item_len - 1 > target_len) { + try p.err(tok, .str_init_too_long, .{}); + } + } else if (item_len > target_len) { + try p.err(tok, .arr_init_too_long, .{ target, item.qt }); } } return true; } -fn coerceInit(p: *Parser, item: *Result, tok: TokenIndex, target: Type) !void { - if (target.is(.void)) return; // Do not do type coercion on excess items +fn coerceInit(p: *Parser, item: *Result, tok: TokenIndex, target: QualType) !void { + if (target.isInvalid()) return; const node = item.node; - try item.lvalConversion(p); - if (target.is(.auto_type)) { - if (p.getNode(node, .member_access_expr) orelse p.getNode(node, .member_access_ptr_expr)) |member_node| { - if (p.tmpTree().isBitfield(member_node)) try p.errTok(.auto_type_from_bitfield, tok); + if (target.isAutoType() or target.isC23Auto()) { + if (p.getNode(node, .member_access_expr) orelse p.getNode(node, .member_access_ptr_expr)) |access| { + if (access.isBitFieldWidth(&p.tree) != null) try p.err(tok, .auto_type_from_bitfield, .{}); } - return; - } else if (target.is(.c23_auto)) { + try item.lvalConversion(p, tok); return; } try item.coerce(p, target, tok, .init); + if (item.val.opt_ref == .none) runtime: { + const diagnostic: Diagnostic = switch (p.init_context) { + .runtime => break :runtime, + .constexpr => .constexpr_requires_const, + .static => break :runtime, // TODO: set this to .non_constant_initializer once we are capable of saving all valid values + }; + p.init_context = .runtime; // Suppress further "non-constant initializer" errors + try p.err(tok, diagnostic, .{}); + } + if (target.@"const" or p.init_context == .constexpr) { + return item.putValue(p); + } + return item.saveValue(p); } -fn isStringInit(p: *Parser, ty: Type) bool { - if (!ty.isArray() or !ty.elemType().isInt()) return false; - var i = p.tok_i; - while (true) : (i += 1) { - switch (p.tok_ids[i]) { - .l_paren => {}, - .string_literal, - .string_literal_utf_16, - .string_literal_utf_8, - .string_literal_utf_32, - .string_literal_wide, - => return true, - else => return false, - } - } +fn isStringInit(p: *Parser, init_qt: QualType, node: Node.Index) bool { + const init_array_ty = init_qt.get(p.comp, .array) orelse return false; + if (!init_array_ty.elem.is(p.comp, .int)) return false; + return p.nodeIs(node, .string_literal_expr); } /// Convert InitList into an AST -fn convertInitList(p: *Parser, il: InitList, init_ty: Type) Error!NodeIndex { - const is_complex = init_ty.isComplex(); - if (init_ty.isScalar() and !is_complex) { - if (il.node == .none) { - return p.addNode(.{ .tag = .default_init_expr, .ty = init_ty, .data = undefined }); - } - return il.node; - } else if (init_ty.is(.variable_len_array)) { - return error.ParsingFailed; // vla invalid, reported earlier - } else if (init_ty.isArray() or is_complex) { - if (il.node != .none) { - return il.node; - } - const list_buf_top = p.list_buf.items.len; - defer p.list_buf.items.len = list_buf_top; - - const elem_ty = init_ty.elemType(); - - const max_items: u64 = init_ty.expectedInitListSize() orelse std.math.maxInt(usize); - var start: u64 = 0; - for (il.list.items) |*init| { - if (init.index > start) { - const elem = try p.addNode(.{ - .tag = .array_filler_expr, - .ty = elem_ty, - .data = .{ .int = init.index - start }, - }); - try p.list_buf.append(elem); +fn convertInitList(p: *Parser, il: InitList, init_qt: QualType) Error!Node.Index { + if (init_qt.isInvalid()) { + return try p.addNode(.{ .default_init_expr = .{ + .last_tok = p.tok_i, + .qt = init_qt, + } }); + } + + if (il.node.unpack()) |some| return some; + + const gpa = p.comp.gpa; + switch (init_qt.base(p.comp).type) { + .complex => |complex_ty| { + if (il.list.items.len == 0) { + return p.addNode(.{ .default_init_expr = .{ + .last_tok = p.tok_i - 1, + .qt = init_qt, + } }); + } + const first = try p.convertInitList(il.list.items[0].list, complex_ty); + const second = if (il.list.items.len > 1) + try p.convertInitList(il.list.items[1].list, complex_ty) + else + null; + + if (il.list.items.len == 2) { + try p.err(il.tok, .complex_component_init, .{}); } - start = init.index + 1; - const elem = try p.convertInitList(init.list, elem_ty); - try p.list_buf.append(elem); - } + const node = try p.addNode(.{ .array_init_expr = .{ + .container_qt = init_qt, + .items = if (second) |some| + &.{ first, some } + else + &.{first}, + .l_brace_tok = il.tok, + } }); + if (!complex_ty.isFloat(p.comp)) return node; + + const first_node = il.list.items[0].list.node.unpack() orelse return node; + const second_node = if (il.list.items.len > 1) il.list.items[1].list.node else .null; + + const first_val = p.tree.value_map.get(first_node) orelse return node; + const second_val = if (second_node.unpack()) |some| p.tree.value_map.get(some) orelse return node else Value.zero; + const complex_val = try Value.intern(p.comp, switch (complex_ty.bitSizeof(p.comp)) { + 32 => .{ .complex = .{ .cf32 = .{ first_val.toFloat(f32, p.comp), second_val.toFloat(f32, p.comp) } } }, + 64 => .{ .complex = .{ .cf64 = .{ first_val.toFloat(f64, p.comp), second_val.toFloat(f64, p.comp) } } }, + 80 => .{ .complex = .{ .cf80 = .{ first_val.toFloat(f80, p.comp), second_val.toFloat(f80, p.comp) } } }, + 128 => .{ .complex = .{ .cf128 = .{ first_val.toFloat(f128, p.comp), second_val.toFloat(f128, p.comp) } } }, + else => unreachable, + }); + try p.tree.value_map.put(gpa, node, complex_val); + return node; + }, + .vector => |vector_ty| { + const list_buf_top = p.list_buf.items.len; + defer p.list_buf.items.len = list_buf_top; + + const elem_ty = init_qt.childType(p.comp); + + const max_len = vector_ty.len; + var start: u64 = 0; + for (il.list.items) |*init| { + if (init.index > start) { + const elem = try p.addNode(.{ + .array_filler_expr = .{ + .last_tok = p.tok_i - 1, + .count = init.index - start, + .qt = elem_ty, + }, + }); + try p.list_buf.append(gpa, elem); + } + start = init.index + 1; - var arr_init_node: Tree.Node = .{ - .tag = .array_init_expr_two, - .ty = init_ty, - .data = .{ .two = .{ .none, .none } }, - }; + const elem = try p.convertInitList(init.list, elem_ty); + try p.list_buf.append(gpa, elem); + } + + if (start < max_len) { + const elem = try p.addNode(.{ + .array_filler_expr = .{ + .last_tok = p.tok_i - 1, + .count = max_len - start, + .qt = elem_ty, + }, + }); + try p.list_buf.append(gpa, elem); + } - const max_elems = p.comp.maxArrayBytes() / (@max(1, elem_ty.sizeof(p.comp) orelse 1)); - if (start > max_elems) { - try p.errTok(.array_too_large, il.tok); - start = max_elems; - } - - if (init_ty.specifier == .incomplete_array) { - arr_init_node.ty.specifier = .array; - arr_init_node.ty.data.array.len = start; - } else if (init_ty.is(.incomplete_array)) { - const arr_ty = try p.arena.create(Type.Array); - arr_ty.* = .{ .elem = init_ty.elemType(), .len = start }; - arr_init_node.ty = .{ - .specifier = .array, - .data = .{ .array = arr_ty }, + return p.addNode(.{ .array_init_expr = .{ + .l_brace_tok = il.tok, + .container_qt = init_qt, + .items = p.list_buf.items[list_buf_top..], + } }); + }, + .array => |array_ty| { + const list_buf_top = p.list_buf.items.len; + defer p.list_buf.items.len = list_buf_top; + + const elem_ty = init_qt.childType(p.comp); + + const max_len = switch (array_ty.len) { + .fixed, .static => |len| len, + // vla invalid, reported earlier + .variable => return try p.addNode(.{ .default_init_expr = .{ + .last_tok = p.tok_i, + .qt = init_qt, + } }), + else => std.math.maxInt(u64), }; - } else if (start < max_items) { - const elem = try p.addNode(.{ - .tag = .array_filler_expr, - .ty = elem_ty, - .data = .{ .int = max_items - start }, - }); - try p.list_buf.append(elem); - } + var start: u64 = 0; + for (il.list.items) |*init| { + if (init.index > start) { + const elem = try p.addNode(.{ + .array_filler_expr = .{ + .last_tok = p.tok_i - 1, + .count = init.index - start, + .qt = elem_ty, + }, + }); + try p.list_buf.append(gpa, elem); + } + start = init.index + 1; - const items = p.list_buf.items[list_buf_top..]; - switch (items.len) { - 0 => {}, - 1 => arr_init_node.data.two[0] = items[0], - 2 => arr_init_node.data.two = .{ items[0], items[1] }, - else => { - arr_init_node.tag = .array_init_expr; - arr_init_node.data = .{ .range = try p.addList(items) }; - }, - } - return try p.addNode(arr_init_node); - } else if (init_ty.get(.@"struct")) |struct_ty| { - assert(!struct_ty.hasIncompleteSize()); - if (il.node != .none) { - return il.node; - } + const elem = try p.convertInitList(init.list, elem_ty); + try p.list_buf.append(gpa, elem); + } - const list_buf_top = p.list_buf.items.len; - defer p.list_buf.items.len = list_buf_top; + const max_elems = p.comp.maxArrayBytes() / (@max(1, elem_ty.sizeofOrNull(p.comp) orelse 1)); + if (start > max_elems) { + try p.err(il.tok, .array_too_large, .{}); + start = max_elems; + } - var init_index: usize = 0; - for (struct_ty.data.record.fields, 0..) |f, i| { - if (init_index < il.list.items.len and il.list.items[init_index].index == i) { - const item = try p.convertInitList(il.list.items[init_index].list, f.ty); - try p.list_buf.append(item); - init_index += 1; - } else { - const item = try p.addNode(.{ .tag = .default_init_expr, .ty = f.ty, .data = undefined }); - try p.list_buf.append(item); + var arr_init_qt = init_qt; + if (array_ty.len == .incomplete) { + arr_init_qt = try p.comp.type_store.put(gpa, .{ .array = .{ + .elem = array_ty.elem, + .len = .{ .fixed = start }, + } }); + } else if (start < max_len) { + const elem = try p.addNode(.{ + .array_filler_expr = .{ + .last_tok = p.tok_i - 1, + .count = max_len - start, + .qt = elem_ty, + }, + }); + try p.list_buf.append(gpa, elem); } - } - var struct_init_node: Tree.Node = .{ - .tag = .struct_init_expr_two, - .ty = init_ty, - .data = .{ .two = .{ .none, .none } }, - }; - const items = p.list_buf.items[list_buf_top..]; - switch (items.len) { - 0 => {}, - 1 => struct_init_node.data.two[0] = items[0], - 2 => struct_init_node.data.two = .{ items[0], items[1] }, - else => { - struct_init_node.tag = .struct_init_expr; - struct_init_node.data = .{ .range = try p.addList(items) }; - }, - } - return try p.addNode(struct_init_node); - } else if (init_ty.get(.@"union")) |union_ty| { - if (il.node != .none) { - return il.node; - } + return p.addNode(.{ .array_init_expr = .{ + .l_brace_tok = il.tok, + .container_qt = arr_init_qt, + .items = p.list_buf.items[list_buf_top..], + } }); + }, + .@"struct" => |struct_ty| { + assert(struct_ty.layout != null); + const list_buf_top = p.list_buf.items.len; + defer p.list_buf.items.len = list_buf_top; + + var init_index: usize = 0; + for (struct_ty.fields, 0..) |field, i| { + if (init_index < il.list.items.len and il.list.items[init_index].index == i) { + const item = try p.convertInitList(il.list.items[init_index].list, field.qt); + try p.list_buf.append(gpa, item); + init_index += 1; + } else { + const item = try p.addNode(.{ + .default_init_expr = .{ + .last_tok = il.tok, + .qt = field.qt, + }, + }); + try p.list_buf.append(gpa, item); + } + } - var union_init_node: Tree.Node = .{ - .tag = .union_init_expr, - .ty = init_ty, - .data = .{ .union_init = .{ .field_index = 0, .node = .none } }, - }; - if (union_ty.data.record.fields.len == 0) { - // do nothing for empty unions - } else if (il.list.items.len == 0) { - union_init_node.data.union_init.node = try p.addNode(.{ - .tag = .default_init_expr, - .ty = init_ty, - .data = undefined, - }); - } else { - const init = il.list.items[0]; - const index: u32 = @truncate(init.index); - const field_ty = union_ty.data.record.fields[index].ty; - union_init_node.data.union_init = .{ - .field_index = index, - .node = try p.convertInitList(init.list, field_ty), + return p.addNode(.{ .struct_init_expr = .{ + .l_brace_tok = il.tok, + .container_qt = init_qt, + .items = p.list_buf.items[list_buf_top..], + } }); + }, + .@"union" => |union_ty| { + const init_node, const index = if (union_ty.fields.len == 0) + // do nothing for empty unions + .{ null, 0 } + else if (il.list.items.len == 0) + .{ try p.addNode(.{ .default_init_expr = .{ + .last_tok = p.tok_i - 1, + .qt = init_qt, + } }), 0 } + else blk: { + const init = il.list.items[0]; + const index: u32 = @truncate(init.index); + const field_qt = union_ty.fields[index].qt; + + break :blk .{ try p.convertInitList(init.list, field_qt), index }; }; - } - return try p.addNode(union_init_node); - } else { - return error.ParsingFailed; // initializer target is invalid, reported earlier + return p.addNode(.{ .union_init_expr = .{ + .field_index = index, + .initializer = init_node, + .l_brace_tok = il.tok, + .union_qt = init_qt, + } }); + }, + // initializer target is invalid, reported earlier + else => return try p.addNode(.{ .default_init_expr = .{ + .last_tok = p.tok_i, + .qt = init_qt, + } }), } } -fn msvcAsmStmt(p: *Parser) Error!?NodeIndex { +fn msvcAsmStmt(p: *Parser) Error!?Node.Index { return p.todo("MSVC assembly statements"); } /// asmOperand : ('[' IDENTIFIER ']')? asmStr '(' expr ')' -fn asmOperand(p: *Parser, names: *std.array_list.Managed(?TokenIndex), constraints: *NodeList, exprs: *NodeList) Error!void { +fn asmOperand(p: *Parser, names: *std.ArrayList(?TokenIndex), constraints: *NodeList, exprs: *NodeList) Error!void { + const gpa = p.comp.gpa; if (p.eatToken(.l_bracket)) |l_bracket| { const ident = (try p.eatIdentifier()) orelse { - try p.err(.expected_identifier); + try p.err(p.tok_i, .expected_identifier, .{}); return error.ParsingFailed; }; - try names.append(ident); + try names.append(gpa, ident); try p.expectClosing(l_bracket, .r_bracket); } else { - try names.append(null); + try names.append(gpa, null); } const constraint = try p.asmStr(); - try constraints.append(constraint.node); + try constraints.append(gpa, constraint.node); const l_paren = p.eatToken(.l_paren) orelse { - try p.errExtra(.expected_token, p.tok_i, .{ .tok_id = .{ .actual = p.tok_ids[p.tok_i], .expected = .l_paren } }); + try p.err(p.tok_i, .expected_token, .{ p.tok_ids[p.tok_i], .l_paren }); return error.ParsingFailed; }; - const res = try p.expr(); + const maybe_res = try p.expr(); try p.expectClosing(l_paren, .r_paren); - try res.expect(p); - try exprs.append(res.node); + const res = try p.expectResult(maybe_res); + try exprs.append(gpa, res.node); } /// gnuAsmStmt @@ -4024,34 +4749,39 @@ fn asmOperand(p: *Parser, names: *std.array_list.Managed(?TokenIndex), constrain /// | asmStr ':' asmOperand* ':' asmOperand* /// | asmStr ':' asmOperand* ':' asmOperand* : asmStr? (',' asmStr)* /// | asmStr ':' asmOperand* ':' asmOperand* : asmStr? (',' asmStr)* : IDENTIFIER (',' IDENTIFIER)* -fn gnuAsmStmt(p: *Parser, quals: Tree.GNUAssemblyQualifiers, asm_tok: TokenIndex, l_paren: TokenIndex) Error!NodeIndex { +fn gnuAsmStmt(p: *Parser, quals: Tree.GNUAssemblyQualifiers, asm_tok: TokenIndex, l_paren: TokenIndex) Error!Node.Index { + const gpa = p.comp.gpa; const asm_str = try p.asmStr(); try p.checkAsmStr(asm_str.val, l_paren); if (p.tok_ids[p.tok_i] == .r_paren) { - return p.addNode(.{ - .tag = .gnu_asm_simple, - .ty = .{ .specifier = .void }, - .data = .{ .un = asm_str.node }, - .loc = @enumFromInt(asm_tok), + return try p.addNode(.{ + .gnu_asm_simple = .{ + .asm_str = asm_str.node, + .asm_tok = asm_tok, + }, }); } const expected_items = 8; // arbitrarily chosen, most assembly will have fewer than 8 inputs/outputs/constraints/names - const bytes_needed = expected_items * @sizeOf(?TokenIndex) + expected_items * 3 * @sizeOf(NodeIndex); + const bytes_needed = expected_items * @sizeOf(?TokenIndex) + expected_items * 3 * @sizeOf(Node.Index); - var stack_fallback = std.heap.stackFallback(bytes_needed, p.gpa); + var stack_fallback = std.heap.stackFallback(bytes_needed, gpa); const allocator = stack_fallback.get(); // TODO: Consider using a TokenIndex of 0 instead of null if we need to store the names in the tree - var names = std.array_list.Managed(?TokenIndex).initCapacity(allocator, expected_items) catch unreachable; // stack allocation already succeeded - defer names.deinit(); - var constraints = NodeList.initCapacity(allocator, expected_items) catch unreachable; // stack allocation already succeeded - defer constraints.deinit(); - var exprs = NodeList.initCapacity(allocator, expected_items) catch unreachable; //stack allocation already succeeded - defer exprs.deinit(); - var clobbers = NodeList.initCapacity(allocator, expected_items) catch unreachable; //stack allocation already succeeded - defer clobbers.deinit(); + var names: std.ArrayList(?TokenIndex) = .empty; + defer names.deinit(allocator); + names.ensureUnusedCapacity(allocator, expected_items) catch unreachable; // stack allocation already succeeded + var constraints: NodeList = .empty; + defer constraints.deinit(allocator); + constraints.ensureUnusedCapacity(allocator, expected_items) catch unreachable; // stack allocation already succeeded + var exprs: NodeList = .empty; + defer exprs.deinit(allocator); + exprs.ensureUnusedCapacity(allocator, expected_items) catch unreachable; //stack allocation already succeeded + var clobbers: NodeList = .empty; + defer clobbers.deinit(allocator); + clobbers.ensureUnusedCapacity(allocator, expected_items) catch unreachable; //stack allocation already succeeded // Outputs var ate_extra_colon = false; @@ -4101,14 +4831,14 @@ fn gnuAsmStmt(p: *Parser, quals: Tree.GNUAssemblyQualifiers, asm_tok: TokenIndex if (!ate_extra_colon and p.tok_ids[p.tok_i].isStringLiteral()) { while (true) { const clobber = try p.asmStr(); - try clobbers.append(clobber.node); + try clobbers.append(allocator, clobber.node); if (p.eatToken(.comma) == null) break; } } } if (!quals.goto and (p.tok_ids[p.tok_i] != .r_paren or ate_extra_colon)) { - try p.errExtra(.expected_token, p.tok_i, .{ .tok_id = .{ .actual = p.tok_ids[p.tok_i], .expected = .r_paren } }); + try p.err(p.tok_i, .expected_token, .{ Tree.Token.Id.r_paren, p.tok_ids[p.tok_i] }); return error.ParsingFailed; } @@ -4120,38 +4850,37 @@ fn gnuAsmStmt(p: *Parser, quals: Tree.GNUAssemblyQualifiers, asm_tok: TokenIndex } while (true) { const ident = (try p.eatIdentifier()) orelse { - try p.err(.expected_identifier); + try p.err(p.tok_i, .expected_identifier, .{}); return error.ParsingFailed; }; const ident_str = p.tokSlice(ident); const label = p.findLabel(ident_str) orelse blk: { - try p.labels.append(.{ .unresolved_goto = ident }); + try p.labels.append(gpa, .{ .unresolved_goto = ident }); break :blk ident; }; - try names.append(ident); - - const elem_ty = try p.arena.create(Type); - elem_ty.* = .{ .specifier = .void }; - const result_ty = Type{ .specifier = .pointer, .data = .{ .sub_type = elem_ty } }; + try names.append(allocator, ident); const label_addr_node = try p.addNode(.{ - .tag = .addr_of_label, - .data = .{ .decl_ref = label }, - .ty = result_ty, - .loc = @enumFromInt(ident), + .addr_of_label = .{ + .label_tok = label, + .qt = .void_pointer, + }, }); - try exprs.append(label_addr_node); + try exprs.append(allocator, label_addr_node); num_labels += 1; if (p.eatToken(.comma) == null) break; } } else if (quals.goto) { - try p.errExtra(.expected_token, p.tok_i, .{ .tok_id = .{ .actual = p.tok_ids[p.tok_i], .expected = .colon } }); + try p.err(p.tok_i, .expected_token, .{ Token.Id.colon, p.tok_ids[p.tok_i] }); return error.ParsingFailed; } // TODO: validate and insert into AST - return .none; + return p.addNode(.{ .null_stmt = .{ + .semicolon_or_r_brace_tok = asm_tok, + .qt = .void, + } }); } fn checkAsmStr(p: *Parser, asm_str: Value, tok: TokenIndex) !void { @@ -4159,7 +4888,7 @@ fn checkAsmStr(p: *Parser, asm_str: Value, tok: TokenIndex) !void { const str = p.comp.interner.get(asm_str.ref()).bytes; if (str.len > 1) { // Empty string (just a NUL byte) is ok because it does not emit any assembly - try p.errTok(.gnu_asm_disabled, tok); + try p.err(tok, .gnu_asm_disabled, .{}); } } } @@ -4168,11 +4897,11 @@ fn checkAsmStr(p: *Parser, asm_str: Value, tok: TokenIndex) !void { /// : keyword_asm asmQual* '(' asmStr ')' /// | keyword_asm asmQual* '(' gnuAsmStmt ')' /// | keyword_asm msvcAsmStmt -fn assembly(p: *Parser, kind: enum { global, decl_label, stmt }) Error!?NodeIndex { +fn assembly(p: *Parser, kind: enum { global, decl_label, stmt }) Error!?Node.Index { const asm_tok = p.tok_i; switch (p.tok_ids[p.tok_i]) { .keyword_asm => { - try p.err(.extension_token_used); + try p.err(p.tok_i, .extension_token_used, .{}); p.tok_i += 1; }, .keyword_asm1, .keyword_asm2 => p.tok_i += 1, @@ -4186,41 +4915,41 @@ fn assembly(p: *Parser, kind: enum { global, decl_label, stmt }) Error!?NodeInde var quals: Tree.GNUAssemblyQualifiers = .{}; while (true) : (p.tok_i += 1) switch (p.tok_ids[p.tok_i]) { .keyword_volatile, .keyword_volatile1, .keyword_volatile2 => { - if (kind != .stmt) try p.errStr(.meaningless_asm_qual, p.tok_i, "volatile"); - if (quals.@"volatile") try p.errStr(.duplicate_asm_qual, p.tok_i, "volatile"); + if (kind != .stmt) try p.err(p.tok_i, .meaningless_asm_qual, .{"volatile"}); + if (quals.@"volatile") try p.err(p.tok_i, .duplicate_asm_qual, .{"volatile"}); quals.@"volatile" = true; }, .keyword_inline, .keyword_inline1, .keyword_inline2 => { - if (kind != .stmt) try p.errStr(.meaningless_asm_qual, p.tok_i, "inline"); - if (quals.@"inline") try p.errStr(.duplicate_asm_qual, p.tok_i, "inline"); + if (kind != .stmt) try p.err(p.tok_i, .meaningless_asm_qual, .{"inline"}); + if (quals.@"inline") try p.err(p.tok_i, .duplicate_asm_qual, .{"inline"}); quals.@"inline" = true; }, .keyword_goto => { - if (kind != .stmt) try p.errStr(.meaningless_asm_qual, p.tok_i, "goto"); - if (quals.goto) try p.errStr(.duplicate_asm_qual, p.tok_i, "goto"); + if (kind != .stmt) try p.err(p.tok_i, .meaningless_asm_qual, .{"goto"}); + if (quals.goto) try p.err(p.tok_i, .duplicate_asm_qual, .{"goto"}); quals.goto = true; }, else => break, }; const l_paren = try p.expectToken(.l_paren); - var result_node: NodeIndex = .none; + var result_node: ?Node.Index = null; switch (kind) { .decl_label => { const asm_str = try p.asmStr(); const str = try p.removeNull(asm_str.val); const attr = Attribute{ .tag = .asm_label, .args = .{ .asm_label = .{ .name = str } }, .syntax = .keyword }; - try p.attr_buf.append(p.gpa, .{ .attr = attr, .tok = asm_tok }); + try p.attr_buf.append(p.comp.gpa, .{ .attr = attr, .tok = asm_tok }); }, .global => { const asm_str = try p.asmStr(); try p.checkAsmStr(asm_str.val, l_paren); result_node = try p.addNode(.{ - .tag = .file_scope_asm, - .ty = .{ .specifier = .void }, - .data = .{ .decl = .{ .name = asm_tok, .node = asm_str.node } }, - .loc = @enumFromInt(asm_tok), + .global_asm = .{ + .asm_tok = asm_tok, + .asm_str = asm_str.node, + }, }); }, .stmt => result_node = try p.gnuAsmStmt(quals, asm_tok, l_paren), @@ -4237,22 +4966,22 @@ fn asmStr(p: *Parser) Error!Result { while (true) : (i += 1) switch (p.tok_ids[i]) { .string_literal, .unterminated_string_literal => {}, .string_literal_utf_16, .string_literal_utf_8, .string_literal_utf_32 => { - try p.errStr(.invalid_asm_str, p.tok_i, "unicode"); + try p.err(p.tok_i, .invalid_asm_str, .{"unicode"}); return error.ParsingFailed; }, .string_literal_wide => { - try p.errStr(.invalid_asm_str, p.tok_i, "wide"); + try p.err(p.tok_i, .invalid_asm_str, .{"wide"}); return error.ParsingFailed; }, else => { if (i == p.tok_i) { - try p.errStr(.expected_str_literal_in, p.tok_i, "asm"); + try p.err(p.tok_i, .expected_str_literal_in, .{"asm"}); return error.ParsingFailed; } break; }, }; - return try p.stringLiteral(); + return p.stringLiteral(); } // ====== statements ====== @@ -4271,80 +5000,89 @@ fn asmStr(p: *Parser) Error!Result { /// | keyword_return expr? ';' /// | assembly ';' /// | expr? ';' -fn stmt(p: *Parser) Error!NodeIndex { +fn stmt(p: *Parser) Error!Node.Index { if (try p.labeledStmt()) |some| return some; if (try p.compoundStmt(false, null)) |some| return some; + const gpa = p.comp.gpa; if (p.eatToken(.keyword_if)) |kw_if| { const l_paren = try p.expectToken(.l_paren); + const cond_tok = p.tok_i; - var cond = try p.expr(); - try cond.expect(p); - try cond.lvalConversion(p); + var cond = try p.expect(expr); + try cond.lvalConversion(p, cond_tok); try cond.usualUnaryConversion(p, cond_tok); - if (!cond.ty.isScalar()) - try p.errStr(.statement_scalar, l_paren + 1, try p.typeStr(cond.ty)); + if (!cond.qt.isInvalid() and cond.qt.scalarKind(p.comp) == .none) + try p.err(l_paren + 1, .statement_scalar, .{cond.qt}); try cond.saveValue(p); + try p.expectClosing(l_paren, .r_paren); - const then = try p.stmt(); - const @"else" = if (p.eatToken(.keyword_else)) |_| try p.stmt() else .none; + const then_body = try p.stmt(); + const else_body = if (p.eatToken(.keyword_else)) |_| try p.stmt() else null; - if (then != .none and @"else" != .none) - return try p.addNode(.{ - .tag = .if_then_else_stmt, - .data = .{ .if3 = .{ .cond = cond.node, .body = (try p.addList(&.{ then, @"else" })).start } }, - .loc = @enumFromInt(kw_if), - }) - else - return try p.addNode(.{ - .tag = .if_then_stmt, - .data = .{ .bin = .{ .lhs = cond.node, .rhs = then } }, - .loc = @enumFromInt(kw_if), - }); + if (p.nodeIs(then_body, .null_stmt) and else_body == null) { + const semicolon_tok = then_body.get(&p.tree).null_stmt.semicolon_or_r_brace_tok; + const locs = p.pp.tokens.items(.loc); + const if_loc = locs[kw_if]; + const semicolon_loc = locs[semicolon_tok]; + if (if_loc.line == semicolon_loc.line) { + try p.err(semicolon_tok, .empty_if_body, .{}); + try p.err(semicolon_tok, .empty_if_body_note, .{}); + } + } + + return p.addNode(.{ .if_stmt = .{ + .if_tok = kw_if, + .cond = cond.node, + .then_body = then_body, + .else_body = else_body, + } }); } if (p.eatToken(.keyword_switch)) |kw_switch| { const l_paren = try p.expectToken(.l_paren); const cond_tok = p.tok_i; - var cond = try p.expr(); - try cond.expect(p); - try cond.lvalConversion(p); + var cond = try p.expect(expr); + try cond.lvalConversion(p, cond_tok); try cond.usualUnaryConversion(p, cond_tok); - if (!cond.ty.isInt()) - try p.errStr(.statement_int, l_paren + 1, try p.typeStr(cond.ty)); + // Switch condition can't be complex. + if (!cond.qt.isInvalid() and !cond.qt.isRealInt(p.comp)) { + try p.err(l_paren + 1, .statement_int, .{cond.qt}); + } + try cond.saveValue(p); try p.expectClosing(l_paren, .r_paren); const old_switch = p.@"switch"; - var @"switch" = Switch{ - .ranges = std.array_list.Managed(Switch.Range).init(p.gpa), - .ty = cond.ty, + var @"switch": Switch = .{ + .qt = cond.qt, .comp = p.comp, }; p.@"switch" = &@"switch"; defer { - @"switch".ranges.deinit(); + @"switch".ranges.deinit(gpa); p.@"switch" = old_switch; } const body = try p.stmt(); - return try p.addNode(.{ - .tag = .switch_stmt, - .data = .{ .bin = .{ .lhs = cond.node, .rhs = body } }, - .loc = @enumFromInt(kw_switch), - }); + return p.addNode(.{ .switch_stmt = .{ + .switch_tok = kw_switch, + .cond = cond.node, + .body = body, + } }); } if (p.eatToken(.keyword_while)) |kw_while| { const l_paren = try p.expectToken(.l_paren); + const cond_tok = p.tok_i; - var cond = try p.expr(); - try cond.expect(p); - try cond.lvalConversion(p); + var cond = try p.expect(expr); + try cond.lvalConversion(p, cond_tok); try cond.usualUnaryConversion(p, cond_tok); - if (!cond.ty.isScalar()) - try p.errStr(.statement_scalar, l_paren + 1, try p.typeStr(cond.ty)); + if (!cond.qt.isInvalid() and cond.qt.scalarKind(p.comp) == .none) + try p.err(l_paren + 1, .statement_scalar, .{cond.qt}); try cond.saveValue(p); + try p.expectClosing(l_paren, .r_paren); const body = body: { @@ -4354,11 +5092,11 @@ fn stmt(p: *Parser) Error!NodeIndex { break :body try p.stmt(); }; - return try p.addNode(.{ - .tag = .while_stmt, - .data = .{ .bin = .{ .lhs = cond.node, .rhs = body } }, - .loc = @enumFromInt(kw_while), - }); + return p.addNode(.{ .while_stmt = .{ + .while_tok = kw_while, + .cond = cond.node, + .body = body, + } }); } if (p.eatToken(.keyword_do)) |kw_do| { const body = body: { @@ -4370,23 +5108,24 @@ fn stmt(p: *Parser) Error!NodeIndex { _ = try p.expectToken(.keyword_while); const l_paren = try p.expectToken(.l_paren); + const cond_tok = p.tok_i; - var cond = try p.expr(); - try cond.expect(p); - try cond.lvalConversion(p); + var cond = try p.expect(expr); + try cond.lvalConversion(p, cond_tok); try cond.usualUnaryConversion(p, cond_tok); - if (!cond.ty.isScalar()) - try p.errStr(.statement_scalar, l_paren + 1, try p.typeStr(cond.ty)); + if (!cond.qt.isInvalid() and cond.qt.scalarKind(p.comp) == .none) + try p.err(l_paren + 1, .statement_scalar, .{cond.qt}); try cond.saveValue(p); try p.expectClosing(l_paren, .r_paren); _ = try p.expectToken(.semicolon); - return try p.addNode(.{ - .tag = .do_while_stmt, - .data = .{ .bin = .{ .lhs = cond.node, .rhs = body } }, - .loc = @enumFromInt(kw_do), - }); + + return p.addNode(.{ .do_while_stmt = .{ + .do_tok = kw_do, + .cond = cond.node, + .body = body, + } }); } if (p.eatToken(.keyword_for)) |kw_for| { try p.syms.pushScope(p); @@ -4399,30 +5138,41 @@ fn stmt(p: *Parser) Error!NodeIndex { // for (init const init_start = p.tok_i; - var err_start = p.comp.diagnostics.list.items.len; - var init = if (!got_decl) try p.expr() else Result{}; - try init.saveValue(p); - try init.maybeWarnUnused(p, init_start, err_start); + var prev_total = p.diagnostics.total; + const init = init: { + if (got_decl) break :init null; + var init = (try p.expr()) orelse break :init null; + + try init.saveValue(p); + try init.maybeWarnUnused(p, init_start, prev_total); + break :init init.node; + }; if (!got_decl) _ = try p.expectToken(.semicolon); // for (init; cond - const cond_tok = p.tok_i; - var cond = try p.expr(); - if (cond.node != .none) { - try cond.lvalConversion(p); + const cond = cond: { + const cond_tok = p.tok_i; + var cond = (try p.expr()) orelse break :cond null; + + try cond.lvalConversion(p, cond_tok); try cond.usualUnaryConversion(p, cond_tok); - if (!cond.ty.isScalar()) - try p.errStr(.statement_scalar, l_paren + 1, try p.typeStr(cond.ty)); - } - try cond.saveValue(p); + if (!cond.qt.isInvalid() and cond.qt.scalarKind(p.comp) == .none) + try p.err(l_paren + 1, .statement_scalar, .{cond.qt}); + try cond.saveValue(p); + break :cond cond.node; + }; _ = try p.expectToken(.semicolon); // for (init; cond; incr const incr_start = p.tok_i; - err_start = p.comp.diagnostics.list.items.len; - var incr = try p.expr(); - try incr.maybeWarnUnused(p, incr_start, err_start); - try incr.saveValue(p); + prev_total = p.diagnostics.total; + const incr = incr: { + var incr = (try p.expr()) orelse break :incr null; + + try incr.maybeWarnUnused(p, incr_start, prev_total); + try incr.saveValue(p); + break :incr incr.node; + }; try p.expectClosing(l_paren, .r_paren); const body = body: { @@ -4432,93 +5182,71 @@ fn stmt(p: *Parser) Error!NodeIndex { break :body try p.stmt(); }; - if (got_decl) { - const start = (try p.addList(p.decl_buf.items[decl_buf_top..])).start; - const end = (try p.addList(&.{ cond.node, incr.node, body })).end; - - return try p.addNode(.{ - .tag = .for_decl_stmt, - .data = .{ .range = .{ .start = start, .end = end } }, - .loc = @enumFromInt(kw_for), - }); - } else if (init.node == .none and cond.node == .none and incr.node == .none) { - return try p.addNode(.{ - .tag = .forever_stmt, - .data = .{ .un = body }, - .loc = @enumFromInt(kw_for), - }); - } else return try p.addNode(.{ - .tag = .for_stmt, - .data = .{ .if3 = .{ - .cond = body, - .body = (try p.addList(&.{ init.node, cond.node, incr.node })).start, - } }, - .loc = @enumFromInt(kw_for), - }); + return p.addNode(.{ .for_stmt = .{ + .for_tok = kw_for, + .init = if (decl_buf_top == p.decl_buf.items.len) + .{ .expr = init } + else + .{ .decls = p.decl_buf.items[decl_buf_top..] }, + .cond = cond, + .incr = incr, + .body = body, + } }); } if (p.eatToken(.keyword_goto)) |goto_tok| { if (p.eatToken(.asterisk)) |_| { const expr_tok = p.tok_i; - var e = try p.expr(); - try e.expect(p); - try e.lvalConversion(p); + var goto_expr = try p.expect(expr); + try goto_expr.lvalConversion(p, expr_tok); p.computed_goto_tok = p.computed_goto_tok orelse goto_tok; - if (!e.ty.isPtr()) { - const elem_ty = try p.arena.create(Type); - elem_ty.* = .{ .specifier = .void, .qual = .{ .@"const" = true } }; - const result_ty = Type{ - .specifier = .pointer, - .data = .{ .sub_type = elem_ty }, - }; - if (!e.ty.isInt()) { - try p.errStr(.incompatible_arg, expr_tok, try p.typePairStrExtra(e.ty, " to parameter of incompatible type ", result_ty)); + + if (!goto_expr.qt.isInvalid() and !goto_expr.qt.isPointer(p.comp)) { + const result_qt = try p.comp.type_store.put(gpa, .{ .pointer = .{ + .child = .{ .@"const" = true, ._index = .void }, + .decayed = null, + } }); + if (!goto_expr.qt.isRealInt(p.comp)) { + try p.err(expr_tok, .incompatible_arg, .{ goto_expr.qt, result_qt }); return error.ParsingFailed; } - if (e.val.isZero(p.comp)) { - try e.nullCast(p, result_ty); + if (goto_expr.val.isZero(p.comp)) { + try goto_expr.nullToPointer(p, result_qt, expr_tok); } else { - try p.errStr(.implicit_int_to_ptr, expr_tok, try p.typePairStrExtra(e.ty, " to ", result_ty)); - try e.ptrCast(p, result_ty); + try p.err(expr_tok, .implicit_int_to_ptr, .{ goto_expr.qt, result_qt }); + try goto_expr.castToPointer(p, result_qt, expr_tok); } } - try e.un(p, .computed_goto_stmt, goto_tok); - _ = try p.expectToken(.semicolon); - return e.node; + return p.addNode(.{ .computed_goto_stmt = .{ .goto_tok = goto_tok, .expr = goto_expr.node } }); } const name_tok = try p.expectIdentifier(); const str = p.tokSlice(name_tok); if (p.findLabel(str) == null) { - try p.labels.append(.{ .unresolved_goto = name_tok }); + try p.labels.append(gpa, .{ .unresolved_goto = name_tok }); } _ = try p.expectToken(.semicolon); - return try p.addNode(.{ - .tag = .goto_stmt, - .data = .{ .decl_ref = name_tok }, - .loc = @enumFromInt(goto_tok), - }); + return p.addNode(.{ .goto_stmt = .{ .label_tok = name_tok } }); } if (p.eatToken(.keyword_continue)) |cont| { - if (!p.in_loop) try p.errTok(.continue_not_in_loop, cont); + if (!p.in_loop) try p.err(cont, .continue_not_in_loop, .{}); _ = try p.expectToken(.semicolon); - return try p.addNode(.{ .tag = .continue_stmt, .data = undefined, .loc = @enumFromInt(cont) }); + return p.addNode(.{ .continue_stmt = .{ .continue_tok = cont } }); } if (p.eatToken(.keyword_break)) |br| { - if (!p.in_loop and p.@"switch" == null) try p.errTok(.break_not_in_loop_or_switch, br); + if (!p.in_loop and p.@"switch" == null) try p.err(br, .break_not_in_loop_or_switch, .{}); _ = try p.expectToken(.semicolon); - return try p.addNode(.{ .tag = .break_stmt, .data = undefined, .loc = @enumFromInt(br) }); + return p.addNode(.{ .break_stmt = .{ .break_tok = br } }); } if (try p.returnStmt()) |some| return some; if (try p.assembly(.stmt)) |some| return some; const expr_start = p.tok_i; - const err_start = p.comp.diagnostics.list.items.len; + const prev_total = p.diagnostics.total; - const e = try p.expr(); - if (e.node != .none) { + if (try p.expr()) |some| { _ = try p.expectToken(.semicolon); - try e.maybeWarnUnused(p, expr_start, err_start); - return e.node; + try some.maybeWarnUnused(p, expr_start, prev_total); + return some.node; } const attr_buf_top = p.attr_buf.len; @@ -4526,12 +5254,13 @@ fn stmt(p: *Parser) Error!NodeIndex { try p.attributeSpecifier(); if (p.eatToken(.semicolon)) |semicolon| { - var null_node: Tree.Node = .{ .tag = .null_stmt, .data = undefined, .loc = @enumFromInt(semicolon) }; - null_node.ty = try Attribute.applyStatementAttributes(p, null_node.ty, expr_start, attr_buf_top); - return p.addNode(null_node); + return p.addNode(.{ .null_stmt = .{ + .semicolon_or_r_brace_tok = semicolon, + .qt = try Attribute.applyStatementAttributes(p, expr_start, attr_buf_top), + } }); } - try p.err(.expected_stmt); + try p.err(p.tok_i, .expected_stmt, .{}); return error.ParsingFailed; } @@ -4539,16 +5268,16 @@ fn stmt(p: *Parser) Error!NodeIndex { /// : IDENTIFIER ':' stmt /// | keyword_case integerConstExpr ':' stmt /// | keyword_default ':' stmt -fn labeledStmt(p: *Parser) Error!?NodeIndex { +fn labeledStmt(p: *Parser) Error!?Node.Index { if ((p.tok_ids[p.tok_i] == .identifier or p.tok_ids[p.tok_i] == .extended_identifier) and p.tok_ids[p.tok_i + 1] == .colon) { const name_tok = try p.expectIdentifier(); const str = p.tokSlice(name_tok); if (p.findLabel(str)) |some| { - try p.errStr(.duplicate_label, name_tok, str); - try p.errStr(.previous_label, some, str); + try p.err(name_tok, .duplicate_label, .{str}); + try p.err(some, .previous_label, .{str}); } else { p.label_count += 1; - try p.labels.append(.{ .label = name_tok }); + try p.labels.append(p.comp.gpa, .{ .label = name_tok }); var i: usize = 0; while (i < p.labels.items.len) { if (p.labels.items[i] == .unresolved_goto and @@ -4564,73 +5293,74 @@ fn labeledStmt(p: *Parser) Error!?NodeIndex { defer p.attr_buf.len = attr_buf_top; try p.attributeSpecifier(); - var labeled_stmt = Tree.Node{ - .tag = .labeled_stmt, - .data = .{ .decl = .{ .name = name_tok, .node = try p.labelableStmt() } }, - .loc = @enumFromInt(name_tok), - }; - labeled_stmt.ty = try Attribute.applyLabelAttributes(p, labeled_stmt.ty, attr_buf_top); - return try p.addNode(labeled_stmt); + return try p.addNode(.{ .labeled_stmt = .{ + .qt = try Attribute.applyLabelAttributes(p, attr_buf_top), + .body = try p.labelableStmt(), + .label_tok = name_tok, + } }); } else if (p.eatToken(.keyword_case)) |case| { - const first_item = try p.integerConstExpr(.gnu_folding_extension); + var first_item = try p.integerConstExpr(.gnu_folding_extension); const ellipsis = p.tok_i; - const second_item = if (p.eatToken(.ellipsis) != null) blk: { - try p.errTok(.gnu_switch_range, ellipsis); + var second_item = if (p.eatToken(.ellipsis) != null) blk: { + try p.err(ellipsis, .gnu_switch_range, .{}); break :blk try p.integerConstExpr(.gnu_folding_extension); } else null; _ = try p.expectToken(.colon); - if (p.@"switch") |some| check: { - if (some.ty.hasIncompleteSize()) break :check; // error already reported for incomplete size + if (p.@"switch") |@"switch"| check: { + if (@"switch".qt.hasIncompleteSize(p.comp)) break :check; // error already reported for incomplete size + + // Coerce to switch condition type + try first_item.coerce(p, @"switch".qt, case + 1, .assign); + try first_item.putValue(p); + if (second_item) |*item| { + try item.coerce(p, @"switch".qt, ellipsis + 1, .assign); + try item.putValue(p); + } const first = first_item.val; const last = if (second_item) |second| second.val else first; if (first.opt_ref == .none) { - try p.errTok(.case_val_unavailable, case + 1); + try p.err(case + 1, .case_val_unavailable, .{}); break :check; } else if (last.opt_ref == .none) { - try p.errTok(.case_val_unavailable, ellipsis + 1); + try p.err(ellipsis + 1, .case_val_unavailable, .{}); break :check; } else if (last.compare(.lt, first, p.comp)) { - try p.errTok(.empty_case_range, case + 1); + try p.err(case + 1, .empty_case_range, .{}); break :check; } // TODO cast to target type - const prev = (try some.add(first, last, case + 1)) orelse break :check; + const prev = (try @"switch".add(first, last, case + 1)) orelse break :check; // TODO check which value was already handled - try p.errStr(.duplicate_switch_case, case + 1, try first_item.str(p)); - try p.errTok(.previous_case, prev.tok); + try p.err(case + 1, .duplicate_switch_case, .{first_item}); + try p.err(prev.tok, .previous_case, .{}); } else { - try p.errStr(.case_not_in_switch, case, "case"); - } - - const s = try p.labelableStmt(); - if (second_item) |some| return try p.addNode(.{ - .tag = .case_range_stmt, - .data = .{ .if3 = .{ .cond = s, .body = (try p.addList(&.{ first_item.node, some.node })).start } }, - .loc = @enumFromInt(case), - }) else return try p.addNode(.{ - .tag = .case_stmt, - .data = .{ .bin = .{ .lhs = first_item.node, .rhs = s } }, - .loc = @enumFromInt(case), - }); + try p.err(case, .case_not_in_switch, .{"case"}); + } + + return try p.addNode(.{ .case_stmt = .{ + .case_tok = case, + .start = first_item.node, + .end = if (second_item) |some| some.node else null, + .body = try p.labelableStmt(), + } }); } else if (p.eatToken(.keyword_default)) |default| { _ = try p.expectToken(.colon); - const s = try p.labelableStmt(); - const node = try p.addNode(.{ - .tag = .default_stmt, - .data = .{ .un = s }, - .loc = @enumFromInt(default), - }); + const node = try p.addNode(.{ .default_stmt = .{ + .default_tok = default, + .body = try p.labelableStmt(), + } }); + const @"switch" = p.@"switch" orelse { - try p.errStr(.case_not_in_switch, default, "default"); + try p.err(default, .case_not_in_switch, .{"default"}); return node; }; if (@"switch".default) |previous| { - try p.errTok(.multiple_default, default); - try p.errTok(.previous_case, previous); + try p.err(default, .multiple_default, .{}); + try p.err(previous, .previous_case, .{}); } else { @"switch".default = default; } @@ -4638,23 +5368,27 @@ fn labeledStmt(p: *Parser) Error!?NodeIndex { } else return null; } -fn labelableStmt(p: *Parser) Error!NodeIndex { +fn labelableStmt(p: *Parser) Error!Node.Index { if (p.tok_ids[p.tok_i] == .r_brace) { - try p.err(.label_compound_end); - return p.addNode(.{ .tag = .null_stmt, .data = undefined, .loc = @enumFromInt(p.tok_i) }); + try p.err(p.tok_i, .label_compound_end, .{}); + return p.addNode(.{ .null_stmt = .{ + .semicolon_or_r_brace_tok = p.tok_i, + .qt = .void, + } }); } return p.stmt(); } const StmtExprState = struct { last_expr_tok: TokenIndex = 0, - last_expr_res: Result = .{ .ty = .{ .specifier = .void } }, + last_expr_qt: QualType = .void, }; /// compoundStmt : '{' ( decl | keyword_extension decl | staticAssert | stmt)* '}' -fn compoundStmt(p: *Parser, is_fn_body: bool, stmt_expr_state: ?*StmtExprState) Error!?NodeIndex { +fn compoundStmt(p: *Parser, is_fn_body: bool, stmt_expr_state: ?*StmtExprState) Error!?Node.Index { const l_brace = p.eatToken(.l_brace) orelse return null; + const gpa = p.comp.gpa; const decl_buf_top = p.decl_buf.items.len; defer p.decl_buf.items.len = decl_buf_top; @@ -4685,23 +5419,19 @@ fn compoundStmt(p: *Parser, is_fn_body: bool, stmt_expr_state: ?*StmtExprState) }, else => |e| return e, }; - if (s == .none) continue; if (stmt_expr_state) |state| { state.* = .{ .last_expr_tok = stmt_tok, - .last_expr_res = .{ - .node = s, - .ty = p.nodes.items(.ty)[@intFromEnum(s)], - }, + .last_expr_qt = s.qt(&p.tree), }; } - try p.decl_buf.append(s); + try p.decl_buf.append(gpa, s); if (noreturn_index == null and p.nodeIsNoreturn(s) == .yes) { noreturn_index = p.tok_i; noreturn_label_count = p.label_count; } - switch (p.nodes.items(.tag)[@intFromEnum(s)]) { + switch (s.get(&p.tree)) { .case_stmt, .default_stmt, .labeled_stmt => noreturn_index = null, else => {}, } @@ -4710,7 +5440,7 @@ fn compoundStmt(p: *Parser, is_fn_body: bool, stmt_expr_state: ?*StmtExprState) if (noreturn_index) |some| { // if new labels were defined we cannot be certain that the code is unreachable - if (some != p.tok_i - 1 and noreturn_label_count == p.label_count) try p.errTok(.unreachable_code, some); + if (some != p.tok_i - 1 and noreturn_label_count == p.label_count) try p.err(some, .unreachable_code, .{}); } if (is_fn_body) { const last_noreturn = if (p.decl_buf.items.len == decl_buf_top) @@ -4718,82 +5448,84 @@ fn compoundStmt(p: *Parser, is_fn_body: bool, stmt_expr_state: ?*StmtExprState) else p.nodeIsNoreturn(p.decl_buf.items[p.decl_buf.items.len - 1]); - if (last_noreturn != .yes) { - const ret_ty = p.func.ty.?.returnType(); + const ret_qt: QualType = if (p.func.qt.?.get(p.comp, .func)) |func_ty| func_ty.return_type else .invalid; + if (last_noreturn != .yes and !ret_qt.isInvalid()) { var return_zero = false; - if (last_noreturn == .no and !ret_ty.is(.void) and !ret_ty.isFunc() and !ret_ty.isArray()) { - const func_name = p.tokSlice(p.func.name); - const interned_name = try StrInt.intern(p.comp, func_name); - if (interned_name == p.string_ids.main_id and ret_ty.is(.int)) { - return_zero = true; - } else { - try p.errStr(.func_does_not_return, p.tok_i - 1, func_name); - } - } - try p.decl_buf.append(try p.addNode(.{ .tag = .implicit_return, .ty = p.func.ty.?.returnType(), .data = .{ .return_zero = return_zero }, .loc = @enumFromInt(r_brace) })); + if (last_noreturn == .no) switch (ret_qt.base(p.comp).type) { + .void => {}, + .func, .array => {}, // Invalid, error reported elsewhere + else => { + const func_name = p.tokSlice(p.func.name); + const interned_name = try p.comp.internString(func_name); + + if (interned_name == p.string_ids.main_id) { + if (ret_qt.get(p.comp, .int)) |int_ty| { + if (int_ty == .int) return_zero = true; + } + } + + if (!return_zero) { + try p.err(p.tok_i - 1, .func_does_not_return, .{func_name}); + } + }, + }; + + const implicit_ret = try p.addNode(.{ .return_stmt = .{ + .return_tok = r_brace, + .return_qt = ret_qt, + .operand = .{ .implicit = return_zero }, + } }); + try p.decl_buf.append(gpa, implicit_ret); } - if (p.func.ident) |some| try p.decl_buf.insert(decl_buf_top, some.node); - if (p.func.pretty_ident) |some| try p.decl_buf.insert(decl_buf_top, some.node); + if (p.func.ident) |some| try p.decl_buf.insert(gpa, decl_buf_top, some.node); + if (p.func.pretty_ident) |some| try p.decl_buf.insert(gpa, decl_buf_top, some.node); } - var node: Tree.Node = .{ - .tag = .compound_stmt_two, - .data = .{ .two = .{ .none, .none } }, - .loc = @enumFromInt(l_brace), - }; - const statements = p.decl_buf.items[decl_buf_top..]; - switch (statements.len) { - 0 => {}, - 1 => node.data = .{ .two = .{ statements[0], .none } }, - 2 => node.data = .{ .two = .{ statements[0], statements[1] } }, - else => { - node.tag = .compound_stmt; - node.data = .{ .range = try p.addList(statements) }; + return try p.addNode(.{ .compound_stmt = .{ + .body = p.decl_buf.items[decl_buf_top..], + .l_brace_tok = l_brace, + } }); +} + +fn pointerValue(p: *Parser, node: Node.Index, offset: Value) !Value { + switch (node.get(&p.tree)) { + .decl_ref_expr => |decl_ref| { + const var_name = try p.comp.internString(p.tokSlice(decl_ref.name_tok)); + const sym = p.syms.findSymbol(var_name) orelse return .{}; + const sym_node = sym.node.unpack() orelse return .{}; + return Value.pointer(.{ .node = @intFromEnum(sym_node), .offset = offset.ref() }, p.comp); }, + .string_literal_expr => return p.tree.value_map.get(node).?, + else => return .{}, } - return try p.addNode(node); } const NoreturnKind = enum { no, yes, complex }; -fn nodeIsNoreturn(p: *Parser, node: NodeIndex) NoreturnKind { - switch (p.nodes.items(.tag)[@intFromEnum(node)]) { +fn nodeIsNoreturn(p: *Parser, node: Node.Index) NoreturnKind { + switch (node.get(&p.tree)) { .break_stmt, .continue_stmt, .return_stmt => return .yes, - .if_then_else_stmt => { - const data = p.data.items[p.nodes.items(.data)[@intFromEnum(node)].if3.body..]; - const then_type = p.nodeIsNoreturn(data[0]); - const else_type = p.nodeIsNoreturn(data[1]); + .if_stmt => |@"if"| { + const else_type = p.nodeIsNoreturn(@"if".else_body orelse return .no); + const then_type = p.nodeIsNoreturn(@"if".then_body); if (then_type == .complex or else_type == .complex) return .complex; if (then_type == .yes and else_type == .yes) return .yes; return .no; }, - .compound_stmt_two => { - const data = p.nodes.items(.data)[@intFromEnum(node)]; - const lhs_type = if (data.two[0] != .none) p.nodeIsNoreturn(data.two[0]) else .no; - const rhs_type = if (data.two[1] != .none) p.nodeIsNoreturn(data.two[1]) else .no; - if (lhs_type == .complex or rhs_type == .complex) return .complex; - if (lhs_type == .yes or rhs_type == .yes) return .yes; - return .no; - }, - .compound_stmt => { - const data = p.nodes.items(.data)[@intFromEnum(node)]; - var it = data.range.start; - while (it != data.range.end) : (it += 1) { - const kind = p.nodeIsNoreturn(p.data.items[it]); + .compound_stmt => |compound| { + for (compound.body) |body_stmt| { + const kind = p.nodeIsNoreturn(body_stmt); if (kind != .no) return kind; } return .no; }, - .labeled_stmt => { - const data = p.nodes.items(.data)[@intFromEnum(node)]; - return p.nodeIsNoreturn(data.decl.node); + .labeled_stmt => |labeled| { + return p.nodeIsNoreturn(labeled.body); }, - .default_stmt => { - const data = p.nodes.items(.data)[@intFromEnum(node)]; - if (data.un == .none) return .no; - return p.nodeIsNoreturn(data.un); + .default_stmt => |default| { + return p.nodeIsNoreturn(default.body); }, - .while_stmt, .do_while_stmt, .for_decl_stmt, .forever_stmt, .for_stmt, .switch_stmt => return .complex, + .while_stmt, .do_while_stmt, .for_stmt, .switch_stmt => return .complex, else => return .no, } } @@ -4882,61 +5614,63 @@ fn nextStmt(p: *Parser, l_brace: TokenIndex) !void { unreachable; } -fn returnStmt(p: *Parser) Error!?NodeIndex { +fn returnStmt(p: *Parser) Error!?Node.Index { const ret_tok = p.eatToken(.keyword_return) orelse return null; const e_tok = p.tok_i; - var e = try p.expr(); + var ret_expr = try p.expr(); _ = try p.expectToken(.semicolon); - const ret_ty = p.func.ty.?.returnType(); - if (p.func.ty.?.hasAttribute(.noreturn)) { - try p.errStr(.invalid_noreturn, e_tok, p.tokSlice(p.func.name)); - } + const func_qt = p.func.qt.?; // `return` cannot be parsed outside of a function. + const ret_qt: QualType = if (func_qt.get(p.comp, .func)) |func_ty| func_ty.return_type else .invalid; + const ret_void = !ret_qt.isInvalid() and ret_qt.is(p.comp, .void); - if (e.node == .none) { - if (!ret_ty.is(.void)) try p.errStr(.func_should_return, ret_tok, p.tokSlice(p.func.name)); - return try p.addNode(.{ .tag = .return_stmt, .data = .{ .un = e.node }, .loc = @enumFromInt(ret_tok) }); - } else if (ret_ty.is(.void)) { - try p.errStr(.void_func_returns_value, e_tok, p.tokSlice(p.func.name)); - return try p.addNode(.{ .tag = .return_stmt, .data = .{ .un = e.node }, .loc = @enumFromInt(ret_tok) }); + if (func_qt.hasAttribute(p.comp, .noreturn)) { + try p.err(e_tok, .invalid_noreturn, .{p.tokSlice(p.func.name)}); } - try e.lvalConversion(p); - try e.coerce(p, ret_ty, e_tok, .ret); + if (ret_expr) |*some| { + if (ret_void) { + try p.err(e_tok, .void_func_returns_value, .{p.tokSlice(p.func.name)}); + } else { + try some.coerce(p, ret_qt, e_tok, .ret); + + try some.saveValue(p); + } + } else if (!ret_void) { + try p.err(ret_tok, .func_should_return, .{p.tokSlice(p.func.name)}); + } - try e.saveValue(p); - return try p.addNode(.{ .tag = .return_stmt, .data = .{ .un = e.node }, .loc = @enumFromInt(ret_tok) }); + return try p.addNode(.{ .return_stmt = .{ + .return_tok = ret_tok, + .operand = if (ret_expr) |some| .{ .expr = some.node } else .none, + .return_qt = ret_qt, + } }); } // ====== expressions ====== pub fn macroExpr(p: *Parser) Compilation.Error!bool { - const res = p.condExpr() catch |e| switch (e) { + const res = p.expect(condExpr) catch |e| switch (e) { error.OutOfMemory => return error.OutOfMemory, error.FatalError => return error.FatalError, error.ParsingFailed => return false, }; - if (res.val.opt_ref == .none) { - try p.errTok(.expected_expr, p.tok_i); - return false; - } return res.val.toBool(p.comp); } const CallExpr = union(enum) { - standard: NodeIndex, + standard: Node.Index, builtin: struct { - node: NodeIndex, + builtin_tok: TokenIndex, tag: Builtin.Tag, }, - fn init(p: *Parser, call_node: NodeIndex, func_node: NodeIndex) CallExpr { - if (p.getNode(call_node, .builtin_call_expr_one)) |node| { - const data = p.nodes.items(.data)[@intFromEnum(node)]; - const name = p.tokSlice(data.decl.name); - const builtin_ty = p.comp.builtins.lookup(name); - return .{ .builtin = .{ .node = node, .tag = builtin_ty.builtin.tag } }; + fn init(p: *Parser, call_node: Node.Index, func_node: Node.Index) CallExpr { + if (p.getNode(call_node, .builtin_ref)) |builtin_ref| { + const name = p.tokSlice(builtin_ref.name_tok); + const expanded = p.comp.builtins.lookup(name); + return .{ .builtin = .{ .builtin_tok = builtin_ref.name_tok, .tag = expanded.builtin.tag } }; } return .{ .standard = func_node }; } @@ -4945,9 +5679,9 @@ const CallExpr = union(enum) { return switch (self) { .standard => true, .builtin => |builtin| switch (builtin.tag) { - Builtin.tagFromName("__builtin_va_start").?, - Builtin.tagFromName("__va_start").?, - Builtin.tagFromName("va_start").?, + .__builtin_va_start, + .__va_start, + .va_start, => arg_idx != 1, else => true, }, @@ -4958,17 +5692,17 @@ const CallExpr = union(enum) { return switch (self) { .standard => true, .builtin => |builtin| switch (builtin.tag) { - Builtin.tagFromName("__builtin_va_start").?, - Builtin.tagFromName("__va_start").?, - Builtin.tagFromName("va_start").?, + .__builtin_va_start, + .__va_start, + .va_start, => arg_idx != 1, - Builtin.tagFromName("__builtin_add_overflow").?, - Builtin.tagFromName("__builtin_complex").?, - Builtin.tagFromName("__builtin_isinf").?, - Builtin.tagFromName("__builtin_isinf_sign").?, - Builtin.tagFromName("__builtin_mul_overflow").?, - Builtin.tagFromName("__builtin_isnan").?, - Builtin.tagFromName("__builtin_sub_overflow").?, + .__builtin_add_overflow, + .__builtin_complex, + .__builtin_isinf, + .__builtin_isinf_sign, + .__builtin_mul_overflow, + .__builtin_isnan, + .__builtin_sub_overflow, => false, else => true, }, @@ -4984,16 +5718,16 @@ const CallExpr = union(enum) { fn checkVarArg(self: CallExpr, p: *Parser, first_after: TokenIndex, param_tok: TokenIndex, arg: *Result, arg_idx: u32) !void { if (self == .standard) return; - const builtin_tok = p.nodes.items(.data)[@intFromEnum(self.builtin.node)].decl.name; + const builtin_tok = self.builtin.builtin_tok; switch (self.builtin.tag) { - Builtin.tagFromName("__builtin_va_start").?, - Builtin.tagFromName("__va_start").?, - Builtin.tagFromName("va_start").?, + .__builtin_va_start, + .__va_start, + .va_start, => return p.checkVaStartArg(builtin_tok, first_after, param_tok, arg, arg_idx), - Builtin.tagFromName("__builtin_complex").? => return p.checkComplexArg(builtin_tok, first_after, param_tok, arg, arg_idx), - Builtin.tagFromName("__builtin_add_overflow").?, - Builtin.tagFromName("__builtin_sub_overflow").?, - Builtin.tagFromName("__builtin_mul_overflow").?, + .__builtin_complex => return p.checkComplexArg(builtin_tok, first_after, param_tok, arg, arg_idx), + .__builtin_add_overflow, + .__builtin_sub_overflow, + .__builtin_mul_overflow, => return p.checkArithOverflowArg(builtin_tok, first_after, param_tok, arg, arg_idx), else => {}, @@ -5009,212 +5743,165 @@ const CallExpr = union(enum) { return switch (self) { .standard => null, .builtin => |builtin| switch (builtin.tag) { - Builtin.tagFromName("__c11_atomic_thread_fence").?, - Builtin.tagFromName("__c11_atomic_signal_fence").?, - Builtin.tagFromName("__c11_atomic_is_lock_free").?, - Builtin.tagFromName("__builtin_isinf").?, - Builtin.tagFromName("__builtin_isinf_sign").?, - Builtin.tagFromName("__builtin_isnan").?, + .__c11_atomic_thread_fence, + .__c11_atomic_signal_fence, + .__c11_atomic_is_lock_free, + .__builtin_isinf, + .__builtin_isinf_sign, + .__builtin_isnan, => 1, - Builtin.tagFromName("__builtin_complex").?, - Builtin.tagFromName("__c11_atomic_load").?, - Builtin.tagFromName("__c11_atomic_init").?, + .__builtin_complex, + .__c11_atomic_load, + .__c11_atomic_init, => 2, - Builtin.tagFromName("__c11_atomic_store").?, - Builtin.tagFromName("__c11_atomic_exchange").?, - Builtin.tagFromName("__c11_atomic_fetch_add").?, - Builtin.tagFromName("__c11_atomic_fetch_sub").?, - Builtin.tagFromName("__c11_atomic_fetch_or").?, - Builtin.tagFromName("__c11_atomic_fetch_xor").?, - Builtin.tagFromName("__c11_atomic_fetch_and").?, - Builtin.tagFromName("__atomic_fetch_add").?, - Builtin.tagFromName("__atomic_fetch_sub").?, - Builtin.tagFromName("__atomic_fetch_and").?, - Builtin.tagFromName("__atomic_fetch_xor").?, - Builtin.tagFromName("__atomic_fetch_or").?, - Builtin.tagFromName("__atomic_fetch_nand").?, - Builtin.tagFromName("__atomic_add_fetch").?, - Builtin.tagFromName("__atomic_sub_fetch").?, - Builtin.tagFromName("__atomic_and_fetch").?, - Builtin.tagFromName("__atomic_xor_fetch").?, - Builtin.tagFromName("__atomic_or_fetch").?, - Builtin.tagFromName("__atomic_nand_fetch").?, - Builtin.tagFromName("__builtin_add_overflow").?, - Builtin.tagFromName("__builtin_sub_overflow").?, - Builtin.tagFromName("__builtin_mul_overflow").?, + .__c11_atomic_store, + .__c11_atomic_exchange, + .__c11_atomic_fetch_add, + .__c11_atomic_fetch_sub, + .__c11_atomic_fetch_or, + .__c11_atomic_fetch_xor, + .__c11_atomic_fetch_and, + .__atomic_fetch_add, + .__atomic_fetch_sub, + .__atomic_fetch_and, + .__atomic_fetch_xor, + .__atomic_fetch_or, + .__atomic_fetch_nand, + .__atomic_add_fetch, + .__atomic_sub_fetch, + .__atomic_and_fetch, + .__atomic_xor_fetch, + .__atomic_or_fetch, + .__atomic_nand_fetch, + .__builtin_add_overflow, + .__builtin_sub_overflow, + .__builtin_mul_overflow, => 3, - Builtin.tagFromName("__c11_atomic_compare_exchange_strong").?, - Builtin.tagFromName("__c11_atomic_compare_exchange_weak").?, + .__c11_atomic_compare_exchange_strong, + .__c11_atomic_compare_exchange_weak, => 5, - Builtin.tagFromName("__atomic_compare_exchange").?, - Builtin.tagFromName("__atomic_compare_exchange_n").?, + .__atomic_compare_exchange, + .__atomic_compare_exchange_n, => 6, else => null, }, }; } - fn returnType(self: CallExpr, p: *Parser, callable_ty: Type) Type { - return switch (self) { - .standard => callable_ty.returnType(), - .builtin => |builtin| switch (builtin.tag) { - Builtin.tagFromName("__c11_atomic_exchange").? => { - if (p.list_buf.items.len != 4) return Type.invalid; // wrong number of arguments; already an error - const second_param = p.list_buf.items[2]; - return p.nodes.items(.ty)[@intFromEnum(second_param)]; - }, - Builtin.tagFromName("__c11_atomic_load").? => { - if (p.list_buf.items.len != 3) return Type.invalid; // wrong number of arguments; already an error - const first_param = p.list_buf.items[1]; - const ty = p.nodes.items(.ty)[@intFromEnum(first_param)]; - if (!ty.isPtr()) return Type.invalid; - return ty.elemType(); - }, + fn returnType(self: CallExpr, p: *Parser, func_qt: QualType) !QualType { + if (self == .standard) { + return if (func_qt.get(p.comp, .func)) |func_ty| func_ty.return_type else .invalid; + } + const builtin = self.builtin; + const func_ty = func_qt.get(p.comp, .func).?; + return switch (builtin.tag) { + .__c11_atomic_exchange => { + if (p.list_buf.items.len != 4) return .invalid; // wrong number of arguments; already an error + const second_param = p.list_buf.items[2]; + return second_param.qt(&p.tree); + }, + .__c11_atomic_load => { + if (p.list_buf.items.len != 3) return .invalid; // wrong number of arguments; already an error + const first_param = p.list_buf.items[1]; + const qt = first_param.qt(&p.tree); + if (!qt.isPointer(p.comp)) return .invalid; + return qt.childType(p.comp); + }, - Builtin.tagFromName("__atomic_fetch_add").?, - Builtin.tagFromName("__atomic_add_fetch").?, - Builtin.tagFromName("__c11_atomic_fetch_add").?, - - Builtin.tagFromName("__atomic_fetch_sub").?, - Builtin.tagFromName("__atomic_sub_fetch").?, - Builtin.tagFromName("__c11_atomic_fetch_sub").?, - - Builtin.tagFromName("__atomic_fetch_and").?, - Builtin.tagFromName("__atomic_and_fetch").?, - Builtin.tagFromName("__c11_atomic_fetch_and").?, - - Builtin.tagFromName("__atomic_fetch_xor").?, - Builtin.tagFromName("__atomic_xor_fetch").?, - Builtin.tagFromName("__c11_atomic_fetch_xor").?, - - Builtin.tagFromName("__atomic_fetch_or").?, - Builtin.tagFromName("__atomic_or_fetch").?, - Builtin.tagFromName("__c11_atomic_fetch_or").?, - - Builtin.tagFromName("__atomic_fetch_nand").?, - Builtin.tagFromName("__atomic_nand_fetch").?, - Builtin.tagFromName("__c11_atomic_fetch_nand").?, - => { - if (p.list_buf.items.len != 3) return Type.invalid; // wrong number of arguments; already an error - const second_param = p.list_buf.items[2]; - return p.nodes.items(.ty)[@intFromEnum(second_param)]; - }, - Builtin.tagFromName("__builtin_complex").? => { - if (p.list_buf.items.len < 1) return Type.invalid; // not enough arguments; already an error - const last_param = p.list_buf.items[p.list_buf.items.len - 1]; - return p.nodes.items(.ty)[@intFromEnum(last_param)].makeComplex(); - }, - Builtin.tagFromName("__atomic_compare_exchange").?, - Builtin.tagFromName("__atomic_compare_exchange_n").?, - Builtin.tagFromName("__c11_atomic_is_lock_free").?, - => .{ .specifier = .bool }, - else => callable_ty.returnType(), - - Builtin.tagFromName("__c11_atomic_compare_exchange_strong").?, - Builtin.tagFromName("__c11_atomic_compare_exchange_weak").?, - => { - if (p.list_buf.items.len != 6) return Type.invalid; // wrong number of arguments - const third_param = p.list_buf.items[3]; - return p.nodes.items(.ty)[@intFromEnum(third_param)]; - }, + .__atomic_fetch_add, + .__atomic_add_fetch, + .__c11_atomic_fetch_add, + + .__atomic_fetch_sub, + .__atomic_sub_fetch, + .__c11_atomic_fetch_sub, + + .__atomic_fetch_and, + .__atomic_and_fetch, + .__c11_atomic_fetch_and, + + .__atomic_fetch_xor, + .__atomic_xor_fetch, + .__c11_atomic_fetch_xor, + + .__atomic_fetch_or, + .__atomic_or_fetch, + .__c11_atomic_fetch_or, + + .__atomic_fetch_nand, + .__atomic_nand_fetch, + .__c11_atomic_fetch_nand, + => { + if (p.list_buf.items.len != 3) return .invalid; // wrong number of arguments; already an error + const second_param = p.list_buf.items[2]; + return second_param.qt(&p.tree); + }, + .__builtin_complex => { + if (p.list_buf.items.len < 1) return .invalid; // not enough arguments; already an error + const last_param = p.list_buf.items[p.list_buf.items.len - 1]; + return try last_param.qt(&p.tree).toComplex(p.comp); + }, + .__atomic_compare_exchange, + .__atomic_compare_exchange_n, + .__c11_atomic_is_lock_free, + => .bool, + else => func_ty.return_type, + + .__c11_atomic_compare_exchange_strong, + .__c11_atomic_compare_exchange_weak, + => { + if (p.list_buf.items.len != 6) return .invalid; // wrong number of arguments + const third_param = p.list_buf.items[3]; + return third_param.qt(&p.tree); }, }; } - fn finish(self: CallExpr, p: *Parser, ty: Type, list_buf_top: usize, arg_count: u32) Error!Result { - const ret_ty = self.returnType(p, ty); + fn finish(self: CallExpr, p: *Parser, func_qt: QualType, list_buf_top: usize, l_paren: TokenIndex) Error!Result { + const args = p.list_buf.items[list_buf_top..]; + const return_qt = try self.returnType(p, func_qt); switch (self) { - .standard => |func_node| { - var call_node: Tree.Node = .{ - .tag = .call_expr_one, - .ty = ret_ty, - .data = .{ .two = .{ func_node, .none } }, - }; - const args = p.list_buf.items[list_buf_top..]; - switch (arg_count) { - 0 => {}, - 1 => call_node.data.two[1] = args[1], // args[0] == func.node - else => { - call_node.tag = .call_expr; - call_node.data = .{ .range = try p.addList(args) }; - }, - } - return Result{ .node = try p.addNode(call_node), .ty = ret_ty }; + .standard => |func_node| return .{ + .qt = return_qt, + .node = try p.addNode(.{ .call_expr = .{ + .l_paren_tok = l_paren, + .qt = return_qt.unqualified(), + .callee = func_node, + .args = args, + } }), }, - .builtin => |builtin| { - const index = @intFromEnum(builtin.node); - var call_node = p.nodes.get(index); - defer p.nodes.set(index, call_node); - call_node.ty = ret_ty; - const args = p.list_buf.items[list_buf_top..]; - switch (arg_count) { - 0 => {}, - 1 => call_node.data.decl.node = args[1], // args[0] == func.node - else => { - call_node.tag = .builtin_call_expr; - args[0] = @enumFromInt(call_node.data.decl.name); - call_node.data = .{ .range = try p.addList(args) }; - }, - } - const val = try evalBuiltin(builtin.tag, p, args[1..]); - return Result{ .node = builtin.node, .ty = ret_ty, .val = val }; + .builtin => |builtin| return .{ + .val = try evalBuiltin(builtin.tag, p, args), + .qt = return_qt, + .node = try p.addNode(.{ .builtin_call_expr = .{ + .builtin_tok = builtin.builtin_tok, + .qt = return_qt, + .args = args, + } }), }, } } }; pub const Result = struct { - node: NodeIndex = .none, - ty: Type = .{ .specifier = .int }, + node: Node.Index, + qt: QualType = .int, val: Value = .{}, - const invalid: Result = .{ .ty = Type.invalid }; - - pub fn str(res: Result, p: *Parser) ![]const u8 { - switch (res.val.opt_ref) { - .none => return "(none)", - .null => return "nullptr_t", - else => {}, - } - const strings_top = p.strings.items.len; - defer p.strings.items.len = strings_top; - - try res.val.print(res.ty, p.comp, p.strings.writer()); - return try p.comp.diagnostics.arena.allocator().dupe(u8, p.strings.items[strings_top..]); - } - - fn expect(res: Result, p: *Parser) Error!void { - if (p.in_macro) { - if (res.val.opt_ref == .none) { - try p.errTok(.expected_expr, p.tok_i); - return error.ParsingFailed; - } - return; - } - if (res.node == .none) { - try p.errTok(.expected_expr, p.tok_i); - return error.ParsingFailed; - } - } - - fn empty(res: Result, p: *Parser) bool { - if (p.in_macro) return res.val.opt_ref == .none; - return res.node == .none; - } - - fn maybeWarnUnused(res: Result, p: *Parser, expr_start: TokenIndex, err_start: usize) Error!void { - if (res.ty.is(.void) or res.node == .none) return; - // don't warn about unused result if the expression contained errors besides other unused results - for (p.comp.diagnostics.list.items[err_start..]) |err_item| { - if (err_item.tag != .unused_value) return; - } + fn maybeWarnUnused(res: Result, p: *Parser, expr_start: TokenIndex, prev_total: usize) Error!void { + if (res.qt.is(p.comp, .void)) return; + if (res.qt.isInvalid()) return; + // // don't warn about unused result if the expression contained errors besides other unused results + if (p.diagnostics.total != prev_total) return; // TODO improve + // for (p.diagnostics.list.items[err_start..]) |err_item| { + // if (err_item.tag != .unused_value) return; + // } var cur_node = res.node; - while (true) switch (p.nodes.items(.tag)[@intFromEnum(cur_node)]) { - .invalid, // So that we don't need to check for node == 0 + while (true) switch (cur_node.get(&p.tree)) { .assign_expr, .mul_assign_expr, .div_assign_expr, @@ -5231,109 +5918,136 @@ pub const Result = struct { .post_inc_expr, .post_dec_expr, => return, - .call_expr, .call_expr_one => { - const tmp_tree = p.tmpTree(); - const child_nodes = tmp_tree.childNodes(cur_node); - const fn_ptr = child_nodes[0]; - const call_info = tmp_tree.callableResultUsage(fn_ptr) orelse return; - if (call_info.nodiscard) try p.errStr(.nodiscard_unused, expr_start, p.tokSlice(call_info.tok)); - if (call_info.warn_unused_result) try p.errStr(.warn_unused_result, expr_start, p.tokSlice(call_info.tok)); + .call_expr => |call| { + const call_info = p.tree.callableResultUsage(call.callee) orelse return; + if (call_info.nodiscard) try p.err(expr_start, .nodiscard_unused, .{p.tokSlice(call_info.tok)}); + if (call_info.warn_unused_result) try p.err(expr_start, .warn_unused_result, .{p.tokSlice(call_info.tok)}); return; }, - .stmt_expr => { - const body = p.nodes.items(.data)[@intFromEnum(cur_node)].un; - switch (p.nodes.items(.tag)[@intFromEnum(body)]) { - .compound_stmt_two => { - const body_stmt = p.nodes.items(.data)[@intFromEnum(body)].two; - cur_node = if (body_stmt[1] != .none) body_stmt[1] else body_stmt[0]; - }, - .compound_stmt => { - const data = p.nodes.items(.data)[@intFromEnum(body)]; - cur_node = p.data.items[data.range.end - 1]; - }, - else => unreachable, - } + .builtin_call_expr => |call| { + const expanded = p.comp.builtins.lookup(p.tokSlice(call.builtin_tok)); + const attributes = expanded.builtin.properties.attributes; + if (attributes.pure) try p.err(call.builtin_tok, .builtin_unused, .{"pure"}); + if (attributes.@"const") try p.err(call.builtin_tok, .builtin_unused, .{"const"}); + return; + }, + .stmt_expr => |stmt_expr| { + const compound = stmt_expr.operand.get(&p.tree).compound_stmt; + cur_node = compound.body[compound.body.len - 1]; }, - .comma_expr => cur_node = p.nodes.items(.data)[@intFromEnum(cur_node)].bin.rhs, - .paren_expr => cur_node = p.nodes.items(.data)[@intFromEnum(cur_node)].un, + .comma_expr => |comma| cur_node = comma.rhs, + .paren_expr => |grouped| cur_node = grouped.operand, else => break, }; - try p.errTok(.unused_value, expr_start); + try p.err(expr_start, .unused_value, .{}); } - fn boolRes(lhs: *Result, p: *Parser, tag: Tree.Tag, rhs: Result, tok_i: TokenIndex) !void { + fn boolRes(lhs: *Result, p: *Parser, tag: std.meta.Tag(Node), rhs: Result, tok_i: TokenIndex) !void { if (lhs.val.opt_ref == .null) { - lhs.val = Value.zero; + lhs.val = .zero; } - if (lhs.ty.specifier != .invalid) { - lhs.ty = Type.int; + if (!lhs.qt.isInvalid()) { + lhs.qt = .int; } return lhs.bin(p, tag, rhs, tok_i); } - fn bin(lhs: *Result, p: *Parser, tag: Tree.Tag, rhs: Result, tok_i: TokenIndex) !void { - lhs.node = try p.addNode(.{ - .tag = tag, - .ty = lhs.ty, - .data = .{ .bin = .{ .lhs = lhs.node, .rhs = rhs.node } }, - .loc = @enumFromInt(tok_i), - }); + fn bin(lhs: *Result, p: *Parser, rt_tag: std.meta.Tag(Node), rhs: Result, tok_i: TokenIndex) !void { + const bin_data: Node.Binary = .{ + .op_tok = tok_i, + .lhs = lhs.node, + .rhs = rhs.node, + .qt = lhs.qt, + }; + switch (rt_tag) { + // zig fmt: off + inline .comma_expr, .assign_expr, .mul_assign_expr, .div_assign_expr, + .mod_assign_expr, .add_assign_expr, .sub_assign_expr, .shl_assign_expr, + .shr_assign_expr, .bit_and_assign_expr, .bit_xor_assign_expr, + .bit_or_assign_expr, .bool_or_expr, .bool_and_expr, .bit_or_expr, + .bit_xor_expr, .bit_and_expr, .equal_expr, .not_equal_expr, + .less_than_expr, .less_than_equal_expr, .greater_than_expr, + .greater_than_equal_expr, .shl_expr, .shr_expr, .add_expr, + .sub_expr, .mul_expr, .div_expr, .mod_expr, + // zig fmt: on + => |tag| lhs.node = try p.addNode(@unionInit(Node, @tagName(tag), bin_data)), + else => unreachable, + } } - fn un(operand: *Result, p: *Parser, tag: Tree.Tag, tok_i: TokenIndex) Error!void { - operand.node = try p.addNode(.{ - .tag = tag, - .ty = operand.ty, - .data = .{ .un = operand.node }, - .loc = @enumFromInt(tok_i), - }); + fn un(operand: *Result, p: *Parser, rt_tag: std.meta.Tag(Node), tok_i: TokenIndex) Error!void { + const un_data: Node.Unary = .{ + .op_tok = tok_i, + .operand = operand.node, + .qt = operand.qt, + }; + switch (rt_tag) { + // zig fmt: off + inline .addr_of_expr, .deref_expr, .plus_expr, .negate_expr, + .bit_not_expr, .bool_not_expr, .pre_inc_expr, .pre_dec_expr, + .imag_expr, .real_expr, .post_inc_expr,.post_dec_expr, + .paren_expr, .stmt_expr, .imaginary_literal, .compound_assign_dummy_expr, + // zig fmt: on + => |tag| operand.node = try p.addNode(@unionInit(Node, @tagName(tag), un_data)), + else => unreachable, + } } - fn implicitCast(operand: *Result, p: *Parser, kind: Tree.CastKind) Error!void { + fn implicitCast(operand: *Result, p: *Parser, kind: Node.Cast.Kind, tok: TokenIndex) Error!void { operand.node = try p.addNode(.{ - .tag = .implicit_cast, - .ty = operand.ty, - .data = .{ .cast = .{ .operand = operand.node, .kind = kind } }, + .cast = .{ + .l_paren = tok, + .kind = kind, + .operand = operand.node, + .qt = operand.qt, + .implicit = true, + }, }); } fn adjustCondExprPtrs(a: *Result, tok: TokenIndex, b: *Result, p: *Parser) !bool { - assert(a.ty.isPtr() and b.ty.isPtr()); + assert(a.qt.isPointer(p.comp) and b.qt.isPointer(p.comp)); + const gpa = p.comp.gpa; - const a_elem = a.ty.elemType(); - const b_elem = b.ty.elemType(); - if (a_elem.eql(b_elem, p.comp, true)) return true; + const a_elem = a.qt.childType(p.comp); + const b_elem = b.qt.childType(p.comp); + if (a_elem.eqlQualified(b_elem, p.comp)) return true; - var adjusted_elem_ty = try p.arena.create(Type); - adjusted_elem_ty.* = a_elem; + const has_void_pointer_branch = a.qt.scalarKind(p.comp) == .void_pointer or + b.qt.scalarKind(p.comp) == .void_pointer; - const has_void_star_branch = a.ty.isVoidStar() or b.ty.isVoidStar(); - const only_quals_differ = a_elem.eql(b_elem, p.comp, false); - const pointers_compatible = only_quals_differ or has_void_star_branch; + const only_quals_differ = a_elem.eql(b_elem, p.comp); + const pointers_compatible = only_quals_differ or has_void_pointer_branch; - if (!pointers_compatible or has_void_star_branch) { + var adjusted_elem_qt = a_elem; + if (!pointers_compatible or has_void_pointer_branch) { if (!pointers_compatible) { - try p.errStr(.pointer_mismatch, tok, try p.typePairStrExtra(a.ty, " and ", b.ty)); + try p.err(tok, .pointer_mismatch, .{ a.qt, b.qt }); } - adjusted_elem_ty.* = .{ .specifier = .void }; + adjusted_elem_qt = .void; } + if (pointers_compatible) { - adjusted_elem_ty.qual = a_elem.qual.mergeCV(b_elem.qual); + adjusted_elem_qt.@"const" = a_elem.@"const" or b_elem.@"const"; + adjusted_elem_qt.@"volatile" = a_elem.@"volatile" or b_elem.@"volatile"; + // TODO restrict? } - if (!adjusted_elem_ty.eql(a_elem, p.comp, true)) { - a.ty = .{ - .data = .{ .sub_type = adjusted_elem_ty }, - .specifier = .pointer, - }; - try a.implicitCast(p, .bitcast); + + if (!adjusted_elem_qt.eqlQualified(a_elem, p.comp)) { + a.qt = try p.comp.type_store.put(gpa, .{ .pointer = .{ + .child = adjusted_elem_qt, + .decayed = null, + } }); + try a.implicitCast(p, .bitcast, tok); } - if (!adjusted_elem_ty.eql(b_elem, p.comp, true)) { - b.ty = .{ - .data = .{ .sub_type = adjusted_elem_ty }, - .specifier = .pointer, - }; - try b.implicitCast(p, .bitcast); + if (!adjusted_elem_qt.eqlQualified(b_elem, p.comp)) { + b.qt = try p.comp.type_store.put(gpa, .{ .pointer = .{ + .child = adjusted_elem_qt, + .decayed = null, + } }); + try b.implicitCast(p, .bitcast, tok); } + return true; } @@ -5348,36 +6062,47 @@ pub const Result = struct { add, sub, }) !bool { - if (b.ty.specifier == .invalid) { + if (b.qt.isInvalid()) { try a.saveValue(p); - a.ty = Type.invalid; + a.qt = .invalid; } - if (a.ty.specifier == .invalid) { + if (a.qt.isInvalid()) { return false; } - try a.lvalConversion(p); - try b.lvalConversion(p); + try a.lvalConversion(p, tok); + try b.lvalConversion(p, tok); - const a_vec = a.ty.is(.vector); - const b_vec = b.ty.is(.vector); + const a_vec = a.qt.is(p.comp, .vector); + const b_vec = b.qt.is(p.comp, .vector); if (a_vec and b_vec) { - if (a.ty.eql(b.ty, p.comp, false)) { + if (a.qt.eql(b.qt, p.comp)) { + return a.shouldEval(b, p); + } + if (a.qt.sizeCompare(b.qt, p.comp) == .eq) { + b.qt = a.qt; + try b.implicitCast(p, .bitcast, tok); return a.shouldEval(b, p); } - return a.invalidBinTy(tok, b, p); + try p.err(tok, .incompatible_vec_types, .{ a.qt, b.qt }); + a.val = .{}; + b.val = .{}; + a.qt = .invalid; + return false; } else if (a_vec) { - if (b.coerceExtra(p, a.ty.elemType(), tok, .test_coerce)) { + if (b.coerceExtra(p, a.qt.childType(p.comp), tok, .test_coerce)) { try b.saveValue(p); - try b.implicitCast(p, .vector_splat); + b.qt = a.qt; + try b.implicitCast(p, .vector_splat, tok); return a.shouldEval(b, p); } else |er| switch (er) { error.CoercionFailed => return a.invalidBinTy(tok, b, p), else => |e| return e, } } else if (b_vec) { - if (a.coerceExtra(p, b.ty.elemType(), tok, .test_coerce)) { + if (a.coerceExtra(p, b.qt.childType(p.comp), tok, .test_coerce)) { try a.saveValue(p); - try a.implicitCast(p, .vector_splat); + a.qt = b.qt; + try a.implicitCast(p, .vector_splat, tok); return a.shouldEval(b, p); } else |er| switch (er) { error.CoercionFailed => return a.invalidBinTy(tok, b, p), @@ -5385,21 +6110,18 @@ pub const Result = struct { } } - const a_int = a.ty.isInt(); - const b_int = b.ty.isInt(); - if (a_int and b_int) { + const a_sk = a.qt.scalarKind(p.comp); + const b_sk = b.qt.scalarKind(p.comp); + + if (a_sk.isInt() and b_sk.isInt()) { try a.usualArithmeticConversion(b, p, tok); return a.shouldEval(b, p); } if (kind == .integer) return a.invalidBinTy(tok, b, p); - const a_float = a.ty.isFloat(); - const b_float = b.ty.isFloat(); - const a_arithmetic = a_int or a_float; - const b_arithmetic = b_int or b_float; - if (a_arithmetic and b_arithmetic) { + if (a_sk.isArithmetic() and b_sk.isArithmetic()) { // <, <=, >, >= only work on real types - if (kind == .relational and (!a.ty.isReal() or !b.ty.isReal())) + if (kind == .relational and (!a_sk.isReal() or !b_sk.isReal())) return a.invalidBinTy(tok, b, p); try a.usualArithmeticConversion(b, p, tok); @@ -5407,444 +6129,533 @@ pub const Result = struct { } if (kind == .arithmetic) return a.invalidBinTy(tok, b, p); - const a_nullptr = a.ty.is(.nullptr_t); - const b_nullptr = b.ty.is(.nullptr_t); - const a_ptr = a.ty.isPtr(); - const b_ptr = b.ty.isPtr(); - const a_scalar = a_arithmetic or a_ptr; - const b_scalar = b_arithmetic or b_ptr; switch (kind) { .boolean_logic => { - if (!(a_scalar or a_nullptr) or !(b_scalar or b_nullptr)) return a.invalidBinTy(tok, b, p); + if (!(a_sk != .none or a_sk == .nullptr_t) or + !(b_sk != .none or b_sk == .nullptr_t)) + { + return a.invalidBinTy(tok, b, p); + } // Do integer promotions but nothing else - if (a_int) try a.intCast(p, a.ty.integerPromotion(p.comp), tok); - if (b_int) try b.intCast(p, b.ty.integerPromotion(p.comp), tok); + if (a_sk.isInt()) try a.castToInt(p, a.qt.promoteInt(p.comp), tok); + if (b_sk.isInt()) try b.castToInt(p, b.qt.promoteInt(p.comp), tok); return a.shouldEval(b, p); }, .relational, .equality => { - if (kind == .equality and (a_nullptr or b_nullptr)) { - if (a_nullptr and b_nullptr) return a.shouldEval(b, p); - const nullptr_res = if (a_nullptr) a else b; - const other_res = if (a_nullptr) b else a; - if (other_res.ty.isPtr()) { - try nullptr_res.nullCast(p, other_res.ty); + if (kind == .equality and (a_sk == .nullptr_t or b_sk == .nullptr_t)) { + if (a_sk == .nullptr_t and b_sk == .nullptr_t) return a.shouldEval(b, p); + + const nullptr_res = if (a_sk == .nullptr_t) a else b; + const other_res = if (a_sk == .nullptr_t) b else a; + + if (other_res.qt.isPointer(p.comp)) { + try nullptr_res.nullToPointer(p, other_res.qt, tok); return other_res.shouldEval(nullptr_res, p); } else if (other_res.val.isZero(p.comp)) { - other_res.val = Value.null; - try other_res.nullCast(p, nullptr_res.ty); + other_res.val = .null; + try other_res.nullToPointer(p, nullptr_res.qt, tok); return other_res.shouldEval(nullptr_res, p); } return a.invalidBinTy(tok, b, p); } + // comparisons between floats and pointes not allowed - if (!a_scalar or !b_scalar or (a_float and b_ptr) or (b_float and a_ptr)) + if (a_sk == .none or b_sk == .none or (a_sk.isFloat() and b_sk.isPointer()) or (b_sk.isFloat() and a_sk.isPointer())) return a.invalidBinTy(tok, b, p); - - if ((a_int or b_int) and !(a.val.isZero(p.comp) or b.val.isZero(p.comp))) { - try p.errStr(.comparison_ptr_int, tok, try p.typePairStr(a.ty, b.ty)); - } else if (a_ptr and b_ptr) { - if (!a.ty.isVoidStar() and !b.ty.isVoidStar() and !a.ty.eql(b.ty, p.comp, false)) - try p.errStr(.comparison_distinct_ptr, tok, try p.typePairStr(a.ty, b.ty)); - } else if (a_ptr) { - try b.ptrCast(p, a.ty); + if (a_sk == .nullptr_t or b_sk == .nullptr_t) return a.invalidBinTy(tok, b, p); + + if ((a_sk.isInt() or b_sk.isInt()) and !(a.val.isZero(p.comp) or b.val.isZero(p.comp))) { + try p.err(tok, .comparison_ptr_int, .{ a.qt, b.qt }); + } else if (a_sk.isPointer() and b_sk.isPointer()) { + if (a_sk != .void_pointer and b_sk != .void_pointer) { + const a_elem = a.qt.childType(p.comp); + const b_elem = b.qt.childType(p.comp); + if (!a_elem.eql(b_elem, p.comp)) { + try p.err(tok, .comparison_distinct_ptr, .{ a.qt, b.qt }); + try b.castToPointer(p, a.qt, tok); + } + } else if (a_sk == .void_pointer) { + try b.castToPointer(p, a.qt, tok); + } else if (b_sk == .void_pointer) { + try a.castToPointer(p, b.qt, tok); + } + } else if (a_sk.isPointer()) { + try b.castToPointer(p, a.qt, tok); } else { - assert(b_ptr); - try a.ptrCast(p, b.ty); + assert(b_sk.isPointer()); + try a.castToPointer(p, b.qt, tok); } return a.shouldEval(b, p); }, .conditional => { // doesn't matter what we return here, as the result is ignored - if (a.ty.is(.void) or b.ty.is(.void)) { - try a.toVoid(p); - try b.toVoid(p); + if (a.qt.is(p.comp, .void) or b.qt.is(p.comp, .void)) { + try a.castToVoid(p, tok); + try b.castToVoid(p, tok); return true; } - if (a_nullptr and b_nullptr) return true; - if ((a_ptr and b_int) or (a_int and b_ptr)) { + + if (a_sk == .nullptr_t and b_sk == .nullptr_t) return true; + + if ((a_sk.isPointer() and b_sk.isInt()) or (a_sk.isInt() and b_sk.isPointer())) { if (a.val.isZero(p.comp) or b.val.isZero(p.comp)) { - try a.nullCast(p, b.ty); - try b.nullCast(p, a.ty); + try a.nullToPointer(p, b.qt, tok); + try b.nullToPointer(p, a.qt, tok); return true; } - const int_ty = if (a_int) a else b; - const ptr_ty = if (a_ptr) a else b; - try p.errStr(.implicit_int_to_ptr, tok, try p.typePairStrExtra(int_ty.ty, " to ", ptr_ty.ty)); - try int_ty.ptrCast(p, ptr_ty.ty); + const int_ty = if (a_sk.isInt()) a else b; + const ptr_ty = if (a_sk.isPointer()) a else b; + try p.err(tok, .implicit_int_to_ptr, .{ int_ty.qt, ptr_ty.qt }); + try int_ty.castToPointer(p, ptr_ty.qt, tok); return true; } - if (a_ptr and b_ptr) return a.adjustCondExprPtrs(tok, b, p); - if ((a_ptr and b_nullptr) or (a_nullptr and b_ptr)) { - const nullptr_res = if (a_nullptr) a else b; - const ptr_res = if (a_nullptr) b else a; - try nullptr_res.nullCast(p, ptr_res.ty); + if ((a_sk.isPointer() and b_sk == .nullptr_t) or (a_sk == .nullptr_t and b_sk.isPointer())) { + const nullptr_res = if (a_sk == .nullptr_t) a else b; + const ptr_res = if (a_sk == .nullptr_t) b else a; + try nullptr_res.nullToPointer(p, ptr_res.qt, tok); return true; } - if (a.ty.isRecord() and b.ty.isRecord() and a.ty.eql(b.ty, p.comp, false)) { + if (a_sk.isPointer() and b_sk.isPointer()) return a.adjustCondExprPtrs(tok, b, p); + + if (a.qt.getRecord(p.comp) != null and b.qt.getRecord(p.comp) != null and a.qt.eql(b.qt, p.comp)) { return true; } return a.invalidBinTy(tok, b, p); }, .add => { // if both aren't arithmetic one should be pointer and the other an integer - if (a_ptr == b_ptr or a_int == b_int) return a.invalidBinTy(tok, b, p); + if (a_sk.isPointer() == b_sk.isPointer() or a_sk.isInt() == b_sk.isInt()) return a.invalidBinTy(tok, b, p); + + if (a_sk == .void_pointer or b_sk == .void_pointer) + try p.err(tok, .gnu_pointer_arith, .{}); + + if (a_sk == .nullptr_t) try a.nullToPointer(p, .void_pointer, tok); + if (b_sk == .nullptr_t) try b.nullToPointer(p, .void_pointer, tok); // Do integer promotions but nothing else - if (a_int) try a.intCast(p, a.ty.integerPromotion(p.comp), tok); - if (b_int) try b.intCast(p, b.ty.integerPromotion(p.comp), tok); + if (a_sk.isInt()) try a.castToInt(p, a.qt.promoteInt(p.comp), tok); + if (b_sk.isInt()) try b.castToInt(p, b.qt.promoteInt(p.comp), tok); // The result type is the type of the pointer operand - if (a_int) a.ty = b.ty else b.ty = a.ty; + if (a_sk.isInt()) a.qt = b.qt else b.qt = a.qt; return a.shouldEval(b, p); }, .sub => { - // if both aren't arithmetic then either both should be pointers or just a - if (!a_ptr or !(b_ptr or b_int)) return a.invalidBinTy(tok, b, p); + // if both aren't arithmetic then either both should be pointers or just the left one. + if (!a_sk.isPointer() or !(b_sk.isPointer() or b_sk.isInt())) return a.invalidBinTy(tok, b, p); + + if (a_sk == .void_pointer) + try p.err(tok, .gnu_pointer_arith, .{}); + + if (a_sk == .nullptr_t) try a.nullToPointer(p, .void_pointer, tok); + if (b_sk == .nullptr_t) try b.nullToPointer(p, .void_pointer, tok); + + if (a_sk.isPointer() and b_sk.isPointer()) { + const a_child_qt = a.qt.get(p.comp, .pointer).?.child; + const b_child_qt = b.qt.get(p.comp, .pointer).?.child; - if (a_ptr and b_ptr) { - if (!a.ty.eql(b.ty, p.comp, false)) try p.errStr(.incompatible_pointers, tok, try p.typePairStr(a.ty, b.ty)); - a.ty = p.comp.types.ptrdiff; + if (!a_child_qt.eql(b_child_qt, p.comp)) try p.err(tok, .incompatible_pointers, .{ a.qt, b.qt }); + if (a.qt.childType(p.comp).sizeofOrNull(p.comp) orelse 1 == 0) try p.err(tok, .subtract_pointers_zero_elem_size, .{a.qt.childType(p.comp)}); + a.qt = p.comp.type_store.ptrdiff; } // Do integer promotion on b if needed - if (b_int) try b.intCast(p, b.ty.integerPromotion(p.comp), tok); + if (b_sk.isInt()) try b.castToInt(p, b.qt.promoteInt(p.comp), tok); return a.shouldEval(b, p); }, else => return a.invalidBinTy(tok, b, p), } } - fn lvalConversion(res: *Result, p: *Parser) Error!void { - if (res.ty.isFunc()) { - if (res.ty.isInvalidFunc()) { - res.ty = .{ .specifier = .invalid }; - } else { - const elem_ty = try p.arena.create(Type); - elem_ty.* = res.ty; - res.ty.specifier = .pointer; - res.ty.data = .{ .sub_type = elem_ty }; - } - try res.implicitCast(p, .function_to_pointer); - } else if (res.ty.isArray()) { - res.val = .{}; - res.ty.decayArray(); - try res.implicitCast(p, .array_to_pointer); - } else if (!p.in_macro and p.tmpTree().isLval(res.node)) { - res.ty.qual = .{}; - try res.implicitCast(p, .lval_to_rval); + fn lvalConversion(res: *Result, p: *Parser, tok: TokenIndex) Error!void { + if (res.qt.is(p.comp, .func)) { + res.val = try p.pointerValue(res.node, .zero); + + res.qt = try res.qt.decay(p.comp); + try res.implicitCast(p, .function_to_pointer, tok); + } else if (res.qt.is(p.comp, .array)) { + res.val = try p.pointerValue(res.node, .zero); + + res.qt = try res.qt.decay(p.comp); + try res.implicitCast(p, .array_to_pointer, tok); + } else if (!p.in_macro and p.tree.isLval(res.node)) { + res.qt = res.qt.unqualified(); + try res.implicitCast(p, .lval_to_rval, tok); } } - fn boolCast(res: *Result, p: *Parser, bool_ty: Type, tok: TokenIndex) Error!void { - if (res.ty.isArray()) { + fn castToBool(res: *Result, p: *Parser, bool_qt: QualType, tok: TokenIndex) Error!void { + if (res.qt.isInvalid()) return; + std.debug.assert(!bool_qt.isInvalid()); + + const src_sk = res.qt.scalarKind(p.comp); + if (res.qt.is(p.comp, .array)) { if (res.val.is(.bytes, p.comp)) { - try p.errStr(.string_literal_to_bool, tok, try p.typePairStrExtra(res.ty, " to ", bool_ty)); + try p.err(tok, .string_literal_to_bool, .{ res.qt, bool_qt }); } else { - try p.errStr(.array_address_to_bool, tok, p.tokSlice(tok)); + try p.err(tok, .array_address_to_bool, .{p.tokSlice(tok)}); } - try res.lvalConversion(p); - res.val = Value.one; - res.ty = bool_ty; - try res.implicitCast(p, .pointer_to_bool); - } else if (res.ty.isPtr()) { + try res.lvalConversion(p, tok); + res.val = .one; + res.qt = bool_qt; + try res.implicitCast(p, .pointer_to_bool, tok); + } else if (src_sk.isPointer()) { res.val.boolCast(p.comp); - res.ty = bool_ty; - try res.implicitCast(p, .pointer_to_bool); - } else if (res.ty.isInt() and !res.ty.is(.bool)) { + res.qt = bool_qt; + try res.implicitCast(p, .pointer_to_bool, tok); + } else if (src_sk.isInt() and src_sk != .bool) { res.val.boolCast(p.comp); - res.ty = bool_ty; - try res.implicitCast(p, .int_to_bool); - } else if (res.ty.isFloat()) { - const old_value = res.val; - const value_change_kind = try res.val.floatToInt(bool_ty, p.comp); - try res.floatToIntWarning(p, bool_ty, old_value, value_change_kind, tok); - if (!res.ty.isReal()) { - res.ty = res.ty.makeReal(); - try res.implicitCast(p, .complex_float_to_real); - } - res.ty = bool_ty; - try res.implicitCast(p, .float_to_bool); - } - } - - fn intCast(res: *Result, p: *Parser, int_ty: Type, tok: TokenIndex) Error!void { - if (int_ty.hasIncompleteSize()) return error.ParsingFailed; // Diagnostic already issued - if (res.ty.is(.bool)) { - res.ty = int_ty.makeReal(); - try res.implicitCast(p, .bool_to_int); - if (!int_ty.isReal()) { - res.ty = int_ty; - try res.implicitCast(p, .real_to_complex_int); - } - } else if (res.ty.isPtr()) { - res.ty = int_ty.makeReal(); - try res.implicitCast(p, .pointer_to_int); - if (!int_ty.isReal()) { - res.ty = int_ty; - try res.implicitCast(p, .real_to_complex_int); - } - } else if (res.ty.isFloat()) { - const old_value = res.val; - const value_change_kind = try res.val.floatToInt(int_ty, p.comp); - try res.floatToIntWarning(p, int_ty, old_value, value_change_kind, tok); - const old_real = res.ty.isReal(); - const new_real = int_ty.isReal(); - if (old_real and new_real) { - res.ty = int_ty; - try res.implicitCast(p, .float_to_int); - } else if (old_real) { - res.ty = int_ty.makeReal(); - try res.implicitCast(p, .float_to_int); - res.ty = int_ty; - try res.implicitCast(p, .real_to_complex_int); - } else if (new_real) { - res.ty = res.ty.makeReal(); - try res.implicitCast(p, .complex_float_to_real); - res.ty = int_ty; - try res.implicitCast(p, .float_to_int); + if (!src_sk.isReal()) { + res.qt = res.qt.toReal(p.comp); + try res.implicitCast(p, .complex_int_to_real, tok); + } + res.qt = bool_qt; + try res.implicitCast(p, .int_to_bool, tok); + } else if (src_sk.isFloat()) { + const old_val = res.val; + const value_change_kind = try res.val.floatToInt(bool_qt, p.comp); + try res.floatToIntWarning(p, bool_qt, old_val, value_change_kind, tok); + if (!src_sk.isReal()) { + res.qt = res.qt.toReal(p.comp); + try res.implicitCast(p, .complex_float_to_real, tok); + } + res.qt = bool_qt; + try res.implicitCast(p, .float_to_bool, tok); + } + } + + fn castToInt(res: *Result, p: *Parser, int_qt: QualType, tok: TokenIndex) Error!void { + if (res.qt.isInvalid()) return; + std.debug.assert(!int_qt.isInvalid()); + if (int_qt.hasIncompleteSize(p.comp)) { + return error.ParsingFailed; // Cast to incomplete enum, diagnostic already issued + } + + const src_sk = res.qt.scalarKind(p.comp); + const dest_sk = int_qt.scalarKind(p.comp); + + if (src_sk == .bool) { + res.qt = int_qt.toReal(p.comp); + try res.implicitCast(p, .bool_to_int, tok); + if (!dest_sk.isReal()) { + res.qt = int_qt; + try res.implicitCast(p, .real_to_complex_int, tok); + } + } else if (src_sk.isPointer()) { + res.val = .{}; + res.qt = int_qt.toReal(p.comp); + try res.implicitCast(p, .pointer_to_int, tok); + if (!dest_sk.isReal()) { + res.qt = int_qt; + try res.implicitCast(p, .real_to_complex_int, tok); + } + } else if (res.qt.isFloat(p.comp)) { + const old_val = res.val; + const value_change_kind = try res.val.floatToInt(int_qt, p.comp); + try res.floatToIntWarning(p, int_qt, old_val, value_change_kind, tok); + if (src_sk.isReal() and dest_sk.isReal()) { + res.qt = int_qt; + try res.implicitCast(p, .float_to_int, tok); + } else if (src_sk.isReal()) { + res.qt = int_qt.toReal(p.comp); + try res.implicitCast(p, .float_to_int, tok); + res.qt = int_qt; + try res.implicitCast(p, .real_to_complex_int, tok); + } else if (dest_sk.isReal()) { + res.qt = res.qt.toReal(p.comp); + try res.implicitCast(p, .complex_float_to_real, tok); + res.qt = int_qt; + try res.implicitCast(p, .float_to_int, tok); } else { - res.ty = int_ty; - try res.implicitCast(p, .complex_float_to_complex_int); + res.qt = int_qt; + try res.implicitCast(p, .complex_float_to_complex_int, tok); } - } else if (!res.ty.eql(int_ty, p.comp, true)) { + } else if (!res.qt.eql(int_qt, p.comp)) { const old_val = res.val; - const value_change_kind = try res.val.intCast(int_ty, p.comp); + const value_change_kind = try res.val.intCast(int_qt, p.comp); switch (value_change_kind) { .none => {}, - .truncated => try p.errStr(.int_value_changed, tok, try p.valueChangedStr(res, old_val, int_ty)), - .sign_changed => try p.errStr(.sign_conversion, tok, try p.typePairStrExtra(res.ty, " to ", int_ty)), - } - - const old_real = res.ty.isReal(); - const new_real = int_ty.isReal(); - if (old_real and new_real) { - res.ty = int_ty; - try res.implicitCast(p, .int_cast); - } else if (old_real) { - const real_int_ty = int_ty.makeReal(); - if (!res.ty.eql(real_int_ty, p.comp, false)) { - res.ty = real_int_ty; - try res.implicitCast(p, .int_cast); + .truncated => try p.errValueChanged(tok, .int_value_changed, res.*, old_val, int_qt), + .sign_changed => try p.err(tok, .sign_conversion, .{ res.qt, int_qt }), + } + + if (src_sk.isReal() and dest_sk.isReal()) { + res.qt = int_qt; + try res.implicitCast(p, .int_cast, tok); + } else if (src_sk.isReal()) { + const real_int_qt = int_qt.toReal(p.comp); + if (!res.qt.eql(real_int_qt, p.comp)) { + res.qt = real_int_qt; + try res.implicitCast(p, .int_cast, tok); } - res.ty = int_ty; - try res.implicitCast(p, .real_to_complex_int); - } else if (new_real) { - res.ty = res.ty.makeReal(); - try res.implicitCast(p, .complex_int_to_real); - res.ty = int_ty; - try res.implicitCast(p, .int_cast); + res.qt = int_qt; + try res.implicitCast(p, .real_to_complex_int, tok); + } else if (dest_sk.isReal()) { + res.qt = res.qt.toReal(p.comp); + try res.implicitCast(p, .complex_int_to_real, tok); + res.qt = int_qt; + try res.implicitCast(p, .int_cast, tok); } else { - res.ty = int_ty; - try res.implicitCast(p, .complex_int_cast); + res.qt = int_qt; + try res.implicitCast(p, .complex_int_cast, tok); } } } - fn floatToIntWarning(res: *Result, p: *Parser, int_ty: Type, old_value: Value, change_kind: Value.FloatToIntChangeKind, tok: TokenIndex) !void { + fn floatToIntWarning( + res: Result, + p: *Parser, + int_qt: QualType, + old_val: Value, + change_kind: Value.FloatToIntChangeKind, + tok: TokenIndex, + ) !void { switch (change_kind) { - .none => return p.errStr(.float_to_int, tok, try p.typePairStrExtra(res.ty, " to ", int_ty)), - .out_of_range => return p.errStr(.float_out_of_range, tok, try p.typePairStrExtra(res.ty, " to ", int_ty)), - .overflow => return p.errStr(.float_overflow_conversion, tok, try p.typePairStrExtra(res.ty, " to ", int_ty)), - .nonzero_to_zero => return p.errStr(.float_zero_conversion, tok, try p.valueChangedStr(res, old_value, int_ty)), - .value_changed => return p.errStr(.float_value_changed, tok, try p.valueChangedStr(res, old_value, int_ty)), - } - } - - fn floatCast(res: *Result, p: *Parser, float_ty: Type) Error!void { - if (res.ty.is(.bool)) { - try res.val.intToFloat(float_ty, p.comp); - res.ty = float_ty.makeReal(); - try res.implicitCast(p, .bool_to_float); - if (!float_ty.isReal()) { - res.ty = float_ty; - try res.implicitCast(p, .real_to_complex_float); - } - } else if (res.ty.isInt()) { - try res.val.intToFloat(float_ty, p.comp); - const old_real = res.ty.isReal(); - const new_real = float_ty.isReal(); - if (old_real and new_real) { - res.ty = float_ty; - try res.implicitCast(p, .int_to_float); - } else if (old_real) { - res.ty = float_ty.makeReal(); - try res.implicitCast(p, .int_to_float); - res.ty = float_ty; - try res.implicitCast(p, .real_to_complex_float); - } else if (new_real) { - res.ty = res.ty.makeReal(); - try res.implicitCast(p, .complex_int_to_real); - res.ty = float_ty; - try res.implicitCast(p, .int_to_float); + .none => return p.err(tok, .float_to_int, .{ res.qt, int_qt }), + .out_of_range => return p.err(tok, .float_out_of_range, .{ res.qt, int_qt }), + .overflow => return p.err(tok, .float_overflow_conversion, .{ res.qt, int_qt }), + .nonzero_to_zero => return p.errValueChanged(tok, .float_zero_conversion, res, old_val, int_qt), + .value_changed => return p.errValueChanged(tok, .float_value_changed, res, old_val, int_qt), + } + } + + fn castToFloat(res: *Result, p: *Parser, float_qt: QualType, tok: TokenIndex) Error!void { + const src_sk = res.qt.scalarKind(p.comp); + const dest_sk = float_qt.scalarKind(p.comp); + + if (src_sk == .bool) { + try res.val.intToFloat(float_qt, p.comp); + res.qt = float_qt.toReal(p.comp); + try res.implicitCast(p, .bool_to_float, tok); + if (!dest_sk.isReal()) { + res.qt = float_qt; + try res.implicitCast(p, .real_to_complex_float, tok); + } + } else if (src_sk.isInt()) { + try res.val.intToFloat(float_qt, p.comp); + if (src_sk.isReal() and dest_sk.isReal()) { + res.qt = float_qt; + try res.implicitCast(p, .int_to_float, tok); + } else if (src_sk.isReal()) { + res.qt = float_qt.toReal(p.comp); + try res.implicitCast(p, .int_to_float, tok); + res.qt = float_qt; + try res.implicitCast(p, .real_to_complex_float, tok); + } else if (dest_sk.isReal()) { + res.qt = res.qt.toReal(p.comp); + try res.implicitCast(p, .complex_int_to_real, tok); + res.qt = float_qt; + try res.implicitCast(p, .int_to_float, tok); } else { - res.ty = float_ty; - try res.implicitCast(p, .complex_int_to_complex_float); - } - } else if (!res.ty.eql(float_ty, p.comp, true)) { - try res.val.floatCast(float_ty, p.comp); - const old_real = res.ty.isReal(); - const new_real = float_ty.isReal(); - if (old_real and new_real) { - res.ty = float_ty; - try res.implicitCast(p, .float_cast); - } else if (old_real) { - if (res.ty.floatRank() != float_ty.floatRank()) { - res.ty = float_ty.makeReal(); - try res.implicitCast(p, .float_cast); + res.qt = float_qt; + try res.implicitCast(p, .complex_int_to_complex_float, tok); + } + } else if (!res.qt.eql(float_qt, p.comp)) { + try res.val.floatCast(float_qt, p.comp); + if (src_sk.isReal() and dest_sk.isReal()) { + res.qt = float_qt; + try res.implicitCast(p, .float_cast, tok); + } else if (src_sk.isReal()) { + if (res.qt.floatRank(p.comp) != float_qt.floatRank(p.comp)) { + res.qt = float_qt.toReal(p.comp); + try res.implicitCast(p, .float_cast, tok); } - res.ty = float_ty; - try res.implicitCast(p, .real_to_complex_float); - } else if (new_real) { - res.ty = res.ty.makeReal(); - try res.implicitCast(p, .complex_float_to_real); - if (res.ty.floatRank() != float_ty.floatRank()) { - res.ty = float_ty; - try res.implicitCast(p, .float_cast); + res.qt = float_qt; + try res.implicitCast(p, .real_to_complex_float, tok); + } else if (dest_sk.isReal()) { + res.qt = res.qt.toReal(p.comp); + try res.implicitCast(p, .complex_float_to_real, tok); + if (res.qt.floatRank(p.comp) != float_qt.floatRank(p.comp)) { + res.qt = float_qt; + try res.implicitCast(p, .float_cast, tok); } } else { - res.ty = float_ty; - try res.implicitCast(p, .complex_float_cast); + res.qt = float_qt; + try res.implicitCast(p, .complex_float_cast, tok); } } } /// Converts a bool or integer to a pointer - fn ptrCast(res: *Result, p: *Parser, ptr_ty: Type) Error!void { - if (res.ty.is(.bool)) { - res.ty = ptr_ty; - try res.implicitCast(p, .bool_to_pointer); - } else if (res.ty.isInt()) { - _ = try res.val.intCast(ptr_ty, p.comp); - res.ty = ptr_ty; - try res.implicitCast(p, .int_to_pointer); - } - } + fn castToPointer(res: *Result, p: *Parser, ptr_qt: QualType, tok: TokenIndex) Error!void { + const src_sk = res.qt.scalarKind(p.comp); + if (src_sk == .bool) { + res.qt = ptr_qt; + try res.implicitCast(p, .bool_to_pointer, tok); + } else if (src_sk.isInt()) { + _ = try res.val.intCast(ptr_qt, p.comp); + res.qt = ptr_qt; + try res.implicitCast(p, .int_to_pointer, tok); + } else if (src_sk == .nullptr_t) { + try res.nullToPointer(p, ptr_qt, tok); + } else if (src_sk.isPointer() and !res.qt.eql(ptr_qt, p.comp)) { + if (ptr_qt.is(p.comp, .nullptr_t)) { + res.qt = .invalid; + return; + } + + const src_elem = res.qt.childType(p.comp); + const dest_elem = ptr_qt.childType(p.comp); + res.qt = ptr_qt; - /// Convert pointer to one with a different child type - fn ptrChildTypeCast(res: *Result, p: *Parser, ptr_ty: Type) Error!void { - res.ty = ptr_ty; - return res.implicitCast(p, .bitcast); + if (dest_elem.eql(src_elem, p.comp) and + (dest_elem.@"const" == src_elem.@"const" or dest_elem.@"const") and + (dest_elem.@"volatile" == src_elem.@"volatile" or dest_elem.@"volatile")) + { + // Gaining qualifiers is a no-op. + try res.implicitCast(p, .no_op, tok); + } else { + try res.implicitCast(p, .bitcast, tok); + } + } } - fn toVoid(res: *Result, p: *Parser) Error!void { - if (!res.ty.is(.void)) { - res.ty = .{ .specifier = .void }; - try res.implicitCast(p, .to_void); + fn castToVoid(res: *Result, p: *Parser, tok: TokenIndex) Error!void { + if (!res.qt.is(p.comp, .void)) { + res.qt = .void; + try res.implicitCast(p, .to_void, tok); } } - fn nullCast(res: *Result, p: *Parser, ptr_ty: Type) Error!void { - if (!res.ty.is(.nullptr_t) and !res.val.isZero(p.comp)) return; - res.ty = ptr_ty; - try res.implicitCast(p, .null_to_pointer); + fn nullToPointer(res: *Result, p: *Parser, ptr_ty: QualType, tok: TokenIndex) Error!void { + if (!res.qt.is(p.comp, .nullptr_t) and !res.val.isZero(p.comp)) return; + res.val = .null; + res.qt = ptr_ty; + try res.implicitCast(p, .null_to_pointer, tok); } fn usualUnaryConversion(res: *Result, p: *Parser, tok: TokenIndex) Error!void { - if (res.ty.isFloat()) fp_eval: { + if (res.qt.isInvalid()) return; + if (res.qt.isFloat(p.comp)) fp_eval: { const eval_method = p.comp.langopts.fp_eval_method orelse break :fp_eval; switch (eval_method) { .source => {}, .indeterminate => unreachable, .double => { - if (res.ty.floatRank() < (Type{ .specifier = .double }).floatRank()) { - const spec: Type.Specifier = if (res.ty.isReal()) .double else .complex_double; - return res.floatCast(p, .{ .specifier = spec }); + if (res.qt.floatRank(p.comp) < QualType.double.floatRank(p.comp)) { + var res_qt: QualType = .double; + if (res.qt.is(p.comp, .complex)) res_qt = try res_qt.toComplex(p.comp); + return res.castToFloat(p, res_qt, tok); } }, .extended => { - if (res.ty.floatRank() < (Type{ .specifier = .long_double }).floatRank()) { - const spec: Type.Specifier = if (res.ty.isReal()) .long_double else .complex_long_double; - return res.floatCast(p, .{ .specifier = spec }); + if (res.qt.floatRank(p.comp) < QualType.long_double.floatRank(p.comp)) { + var res_qt: QualType = .long_double; + if (res.qt.is(p.comp, .complex)) res_qt = try res_qt.toComplex(p.comp); + return res.castToFloat(p, res_qt, tok); } }, } } - if (res.ty.is(.fp16) and !p.comp.langopts.use_native_half_type) { - return res.floatCast(p, .{ .specifier = .float }); - } - if (res.ty.isInt()) { - if (p.tmpTree().bitfieldWidth(res.node, true)) |width| { - if (res.ty.bitfieldPromotion(p.comp, width)) |promotion_ty| { - return res.intCast(p, promotion_ty, tok); - } - } - return res.intCast(p, res.ty.integerPromotion(p.comp), tok); - } - } + if (!p.comp.langopts.use_native_half_type) { + if (res.qt.get(p.comp, .float)) |float_ty| { + if (float_ty == .fp16) { + return res.castToFloat(p, .float, tok); + } + } + } + + if (res.qt.isInt(p.comp) and !p.in_macro) { + if (p.tree.bitfieldWidth(res.node, true)) |width| { + if (res.qt.promoteBitfield(p.comp, width)) |promotion_ty| { + return res.castToInt(p, promotion_ty, tok); + } + } + return res.castToInt(p, res.qt.promoteInt(p.comp), tok); + } + } + + fn usualArithmeticConversion(a: *Result, b: *Result, p: *Parser, tok: TokenIndex) Error!void { + try a.usualUnaryConversion(p, tok); + try b.usualUnaryConversion(p, tok); + + // if either is a float cast to that type + const a_float = a.qt.isFloat(p.comp); + const b_float = b.qt.isFloat(p.comp); + if (a_float and b_float) { + const a_complex = a.qt.is(p.comp, .complex); + const b_complex = b.qt.is(p.comp, .complex); + + const res_qt = if (a.qt.floatRank(p.comp) > b.qt.floatRank(p.comp)) + (if (!a_complex and b_complex) + try a.qt.toComplex(p.comp) + else + a.qt) + else + (if (!b_complex and a_complex) + try b.qt.toComplex(p.comp) + else + b.qt); + + try a.castToFloat(p, res_qt, tok); + try b.castToFloat(p, res_qt, tok); + return; + } else if (a_float) { + try b.castToFloat(p, a.qt, tok); + return; + } else if (b_float) { + try a.castToFloat(p, b.qt, tok); + return; + } + + if (a.qt.eql(b.qt, p.comp)) { + // cast to promoted type + try a.castToInt(p, a.qt, tok); + try b.castToInt(p, b.qt, tok); + return; + } + + const a_real = a.qt.toReal(p.comp); + const b_real = b.qt.toReal(p.comp); - fn usualArithmeticConversion(a: *Result, b: *Result, p: *Parser, tok: TokenIndex) Error!void { - try a.usualUnaryConversion(p, tok); - try b.usualUnaryConversion(p, tok); + const type_order = a.qt.intRankOrder(b.qt, p.comp); + const a_signed = a.qt.signedness(p.comp) == .signed; + const b_signed = b.qt.signedness(p.comp) == .signed; - // if either is a float cast to that type - if (a.ty.isFloat() or b.ty.isFloat()) { - const float_types = [6][2]Type.Specifier{ - .{ .complex_long_double, .long_double }, - .{ .complex_float128, .float128 }, - .{ .complex_double, .double }, - .{ .complex_float, .float }, - // No `_Complex __fp16` type - .{ .invalid, .fp16 }, - .{ .complex_float16, .float16 }, + var target_qt: QualType = .invalid; + if (a_signed == b_signed) { + // If both have the same sign, use higher-rank type. + target_qt = switch (type_order) { + .lt => b.qt, + .eq, .gt => a_real, }; - const a_spec = a.ty.canonicalize(.standard).specifier; - const b_spec = b.ty.canonicalize(.standard).specifier; - if (p.comp.target.cTypeBitSize(.longdouble) == 128) { - if (try a.floatConversion(b, a_spec, b_spec, p, float_types[0])) return; - } - if (try a.floatConversion(b, a_spec, b_spec, p, float_types[1])) return; - if (p.comp.target.cTypeBitSize(.longdouble) == 80) { - if (try a.floatConversion(b, a_spec, b_spec, p, float_types[0])) return; - } - if (try a.floatConversion(b, a_spec, b_spec, p, float_types[2])) return; - if (p.comp.target.cTypeBitSize(.longdouble) == 64) { - if (try a.floatConversion(b, a_spec, b_spec, p, float_types[0])) return; - } - if (try a.floatConversion(b, a_spec, b_spec, p, float_types[3])) return; - if (try a.floatConversion(b, a_spec, b_spec, p, float_types[4])) return; - if (try a.floatConversion(b, a_spec, b_spec, p, float_types[5])) return; - unreachable; + } else if (type_order != if (a_signed) std.math.Order.gt else std.math.Order.lt) { + // Only one is signed; and the unsigned type has rank >= the signed type + // Use the unsigned type + target_qt = if (b_signed) a_real else b_real; + } else if (a_real.bitSizeof(p.comp) != b_real.bitSizeof(p.comp)) { + // Signed type is higher rank and sizes are not equal + // Use the signed type + target_qt = if (a_signed) a_real else b_real; + } else { + // Signed type is higher rank but same size as unsigned type + // e.g. `long` and `unsigned` on x86-linux-gnu + // Use unsigned version of the signed type + target_qt = if (a_signed) try a_real.makeIntUnsigned(p.comp) else try b_real.makeIntUnsigned(p.comp); } - if (a.ty.eql(b.ty, p.comp, true)) { - // cast to promoted type - try a.intCast(p, a.ty, tok); - try b.intCast(p, b.ty, tok); - return; + if (a.qt.is(p.comp, .complex) or b.qt.is(p.comp, .complex)) { + target_qt = try target_qt.toComplex(p.comp); } - const target = a.ty.integerConversion(b.ty, p.comp); - if (!target.isReal()) { + if (target_qt.is(p.comp, .complex)) { + // TODO implement complex int values try a.saveValue(p); try b.saveValue(p); } - try a.intCast(p, target, tok); - try b.intCast(p, target, tok); - } - - fn floatConversion(a: *Result, b: *Result, a_spec: Type.Specifier, b_spec: Type.Specifier, p: *Parser, pair: [2]Type.Specifier) !bool { - if (a_spec == pair[0] or a_spec == pair[1] or - b_spec == pair[0] or b_spec == pair[1]) - { - const both_real = a.ty.isReal() and b.ty.isReal(); - const res_spec = pair[@intFromBool(both_real)]; - const ty = Type{ .specifier = res_spec }; - try a.floatCast(p, ty); - try b.floatCast(p, ty); - return true; - } - return false; + try a.castToInt(p, target_qt, tok); + try b.castToInt(p, target_qt, tok); } fn invalidBinTy(a: *Result, tok: TokenIndex, b: *Result, p: *Parser) Error!bool { - try p.errStr(.invalid_bin_types, tok, try p.typePairStr(a.ty, b.ty)); + try p.err(tok, .invalid_bin_types, .{ a.qt, b.qt }); a.val = .{}; b.val = .{}; - a.ty = Type.invalid; + a.qt = .invalid; return false; } @@ -5861,168 +6672,213 @@ pub const Result = struct { /// Saves value and replaces it with `.unavailable`. fn saveValue(res: *Result, p: *Parser) !void { assert(!p.in_macro); - if (res.val.opt_ref == .none or res.val.opt_ref == .null) return; - if (!p.in_macro) try p.value_map.put(res.node, res.val); + try res.putValue(p); res.val = .{}; } - fn castType(res: *Result, p: *Parser, to: Type, operand_tok: TokenIndex, l_paren: TokenIndex) !void { - var cast_kind: Tree.CastKind = undefined; + /// Saves value without altering the result. + fn putValue(res: *const Result, p: *Parser) !void { + if (res.val.opt_ref == .none or res.val.opt_ref == .null) return; + if (!p.in_macro) try p.tree.value_map.put(p.comp.gpa, res.node, res.val); + } + + fn castType(res: *Result, p: *Parser, dest_qt: QualType, operand_tok: TokenIndex, l_paren: TokenIndex) !void { + if (res.qt.isInvalid()) { + res.val = .{}; + return; + } else if (dest_qt.isInvalid()) { + res.val = .{}; + res.qt = .invalid; + return; + } + var cast_kind: Node.Cast.Kind = undefined; + + const dest_sk = dest_qt.scalarKind(p.comp); + const src_sk = res.qt.scalarKind(p.comp); - if (to.is(.void)) { + const dest_vec = dest_qt.is(p.comp, .vector); + const src_vec = res.qt.is(p.comp, .vector); + + if (dest_qt.is(p.comp, .void)) { // everything can cast to void cast_kind = .to_void; res.val = .{}; - } else if (to.is(.nullptr_t)) { - if (res.ty.is(.nullptr_t)) { + } else if (res.qt.is(p.comp, .void)) { + try p.err(operand_tok, .invalid_cast_operand_type, .{res.qt}); + return error.ParsingFailed; + } else if (dest_vec and src_vec) { + if (dest_qt.eql(res.qt, p.comp)) { + cast_kind = .no_op; + } else if (dest_qt.sizeCompare(res.qt, p.comp) == .eq) { + cast_kind = .bitcast; + } else { + try p.err(l_paren, .invalid_vec_conversion, .{ dest_qt, res.qt }); + return error.ParsingFailed; + } + } else if (dest_vec or src_vec) { + const non_vec_sk = if (dest_vec) src_sk else dest_sk; + const vec_qt = if (dest_vec) dest_qt else res.qt; + const non_vec_qt = if (dest_vec) res.qt else dest_qt; + const non_vec_tok = if (dest_vec) operand_tok else l_paren; + if (non_vec_sk == .none) { + try p.err(non_vec_tok, .invalid_cast_operand_type, .{non_vec_qt}); + return error.ParsingFailed; + } else if (!non_vec_sk.isInt()) { + try p.err(non_vec_tok, .invalid_vec_conversion_scalar, .{ vec_qt, non_vec_qt }); + return error.ParsingFailed; + } else if (dest_qt.sizeCompare(res.qt, p.comp) != .eq) { + try p.err(non_vec_tok, .invalid_vec_conversion_int, .{ vec_qt, non_vec_qt }); + return error.ParsingFailed; + } else { + cast_kind = .bitcast; + } + } else if (dest_sk == .nullptr_t) { + res.val = .{}; + if (src_sk == .nullptr_t) { cast_kind = .no_op; } else { - try p.errStr(.invalid_object_cast, l_paren, try p.typePairStrExtra(res.ty, " to ", to)); + try p.err(l_paren, .invalid_object_cast, .{ res.qt, dest_qt }); return error.ParsingFailed; } - } else if (res.ty.is(.nullptr_t)) { - if (to.is(.bool)) { - try res.nullCast(p, res.ty); + } else if (src_sk == .nullptr_t) { + if (dest_sk == .bool) { + try res.nullToPointer(p, res.qt, l_paren); res.val.boolCast(p.comp); - res.ty = .{ .specifier = .bool }; - try res.implicitCast(p, .pointer_to_bool); + res.qt = .bool; + try res.implicitCast(p, .pointer_to_bool, l_paren); try res.saveValue(p); - } else if (to.isPtr()) { - try res.nullCast(p, to); + } else if (dest_sk.isPointer()) { + try res.nullToPointer(p, dest_qt, l_paren); } else { - try p.errStr(.invalid_object_cast, l_paren, try p.typePairStrExtra(res.ty, " to ", to)); + try p.err(l_paren, .invalid_object_cast, .{ res.qt, dest_qt }); return error.ParsingFailed; } cast_kind = .no_op; - } else if (res.val.isZero(p.comp) and to.isPtr()) { + } else if (res.val.isZero(p.comp) and dest_sk.isPointer()) { cast_kind = .null_to_pointer; - } else if (to.isScalar()) cast: { - const old_float = res.ty.isFloat(); - const new_float = to.isFloat(); - - if (new_float and res.ty.isPtr()) { - try p.errStr(.invalid_cast_to_float, l_paren, try p.typeStr(to)); + } else if (dest_sk != .none) cast: { + if (dest_sk.isFloat() and src_sk.isPointer()) { + try p.err(l_paren, .invalid_cast_to_float, .{dest_qt}); return error.ParsingFailed; - } else if (old_float and to.isPtr()) { - try p.errStr(.invalid_cast_to_pointer, l_paren, try p.typeStr(res.ty)); + } else if ((src_sk.isFloat() or !src_sk.isReal()) and dest_sk.isPointer()) { + try p.err(l_paren, .invalid_cast_to_pointer, .{res.qt}); return error.ParsingFailed; } - const old_real = res.ty.isReal(); - const new_real = to.isReal(); - if (to.eql(res.ty, p.comp, false)) { + if (dest_qt.eql(res.qt, p.comp)) { cast_kind = .no_op; - } else if (to.is(.bool)) { - if (res.ty.isPtr()) { + } else if (dest_sk == .bool) { + if (src_sk.isPointer()) { cast_kind = .pointer_to_bool; - } else if (res.ty.isInt()) { - if (!old_real) { - res.ty = res.ty.makeReal(); - try res.implicitCast(p, .complex_int_to_real); + } else if (src_sk.isInt()) { + if (!src_sk.isReal()) { + res.qt = res.qt.toReal(p.comp); + try res.implicitCast(p, .complex_int_to_real, l_paren); } cast_kind = .int_to_bool; - } else if (old_float) { - if (!old_real) { - res.ty = res.ty.makeReal(); - try res.implicitCast(p, .complex_float_to_real); + } else if (src_sk.isFloat()) { + if (!src_sk.isReal()) { + res.qt = res.qt.toReal(p.comp); + try res.implicitCast(p, .complex_float_to_real, l_paren); } cast_kind = .float_to_bool; } - } else if (to.isInt()) { - if (res.ty.is(.bool)) { - if (!new_real) { - res.ty = to.makeReal(); - try res.implicitCast(p, .bool_to_int); + } else if (dest_sk.isInt()) { + if (src_sk == .bool) { + if (!dest_sk.isReal()) { + res.qt = dest_qt.toReal(p.comp); + try res.implicitCast(p, .bool_to_int, l_paren); cast_kind = .real_to_complex_int; } else { cast_kind = .bool_to_int; } - } else if (res.ty.isInt()) { - if (old_real and new_real) { + } else if (src_sk.isInt()) { + if (src_sk.isReal() and dest_sk.isReal()) { cast_kind = .int_cast; - } else if (old_real) { - res.ty = to.makeReal(); - try res.implicitCast(p, .int_cast); + } else if (src_sk.isReal()) { + res.qt = dest_qt.toReal(p.comp); + try res.implicitCast(p, .int_cast, l_paren); cast_kind = .real_to_complex_int; - } else if (new_real) { - res.ty = res.ty.makeReal(); - try res.implicitCast(p, .complex_int_to_real); + } else if (dest_sk.isReal()) { + res.qt = res.qt.toReal(p.comp); + try res.implicitCast(p, .complex_int_to_real, l_paren); cast_kind = .int_cast; } else { cast_kind = .complex_int_cast; } - } else if (res.ty.isPtr()) { - if (!new_real) { - res.ty = to.makeReal(); - try res.implicitCast(p, .pointer_to_int); + } else if (src_sk.isPointer()) { + res.val = .{}; + if (!dest_sk.isReal()) { + res.qt = dest_qt.toReal(p.comp); + try res.implicitCast(p, .pointer_to_int, l_paren); cast_kind = .real_to_complex_int; } else { cast_kind = .pointer_to_int; } - } else if (old_real and new_real) { + } else if (src_sk.isReal() and dest_sk.isReal()) { cast_kind = .float_to_int; - } else if (old_real) { - res.ty = to.makeReal(); - try res.implicitCast(p, .float_to_int); + } else if (src_sk.isReal()) { + res.qt = dest_qt.toReal(p.comp); + try res.implicitCast(p, .float_to_int, l_paren); cast_kind = .real_to_complex_int; - } else if (new_real) { - res.ty = res.ty.makeReal(); - try res.implicitCast(p, .complex_float_to_real); + } else if (dest_sk.isReal()) { + res.qt = res.qt.toReal(p.comp); + try res.implicitCast(p, .complex_float_to_real, l_paren); cast_kind = .float_to_int; } else { cast_kind = .complex_float_to_complex_int; } - } else if (to.isPtr()) { - if (res.ty.isArray()) - cast_kind = .array_to_pointer - else if (res.ty.isPtr()) - cast_kind = .bitcast - else if (res.ty.isFunc()) - cast_kind = .function_to_pointer - else if (res.ty.is(.bool)) - cast_kind = .bool_to_pointer - else if (res.ty.isInt()) { - if (!old_real) { - res.ty = res.ty.makeReal(); - try res.implicitCast(p, .complex_int_to_real); + } else if (dest_sk.isPointer()) { + if (src_sk.isPointer()) { + cast_kind = .bitcast; + } else if (src_sk.isInt()) { + if (!src_sk.isReal()) { + res.qt = res.qt.toReal(p.comp); + try res.implicitCast(p, .complex_int_to_real, l_paren); } cast_kind = .int_to_pointer; + } else if (src_sk == .bool) { + cast_kind = .bool_to_pointer; + } else if (res.qt.is(p.comp, .array)) { + cast_kind = .array_to_pointer; + } else if (res.qt.is(p.comp, .func)) { + cast_kind = .function_to_pointer; } else { - try p.errStr(.cond_expr_type, operand_tok, try p.typeStr(res.ty)); + try p.err(operand_tok, .invalid_cast_operand_type, .{res.qt}); return error.ParsingFailed; } - } else if (new_float) { - if (res.ty.is(.bool)) { - if (!new_real) { - res.ty = to.makeReal(); - try res.implicitCast(p, .bool_to_float); + } else if (dest_sk.isFloat()) { + if (src_sk == .bool) { + if (!dest_sk.isReal()) { + res.qt = dest_qt.toReal(p.comp); + try res.implicitCast(p, .bool_to_float, l_paren); cast_kind = .real_to_complex_float; } else { cast_kind = .bool_to_float; } - } else if (res.ty.isInt()) { - if (old_real and new_real) { + } else if (src_sk.isInt()) { + if (src_sk.isReal() and dest_sk.isReal()) { cast_kind = .int_to_float; - } else if (old_real) { - res.ty = to.makeReal(); - try res.implicitCast(p, .int_to_float); + } else if (src_sk.isReal()) { + res.qt = dest_qt.toReal(p.comp); + try res.implicitCast(p, .int_to_float, l_paren); cast_kind = .real_to_complex_float; - } else if (new_real) { - res.ty = res.ty.makeReal(); - try res.implicitCast(p, .complex_int_to_real); + } else if (dest_sk.isReal()) { + res.qt = res.qt.toReal(p.comp); + try res.implicitCast(p, .complex_int_to_real, l_paren); cast_kind = .int_to_float; } else { cast_kind = .complex_int_to_complex_float; } - } else if (old_real and new_real) { + } else if (src_sk.isReal() and dest_sk.isReal()) { cast_kind = .float_cast; - } else if (old_real) { - res.ty = to.makeReal(); - try res.implicitCast(p, .float_cast); + } else if (src_sk.isReal()) { + res.qt = dest_qt.toReal(p.comp); + try res.implicitCast(p, .float_cast, l_paren); cast_kind = .real_to_complex_float; - } else if (new_real) { - res.ty = res.ty.makeReal(); - try res.implicitCast(p, .complex_float_to_real); + } else if (dest_sk.isReal()) { + res.qt = res.qt.toReal(p.comp); + try res.implicitCast(p, .complex_float_to_real, l_paren); cast_kind = .float_cast; } else { cast_kind = .complex_float_cast; @@ -6030,67 +6886,74 @@ pub const Result = struct { } if (res.val.opt_ref == .none) break :cast; - const old_int = res.ty.isInt() or res.ty.isPtr(); - const new_int = to.isInt() or to.isPtr(); - if (to.is(.bool)) { + const src_int = src_sk.isInt() or src_sk.isPointer(); + const dest_int = dest_sk.isInt() or dest_sk.isPointer(); + if (dest_sk == .bool) { res.val.boolCast(p.comp); - } else if (old_float and new_int) { - if (to.hasIncompleteSize()) { - try p.errStr(.cast_to_incomplete_type, l_paren, try p.typeStr(to)); + } else if (src_sk.isFloat() and dest_int) { + if (dest_qt.hasIncompleteSize(p.comp)) { + try p.err(l_paren, .cast_to_incomplete_type, .{dest_qt}); return error.ParsingFailed; } // Explicit cast, no conversion warning - _ = try res.val.floatToInt(to, p.comp); - } else if (new_float and old_int) { - try res.val.intToFloat(to, p.comp); - } else if (new_float and old_float) { - try res.val.floatCast(to, p.comp); - } else if (old_int and new_int) { - if (to.hasIncompleteSize()) { - try p.errStr(.cast_to_incomplete_type, l_paren, try p.typeStr(to)); + _ = try res.val.floatToInt(dest_qt, p.comp); + } else if (dest_sk.isFloat() and src_int) { + try res.val.intToFloat(dest_qt, p.comp); + } else if (dest_sk.isFloat() and src_sk.isFloat()) { + try res.val.floatCast(dest_qt, p.comp); + } else if (src_int and dest_int) { + if (dest_qt.hasIncompleteSize(p.comp)) { + try p.err(l_paren, .cast_to_incomplete_type, .{dest_qt}); return error.ParsingFailed; } - _ = try res.val.intCast(to, p.comp); + _ = try res.val.intCast(dest_qt, p.comp); } - } else if (to.get(.@"union")) |union_ty| { - if (union_ty.data.record.hasFieldOfType(res.ty, p.comp)) { - cast_kind = .union_cast; - try p.errTok(.gnu_union_cast, l_paren); - } else { - if (union_ty.data.record.isIncomplete()) { - try p.errStr(.cast_to_incomplete_type, l_paren, try p.typeStr(to)); - } else { - try p.errStr(.invalid_union_cast, l_paren, try p.typeStr(res.ty)); - } + } else if (dest_qt.get(p.comp, .@"union")) |union_ty| { + if (union_ty.layout == null) { + try p.err(l_paren, .cast_to_incomplete_type, .{dest_qt}); return error.ParsingFailed; } - } else { - if (to.is(.auto_type)) { - try p.errTok(.invalid_cast_to_auto_type, l_paren); + + for (union_ty.fields) |field| { + if (field.qt.eql(res.qt, p.comp)) { + cast_kind = .union_cast; + try p.err(l_paren, .gnu_union_cast, .{}); + break; + } } else { - try p.errStr(.invalid_cast_type, l_paren, try p.typeStr(to)); + try p.err(l_paren, .invalid_union_cast, .{res.qt}); + return error.ParsingFailed; } + } else if (dest_qt.eql(res.qt, p.comp)) { + try p.err(l_paren, .cast_to_same_type, .{dest_qt}); + cast_kind = .no_op; + } else { + try p.err(l_paren, .invalid_cast_type, .{dest_qt}); return error.ParsingFailed; } - if (to.anyQual()) try p.errStr(.qual_cast, l_paren, try p.typeStr(to)); - if (to.isInt() and res.ty.isPtr() and to.sizeCompare(res.ty, p.comp) == .lt) { - try p.errStr(.cast_to_smaller_int, l_paren, try p.typePairStrExtra(to, " from ", res.ty)); + + if (dest_qt.isQualified()) try p.err(l_paren, .qual_cast, .{dest_qt}); + if (dest_sk.isInt() and src_sk.isPointer() and dest_qt.sizeCompare(res.qt, p.comp) == .lt) { + try p.err(l_paren, .cast_to_smaller_int, .{ dest_qt, res.qt }); } - res.ty = to; - res.ty.qual = .{}; + + res.qt = dest_qt.unqualified(); res.node = try p.addNode(.{ - .tag = .explicit_cast, - .ty = res.ty, - .data = .{ .cast = .{ .operand = res.node, .kind = cast_kind } }, - .loc = @enumFromInt(l_paren), + .cast = .{ + .l_paren = l_paren, + .qt = res.qt, + .operand = res.node, + .kind = cast_kind, + .implicit = false, + }, }); } - fn intFitsInType(res: Result, p: *Parser, ty: Type) !bool { + fn intFitsInType(res: Result, p: *Parser, ty: QualType) !bool { const max_int = try Value.maxInt(ty, p.comp); const min_int = try Value.minInt(ty, p.comp); return res.val.compare(.lte, max_int, p.comp) and - (res.ty.isUnsignedInt(p.comp) or res.val.compare(.gte, min_int, p.comp)); + (res.qt.signedness(p.comp) == .unsigned or res.val.compare(.gte, min_int, p.comp)); } const CoerceContext = union(enum) { @@ -6102,26 +6965,17 @@ pub const Result = struct { fn note(c: CoerceContext, p: *Parser) !void { switch (c) { - .arg => |tok| try p.errTok(.parameter_here, tok), + .arg => |tok| try p.err(tok, .parameter_here, .{}), .test_coerce => unreachable, else => {}, } } - - fn typePairStr(c: CoerceContext, p: *Parser, dest_ty: Type, src_ty: Type) ![]const u8 { - switch (c) { - .assign, .init => return p.typePairStrExtra(dest_ty, " from incompatible type ", src_ty), - .ret => return p.typePairStrExtra(src_ty, " from a function with incompatible result type ", dest_ty), - .arg => return p.typePairStrExtra(src_ty, " to parameter of incompatible type ", dest_ty), - .test_coerce => unreachable, - } - } }; /// Perform assignment-like coercion to `dest_ty`. - fn coerce(res: *Result, p: *Parser, dest_ty: Type, tok: TokenIndex, c: CoerceContext) Error!void { - if (res.ty.specifier == .invalid or dest_ty.specifier == .invalid) { - res.ty = Type.invalid; + fn coerce(res: *Result, p: *Parser, dest_ty: QualType, tok: TokenIndex, c: CoerceContext) Error!void { + if (dest_ty.isInvalid()) { + res.qt = .invalid; return; } return res.coerceExtra(p, dest_ty, tok, c) catch |er| switch (er) { @@ -6133,104 +6987,131 @@ pub const Result = struct { fn coerceExtra( res: *Result, p: *Parser, - dest_ty: Type, + dest_qt: QualType, tok: TokenIndex, c: CoerceContext, ) (Error || error{CoercionFailed})!void { // Subject of the coercion does not need to be qualified. - var unqual_ty = dest_ty.canonicalize(.standard); - unqual_ty.qual = .{}; - if (unqual_ty.is(.nullptr_t)) { - if (res.ty.is(.nullptr_t)) return; - } else if (unqual_ty.is(.bool)) { - if (res.ty.isScalar() and !res.ty.is(.nullptr_t)) { + const src_original_qt = res.qt; + switch (c) { + .init, .ret, .assign => try res.lvalConversion(p, tok), + else => {}, + } + if (res.qt.isInvalid()) return; + const dest_unqual = dest_qt.unqualified(); + const dest_sk = dest_unqual.scalarKind(p.comp); + const src_sk = res.qt.scalarKind(p.comp); + + if (dest_qt.is(p.comp, .vector) and res.qt.is(p.comp, .vector)) { + if (dest_unqual.eql(res.qt, p.comp)) return; + if (dest_unqual.sizeCompare(res.qt, p.comp) == .eq) { + res.qt = dest_unqual; + return res.implicitCast(p, .bitcast, tok); + } + } else if (dest_sk == .nullptr_t) { + if (src_sk == .nullptr_t) return; + } else if (dest_sk == .bool) { + if (src_sk != .none and src_sk != .nullptr_t) { // this is ridiculous but it's what clang does - try res.boolCast(p, unqual_ty, tok); + try res.castToBool(p, dest_unqual, tok); return; } - } else if (unqual_ty.isInt()) { - if (res.ty.isInt() or res.ty.isFloat()) { - try res.intCast(p, unqual_ty, tok); + } else if (dest_sk.isInt()) { + if (src_sk.isInt() or src_sk.isFloat()) { + try res.castToInt(p, dest_unqual, tok); return; - } else if (res.ty.isPtr()) { + } else if (src_sk.isPointer()) { if (c == .test_coerce) return error.CoercionFailed; - try p.errStr(.implicit_ptr_to_int, tok, try p.typePairStrExtra(res.ty, " to ", dest_ty)); + try p.err(tok, .implicit_ptr_to_int, .{ src_original_qt, dest_unqual }); try c.note(p); - try res.intCast(p, unqual_ty, tok); + try res.castToInt(p, dest_unqual, tok); return; } - } else if (unqual_ty.isFloat()) { - if (res.ty.isInt() or res.ty.isFloat()) { - try res.floatCast(p, unqual_ty); + } else if (dest_sk.isFloat()) { + if (src_sk.isInt() or src_sk.isFloat()) { + try res.castToFloat(p, dest_unqual, tok); return; } - } else if (unqual_ty.isPtr()) { - if (res.ty.is(.nullptr_t) or res.val.isZero(p.comp)) { - try res.nullCast(p, dest_ty); + } else if (dest_sk.isPointer()) { + if (src_sk == .nullptr_t or res.val.isZero(p.comp)) { + try res.nullToPointer(p, dest_unqual, tok); return; - } else if (res.ty.isInt() and res.ty.isReal()) { + } else if (src_sk.isInt() and src_sk.isReal()) { if (c == .test_coerce) return error.CoercionFailed; - try p.errStr(.implicit_int_to_ptr, tok, try p.typePairStrExtra(res.ty, " to ", dest_ty)); + try p.err(tok, .implicit_int_to_ptr, .{ src_original_qt, dest_unqual }); try c.note(p); - try res.ptrCast(p, unqual_ty); + try res.castToPointer(p, dest_unqual, tok); return; - } else if (res.ty.isVoidStar() or unqual_ty.eql(res.ty, p.comp, true)) { - return; // ok - } else if (unqual_ty.isVoidStar() and res.ty.isPtr() or (res.ty.isInt() and res.ty.isReal())) { - return; // ok - } else if (unqual_ty.eql(res.ty, p.comp, false)) { - if (!unqual_ty.elemType().qual.hasQuals(res.ty.elemType().qual)) { - try p.errStr(switch (c) { - .assign => .ptr_assign_discards_quals, - .init => .ptr_init_discards_quals, - .ret => .ptr_ret_discards_quals, - .arg => .ptr_arg_discards_quals, - .test_coerce => return error.CoercionFailed, - }, tok, try c.typePairStr(p, dest_ty, res.ty)); + } else if (src_sk == .void_pointer or dest_unqual.eql(res.qt, p.comp)) { + return res.castToPointer(p, dest_unqual, tok); + } else if (dest_sk == .void_pointer and src_sk.isPointer()) { + return res.castToPointer(p, dest_unqual, tok); + } else if (src_sk.isPointer()) { + const src_child = res.qt.childType(p.comp); + const dest_child = dest_unqual.childType(p.comp); + if (src_child.eql(dest_child, p.comp)) { + if ((src_child.@"const" and !dest_child.@"const") or + (src_child.@"volatile" and !dest_child.@"volatile") or + (src_child.restrict and !dest_child.restrict)) + { + try p.err(tok, switch (c) { + .assign => .ptr_assign_discards_quals, + .init => .ptr_init_discards_quals, + .ret => .ptr_ret_discards_quals, + .arg => .ptr_arg_discards_quals, + .test_coerce => return error.CoercionFailed, + }, .{ dest_qt, src_original_qt }); + } + try res.castToPointer(p, dest_unqual, tok); + return; } - try res.ptrCast(p, unqual_ty); - return; - } else if (res.ty.isPtr()) { - const different_sign_only = unqual_ty.elemType().sameRankDifferentSign(res.ty.elemType(), p.comp); - try p.errStr(switch (c) { - .assign => ([2]Diagnostics.Tag{ .incompatible_ptr_assign, .incompatible_ptr_assign_sign })[@intFromBool(different_sign_only)], - .init => ([2]Diagnostics.Tag{ .incompatible_ptr_init, .incompatible_ptr_init_sign })[@intFromBool(different_sign_only)], - .ret => ([2]Diagnostics.Tag{ .incompatible_return, .incompatible_return_sign })[@intFromBool(different_sign_only)], - .arg => ([2]Diagnostics.Tag{ .incompatible_ptr_arg, .incompatible_ptr_arg_sign })[@intFromBool(different_sign_only)], + + const different_sign_only = src_child.sameRankDifferentSign(dest_child, p.comp); + switch (c) { + .assign => try p.err(tok, if (different_sign_only) .incompatible_ptr_assign_sign else .incompatible_ptr_assign, .{ dest_qt, src_original_qt }), + .init => try p.err(tok, if (different_sign_only) .incompatible_ptr_init_sign else .incompatible_ptr_init, .{ dest_qt, src_original_qt }), + .ret => try p.err(tok, if (different_sign_only) .incompatible_return_sign else .incompatible_return, .{ src_original_qt, dest_qt }), + .arg => try p.err(tok, if (different_sign_only) .incompatible_ptr_arg_sign else .incompatible_ptr_arg, .{ src_original_qt, dest_qt }), .test_coerce => return error.CoercionFailed, - }, tok, try c.typePairStr(p, dest_ty, res.ty)); + } try c.note(p); - try res.ptrChildTypeCast(p, unqual_ty); - return; + + res.qt = dest_unqual; + return res.implicitCast(p, .bitcast, tok); } - } else if (unqual_ty.isRecord()) { - if (unqual_ty.eql(res.ty, p.comp, false)) { + } else if (dest_unqual.getRecord(p.comp) != null) { + if (dest_unqual.eql(res.qt, p.comp)) { return; // ok } - if (c == .arg) if (unqual_ty.get(.@"union")) |union_ty| { - if (dest_ty.hasAttribute(.transparent_union)) transparent_union: { - res.coerceExtra(p, union_ty.data.record.fields[0].ty, tok, .test_coerce) catch |er| switch (er) { + if (c == .arg) if (dest_unqual.get(p.comp, .@"union")) |union_ty| { + if (dest_unqual.hasAttribute(p.comp, .transparent_union)) transparent_union: { + res.coerceExtra(p, union_ty.fields[0].qt, tok, .test_coerce) catch |er| switch (er) { error.CoercionFailed => break :transparent_union, else => |e| return e, }; - res.node = try p.addNode(.{ - .tag = .union_init_expr, - .ty = dest_ty, - .data = .{ .union_init = .{ .field_index = 0, .node = res.node } }, - }); - res.ty = dest_ty; + res.node = try p.addNode(.{ .union_init_expr = .{ + .field_index = 0, + .initializer = res.node, + .l_brace_tok = tok, + .union_qt = dest_unqual, + } }); + res.qt = dest_unqual; return; } }; - } else if (unqual_ty.is(.vector)) { - if (unqual_ty.eql(res.ty, p.comp, false)) { + } else if (dest_unqual.is(p.comp, .vector)) { + if (dest_unqual.eql(res.qt, p.comp)) { return; // ok } } else { - if (c == .assign and (unqual_ty.isArray() or unqual_ty.isFunc())) { - try p.errTok(.not_assignable, tok); - return; + if (c == .assign) { + const base_type = dest_unqual.base(p.comp); + switch (base_type.type) { + .array => return p.err(tok, .array_not_assignable, .{base_type.qt}), + .func => return p.err(tok, .non_object_not_assignable, .{base_type.qt}), + else => {}, + } } else if (c == .test_coerce) { return error.CoercionFailed; } @@ -6239,40 +7120,52 @@ pub const Result = struct { return error.ParsingFailed; } - try p.errStr(switch (c) { - .assign => .incompatible_assign, - .init => .incompatible_init, - .ret => .incompatible_return, - .arg => .incompatible_arg, + switch (c) { + .assign => try p.err(tok, .incompatible_assign, .{ dest_unqual, res.qt }), + .init => try p.err(tok, .incompatible_init, .{ dest_unqual, res.qt }), + .ret => try p.err(tok, .incompatible_return, .{ res.qt, dest_unqual }), + .arg => try p.err(tok, .incompatible_arg, .{ res.qt, dest_unqual }), .test_coerce => return error.CoercionFailed, - }, tok, try c.typePairStr(p, dest_ty, res.ty)); + } try c.note(p); } }; +fn expect(p: *Parser, comptime func: fn (*Parser) Error!?Result) Error!Result { + return p.expectResult(try func(p)); +} + +fn expectResult(p: *Parser, res: ?Result) Error!Result { + return res orelse { + try p.err(p.tok_i, .expected_expr, .{}); + return error.ParsingFailed; + }; +} + /// expr : assignExpr (',' assignExpr)* -fn expr(p: *Parser) Error!Result { +fn expr(p: *Parser) Error!?Result { var expr_start = p.tok_i; - var err_start = p.comp.diagnostics.list.items.len; - var lhs = try p.assignExpr(); - if (p.tok_ids[p.tok_i] == .comma) try lhs.expect(p); + var prev_total = p.diagnostics.total; + var lhs = (try p.assignExpr()) orelse { + if (p.tok_ids[p.tok_i] == .comma) _ = try p.expectResult(null); + return null; + }; while (p.eatToken(.comma)) |comma| { - try lhs.maybeWarnUnused(p, expr_start, err_start); + try lhs.maybeWarnUnused(p, expr_start, prev_total); expr_start = p.tok_i; - err_start = p.comp.diagnostics.list.items.len; + prev_total = p.diagnostics.total; - var rhs = try p.assignExpr(); - try rhs.expect(p); - try rhs.lvalConversion(p); + var rhs = try p.expect(assignExpr); + try rhs.lvalConversion(p, expr_start); lhs.val = rhs.val; - lhs.ty = rhs.ty; + lhs.qt = rhs.qt; try lhs.bin(p, .comma_expr, rhs, comma); } return lhs; } -fn tokToTag(p: *Parser, tok: TokenIndex) Tree.Tag { - return switch (p.tok_ids[tok]) { +fn eatTag(p: *Parser, id: Token.Id) ?std.meta.Tag(Node) { + if (p.eatToken(id)) |_| return switch (id) { .equal => .assign_expr, .asterisk_equal => .mul_assign_expr, .slash_equal => .div_assign_expr, @@ -6298,69 +7191,125 @@ fn tokToTag(p: *Parser, tok: TokenIndex) Tree.Tag { .slash => .div_expr, .percent => .mod_expr, else => unreachable, + } else return null; +} + +fn nonAssignExpr(assign_node: std.meta.Tag(Node)) std.meta.Tag(Node) { + return switch (assign_node) { + .mul_assign_expr => .mul_expr, + .div_assign_expr => .div_expr, + .mod_assign_expr => .mod_expr, + .add_assign_expr => .add_expr, + .sub_assign_expr => .sub_expr, + .shl_assign_expr => .shl_expr, + .shr_assign_expr => .shr_expr, + .bit_and_assign_expr => .bit_and_expr, + .bit_xor_assign_expr => .bit_xor_expr, + .bit_or_assign_expr => .bit_or_expr, + else => unreachable, + }; +} + +fn unwrapNestedOperation(p: *Parser, node_idx: Node.Index) ?Node.DeclRef { + return loop: switch (node_idx.get(&p.tree)) { + inline .array_access_expr, + .member_access_ptr_expr, + .member_access_expr, + => |memb_or_arr_access| continue :loop memb_or_arr_access.base.get(&p.tree), + inline .cast, + .paren_expr, + .pre_inc_expr, + .post_inc_expr, + .pre_dec_expr, + .post_dec_expr, + => |cast_or_unary| continue :loop cast_or_unary.operand.get(&p.tree), + .sub_expr, + .add_expr, + => |bin| continue :loop bin.lhs.get(&p.tree), + .call_expr => |call| continue :loop call.callee.get(&p.tree), + .decl_ref_expr => |decl_ref| decl_ref, + else => null, + }; +} + +fn issueDeclaredConstHereNote(p: *Parser, decl_ref: Tree.Node.DeclRef, var_name: []const u8) Compilation.Error!void { + const location = switch (decl_ref.decl.get(&p.tree)) { + .variable => |variable| variable.name_tok, + .param => |param| param.name_tok, + else => return, }; + try p.err(location, .declared_const_here, .{var_name}); +} + +fn issueConstAssignmetDiagnostics(p: *Parser, node_idx: Node.Index, tok: TokenIndex) Compilation.Error!void { + if (p.unwrapNestedOperation(node_idx)) |unwrapped| { + const name = p.tokSlice(unwrapped.name_tok); + try p.err(tok, .const_var_assignment, .{ name, unwrapped.qt }); + try p.issueDeclaredConstHereNote(unwrapped, name); + } else { + try p.err(tok, .not_assignable, .{}); + } } /// assignExpr /// : condExpr /// | unExpr ('=' | '*=' | '/=' | '%=' | '+=' | '-=' | '<<=' | '>>=' | '&=' | '^=' | '|=') assignExpr -fn assignExpr(p: *Parser) Error!Result { - var lhs = try p.condExpr(); - if (lhs.empty(p)) return lhs; +fn assignExpr(p: *Parser) Error!?Result { + var lhs = (try p.condExpr()) orelse return null; const tok = p.tok_i; - const eq = p.eatToken(.equal); - const mul = eq orelse p.eatToken(.asterisk_equal); - const div = mul orelse p.eatToken(.slash_equal); - const mod = div orelse p.eatToken(.percent_equal); - const add = mod orelse p.eatToken(.plus_equal); - const sub = add orelse p.eatToken(.minus_equal); - const shl = sub orelse p.eatToken(.angle_bracket_angle_bracket_left_equal); - const shr = shl orelse p.eatToken(.angle_bracket_angle_bracket_right_equal); - const bit_and = shr orelse p.eatToken(.ampersand_equal); - const bit_xor = bit_and orelse p.eatToken(.caret_equal); - const bit_or = bit_xor orelse p.eatToken(.pipe_equal); - - const tag = p.tokToTag(bit_or orelse return lhs); - var rhs = try p.assignExpr(); - try rhs.expect(p); - try rhs.lvalConversion(p); + const tag = p.eatTag(.equal) orelse + p.eatTag(.asterisk_equal) orelse + p.eatTag(.slash_equal) orelse + p.eatTag(.percent_equal) orelse + p.eatTag(.plus_equal) orelse + p.eatTag(.minus_equal) orelse + p.eatTag(.angle_bracket_angle_bracket_left_equal) orelse + p.eatTag(.angle_bracket_angle_bracket_right_equal) orelse + p.eatTag(.ampersand_equal) orelse + p.eatTag(.caret_equal) orelse + p.eatTag(.pipe_equal) orelse return lhs; + + var rhs = try p.expect(assignExpr); var is_const: bool = undefined; - if (!p.tmpTree().isLvalExtra(lhs.node, &is_const) or is_const) { - try p.errTok(.not_assignable, tok); - return error.ParsingFailed; + if (!p.tree.isLvalExtra(lhs.node, &is_const) or is_const) { + try p.issueConstAssignmetDiagnostics(lhs.node, tok); + lhs.qt = .invalid; + } + + if (tag == .assign_expr) { + try rhs.coerce(p, lhs.qt, tok, .assign); + + try lhs.bin(p, tag, rhs, tok); + return lhs; } - // adjustTypes will do do lvalue conversion but we do not want that - var lhs_copy = lhs; + var lhs_dummy = blk: { + var lhs_copy = lhs; + try lhs_copy.un(p, .compound_assign_dummy_expr, tok); + try lhs_copy.lvalConversion(p, tok); + break :blk lhs_copy; + }; switch (tag) { - .assign_expr => {}, // handle plain assignment separately .mul_assign_expr, .div_assign_expr, .mod_assign_expr, => { - if (rhs.val.isZero(p.comp) and lhs.ty.isInt() and rhs.ty.isInt()) { + if (!lhs.qt.isInvalid() and rhs.val.isZero(p.comp) and lhs.qt.isInt(p.comp) and rhs.qt.isInt(p.comp)) { switch (tag) { - .div_assign_expr => try p.errStr(.division_by_zero, div.?, "division"), - .mod_assign_expr => try p.errStr(.division_by_zero, mod.?, "remainder"), + .div_assign_expr => try p.err(tok, .division_by_zero, .{"division"}), + .mod_assign_expr => try p.err(tok, .division_by_zero, .{"remainder"}), else => {}, } } - _ = try lhs_copy.adjustTypes(tok, &rhs, p, if (tag == .mod_assign_expr) .integer else .arithmetic); - try lhs.bin(p, tag, rhs, bit_or.?); - return lhs; + _ = try lhs_dummy.adjustTypes(tok, &rhs, p, if (tag == .mod_assign_expr) .integer else .arithmetic); }, - .sub_assign_expr, - .add_assign_expr, - => { - if (lhs.ty.isPtr() and rhs.ty.isInt()) { - try rhs.ptrCast(p, lhs.ty); - } else { - _ = try lhs_copy.adjustTypes(tok, &rhs, p, .arithmetic); - } - try lhs.bin(p, tag, rhs, bit_or.?); - return lhs; + .sub_assign_expr => { + _ = try lhs_dummy.adjustTypes(tok, &rhs, p, .sub); + }, + .add_assign_expr => { + _ = try lhs_dummy.adjustTypes(tok, &rhs, p, .add); }, .shl_assign_expr, .shr_assign_expr, @@ -6368,16 +7317,14 @@ fn assignExpr(p: *Parser) Error!Result { .bit_xor_assign_expr, .bit_or_assign_expr, => { - _ = try lhs_copy.adjustTypes(tok, &rhs, p, .integer); - try lhs.bin(p, tag, rhs, bit_or.?); - return lhs; + _ = try lhs_dummy.adjustTypes(tok, &rhs, p, .integer); }, else => unreachable, } - try rhs.coerce(p, lhs.ty, tok, .assign); - - try lhs.bin(p, tag, rhs, bit_or.?); + _ = try lhs_dummy.bin(p, nonAssignExpr(tag), rhs, tok); + try lhs_dummy.coerce(p, lhs.qt, tok, .assign); + try lhs.bin(p, tag, lhs_dummy, tok); return lhs; } @@ -6386,8 +7333,8 @@ fn assignExpr(p: *Parser) Error!Result { fn integerConstExpr(p: *Parser, decl_folding: ConstDeclFoldingMode) Error!Result { const start = p.tok_i; const res = try p.constExpr(decl_folding); - if (!res.ty.isInt() and res.ty.specifier != .invalid) { - try p.errTok(.expected_integer_constant_expr, start); + if (!res.qt.isInvalid() and !res.qt.isRealInt(p.comp)) { + try p.err(start, .expected_integer_constant_expr, .{}); return error.ParsingFailed; } return res; @@ -6400,27 +7347,24 @@ fn constExpr(p: *Parser, decl_folding: ConstDeclFoldingMode) Error!Result { defer p.const_decl_folding = const_decl_folding; p.const_decl_folding = decl_folding; - const res = try p.condExpr(); - try res.expect(p); + const res = try p.expect(condExpr); - if (res.ty.specifier == .invalid or res.val.opt_ref == .none) return res; + if (res.qt.isInvalid() or res.val.opt_ref == .none) return res; - // saveValue sets val to unavailable - var copy = res; - try copy.saveValue(p); + try res.putValue(p); return res; } /// condExpr : lorExpr ('?' expression? ':' condExpr)? -fn condExpr(p: *Parser) Error!Result { +fn condExpr(p: *Parser) Error!?Result { const cond_tok = p.tok_i; - var cond = try p.lorExpr(); - if (cond.empty(p) or p.eatToken(.question_mark) == null) return cond; - try cond.lvalConversion(p); + var cond = (try p.lorExpr()) orelse return null; + if (p.eatToken(.question_mark) == null) return cond; + try cond.lvalConversion(p, cond_tok); const saved_eval = p.no_eval; - if (!cond.ty.isScalar()) { - try p.errStr(.cond_expr_type, cond_tok, try p.typeStr(cond.ty)); + if (cond.qt.scalarKind(p.comp) == .none) { + try p.err(cond_tok, .cond_expr_type, .{cond.qt}); return error.ParsingFailed; } @@ -6431,21 +7375,29 @@ fn condExpr(p: *Parser) Error!Result { var then_expr = blk: { defer p.no_eval = saved_eval; if (cond.val.opt_ref != .none and !cond.val.toBool(p.comp)) p.no_eval = true; - break :blk try p.expr(); + break :blk try p.expect(expr); }; - try then_expr.expect(p); // If we saw a colon then this is a binary conditional expression. if (maybe_colon) |colon| { var cond_then = cond; - cond_then.node = try p.addNode(.{ .tag = .cond_dummy_expr, .ty = cond.ty, .data = .{ .un = cond.node } }); + cond_then.node = try p.addNode(.{ + .cond_dummy_expr = .{ + .op_tok = colon, + .operand = cond.node, + .qt = cond.qt, + }, + }); _ = try cond_then.adjustTypes(colon, &then_expr, p, .conditional); - cond.ty = then_expr.ty; + cond.qt = then_expr.qt; cond.node = try p.addNode(.{ - .tag = .binary_cond_expr, - .ty = cond.ty, - .data = .{ .if3 = .{ .cond = cond.node, .body = (try p.addList(&.{ cond_then.node, then_expr.node })).start } }, - .loc = @enumFromInt(cond_tok), + .binary_cond_expr = .{ + .cond_tok = cond_tok, + .cond = cond.node, + .then_expr = cond_then.node, + .else_expr = then_expr.node, + .qt = cond.qt, + }, }); return cond; } @@ -6454,9 +7406,8 @@ fn condExpr(p: *Parser) Error!Result { var else_expr = blk: { defer p.no_eval = saved_eval; if (cond.val.opt_ref != .none and cond.val.toBool(p.comp)) p.no_eval = true; - break :blk try p.condExpr(); + break :blk try p.expect(condExpr); }; - try else_expr.expect(p); _ = try then_expr.adjustTypes(colon, &else_expr, p, .conditional); @@ -6466,27 +7417,28 @@ fn condExpr(p: *Parser) Error!Result { try then_expr.saveValue(p); try else_expr.saveValue(p); } - cond.ty = then_expr.ty; + cond.qt = then_expr.qt; cond.node = try p.addNode(.{ - .tag = .cond_expr, - .ty = cond.ty, - .data = .{ .if3 = .{ .cond = cond.node, .body = (try p.addList(&.{ then_expr.node, else_expr.node })).start } }, - .loc = @enumFromInt(cond_tok), + .cond_expr = .{ + .cond_tok = cond_tok, + .qt = cond.qt, + .cond = cond.node, + .then_expr = then_expr.node, + .else_expr = else_expr.node, + }, }); return cond; } /// lorExpr : landExpr ('||' landExpr)* -fn lorExpr(p: *Parser) Error!Result { - var lhs = try p.landExpr(); - if (lhs.empty(p)) return lhs; +fn lorExpr(p: *Parser) Error!?Result { + var lhs = (try p.landExpr()) orelse return null; const saved_eval = p.no_eval; defer p.no_eval = saved_eval; while (p.eatToken(.pipe_pipe)) |tok| { if (lhs.val.opt_ref != .none and lhs.val.toBool(p.comp)) p.no_eval = true; - var rhs = try p.landExpr(); - try rhs.expect(p); + var rhs = try p.expect(landExpr); if (try lhs.adjustTypes(tok, &rhs, p, .boolean_logic)) { const res = lhs.val.toBool(p.comp) or rhs.val.toBool(p.comp); @@ -6500,16 +7452,14 @@ fn lorExpr(p: *Parser) Error!Result { } /// landExpr : orExpr ('&&' orExpr)* -fn landExpr(p: *Parser) Error!Result { - var lhs = try p.orExpr(); - if (lhs.empty(p)) return lhs; +fn landExpr(p: *Parser) Error!?Result { + var lhs = (try p.orExpr()) orelse return null; const saved_eval = p.no_eval; defer p.no_eval = saved_eval; while (p.eatToken(.ampersand_ampersand)) |tok| { if (lhs.val.opt_ref != .none and !lhs.val.toBool(p.comp)) p.no_eval = true; - var rhs = try p.orExpr(); - try rhs.expect(p); + var rhs = try p.expect(orExpr); if (try lhs.adjustTypes(tok, &rhs, p, .boolean_logic)) { const res = lhs.val.toBool(p.comp) and rhs.val.toBool(p.comp); @@ -6523,12 +7473,10 @@ fn landExpr(p: *Parser) Error!Result { } /// orExpr : xorExpr ('|' xorExpr)* -fn orExpr(p: *Parser) Error!Result { - var lhs = try p.xorExpr(); - if (lhs.empty(p)) return lhs; +fn orExpr(p: *Parser) Error!?Result { + var lhs = (try p.xorExpr()) orelse return null; while (p.eatToken(.pipe)) |tok| { - var rhs = try p.xorExpr(); - try rhs.expect(p); + var rhs = try p.expect(xorExpr); if (try lhs.adjustTypes(tok, &rhs, p, .integer)) { lhs.val = try lhs.val.bitOr(rhs.val, p.comp); @@ -6539,12 +7487,10 @@ fn orExpr(p: *Parser) Error!Result { } /// xorExpr : andExpr ('^' andExpr)* -fn xorExpr(p: *Parser) Error!Result { - var lhs = try p.andExpr(); - if (lhs.empty(p)) return lhs; +fn xorExpr(p: *Parser) Error!?Result { + var lhs = (try p.andExpr()) orelse return null; while (p.eatToken(.caret)) |tok| { - var rhs = try p.andExpr(); - try rhs.expect(p); + var rhs = try p.expect(andExpr); if (try lhs.adjustTypes(tok, &rhs, p, .integer)) { lhs.val = try lhs.val.bitXor(rhs.val, p.comp); @@ -6555,12 +7501,10 @@ fn xorExpr(p: *Parser) Error!Result { } /// andExpr : eqExpr ('&' eqExpr)* -fn andExpr(p: *Parser) Error!Result { - var lhs = try p.eqExpr(); - if (lhs.empty(p)) return lhs; +fn andExpr(p: *Parser) Error!?Result { + var lhs = (try p.eqExpr()) orelse return null; while (p.eatToken(.ampersand)) |tok| { - var rhs = try p.eqExpr(); - try rhs.expect(p); + var rhs = try p.expect(eqExpr); if (try lhs.adjustTypes(tok, &rhs, p, .integer)) { lhs.val = try lhs.val.bitAnd(rhs.val, p.comp); @@ -6571,42 +7515,43 @@ fn andExpr(p: *Parser) Error!Result { } /// eqExpr : compExpr (('==' | '!=') compExpr)* -fn eqExpr(p: *Parser) Error!Result { - var lhs = try p.compExpr(); - if (lhs.empty(p)) return lhs; +fn eqExpr(p: *Parser) Error!?Result { + var lhs = (try p.compExpr()) orelse return null; while (true) { - const eq = p.eatToken(.equal_equal); - const ne = eq orelse p.eatToken(.bang_equal); - const tag = p.tokToTag(ne orelse break); - var rhs = try p.compExpr(); - try rhs.expect(p); + const tok = p.tok_i; + const tag = p.eatTag(.equal_equal) orelse + p.eatTag(.bang_equal) orelse break; + var rhs = try p.expect(compExpr); - if (try lhs.adjustTypes(ne.?, &rhs, p, .equality)) { + if (try lhs.adjustTypes(tok, &rhs, p, .equality)) { const op: std.math.CompareOperator = if (tag == .equal_expr) .eq else .neq; - const res = lhs.val.compare(op, rhs.val, p.comp); - lhs.val = Value.fromBool(res); + + const res: ?bool = if (lhs.qt.isPointer(p.comp) or rhs.qt.isPointer(p.comp)) + lhs.val.comparePointers(op, rhs.val, p.comp) + else + lhs.val.compare(op, rhs.val, p.comp); + + lhs.val = if (res) |val| Value.fromBool(val) else .{}; } else { lhs.val.boolCast(p.comp); } - try lhs.boolRes(p, tag, rhs, ne.?); + try lhs.boolRes(p, tag, rhs, tok); } return lhs; } /// compExpr : shiftExpr (('<' | '<=' | '>' | '>=') shiftExpr)* -fn compExpr(p: *Parser) Error!Result { - var lhs = try p.shiftExpr(); - if (lhs.empty(p)) return lhs; +fn compExpr(p: *Parser) Error!?Result { + var lhs = (try p.shiftExpr()) orelse return null; while (true) { - const lt = p.eatToken(.angle_bracket_left); - const le = lt orelse p.eatToken(.angle_bracket_left_equal); - const gt = le orelse p.eatToken(.angle_bracket_right); - const ge = gt orelse p.eatToken(.angle_bracket_right_equal); - const tag = p.tokToTag(ge orelse break); - var rhs = try p.shiftExpr(); - try rhs.expect(p); - - if (try lhs.adjustTypes(ge.?, &rhs, p, .relational)) { + const tok = p.tok_i; + const tag = p.eatTag(.angle_bracket_left) orelse + p.eatTag(.angle_bracket_left_equal) orelse + p.eatTag(.angle_bracket_right) orelse + p.eatTag(.angle_bracket_right_equal) orelse break; + var rhs = try p.expect(shiftExpr); + + if (try lhs.adjustTypes(tok, &rhs, p, .relational)) { const op: std.math.CompareOperator = switch (tag) { .less_than_expr => .lt, .less_than_equal_expr => .lte, @@ -6614,171 +7559,168 @@ fn compExpr(p: *Parser) Error!Result { .greater_than_equal_expr => .gte, else => unreachable, }; - const res = lhs.val.compare(op, rhs.val, p.comp); - lhs.val = Value.fromBool(res); + + const res: ?bool = if (lhs.qt.isPointer(p.comp) or rhs.qt.isPointer(p.comp)) + lhs.val.comparePointers(op, rhs.val, p.comp) + else + lhs.val.compare(op, rhs.val, p.comp); + lhs.val = if (res) |val| Value.fromBool(val) else .{}; } else { lhs.val.boolCast(p.comp); } - try lhs.boolRes(p, tag, rhs, ge.?); + try lhs.boolRes(p, tag, rhs, tok); } return lhs; } /// shiftExpr : addExpr (('<<' | '>>') addExpr)* -fn shiftExpr(p: *Parser) Error!Result { - var lhs = try p.addExpr(); - if (lhs.empty(p)) return lhs; +fn shiftExpr(p: *Parser) Error!?Result { + var lhs = (try p.addExpr()) orelse return null; while (true) { - const shl = p.eatToken(.angle_bracket_angle_bracket_left); - const shr = shl orelse p.eatToken(.angle_bracket_angle_bracket_right); - const tag = p.tokToTag(shr orelse break); - var rhs = try p.addExpr(); - try rhs.expect(p); - - if (try lhs.adjustTypes(shr.?, &rhs, p, .integer)) { - if (rhs.val.compare(.lt, Value.zero, p.comp)) { - try p.errStr(.negative_shift_count, shl orelse shr.?, try rhs.str(p)); - } - if (rhs.val.compare(.gte, try Value.int(lhs.ty.bitSizeof(p.comp).?, p.comp), p.comp)) { - try p.errStr(.too_big_shift_count, shl orelse shr.?, try rhs.str(p)); - } - if (shl != null) { - if (try lhs.val.shl(lhs.val, rhs.val, lhs.ty, p.comp) and - lhs.ty.signedness(p.comp) != .unsigned) try p.errOverflow(shl.?, lhs); + const tok = p.tok_i; + const tag = p.eatTag(.angle_bracket_angle_bracket_left) orelse + p.eatTag(.angle_bracket_angle_bracket_right) orelse break; + var rhs = try p.expect(addExpr); + + if (try lhs.adjustTypes(tok, &rhs, p, .integer)) { + if (rhs.val.compare(.lt, .zero, p.comp)) { + try p.err(tok, .negative_shift_count, .{}); + } + if (rhs.val.compare(.gte, try Value.int(lhs.qt.bitSizeof(p.comp), p.comp), p.comp)) { + try p.err(tok, .too_big_shift_count, .{}); + } + if (tag == .shl_expr) { + if (try lhs.val.shl(lhs.val, rhs.val, lhs.qt, p.comp) and + lhs.qt.signedness(p.comp) != .unsigned) try p.err(tok, .overflow, .{lhs}); } else { - lhs.val = try lhs.val.shr(rhs.val, lhs.ty, p.comp); + lhs.val = try lhs.val.shr(rhs.val, lhs.qt, p.comp); } } - try lhs.bin(p, tag, rhs, shr.?); + try lhs.bin(p, tag, rhs, tok); } return lhs; } /// addExpr : mulExpr (('+' | '-') mulExpr)* -fn addExpr(p: *Parser) Error!Result { - var lhs = try p.mulExpr(); - if (lhs.empty(p)) return lhs; +fn addExpr(p: *Parser) Error!?Result { + var lhs = (try p.mulExpr()) orelse return null; while (true) { - const plus = p.eatToken(.plus); - const minus = plus orelse p.eatToken(.minus); - const tag = p.tokToTag(minus orelse break); - var rhs = try p.mulExpr(); - try rhs.expect(p); - - const lhs_ty = lhs.ty; - if (try lhs.adjustTypes(minus.?, &rhs, p, if (plus != null) .add else .sub)) { - if (plus != null) { - if (try lhs.val.add(lhs.val, rhs.val, lhs.ty, p.comp) and - lhs.ty.signedness(p.comp) != .unsigned) try p.errOverflow(plus.?, lhs); + const tok = p.tok_i; + const tag = p.eatTag(.plus) orelse + p.eatTag(.minus) orelse break; + var rhs = try p.expect(mulExpr); + + // We'll want to check this for invalid pointer arithmetic. + const original_lhs_qt = lhs.qt; + + if (try lhs.adjustTypes(tok, &rhs, p, if (tag == .add_expr) .add else .sub)) { + const lhs_sk = lhs.qt.scalarKind(p.comp); + if (tag == .add_expr) { + if (try lhs.val.add(lhs.val, rhs.val, lhs.qt, p.comp)) { + if (lhs_sk.isPointer()) { + const increment = lhs; + const ptr_bits = p.comp.type_store.intptr.bitSizeof(p.comp); + const element_size = increment.qt.childType(p.comp).sizeofOrNull(p.comp) orelse 1; + const max_elems = p.comp.maxArrayBytes() / element_size; + + try p.err(tok, .array_overflow, .{ increment, ptr_bits, element_size * 8, element_size, max_elems }); + } else if (lhs.qt.signedness(p.comp) != .unsigned) { + try p.err(tok, .overflow, .{lhs}); + } + } } else { - if (try lhs.val.sub(lhs.val, rhs.val, lhs.ty, p.comp) and - lhs.ty.signedness(p.comp) != .unsigned) try p.errOverflow(minus.?, lhs); + const elem_size = if (original_lhs_qt.isPointer(p.comp)) original_lhs_qt.childType(p.comp).sizeofOrNull(p.comp) orelse 1 else 1; + if (elem_size == 0 and rhs.qt.isPointer(p.comp)) { + lhs.val = .{}; + } else { + if (try lhs.val.sub(lhs.val, rhs.val, lhs.qt, elem_size, p.comp) and + lhs.qt.signedness(p.comp) != .unsigned) + { + try p.err(tok, .overflow, .{lhs}); + } + } } } - if (lhs.ty.specifier != .invalid and lhs_ty.isPtr() and !lhs_ty.isVoidStar() and lhs_ty.elemType().hasIncompleteSize()) { - try p.errStr(.ptr_arithmetic_incomplete, minus.?, try p.typeStr(lhs_ty.elemType())); - lhs.ty = Type.invalid; + if (!lhs.qt.isInvalid()) { + const lhs_sk = original_lhs_qt.scalarKind(p.comp); + if (lhs_sk == .pointer and original_lhs_qt.childType(p.comp).hasIncompleteSize(p.comp)) { + try p.err(tok, .ptr_arithmetic_incomplete, .{original_lhs_qt.childType(p.comp)}); + lhs.qt = .invalid; + } } - try lhs.bin(p, tag, rhs, minus.?); + try lhs.bin(p, tag, rhs, tok); } return lhs; } /// mulExpr : castExpr (('*' | '/' | '%') castExpr)*´ -fn mulExpr(p: *Parser) Error!Result { - var lhs = try p.castExpr(); - if (lhs.empty(p)) return lhs; +fn mulExpr(p: *Parser) Error!?Result { + var lhs = (try p.castExpr()) orelse return null; while (true) { - const mul = p.eatToken(.asterisk); - const div = mul orelse p.eatToken(.slash); - const percent = div orelse p.eatToken(.percent); - const tag = p.tokToTag(percent orelse break); - var rhs = try p.castExpr(); - try rhs.expect(p); - - if (rhs.val.isZero(p.comp) and mul == null and !p.no_eval and lhs.ty.isInt() and rhs.ty.isInt()) { - const err_tag: Diagnostics.Tag = if (p.in_macro) .division_by_zero_macro else .division_by_zero; + const tok = p.tok_i; + const tag = p.eatTag(.asterisk) orelse + p.eatTag(.slash) orelse + p.eatTag(.percent) orelse break; + var rhs = try p.expect(castExpr); + + if (rhs.val.isZero(p.comp) and tag != .mul_expr and !p.no_eval and lhs.qt.isInt(p.comp) and rhs.qt.isInt(p.comp)) { lhs.val = .{}; - if (div != null) { - try p.errStr(err_tag, div.?, "division"); - } else { - try p.errStr(err_tag, percent.?, "remainder"); - } + try p.err(tok, if (p.in_macro) .division_by_zero_macro else .division_by_zero, if (tag == .div_expr) .{"division"} else .{"remainder"}); if (p.in_macro) return error.ParsingFailed; } - if (try lhs.adjustTypes(percent.?, &rhs, p, if (tag == .mod_expr) .integer else .arithmetic)) { - if (mul != null) { - if (try lhs.val.mul(lhs.val, rhs.val, lhs.ty, p.comp) and - lhs.ty.signedness(p.comp) != .unsigned) try p.errOverflow(mul.?, lhs); - } else if (div != null) { - if (try lhs.val.div(lhs.val, rhs.val, lhs.ty, p.comp) and - lhs.ty.signedness(p.comp) != .unsigned) try p.errOverflow(div.?, lhs); - } else { - var res = try Value.rem(lhs.val, rhs.val, lhs.ty, p.comp); - if (res.opt_ref == .none) { - if (p.in_macro) { - // match clang behavior by defining invalid remainder to be zero in macros - res = Value.zero; - } else { - try lhs.saveValue(p); - try rhs.saveValue(p); + if (try lhs.adjustTypes(tok, &rhs, p, if (tag == .mod_expr) .integer else .arithmetic)) { + switch (tag) { + .mul_expr => if (try lhs.val.mul(lhs.val, rhs.val, lhs.qt, p.comp) and + lhs.qt.signedness(p.comp) != .unsigned) try p.err(tok, .overflow, .{lhs}), + .div_expr => if (try lhs.val.div(lhs.val, rhs.val, lhs.qt, p.comp) and + lhs.qt.signedness(p.comp) != .unsigned) try p.err(tok, .overflow, .{lhs}), + .mod_expr => { + var res = try Value.rem(lhs.val, rhs.val, lhs.qt, p.comp); + if (res.opt_ref == .none) { + if (p.in_macro) { + // match clang behavior by defining invalid remainder to be zero in macros + res = .zero; + } else { + try lhs.saveValue(p); + try rhs.saveValue(p); + } } - } - lhs.val = res; + lhs.val = res; + }, + else => unreachable, } } - try lhs.bin(p, tag, rhs, percent.?); + try lhs.bin(p, tag, rhs, tok); } return lhs; } -/// This will always be the last message, if present -fn removeUnusedWarningForTok(p: *Parser, last_expr_tok: TokenIndex) void { - if (last_expr_tok == 0) return; - if (p.comp.diagnostics.list.items.len == 0) return; - - const last_expr_loc = p.pp.tokens.items(.loc)[last_expr_tok]; - const last_msg = p.comp.diagnostics.list.items[p.comp.diagnostics.list.items.len - 1]; - - if (last_msg.tag == .unused_value and last_msg.loc.eql(last_expr_loc)) { - p.comp.diagnostics.list.items.len = p.comp.diagnostics.list.items.len - 1; - } -} - /// castExpr /// : '(' compoundStmt ')' suffixExpr* /// | '(' typeName ')' castExpr /// | '(' typeName ')' '{' initializerItems '}' -/// | __builtin_choose_expr '(' integerConstExpr ',' assignExpr ',' assignExpr ')' -/// | __builtin_va_arg '(' assignExpr ',' typeName ')' -/// | __builtin_offsetof '(' typeName ',' offsetofMemberDesignator ')' -/// | __builtin_bitoffsetof '(' typeName ',' offsetofMemberDesignator ')' /// | unExpr -fn castExpr(p: *Parser) Error!Result { +fn castExpr(p: *Parser) Error!?Result { if (p.eatToken(.l_paren)) |l_paren| cast_expr: { if (p.tok_ids[p.tok_i] == .l_brace) { const tok = p.tok_i; - try p.err(.gnu_statement_expression); - if (p.func.ty == null) { - try p.err(.stmt_expr_not_allowed_file_scope); + try p.err(p.tok_i, .gnu_statement_expression, .{}); + if (p.func.qt == null) { + try p.err(p.tok_i, .stmt_expr_not_allowed_file_scope, .{}); return error.ParsingFailed; } var stmt_expr_state: StmtExprState = .{}; const body_node = (try p.compoundStmt(false, &stmt_expr_state)).?; // compoundStmt only returns null if .l_brace isn't the first token - p.removeUnusedWarningForTok(stmt_expr_state.last_expr_tok); - var res = Result{ + var res: Result = .{ .node = body_node, - .ty = stmt_expr_state.last_expr_res.ty, - .val = stmt_expr_state.last_expr_res.val, + .qt = stmt_expr_state.last_expr_qt, }; try p.expectClosing(l_paren, .r_paren); try res.un(p, .stmt_expr, tok); - while (true) { - const suffix = try p.suffixExpr(res); - if (suffix.empty(p)) break; + while (try p.suffixExpr(res)) |suffix| { res = suffix; } return res; @@ -6790,242 +7732,415 @@ fn castExpr(p: *Parser) Error!Result { try p.expectClosing(l_paren, .r_paren); if (p.tok_ids[p.tok_i] == .l_brace) { - // Compound literal; handled in unExpr - p.tok_i = l_paren; - break :cast_expr; + var lhs = (try p.compoundLiteral(ty, l_paren)).?; + while (try p.suffixExpr(lhs)) |suffix| { + lhs = suffix; + } + return lhs; } const operand_tok = p.tok_i; - var operand = try p.castExpr(); - try operand.expect(p); - try operand.lvalConversion(p); + var operand = try p.expect(castExpr); + try operand.lvalConversion(p, operand_tok); try operand.castType(p, ty, operand_tok, l_paren); return operand; } - switch (p.tok_ids[p.tok_i]) { - .builtin_choose_expr => return p.builtinChooseExpr(), - .builtin_va_arg => return p.builtinVaArg(), - .builtin_offsetof => return p.builtinOffsetof(false), - .builtin_bitoffsetof => return p.builtinOffsetof(true), - .builtin_types_compatible_p => return p.typesCompatible(), - // TODO: other special-cased builtins - else => {}, - } return p.unExpr(); } -fn typesCompatible(p: *Parser) Error!Result { - const builtin_tok = p.tok_i; - p.tok_i += 1; +/// shufflevector : __builtin_shufflevector '(' assignExpr ',' assignExpr (',' integerConstExpr)* ')' +fn shufflevector(p: *Parser, builtin_tok: TokenIndex) Error!Result { const l_paren = try p.expectToken(.l_paren); const first_tok = p.tok_i; - const first = (try p.typeName()) orelse { - try p.err(.expected_type); - p.skipTo(.r_paren); - return error.ParsingFailed; + const lhs = try p.expect(assignExpr); + _ = try p.expectToken(.comma); + const second_tok = p.tok_i; + const rhs = try p.expect(assignExpr); + + const max_index: ?Value = blk: { + if (lhs.qt.isInvalid() or rhs.qt.isInvalid()) break :blk null; + const lhs_vec = lhs.qt.get(p.comp, .vector) orelse break :blk null; + const rhs_vec = rhs.qt.get(p.comp, .vector) orelse break :blk null; + + break :blk try Value.int(lhs_vec.len + rhs_vec.len, p.comp); + }; + const negative_one = try Value.intern(p.comp, .{ .int = .{ .i64 = -1 } }); + + const gpa = p.comp.gpa; + const list_buf_top = p.list_buf.items.len; + defer p.list_buf.items.len = list_buf_top; + while (p.eatToken(.comma)) |_| { + const index_tok = p.tok_i; + const index = try p.integerConstExpr(.gnu_folding_extension); + try p.list_buf.append(gpa, index.node); + if (index.val.compare(.lt, negative_one, p.comp)) { + try p.err(index_tok, .shufflevector_negative_index, .{}); + } else if (max_index != null and index.val.compare(.gte, max_index.?, p.comp)) { + try p.err(index_tok, .shufflevector_index_too_big, .{}); + } + } + + try p.expectClosing(l_paren, .r_paren); + + var res_qt: QualType = .invalid; + if (!lhs.qt.isInvalid() and !lhs.qt.is(p.comp, .vector)) { + try p.err(first_tok, .shufflevector_arg, .{"first"}); + } else if (!rhs.qt.isInvalid() and !rhs.qt.is(p.comp, .vector)) { + try p.err(second_tok, .shufflevector_arg, .{"second"}); + } else if (!lhs.qt.eql(rhs.qt, p.comp)) { + try p.err(builtin_tok, .shufflevector_same_type, .{}); + } else if (p.list_buf.items.len == list_buf_top) { + res_qt = lhs.qt; + } else { + res_qt = try p.comp.type_store.put(gpa, .{ .vector = .{ + .elem = lhs.qt.childType(p.comp), + .len = @intCast(p.list_buf.items.len - list_buf_top), + } }); + } + + return .{ + .qt = res_qt, + .node = try p.addNode(.{ + .builtin_shufflevector = .{ + .builtin_tok = builtin_tok, + .qt = res_qt, + .lhs = lhs.node, + .rhs = rhs.node, + .indexes = p.list_buf.items[list_buf_top..], + }, + }), }; - const lhs = try p.addNode(.{ .tag = .invalid, .ty = first, .data = undefined, .loc = @enumFromInt(first_tok) }); +} + +/// convertvector : __builtin_convertvector '(' assignExpr ',' typeName ')' +fn convertvector(p: *Parser, builtin_tok: TokenIndex) Error!Result { + const l_paren = try p.expectToken(.l_paren); + + const operand = try p.expect(assignExpr); _ = try p.expectToken(.comma); - const second_tok = p.tok_i; - const second = (try p.typeName()) orelse { - try p.err(.expected_type); + var dest_qt = (try p.typeName()) orelse { + try p.err(p.tok_i, .expected_type, .{}); p.skipTo(.r_paren); return error.ParsingFailed; }; - const rhs = try p.addNode(.{ .tag = .invalid, .ty = second, .data = undefined, .loc = @enumFromInt(second_tok) }); try p.expectClosing(l_paren, .r_paren); - var first_unqual = first.canonicalize(.standard); - first_unqual.qual.@"const" = false; - first_unqual.qual.@"volatile" = false; - var second_unqual = second.canonicalize(.standard); - second_unqual.qual.@"const" = false; - second_unqual.qual.@"volatile" = false; + if (operand.qt.isInvalid() or operand.qt.isInvalid()) { + dest_qt = .invalid; + } else check: { + const operand_vec = operand.qt.get(p.comp, .vector) orelse { + try p.err(builtin_tok, .convertvector_arg, .{"first"}); + dest_qt = .invalid; + break :check; + }; + const dest_vec = dest_qt.get(p.comp, .vector) orelse { + try p.err(builtin_tok, .convertvector_arg, .{"second"}); + dest_qt = .invalid; + break :check; + }; + if (operand_vec.len != dest_vec.len) { + try p.err(builtin_tok, .convertvector_size, .{}); + dest_qt = .invalid; + } + } + + return .{ + .qt = dest_qt, + .node = try p.addNode(.{ + .builtin_convertvector = .{ + .builtin_tok = builtin_tok, + .dest_qt = dest_qt, + .operand = operand.node, + }, + }), + }; +} + +/// typesCompatible : __builtin_types_compatible_p '(' typeName ',' typeName ')' +fn typesCompatible(p: *Parser, builtin_tok: TokenIndex) Error!Result { + const l_paren = try p.expectToken(.l_paren); + + const lhs = (try p.typeName()) orelse { + try p.err(p.tok_i, .expected_type, .{}); + p.skipTo(.r_paren); + return error.ParsingFailed; + }; + _ = try p.expectToken(.comma); + + const rhs = (try p.typeName()) orelse { + try p.err(p.tok_i, .expected_type, .{}); + p.skipTo(.r_paren); + return error.ParsingFailed; + }; - const compatible = first_unqual.eql(second_unqual, p.comp, true); + try p.expectClosing(l_paren, .r_paren); - const res = Result{ + const compatible = lhs.eql(rhs, p.comp); + const res: Result = .{ .val = Value.fromBool(compatible), + .qt = .int, .node = try p.addNode(.{ - .tag = .builtin_types_compatible_p, - .ty = Type.int, - .data = .{ .bin = .{ + .builtin_types_compatible_p = .{ + .builtin_tok = builtin_tok, .lhs = lhs, .rhs = rhs, - } }, - .loc = @enumFromInt(builtin_tok), + }, }), }; - try p.value_map.put(res.node, res.val); + try res.putValue(p); return res; } +/// chooseExpr : __builtin_choose_expr '(' integerConstExpr ',' assignExpr ',' assignExpr ')' fn builtinChooseExpr(p: *Parser) Error!Result { - p.tok_i += 1; const l_paren = try p.expectToken(.l_paren); const cond_tok = p.tok_i; var cond = try p.integerConstExpr(.no_const_decl_folding); if (cond.val.opt_ref == .none) { - try p.errTok(.builtin_choose_cond, cond_tok); + try p.err(cond_tok, .builtin_choose_cond, .{}); return error.ParsingFailed; } _ = try p.expectToken(.comma); - var then_expr = if (cond.val.toBool(p.comp)) try p.assignExpr() else try p.parseNoEval(assignExpr); - try then_expr.expect(p); + const then_expr = if (cond.val.toBool(p.comp)) + try p.expect(assignExpr) + else + try p.parseNoEval(assignExpr); _ = try p.expectToken(.comma); - var else_expr = if (!cond.val.toBool(p.comp)) try p.assignExpr() else try p.parseNoEval(assignExpr); - try else_expr.expect(p); + const else_expr = if (!cond.val.toBool(p.comp)) + try p.expect(assignExpr) + else + try p.parseNoEval(assignExpr); try p.expectClosing(l_paren, .r_paren); if (cond.val.toBool(p.comp)) { cond.val = then_expr.val; - cond.ty = then_expr.ty; + cond.qt = then_expr.qt; } else { cond.val = else_expr.val; - cond.ty = else_expr.ty; + cond.qt = else_expr.qt; } cond.node = try p.addNode(.{ - .tag = .builtin_choose_expr, - .ty = cond.ty, - .data = .{ .if3 = .{ .cond = cond.node, .body = (try p.addList(&.{ then_expr.node, else_expr.node })).start } }, + .builtin_choose_expr = .{ + .cond_tok = cond_tok, + .qt = cond.qt, + .cond = cond.node, + .then_expr = then_expr.node, + .else_expr = else_expr.node, + }, }); return cond; } -fn builtinVaArg(p: *Parser) Error!Result { - const builtin_tok = p.tok_i; - p.tok_i += 1; - +/// vaStart : __builtin_va_arg '(' assignExpr ',' typeName ')' +fn builtinVaArg(p: *Parser, builtin_tok: TokenIndex) Error!Result { const l_paren = try p.expectToken(.l_paren); const va_list_tok = p.tok_i; - var va_list = try p.assignExpr(); - try va_list.expect(p); - try va_list.lvalConversion(p); + var va_list = try p.expect(assignExpr); + try va_list.lvalConversion(p, va_list_tok); _ = try p.expectToken(.comma); const ty = (try p.typeName()) orelse { - try p.err(.expected_type); + try p.err(p.tok_i, .expected_type, .{}); return error.ParsingFailed; }; try p.expectClosing(l_paren, .r_paren); - if (!va_list.ty.eql(p.comp.types.va_list, p.comp, true)) { - try p.errStr(.incompatible_va_arg, va_list_tok, try p.typeStr(va_list.ty)); + if (!va_list.qt.eql(p.comp.type_store.va_list, p.comp)) { + try p.err(va_list_tok, .incompatible_va_arg, .{va_list.qt}); return error.ParsingFailed; } - return Result{ .ty = ty, .node = try p.addNode(.{ - .tag = .special_builtin_call_one, - .ty = ty, - .data = .{ .decl = .{ .name = builtin_tok, .node = va_list.node } }, - }) }; + return .{ + .qt = ty, + .node = try p.addNode(.{ + .builtin_call_expr = .{ + .builtin_tok = builtin_tok, + .qt = ty, + .args = &.{va_list.node}, + }, + }), + }; } -fn builtinOffsetof(p: *Parser, want_bits: bool) Error!Result { - const builtin_tok = p.tok_i; - p.tok_i += 1; +const OffsetKind = enum { bits, bytes }; +/// offsetof +/// : __builtin_offsetof '(' typeName ',' offsetofMemberDesignator ')' +/// | __builtin_bitoffsetof '(' typeName ',' offsetofMemberDesignator ')' +fn builtinOffsetof(p: *Parser, builtin_tok: TokenIndex, offset_kind: OffsetKind) Error!Result { const l_paren = try p.expectToken(.l_paren); const ty_tok = p.tok_i; - const ty = (try p.typeName()) orelse { - try p.err(.expected_type); + const operand_qt = (try p.typeName()) orelse { + try p.err(p.tok_i, .expected_type, .{}); p.skipTo(.r_paren); return error.ParsingFailed; }; - if (!ty.isRecord()) { - try p.errStr(.offsetof_ty, ty_tok, try p.typeStr(ty)); + const record_ty = operand_qt.getRecord(p.comp) orelse { + try p.err(ty_tok, .offsetof_ty, .{operand_qt}); p.skipTo(.r_paren); return error.ParsingFailed; - } else if (ty.hasIncompleteSize()) { - try p.errStr(.offsetof_incomplete, ty_tok, try p.typeStr(ty)); + }; + + if (record_ty.layout == null) { + try p.err(ty_tok, .offsetof_incomplete, .{operand_qt}); p.skipTo(.r_paren); return error.ParsingFailed; } _ = try p.expectToken(.comma); - const offsetof_expr = try p.offsetofMemberDesignator(ty, want_bits); + const offsetof_expr = try p.offsetofMemberDesignator(record_ty, operand_qt, offset_kind, builtin_tok); try p.expectClosing(l_paren, .r_paren); - return Result{ - .ty = p.comp.types.size, + const res: Result = .{ + .qt = p.comp.type_store.size, .val = offsetof_expr.val, .node = try p.addNode(.{ - .tag = .special_builtin_call_one, - .ty = p.comp.types.size, - .data = .{ .decl = .{ .name = builtin_tok, .node = offsetof_expr.node } }, + .builtin_call_expr = .{ + .builtin_tok = builtin_tok, + .qt = p.comp.type_store.size, + .args = &.{offsetof_expr.node}, + }, }), }; + try res.putValue(p); + return res; } -/// offsetofMemberDesignator: IDENTIFIER ('.' IDENTIFIER | '[' expr ']' )* -fn offsetofMemberDesignator(p: *Parser, base_ty: Type, want_bits: bool) Error!Result { +/// offsetofMemberDesignator : IDENTIFIER ('.' IDENTIFIER | '[' expr ']' )* +fn offsetofMemberDesignator( + p: *Parser, + base_record_ty: Type.Record, + base_qt: QualType, + offset_kind: OffsetKind, + access_tok: TokenIndex, +) Error!Result { errdefer p.skipTo(.r_paren); const base_field_name_tok = try p.expectIdentifier(); - const base_field_name = try StrInt.intern(p.comp, p.tokSlice(base_field_name_tok)); - const base_record_ty = base_ty.getRecord().?; - try p.validateFieldAccess(base_record_ty, base_ty, base_field_name_tok, base_field_name); - const base_node = try p.addNode(.{ .tag = .default_init_expr, .ty = base_ty, .data = undefined }); + const base_field_name = try p.comp.internString(p.tokSlice(base_field_name_tok)); + + try p.validateFieldAccess(base_record_ty, base_qt, base_field_name_tok, base_field_name); + const base_node = try p.addNode(.{ .default_init_expr = .{ + .last_tok = p.tok_i, + .qt = base_qt, + } }); var cur_offset: u64 = 0; - var lhs = try p.fieldAccessExtra(base_node, base_record_ty, base_field_name, false, &cur_offset); + var lhs = try p.fieldAccessExtra(base_node, base_record_ty, base_field_name, false, access_tok, &cur_offset); - var total_offset = cur_offset; + var total_offset: i64 = @intCast(cur_offset); + var runtime_offset = false; while (true) switch (p.tok_ids[p.tok_i]) { .period => { p.tok_i += 1; const field_name_tok = try p.expectIdentifier(); - const field_name = try StrInt.intern(p.comp, p.tokSlice(field_name_tok)); + const field_name = try p.comp.internString(p.tokSlice(field_name_tok)); - const lhs_record_ty = lhs.ty.getRecord() orelse { - try p.errStr(.offsetof_ty, field_name_tok, try p.typeStr(lhs.ty)); + const lhs_record_ty = lhs.qt.getRecord(p.comp) orelse { + try p.err(field_name_tok, .offsetof_ty, .{lhs.qt}); return error.ParsingFailed; }; - try p.validateFieldAccess(lhs_record_ty, lhs.ty, field_name_tok, field_name); - lhs = try p.fieldAccessExtra(lhs.node, lhs_record_ty, field_name, false, &cur_offset); - total_offset += cur_offset; + try p.validateFieldAccess(lhs_record_ty, lhs.qt, field_name_tok, field_name); + lhs = try p.fieldAccessExtra(lhs.node, lhs_record_ty, field_name, false, access_tok, &cur_offset); + total_offset += @intCast(cur_offset); }, .l_bracket => { const l_bracket_tok = p.tok_i; p.tok_i += 1; - var index = try p.expr(); - try index.expect(p); + var index = try p.expect(expr); _ = try p.expectClosing(l_bracket_tok, .r_bracket); - if (!lhs.ty.isArray()) { - try p.errStr(.offsetof_array, l_bracket_tok, try p.typeStr(lhs.ty)); + const array_ty = lhs.qt.get(p.comp, .array) orelse { + try p.err(l_bracket_tok, .offsetof_array, .{lhs.qt}); return error.ParsingFailed; - } + }; var ptr = lhs; - try ptr.lvalConversion(p); - try index.lvalConversion(p); + try ptr.lvalConversion(p, l_bracket_tok); + try index.lvalConversion(p, l_bracket_tok); - if (index.ty.isInt()) { + if (!index.qt.isInvalid() and index.qt.isRealInt(p.comp)) { try p.checkArrayBounds(index, lhs, l_bracket_tok); + } else if (!index.qt.isInvalid()) { + try p.err(l_bracket_tok, .invalid_index, .{}); + } + + if (index.val.toInt(i64, p.comp)) |index_int| { + total_offset += @as(i64, @intCast(array_ty.elem.bitSizeof(p.comp))) * index_int; } else { - try p.errTok(.invalid_index, l_bracket_tok); + runtime_offset = true; } try index.saveValue(p); - try ptr.bin(p, .array_access_expr, index, l_bracket_tok); + ptr.node = try p.addNode(.{ .array_access_expr = .{ + .l_bracket_tok = l_bracket_tok, + .base = ptr.node, + .index = index.node, + .qt = ptr.qt, + } }); lhs = ptr; }, - else => break, - }; - const val = try Value.int(if (want_bits) total_offset else total_offset / 8, p.comp); - return Result{ .ty = base_ty, .val = val, .node = lhs.node }; + else => break, + }; + return .{ + .qt = base_qt, + .val = if (runtime_offset) + .{} + else + try Value.int(if (offset_kind == .bits) total_offset else @divExact(total_offset, 8), p.comp), + .node = lhs.node, + }; +} + +fn computeOffsetExtra(p: *Parser, node: Node.Index, offset_so_far: *Value) !Value { + switch (node.get(&p.tree)) { + .cast => |cast| { + return switch (cast.kind) { + .array_to_pointer, .no_op, .bitcast => p.computeOffsetExtra(cast.operand, offset_so_far), + .lval_to_rval => .{}, + else => unreachable, + }; + }, + .paren_expr => |un| return p.computeOffsetExtra(un.operand, offset_so_far), + .decl_ref_expr => return p.pointerValue(node, offset_so_far.*), + .array_access_expr => |access| { + const index_val = p.tree.value_map.get(access.index) orelse return .{}; + var size = try Value.int(access.qt.sizeof(p.comp), p.comp); + const mul_overflow = try size.mul(size, index_val, p.comp.type_store.ptrdiff, p.comp); + + const add_overflow = try offset_so_far.add(size, offset_so_far.*, p.comp.type_store.ptrdiff, p.comp); + _ = mul_overflow; + _ = add_overflow; + return p.computeOffsetExtra(access.base, offset_so_far); + }, + .member_access_expr, .member_access_ptr_expr => |access| { + var ty = access.base.qt(&p.tree); + if (ty.isPointer(p.comp)) ty = ty.childType(p.comp); + const record_ty = ty.getRecord(p.comp).?; + + const field_offset = try Value.int(@divExact(record_ty.fields[access.member_index].layout.offset_bits, 8), p.comp); + _ = try offset_so_far.add(field_offset, offset_so_far.*, p.comp.type_store.ptrdiff, p.comp); + return p.computeOffsetExtra(access.base, offset_so_far); + }, + else => return .{}, + } +} + +/// Compute the offset (in bytes) of an expression from a base pointer. +fn computeOffset(p: *Parser, res: Result) !Value { + var val: Value = if (res.val.opt_ref == .none) .zero else res.val; + return p.computeOffsetExtra(res.node, &val); } /// unExpr @@ -7036,92 +8151,115 @@ fn offsetofMemberDesignator(p: *Parser, base_ty: Type, want_bits: bool) Error!Re /// | keyword_sizeof '(' typeName ')' /// | keyword_alignof '(' typeName ')' /// | keyword_c23_alignof '(' typeName ')' -fn unExpr(p: *Parser) Error!Result { +fn unExpr(p: *Parser) Error!?Result { + const gpa = p.comp.gpa; const tok = p.tok_i; switch (p.tok_ids[tok]) { .ampersand_ampersand => { const address_tok = p.tok_i; p.tok_i += 1; const name_tok = try p.expectIdentifier(); - try p.errTok(.gnu_label_as_value, address_tok); + try p.err(address_tok, .gnu_label_as_value, .{}); p.contains_address_of_label = true; const str = p.tokSlice(name_tok); if (p.findLabel(str) == null) { - try p.labels.append(.{ .unresolved_goto = name_tok }); + try p.labels.append(gpa, .{ .unresolved_goto = name_tok }); } - const elem_ty = try p.arena.create(Type); - elem_ty.* = .{ .specifier = .void }; - const result_ty = Type{ .specifier = .pointer, .data = .{ .sub_type = elem_ty } }; - return Result{ + + return .{ .node = try p.addNode(.{ - .tag = .addr_of_label, - .data = .{ .decl_ref = name_tok }, - .ty = result_ty, - .loc = @enumFromInt(address_tok), + .addr_of_label = .{ + .label_tok = name_tok, + .qt = .void_pointer, + }, }), - .ty = result_ty, + .qt = .void_pointer, }; }, .ampersand => { if (p.in_macro) { - try p.err(.invalid_preproc_operator); + try p.err(p.tok_i, .invalid_preproc_operator, .{}); return error.ParsingFailed; } + const orig_tok_i = p.tok_i; p.tok_i += 1; - var operand = try p.castExpr(); - try operand.expect(p); + var operand = try p.expect(castExpr); + var addr_val: Value = .{}; - const tree = p.tmpTree(); if (p.getNode(operand.node, .member_access_expr) orelse - p.getNode(operand.node, .member_access_ptr_expr)) |member_node| + p.getNode(operand.node, .member_access_ptr_expr)) |access| { - if (tree.isBitfield(member_node)) try p.errTok(.addr_of_bitfield, tok); - } - if (!tree.isLval(operand.node) and !operand.ty.is(.invalid)) { - try p.errTok(.addr_of_rvalue, tok); + if (access.isBitFieldWidth(&p.tree) != null) try p.err(tok, .addr_of_bitfield, .{}); + const lhs_qt = access.base.qt(&p.tree); + if (lhs_qt.hasAttribute(p.comp, .@"packed")) { + const record_ty = lhs_qt.getRecord(p.comp).?; + try p.err(orig_tok_i, .packed_member_address, .{ + record_ty.fields[access.member_index].name.lookup(p.comp), + record_ty.name.lookup(p.comp), + }); + } } - if (operand.ty.qual.register) try p.errTok(.addr_of_register, tok); + if (!operand.qt.isInvalid()) { + if (!p.tree.isLval(operand.node)) { + try p.err(tok, .addr_of_rvalue, .{}); + } + addr_val = try p.computeOffset(operand); - if (!operand.ty.is(.invalid)) { - const elem_ty = try p.arena.create(Type); - elem_ty.* = operand.ty; - operand.ty = Type{ - .specifier = .pointer, - .data = .{ .sub_type = elem_ty }, - }; + operand.qt = try p.comp.type_store.put(gpa, .{ .pointer = .{ + .child = operand.qt, + .decayed = null, + } }); } + if (p.getNode(operand.node, .decl_ref_expr)) |decl_ref| { + switch (decl_ref.decl.get(&p.tree)) { + .variable => |variable| { + if (variable.storage_class == .register) try p.err(tok, .addr_of_register, .{}); + }, + else => {}, + } + } else if (p.getNode(operand.node, .compound_literal_expr)) |literal| { + switch (literal.storage_class) { + .register => try p.err(tok, .addr_of_register, .{}), + else => {}, + } + } + try operand.saveValue(p); try operand.un(p, .addr_of_expr, tok); + operand.val = addr_val; return operand; }, .asterisk => { - const asterisk_loc = p.tok_i; p.tok_i += 1; - var operand = try p.castExpr(); - try operand.expect(p); + var operand = try p.expect(castExpr); - if (operand.ty.isArray() or operand.ty.isPtr() or operand.ty.isFunc()) { - try operand.lvalConversion(p); - operand.ty = operand.ty.elemType(); - } else { - try p.errTok(.indirection_ptr, tok); + switch (operand.qt.base(p.comp).type) { + .array, .func, .pointer => { + try operand.lvalConversion(p, tok); + operand.qt = operand.qt.childType(p.comp); + operand.val = .{}; + }, + else => { + try p.err(tok, .indirection_ptr, .{}); + }, } - if (operand.ty.hasIncompleteSize() and !operand.ty.is(.void)) { - try p.errStr(.deref_incomplete_ty_ptr, asterisk_loc, try p.typeStr(operand.ty)); + + if (operand.qt.hasIncompleteSize(p.comp) and !operand.qt.is(p.comp, .void)) { + try p.err(tok, .deref_incomplete_ty_ptr, .{operand.qt}); } - operand.ty.qual = .{}; + + operand.qt = operand.qt.unqualified(); try operand.un(p, .deref_expr, tok); return operand; }, .plus => { p.tok_i += 1; - var operand = try p.castExpr(); - try operand.expect(p); - try operand.lvalConversion(p); - if (!operand.ty.isInt() and !operand.ty.isFloat()) - try p.errStr(.invalid_argument_un, tok, try p.typeStr(operand.ty)); + var operand = try p.expect(castExpr); + try operand.lvalConversion(p, tok); + if (!operand.qt.isInt(p.comp) and !operand.qt.isFloat(p.comp)) + try p.err(tok, .invalid_argument_un, .{operand.qt}); try operand.usualUnaryConversion(p, tok); @@ -7130,15 +8268,14 @@ fn unExpr(p: *Parser) Error!Result { .minus => { p.tok_i += 1; - var operand = try p.castExpr(); - try operand.expect(p); - try operand.lvalConversion(p); - if (!operand.ty.isInt() and !operand.ty.isFloat()) - try p.errStr(.invalid_argument_un, tok, try p.typeStr(operand.ty)); + var operand = try p.expect(castExpr); + try operand.lvalConversion(p, tok); + if (!operand.qt.isInt(p.comp) and !operand.qt.isFloat(p.comp)) + try p.err(tok, .invalid_argument_un, .{operand.qt}); try operand.usualUnaryConversion(p, tok); if (operand.val.isArithmetic(p.comp)) { - _ = try operand.val.sub(Value.zero, operand.val, operand.ty, p.comp); + _ = try operand.val.negate(operand.val, operand.qt, p.comp); } else { operand.val = .{}; } @@ -7148,22 +8285,24 @@ fn unExpr(p: *Parser) Error!Result { .plus_plus => { p.tok_i += 1; - var operand = try p.castExpr(); - try operand.expect(p); - if (!operand.ty.isScalar()) - try p.errStr(.invalid_argument_un, tok, try p.typeStr(operand.ty)); - if (operand.ty.isComplex()) - try p.errStr(.complex_prefix_postfix_op, p.tok_i, try p.typeStr(operand.ty)); - - if (!p.tmpTree().isLval(operand.node) or operand.ty.isConst()) { - try p.errTok(.not_assignable, tok); + var operand = try p.expect(castExpr); + const scalar_kind = operand.qt.scalarKind(p.comp); + if (scalar_kind == .void_pointer) + try p.err(tok, .gnu_pointer_arith, .{}); + if (scalar_kind == .none) + try p.err(tok, .invalid_argument_un, .{operand.qt}); + if (!scalar_kind.isReal()) + try p.err(p.tok_i, .complex_prefix_postfix_op, .{operand.qt}); + + if (!p.tree.isLval(operand.node) or operand.qt.@"const") { + try p.err(tok, .not_assignable, .{}); return error.ParsingFailed; } try operand.usualUnaryConversion(p, tok); if (operand.val.is(.int, p.comp) or operand.val.is(.int, p.comp)) { - if (try operand.val.add(operand.val, Value.one, operand.ty, p.comp)) - try p.errOverflow(tok, operand); + if (try operand.val.add(operand.val, .one, operand.qt, p.comp)) + try p.err(tok, .overflow, .{operand}); } else { operand.val = .{}; } @@ -7174,22 +8313,24 @@ fn unExpr(p: *Parser) Error!Result { .minus_minus => { p.tok_i += 1; - var operand = try p.castExpr(); - try operand.expect(p); - if (!operand.ty.isScalar()) - try p.errStr(.invalid_argument_un, tok, try p.typeStr(operand.ty)); - if (operand.ty.isComplex()) - try p.errStr(.complex_prefix_postfix_op, p.tok_i, try p.typeStr(operand.ty)); - - if (!p.tmpTree().isLval(operand.node) or operand.ty.isConst()) { - try p.errTok(.not_assignable, tok); + var operand = try p.expect(castExpr); + const scalar_kind = operand.qt.scalarKind(p.comp); + if (scalar_kind == .void_pointer) + try p.err(tok, .gnu_pointer_arith, .{}); + if (scalar_kind == .none) + try p.err(tok, .invalid_argument_un, .{operand.qt}); + if (!scalar_kind.isReal()) + try p.err(p.tok_i, .complex_prefix_postfix_op, .{operand.qt}); + + if (!p.tree.isLval(operand.node) or operand.qt.@"const") { + try p.err(tok, .not_assignable, .{}); return error.ParsingFailed; } try operand.usualUnaryConversion(p, tok); if (operand.val.is(.int, p.comp) or operand.val.is(.int, p.comp)) { - if (try operand.val.sub(operand.val, Value.one, operand.ty, p.comp)) - try p.errOverflow(tok, operand); + if (try operand.val.decrement(operand.val, operand.qt, p.comp)) + try p.err(tok, .overflow, .{operand}); } else { operand.val = .{}; } @@ -7200,21 +8341,21 @@ fn unExpr(p: *Parser) Error!Result { .tilde => { p.tok_i += 1; - var operand = try p.castExpr(); - try operand.expect(p); - try operand.lvalConversion(p); + var operand = try p.expect(castExpr); + try operand.lvalConversion(p, tok); try operand.usualUnaryConversion(p, tok); - if (operand.ty.isInt()) { - if (operand.val.is(.int, p.comp)) { - operand.val = try operand.val.bitNot(operand.ty, p.comp); - } - } else if (operand.ty.isComplex()) { - try p.errStr(.complex_conj, tok, try p.typeStr(operand.ty)); + const scalar_kind = operand.qt.scalarKind(p.comp); + if (!scalar_kind.isReal()) { + try p.err(tok, .complex_conj, .{operand.qt}); if (operand.val.is(.complex, p.comp)) { - operand.val = try operand.val.complexConj(operand.ty, p.comp); + operand.val = try operand.val.complexConj(operand.qt, p.comp); + } + } else if (scalar_kind.isInt()) { + if (operand.val.is(.int, p.comp)) { + operand.val = try operand.val.bitNot(operand.qt, p.comp); } } else { - try p.errStr(.invalid_argument_un, tok, try p.typeStr(operand.ty)); + try p.err(tok, .invalid_argument_un, .{operand.qt}); operand.val = .{}; } try operand.un(p, .bit_not_expr, tok); @@ -7223,70 +8364,87 @@ fn unExpr(p: *Parser) Error!Result { .bang => { p.tok_i += 1; - var operand = try p.castExpr(); - try operand.expect(p); - try operand.lvalConversion(p); - if (!operand.ty.isScalar()) - try p.errStr(.invalid_argument_un, tok, try p.typeStr(operand.ty)); + var operand = try p.expect(castExpr); + try operand.lvalConversion(p, tok); + if (operand.qt.scalarKind(p.comp) == .none) + try p.err(tok, .invalid_argument_un, .{operand.qt}); try operand.usualUnaryConversion(p, tok); if (operand.val.is(.int, p.comp)) { operand.val = Value.fromBool(!operand.val.toBool(p.comp)); } else if (operand.val.opt_ref == .null) { - operand.val = Value.one; + operand.val = .one; } else { - if (operand.ty.isDecayed()) { - operand.val = Value.zero; - } else { - operand.val = .{}; + operand.val = .{}; + if (operand.qt.get(p.comp, .pointer)) |pointer_ty| { + if (pointer_ty.decayed != null) operand.val = .zero; } } - operand.ty = .{ .specifier = .int }; + operand.qt = .int; try operand.un(p, .bool_not_expr, tok); return operand; }, .keyword_sizeof => { p.tok_i += 1; const expected_paren = p.tok_i; - var res = Result{}; - if (try p.typeName()) |ty| { - res.ty = ty; - try p.errTok(.expected_parens_around_typename, expected_paren); + + var has_expr = false; + var res: Result = .{ + .node = undefined, // check has_expr + }; + if (try p.typeName()) |qt| { + res.qt = qt; + try p.err(expected_paren, .expected_parens_around_typename, .{}); } else if (p.eatToken(.l_paren)) |l_paren| { if (try p.typeName()) |ty| { - res.ty = ty; + res.qt = ty; try p.expectClosing(l_paren, .r_paren); } else { p.tok_i = expected_paren; res = try p.parseNoEval(unExpr); + has_expr = true; } } else { res = try p.parseNoEval(unExpr); + has_expr = true; } + const operand_qt = res.qt; - if (res.ty.is(.void)) { - try p.errStr(.pointer_arith_void, tok, "sizeof"); - } else if (res.ty.isDecayed()) { - const array_ty = res.ty.originalTypeOfDecayedArray(); - const err_str = try p.typePairStrExtra(res.ty, " instead of ", array_ty); - try p.errStr(.sizeof_array_arg, tok, err_str); - } - if (res.ty.sizeof(p.comp)) |size| { - if (size == 0) { - try p.errTok(.sizeof_returns_zero, tok); - } - res.val = try Value.int(size, p.comp); - res.ty = p.comp.types.size; - } else { + if (res.qt.isInvalid()) { res.val = .{}; - if (res.ty.hasIncompleteSize()) { - try p.errStr(.invalid_sizeof, expected_paren - 1, try p.typeStr(res.ty)); - res.ty = Type.invalid; + } else { + const base_type = res.qt.base(p.comp); + switch (base_type.type) { + .void => try p.err(tok, .pointer_arith_void, .{"sizeof"}), + .pointer => |pointer_ty| if (pointer_ty.decayed) |decayed_qt| { + try p.err(tok, .sizeof_array_arg, .{ res.qt, decayed_qt }); + }, + else => {}, + } + + if (base_type.qt.sizeofOrNull(p.comp)) |size| { + if (size == 0 and p.comp.langopts.emulate == .msvc) { + try p.err(tok, .sizeof_returns_zero, .{}); + } + res.val = try Value.int(size, p.comp); + res.qt = p.comp.type_store.size; } else { - res.ty = p.comp.types.size; + res.val = .{}; + if (res.qt.hasIncompleteSize(p.comp)) { + try p.err(expected_paren - 1, .invalid_sizeof, .{res.qt}); + res.qt = .invalid; + } else { + res.qt = p.comp.type_store.size; + } } } - try res.un(p, .sizeof_expr, tok); + + res.node = try p.addNode(.{ .sizeof_expr = .{ + .op_tok = tok, + .qt = res.qt, + .expr = if (has_expr) res.node else null, + .operand_qt = operand_qt, + } }); return res; }, .keyword_alignof, @@ -7296,35 +8454,51 @@ fn unExpr(p: *Parser) Error!Result { => { p.tok_i += 1; const expected_paren = p.tok_i; - var res = Result{}; - if (try p.typeName()) |ty| { - res.ty = ty; - try p.errTok(.expected_parens_around_typename, expected_paren); + + var has_expr = false; + var res: Result = .{ + .node = undefined, // check has_expr + }; + if (try p.typeName()) |qt| { + res.qt = qt; + try p.err(expected_paren, .expected_parens_around_typename, .{}); } else if (p.eatToken(.l_paren)) |l_paren| { - if (try p.typeName()) |ty| { - res.ty = ty; + if (try p.typeName()) |qt| { + res.qt = qt; try p.expectClosing(l_paren, .r_paren); } else { p.tok_i = expected_paren; res = try p.parseNoEval(unExpr); - try p.errTok(.alignof_expr, expected_paren); + has_expr = true; + + try p.err(expected_paren, .alignof_expr, .{}); } } else { res = try p.parseNoEval(unExpr); - try p.errTok(.alignof_expr, expected_paren); + has_expr = true; + + try p.err(expected_paren, .alignof_expr, .{}); } + const operand_qt = res.qt; - if (res.ty.is(.void)) { - try p.errStr(.pointer_arith_void, tok, "alignof"); + if (res.qt.is(p.comp, .void)) { + try p.err(tok, .pointer_arith_void, .{"alignof"}); } - if (res.ty.alignable()) { - res.val = try Value.int(res.ty.alignof(p.comp), p.comp); - res.ty = p.comp.types.size; - } else { - try p.errStr(.invalid_alignof, expected_paren, try p.typeStr(res.ty)); - res.ty = Type.invalid; + + if (res.qt.sizeofOrNull(p.comp) != null) { + res.val = try Value.int(res.qt.alignof(p.comp), p.comp); + res.qt = p.comp.type_store.size; + } else if (!res.qt.isInvalid()) { + try p.err(expected_paren, .invalid_alignof, .{res.qt}); + res.qt = .invalid; } - try res.un(p, .alignof_expr, tok); + + res.node = try p.addNode(.{ .alignof_expr = .{ + .op_tok = tok, + .qt = res.qt, + .expr = if (has_expr) res.node else null, + .operand_qt = operand_qt, + } }); return res; }, .keyword_extension => { @@ -7333,38 +8507,35 @@ fn unExpr(p: *Parser) Error!Result { defer p.extension_suppressed = saved_extension; p.extension_suppressed = true; - var child = try p.castExpr(); - try child.expect(p); - return child; + return try p.expect(castExpr); }, .keyword_imag1, .keyword_imag2 => { const imag_tok = p.tok_i; p.tok_i += 1; - var operand = try p.castExpr(); - try operand.expect(p); - try operand.lvalConversion(p); - if (operand.ty.is(.invalid)) return Result.invalid; - if (!operand.ty.isInt() and !operand.ty.isFloat()) { - try p.errStr(.invalid_imag, imag_tok, try p.typeStr(operand.ty)); + var operand = try p.expect(castExpr); + try operand.lvalConversion(p, tok); + if (operand.qt.isInvalid()) return operand; + + const scalar_kind = operand.qt.scalarKind(p.comp); + if (!scalar_kind.isArithmetic()) { + try p.err(imag_tok, .invalid_imag, .{operand.qt}); } - if (operand.ty.isComplex()) { + if (!scalar_kind.isReal()) { operand.val = try operand.val.imaginaryPart(p.comp); - } else if (operand.ty.isReal()) { - switch (p.comp.langopts.emulate) { - .msvc => {}, // Doesn't support `_Complex` or `__imag` in the first place - .gcc => operand.val = Value.zero, - .clang => { - if (operand.val.is(.int, p.comp) or operand.val.is(.float, p.comp)) { - operand.val = Value.zero; - } else { - operand.val = .{}; - } - }, - } + } else switch (p.comp.langopts.emulate) { + .msvc => {}, // Doesn't support `_Complex` or `__imag` in the first place + .gcc => operand.val = .zero, + .clang => { + if (operand.val.is(.int, p.comp) or operand.val.is(.float, p.comp)) { + operand.val = .zero; + } else { + operand.val = .{}; + } + }, } // convert _Complex T to T - operand.ty = operand.ty.makeReal(); + operand.qt = operand.qt.toReal(p.comp); try operand.un(p, .imag_expr, tok); return operand; }, @@ -7372,28 +8543,24 @@ fn unExpr(p: *Parser) Error!Result { const real_tok = p.tok_i; p.tok_i += 1; - var operand = try p.castExpr(); - try operand.expect(p); - try operand.lvalConversion(p); - if (operand.ty.is(.invalid)) return Result.invalid; - if (!operand.ty.isInt() and !operand.ty.isFloat()) { - try p.errStr(.invalid_real, real_tok, try p.typeStr(operand.ty)); + var operand = try p.expect(castExpr); + try operand.lvalConversion(p, tok); + if (operand.qt.isInvalid()) return operand; + if (!operand.qt.isInt(p.comp) and !operand.qt.isFloat(p.comp)) { + try p.err(real_tok, .invalid_real, .{operand.qt}); } // convert _Complex T to T - operand.ty = operand.ty.makeReal(); + operand.qt = operand.qt.toReal(p.comp); operand.val = try operand.val.realPart(p.comp); try operand.un(p, .real_expr, tok); return operand; }, else => { - var lhs = try p.compoundLiteral(); - if (lhs.empty(p)) { - lhs = try p.primaryExpr(); - if (lhs.empty(p)) return lhs; - } - while (true) { - const suffix = try p.suffixExpr(lhs); - if (suffix.empty(p)) break; + var lhs = (try p.compoundLiteral(null, null)) orelse + (try p.primaryExpr()) orelse + return null; + + while (try p.suffixExpr(lhs)) |suffix| { lhs = suffix; } return lhs; @@ -7404,58 +8571,68 @@ fn unExpr(p: *Parser) Error!Result { /// compoundLiteral /// : '(' storageClassSpec* type_name ')' '{' initializer_list '}' /// | '(' storageClassSpec* type_name ')' '{' initializer_list ',' '}' -fn compoundLiteral(p: *Parser) Error!Result { - const l_paren = p.eatToken(.l_paren) orelse return Result{}; +fn compoundLiteral(p: *Parser, qt_opt: ?QualType, opt_l_paren: ?TokenIndex) Error!?Result { + const l_paren, const d = if (qt_opt) |some| .{ opt_l_paren.?, DeclSpec{ .qt = some } } else blk: { + const l_paren = p.eatToken(.l_paren) orelse return null; - var d: DeclSpec = .{ .ty = .{ .specifier = undefined } }; - const any = if (p.comp.langopts.standard.atLeast(.c23)) - try p.storageClassSpec(&d) - else - false; - - const tag: Tree.Tag = switch (d.storage_class) { - .static => if (d.thread_local != null) - .static_thread_local_compound_literal_expr + var d: DeclSpec = .{ .qt = .invalid }; + const any = if (p.comp.langopts.standard.atLeast(.c23)) + try p.storageClassSpec(&d) else - .static_compound_literal_expr, - .register, .none => if (d.thread_local != null) - .thread_local_compound_literal_expr - else - .compound_literal_expr, - .auto, .@"extern", .typedef => |tok| blk: { - try p.errStr(.invalid_compound_literal_storage_class, tok, @tagName(d.storage_class)); - d.storage_class = .none; - break :blk if (d.thread_local != null) - .thread_local_compound_literal_expr - else - .compound_literal_expr; - }, - }; + false; - var ty = (try p.typeName()) orelse { - p.tok_i = l_paren; - if (any) { - try p.err(.expected_type); - return error.ParsingFailed; + switch (d.storage_class) { + .auto, .@"extern", .typedef => |tok| { + try p.err(tok, .invalid_compound_literal_storage_class, .{@tagName(d.storage_class)}); + d.storage_class = .none; + }, + .register => if (p.func.qt == null) try p.err(p.tok_i, .illegal_storage_on_global, .{}), + else => {}, } - return Result{}; + + d.qt = (try p.typeName()) orelse { + p.tok_i = l_paren; + if (any) { + try p.err(p.tok_i, .expected_type, .{}); + return error.ParsingFailed; + } + return null; + }; + try p.expectClosing(l_paren, .r_paren); + break :blk .{ l_paren, d }; }; - if (d.storage_class == .register) ty.qual.register = true; - try p.expectClosing(l_paren, .r_paren); + var qt = d.qt; - if (ty.isFunc()) { - try p.err(.func_init); - } else if (ty.is(.variable_len_array)) { - try p.err(.vla_init); - } else if (ty.hasIncompleteSize() and !ty.is(.incomplete_array)) { - try p.errStr(.variable_incomplete_ty, p.tok_i, try p.typeStr(ty)); - return error.ParsingFailed; + switch (qt.base(p.comp).type) { + .func => try p.err(p.tok_i, .func_init, .{}), + .array => |array_ty| if (array_ty.len == .variable) { + try p.err(p.tok_i, .vla_init, .{}); + }, + else => if (qt.hasIncompleteSize(p.comp)) { + try p.err(p.tok_i, .variable_incomplete_ty, .{qt}); + return error.ParsingFailed; + }, } - var init_list_expr = try p.initializer(ty); + + const init_context = p.init_context; + defer p.init_context = init_context; + p.init_context = d.initContext(p); + var init_list_expr = try p.initializer(qt); if (d.constexpr) |_| { // TODO error if not constexpr } - try init_list_expr.un(p, tag, l_paren); + + init_list_expr.node = try p.addNode(.{ .compound_literal_expr = .{ + .l_paren_tok = l_paren, + .storage_class = switch (d.storage_class) { + .register => .register, + .static => .static, + else => .auto, + }, + .thread_local = d.thread_local != null, + .initializer = init_list_expr.node, + .qt = init_list_expr.qt, + } }); return init_list_expr; } @@ -7467,21 +8644,23 @@ fn compoundLiteral(p: *Parser) Error!Result { /// | '++' /// | '--' /// argumentExprList : assignExpr (',' assignExpr)* -fn suffixExpr(p: *Parser, lhs: Result) Error!Result { - assert(!lhs.empty(p)); +fn suffixExpr(p: *Parser, lhs: Result) Error!?Result { switch (p.tok_ids[p.tok_i]) { - .l_paren => return p.callExpr(lhs), + .l_paren => return try p.callExpr(lhs), .plus_plus => { defer p.tok_i += 1; var operand = lhs; - if (!operand.ty.isScalar()) - try p.errStr(.invalid_argument_un, p.tok_i, try p.typeStr(operand.ty)); - if (operand.ty.isComplex()) - try p.errStr(.complex_prefix_postfix_op, p.tok_i, try p.typeStr(operand.ty)); - - if (!p.tmpTree().isLval(operand.node) or operand.ty.isConst()) { - try p.err(.not_assignable); + const scalar_kind = operand.qt.scalarKind(p.comp); + if (scalar_kind == .void_pointer) + try p.err(p.tok_i, .gnu_pointer_arith, .{}); + if (scalar_kind == .none) + try p.err(p.tok_i, .invalid_argument_un, .{operand.qt}); + if (!scalar_kind.isReal()) + try p.err(p.tok_i, .complex_prefix_postfix_op, .{operand.qt}); + + if (!p.tree.isLval(operand.node) or operand.qt.@"const") { + try p.err(p.tok_i, .not_assignable, .{}); return error.ParsingFailed; } try operand.usualUnaryConversion(p, p.tok_i); @@ -7493,13 +8672,16 @@ fn suffixExpr(p: *Parser, lhs: Result) Error!Result { defer p.tok_i += 1; var operand = lhs; - if (!operand.ty.isScalar()) - try p.errStr(.invalid_argument_un, p.tok_i, try p.typeStr(operand.ty)); - if (operand.ty.isComplex()) - try p.errStr(.complex_prefix_postfix_op, p.tok_i, try p.typeStr(operand.ty)); - - if (!p.tmpTree().isLval(operand.node) or operand.ty.isConst()) { - try p.err(.not_assignable); + const scalar_kind = operand.qt.scalarKind(p.comp); + if (scalar_kind == .void_pointer) + try p.err(p.tok_i, .gnu_pointer_arith, .{}); + if (scalar_kind == .none) + try p.err(p.tok_i, .invalid_argument_un, .{operand.qt}); + if (!scalar_kind.isReal()) + try p.err(p.tok_i, .complex_prefix_postfix_op, .{operand.qt}); + + if (!p.tree.isLval(operand.node) or operand.qt.@"const") { + try p.err(p.tok_i, .not_assignable, .{}); return error.ParsingFailed; } try operand.usualUnaryConversion(p, p.tok_i); @@ -7510,56 +8692,68 @@ fn suffixExpr(p: *Parser, lhs: Result) Error!Result { .l_bracket => { const l_bracket = p.tok_i; p.tok_i += 1; - var index = try p.expr(); - try index.expect(p); + var index = try p.expect(expr); try p.expectClosing(l_bracket, .r_bracket); const array_before_conversion = lhs; const index_before_conversion = index; var ptr = lhs; - try ptr.lvalConversion(p); - try index.lvalConversion(p); - if (ptr.ty.isPtr()) { - ptr.ty = ptr.ty.elemType(); - if (index.ty.isInt()) { + try ptr.lvalConversion(p, l_bracket); + try index.lvalConversion(p, l_bracket); + if (ptr.qt.get(p.comp, .pointer)) |pointer_ty| { + ptr.qt = pointer_ty.child; + if (index.qt.isRealInt(p.comp)) { try p.checkArrayBounds(index_before_conversion, array_before_conversion, l_bracket); } else { - try p.errTok(.invalid_index, l_bracket); + try p.err(l_bracket, .invalid_index, .{}); } - } else if (index.ty.isPtr()) { - index.ty = index.ty.elemType(); - if (ptr.ty.isInt()) { + } else if (index.qt.get(p.comp, .pointer)) |pointer_ty| { + index.qt = pointer_ty.child; + if (ptr.qt.isRealInt(p.comp)) { try p.checkArrayBounds(array_before_conversion, index_before_conversion, l_bracket); } else { - try p.errTok(.invalid_index, l_bracket); + try p.err(l_bracket, .invalid_index, .{}); } std.mem.swap(Result, &ptr, &index); - } else { - try p.errTok(.invalid_subscript, l_bracket); + } else if (ptr.qt.get(p.comp, .vector)) |vector_ty| { + ptr = array_before_conversion; + ptr.qt = vector_ty.elem; + if (!index.qt.isRealInt(p.comp)) { + try p.err(l_bracket, .invalid_index, .{}); + } + } else if (!index.qt.isInvalid() and !ptr.qt.isInvalid()) { + try p.err(l_bracket, .invalid_subscript, .{}); } try ptr.saveValue(p); try index.saveValue(p); - try ptr.bin(p, .array_access_expr, index, l_bracket); + ptr.node = try p.addNode(.{ .array_access_expr = .{ + .l_bracket_tok = l_bracket, + .base = ptr.node, + .index = index.node, + .qt = ptr.qt, + } }); return ptr; }, .period => { + const period = p.tok_i; p.tok_i += 1; const name = try p.expectIdentifier(); - return p.fieldAccess(lhs, name, false); + return try p.fieldAccess(lhs, name, false, period); }, .arrow => { + const arrow = p.tok_i; p.tok_i += 1; const name = try p.expectIdentifier(); - if (lhs.ty.isArray()) { + if (lhs.qt.is(p.comp, .array)) { var copy = lhs; - copy.ty.decayArray(); - try copy.implicitCast(p, .array_to_pointer); - return p.fieldAccess(copy, name, true); + copy.qt = try copy.qt.decay(p.comp); + try copy.implicitCast(p, .array_to_pointer, arrow); + return try p.fieldAccess(copy, name, true, arrow); } - return p.fieldAccess(lhs, name, true); + return try p.fieldAccess(lhs, name, true, arrow); }, - else => return Result{}, + else => return null, } } @@ -7568,66 +8762,99 @@ fn fieldAccess( lhs: Result, field_name_tok: TokenIndex, is_arrow: bool, + access_tok: TokenIndex, ) !Result { - const expr_ty = lhs.ty; - const is_ptr = expr_ty.isPtr(); - const expr_base_ty = if (is_ptr) expr_ty.elemType() else expr_ty; - const record_ty = expr_base_ty.getRecord() orelse { - try p.errStr(.expected_record_ty, field_name_tok, try p.typeStr(expr_ty)); + if (lhs.qt.isInvalid()) { + const access: Node.MemberAccess = .{ + .access_tok = access_tok, + .qt = .invalid, + .base = lhs.node, + .member_index = std.math.maxInt(u32), + }; + return .{ + .qt = .invalid, + .node = try p.addNode(if (is_arrow) + .{ .member_access_ptr_expr = access } + else + .{ .member_access_expr = access }), + }; + } + + const expr_qt = if (lhs.qt.get(p.comp, .atomic)) |atomic| atomic else lhs.qt; + const is_ptr = expr_qt.isPointer(p.comp); + const expr_base_qt = if (is_ptr) expr_qt.childType(p.comp) else expr_qt; + const record_qt = if (expr_base_qt.get(p.comp, .atomic)) |atomic| atomic else expr_base_qt; + const record_ty = record_qt.getRecord(p.comp) orelse { + try p.err(field_name_tok, .expected_record_ty, .{expr_qt}); return error.ParsingFailed; }; - if (record_ty.isIncomplete()) { - try p.errStr(.deref_incomplete_ty_ptr, field_name_tok - 2, try p.typeStr(expr_base_ty)); + if (record_ty.layout == null) { + // Invalid use of incomplete type, error reported elsewhere. + if (!is_ptr) return error.ParsingFailed; + + try p.err(field_name_tok - 2, .deref_incomplete_ty_ptr, .{expr_base_qt}); return error.ParsingFailed; } - if (is_arrow and !is_ptr) try p.errStr(.member_expr_not_ptr, field_name_tok, try p.typeStr(expr_ty)); - if (!is_arrow and is_ptr) try p.errStr(.member_expr_ptr, field_name_tok, try p.typeStr(expr_ty)); + if (expr_qt != lhs.qt) try p.err(field_name_tok, .member_expr_atomic, .{lhs.qt}); + if (expr_base_qt != record_qt) try p.err(field_name_tok, .member_expr_atomic, .{expr_base_qt}); + + if (is_arrow and !is_ptr) try p.err(field_name_tok, .member_expr_not_ptr, .{expr_qt}); + if (!is_arrow and is_ptr) try p.err(field_name_tok, .member_expr_ptr, .{expr_qt}); - const field_name = try StrInt.intern(p.comp, p.tokSlice(field_name_tok)); - try p.validateFieldAccess(record_ty, expr_ty, field_name_tok, field_name); + const field_name = try p.comp.internString(p.tokSlice(field_name_tok)); + try p.validateFieldAccess(record_ty, record_qt, field_name_tok, field_name); var discard: u64 = 0; - return p.fieldAccessExtra(lhs.node, record_ty, field_name, is_arrow, &discard); + return p.fieldAccessExtra(lhs.node, record_ty, field_name, is_arrow, access_tok, &discard); } -fn validateFieldAccess(p: *Parser, record_ty: *const Type.Record, expr_ty: Type, field_name_tok: TokenIndex, field_name: StringId) Error!void { - if (record_ty.hasField(field_name)) return; - - p.strings.items.len = 0; - - try p.strings.writer().print("'{s}' in '", .{p.tokSlice(field_name_tok)}); - const mapper = p.comp.string_interner.getSlowTypeMapper(); - try expr_ty.print(mapper, p.comp.langopts, p.strings.writer()); - try p.strings.append('\''); - - const duped = try p.comp.diagnostics.arena.allocator().dupe(u8, p.strings.items); - try p.errStr(.no_such_member, field_name_tok, duped); +fn validateFieldAccess(p: *Parser, record_ty: Type.Record, record_qt: QualType, field_name_tok: TokenIndex, field_name: StringId) Error!void { + if (record_ty.hasField(p.comp, field_name)) return; + try p.err(field_name_tok, .no_such_member, .{ p.tokSlice(field_name_tok), record_qt }); return error.ParsingFailed; } -fn fieldAccessExtra(p: *Parser, lhs: NodeIndex, record_ty: *const Type.Record, field_name: StringId, is_arrow: bool, offset_bits: *u64) Error!Result { - for (record_ty.fields, 0..) |f, i| { - if (f.isAnonymousRecord()) { - if (!f.ty.hasField(field_name)) continue; - const inner = try p.addNode(.{ - .tag = if (is_arrow) .member_access_ptr_expr else .member_access_expr, - .ty = f.ty, - .data = .{ .member = .{ .lhs = lhs, .index = @intCast(i) } }, - }); - const ret = p.fieldAccessExtra(inner, f.ty.getRecord().?, field_name, false, offset_bits); - offset_bits.* = f.layout.offset_bits; +fn fieldAccessExtra( + p: *Parser, + base: Node.Index, + record_ty: Type.Record, + target_name: StringId, + is_arrow: bool, + access_tok: TokenIndex, + offset_bits: *u64, +) Error!Result { + for (record_ty.fields, 0..) |field, field_index| { + if (field.name_tok == 0) if (field.qt.getRecord(p.comp)) |field_record_ty| { + if (!field_record_ty.hasField(p.comp, target_name)) continue; + + const access: Node.MemberAccess = .{ + .access_tok = access_tok, + .qt = field.qt, + .base = base, + .member_index = @intCast(field_index), + }; + const inner = try p.addNode(if (is_arrow) + .{ .member_access_ptr_expr = access } + else + .{ .member_access_expr = access }); + + const ret = p.fieldAccessExtra(inner, field_record_ty, target_name, false, access_tok, offset_bits); + offset_bits.* = field.layout.offset_bits; return ret; - } - if (field_name == f.name) { - offset_bits.* = f.layout.offset_bits; - return Result{ - .ty = f.ty, - .node = try p.addNode(.{ - .tag = if (is_arrow) .member_access_ptr_expr else .member_access_expr, - .ty = f.ty, - .data = .{ .member = .{ .lhs = lhs, .index = @intCast(i) } }, - }), + }; + if (target_name == field.name) { + offset_bits.* = field.layout.offset_bits; + + const access: Node.MemberAccess = .{ + .access_tok = access_tok, + .qt = field.qt, + .base = base, + .member_index = @intCast(field_index), }; + return .{ .qt = field.qt, .node = try p.addNode(if (is_arrow) + .{ .member_access_ptr_expr = access } + else + .{ .member_access_expr = access }) }; } } // We already checked that this container has a field by the name. @@ -7637,22 +8864,22 @@ fn fieldAccessExtra(p: *Parser, lhs: NodeIndex, record_ty: *const Type.Record, f fn checkVaStartArg(p: *Parser, builtin_tok: TokenIndex, first_after: TokenIndex, param_tok: TokenIndex, arg: *Result, idx: u32) !void { assert(idx != 0); if (idx > 1) { - try p.errTok(.closing_paren, first_after); + try p.err(first_after, .closing_paren, .{}); return error.ParsingFailed; } - var func_ty = p.func.ty orelse { - try p.errTok(.va_start_not_in_func, builtin_tok); + const func_qt = p.func.qt orelse { + try p.err(builtin_tok, .va_start_not_in_func, .{}); return; }; - const func_params = func_ty.params(); - if (func_ty.specifier != .var_args_func or func_params.len == 0) { - return p.errTok(.va_start_fixed_args, builtin_tok); + const func_ty = func_qt.get(p.comp, .func) orelse return; + if (func_ty.kind != .variadic or func_ty.params.len == 0) { + return p.err(builtin_tok, .va_start_fixed_args, .{}); } - const last_param_name = func_params[func_params.len - 1].name; + const last_param_name = func_ty.params[func_ty.params.len - 1].name; const decl_ref = p.getNode(arg.node, .decl_ref_expr); - if (decl_ref == null or last_param_name != try StrInt.intern(p.comp, p.tokSlice(p.nodes.items(.data)[@intFromEnum(decl_ref.?)].decl_ref))) { - try p.errTok(.va_start_not_last_param, param_tok); + if (decl_ref == null or last_param_name != try p.comp.internString(p.tokSlice(decl_ref.?.name_tok))) { + try p.err(param_tok, .va_start_not_last_param, .{}); } } @@ -7660,44 +8887,55 @@ fn checkArithOverflowArg(p: *Parser, builtin_tok: TokenIndex, first_after: Token _ = builtin_tok; _ = first_after; if (idx <= 1) { - if (!arg.ty.isInt()) { - return p.errStr(.overflow_builtin_requires_int, param_tok, try p.typeStr(arg.ty)); + if (!arg.qt.isRealInt(p.comp)) { + return p.err(param_tok, .overflow_builtin_requires_int, .{arg.qt}); } } else if (idx == 2) { - if (!arg.ty.isPtr()) return p.errStr(.overflow_result_requires_ptr, param_tok, try p.typeStr(arg.ty)); - const child = arg.ty.elemType(); - if (!child.isInt() or child.is(.bool) or child.is(.@"enum") or child.qual.@"const") return p.errStr(.overflow_result_requires_ptr, param_tok, try p.typeStr(arg.ty)); + if (!arg.qt.isPointer(p.comp)) return p.err(param_tok, .overflow_result_requires_ptr, .{arg.qt}); + const child = arg.qt.childType(p.comp); + if (child.scalarKind(p.comp) != .int or child.@"const") return p.err(param_tok, .overflow_result_requires_ptr, .{arg.qt}); } } fn checkComplexArg(p: *Parser, builtin_tok: TokenIndex, first_after: TokenIndex, param_tok: TokenIndex, arg: *Result, idx: u32) !void { _ = builtin_tok; _ = first_after; - if (idx <= 1 and !arg.ty.isFloat()) { - try p.errStr(.not_floating_type, param_tok, try p.typeStr(arg.ty)); + if (idx <= 1 and !arg.qt.isFloat(p.comp)) { + try p.err(param_tok, .not_floating_type, .{arg.qt}); } else if (idx == 1) { const prev_idx = p.list_buf.items[p.list_buf.items.len - 1]; - const prev_ty = p.nodes.items(.ty)[@intFromEnum(prev_idx)]; - if (!prev_ty.eql(arg.ty, p.comp, false)) { - try p.errStr(.argument_types_differ, param_tok, try p.typePairStrExtra(prev_ty, " vs ", arg.ty)); + const prev_qt = prev_idx.qt(&p.tree); + if (!prev_qt.eql(arg.qt, p.comp)) { + try p.err(param_tok, .argument_types_differ, .{ prev_qt, arg.qt }); } } } fn callExpr(p: *Parser, lhs: Result) Error!Result { + const gpa = p.comp.gpa; const l_paren = p.tok_i; p.tok_i += 1; - const ty = lhs.ty.isCallable() orelse { - try p.errStr(.not_callable, l_paren, try p.typeStr(lhs.ty)); - return error.ParsingFailed; + + // We cannot refer to the function type here because the pointer to + // type_store.extra might get invalidated while parsing args. + const func_qt, const params_len, const func_kind = blk: { + var base_qt = lhs.qt; + if (base_qt.get(p.comp, .pointer)) |pointer_ty| base_qt = pointer_ty.child; + if (base_qt.isInvalid()) break :blk .{ base_qt, std.math.maxInt(usize), undefined }; + + const func_type_qt = base_qt.base(p.comp); + if (func_type_qt.type != .func) { + try p.err(l_paren, .not_callable, .{lhs.qt}); + return error.ParsingFailed; + } + break :blk .{ func_type_qt.qt, func_type_qt.type.func.params.len, func_type_qt.type.func.kind }; }; - const params = ty.params(); + var func = lhs; - try func.lvalConversion(p); + try func.lvalConversion(p, l_paren); const list_buf_top = p.list_buf.items.len; defer p.list_buf.items.len = list_buf_top; - try p.list_buf.append(func.node); var arg_count: u32 = 0; var first_after = l_paren; @@ -7705,23 +8943,24 @@ fn callExpr(p: *Parser, lhs: Result) Error!Result { while (p.eatToken(.r_paren) == null) { const param_tok = p.tok_i; - if (arg_count == params.len) first_after = p.tok_i; - var arg = try p.assignExpr(); - try arg.expect(p); + if (arg_count == params_len) first_after = p.tok_i; + var arg = try p.expect(assignExpr); if (call_expr.shouldPerformLvalConversion(arg_count)) { - try arg.lvalConversion(p); + try arg.lvalConversion(p, param_tok); } - if (arg.ty.hasIncompleteSize() and !arg.ty.is(.void)) return error.ParsingFailed; + if ((arg.qt.hasIncompleteSize(p.comp) and !arg.qt.is(p.comp, .void)) or arg.qt.isInvalid()) return error.ParsingFailed; + + if (arg_count >= params_len) { + if (call_expr.shouldPromoteVarArg(arg_count)) switch (arg.qt.base(p.comp).type) { + .int => |int_ty| if (int_ty == .int) try arg.castToInt(p, arg.qt.promoteInt(p.comp), param_tok), + .float => |float_ty| if (float_ty == .double) try arg.castToFloat(p, .double, param_tok), + else => {}, + }; - if (arg_count >= params.len) { - if (call_expr.shouldPromoteVarArg(arg_count)) { - if (arg.ty.isInt()) try arg.intCast(p, arg.ty.integerPromotion(p.comp), param_tok); - if (arg.ty.is(.float)) try arg.floatCast(p, .{ .specifier = .double }); - } try call_expr.checkVarArg(p, first_after, param_tok, &arg, arg_count); try arg.saveValue(p); - try p.list_buf.append(arg.node); + try p.list_buf.append(gpa, arg.node); arg_count += 1; _ = p.eatToken(.comma) orelse { @@ -7730,29 +8969,33 @@ fn callExpr(p: *Parser, lhs: Result) Error!Result { }; continue; } - const p_ty = params[arg_count].ty; - if (p_ty.specifier == .static_array) { - const arg_array_len: u64 = arg.ty.arrayLen() orelse std.math.maxInt(u64); - const param_array_len: u64 = p_ty.arrayLen().?; - if (arg_array_len < param_array_len) { - const extra = Diagnostics.Message.Extra{ .arguments = .{ - .expected = @intCast(arg_array_len), - .actual = @intCast(param_array_len), - } }; - try p.errExtra(.array_argument_too_small, param_tok, extra); - try p.errTok(.callee_with_static_array, params[arg_count].name_tok); - } - if (arg.val.isZero(p.comp)) { - try p.errTok(.non_null_argument, param_tok); - try p.errTok(.callee_with_static_array, params[arg_count].name_tok); + + if (func_qt.get(p.comp, .func)) |func_ty| { + const param = func_ty.params[arg_count]; + + if (param.qt.get(p.comp, .pointer)) |pointer_ty| static_check: { + const decayed_child_qt = pointer_ty.decayed orelse break :static_check; + const param_array_ty = decayed_child_qt.get(p.comp, .array).?; + if (param_array_ty.len != .static) break :static_check; + const param_array_len = param_array_ty.len.static; + const arg_array_len = arg.qt.arrayLen(p.comp); + + if (arg_array_len != null and arg_array_len.? < param_array_len) { + try p.err(param_tok, .array_argument_too_small, .{ arg_array_len.?, param_array_len }); + try p.err(param.name_tok, .callee_with_static_array, .{}); + } + if (arg.val.isZero(p.comp)) { + try p.err(param_tok, .non_null_argument, .{}); + try p.err(param.name_tok, .callee_with_static_array, .{}); + } } - } - if (call_expr.shouldCoerceArg(arg_count)) { - try arg.coerce(p, p_ty, param_tok, .{ .arg = params[arg_count].name_tok }); + if (call_expr.shouldCoerceArg(arg_count)) { + try arg.coerce(p, param.qt, param_tok, .{ .arg = param.name_tok }); + } } try arg.saveValue(p); - try p.list_buf.append(arg.node); + try p.list_buf.append(gpa, arg.node); arg_count += 1; _ = p.eatToken(.comma) orelse { @@ -7760,48 +9003,49 @@ fn callExpr(p: *Parser, lhs: Result) Error!Result { break; }; } + if (func_qt.isInvalid()) { + // Skip argument count checks. + return try call_expr.finish(p, func_qt, list_buf_top, l_paren); + } - const actual: u32 = @intCast(arg_count); - const extra = Diagnostics.Message.Extra{ .arguments = .{ - .expected = @intCast(params.len), - .actual = actual, - } }; if (call_expr.paramCountOverride()) |expected| { - if (expected != actual) { - try p.errExtra(.expected_arguments, first_after, .{ .arguments = .{ .expected = expected, .actual = actual } }); - } - } else if (ty.is(.func) and params.len != arg_count) { - try p.errExtra(.expected_arguments, first_after, extra); - } else if (ty.is(.old_style_func) and params.len != arg_count) { - if (params.len == 0) - try p.errTok(.passing_args_to_kr, first_after) - else - try p.errExtra(.expected_arguments_old, first_after, extra); - } else if (ty.is(.var_args_func) and arg_count < params.len) { - try p.errExtra(.expected_at_least_arguments, first_after, extra); + if (expected != arg_count) { + try p.err(first_after, .expected_arguments, .{ expected, arg_count }); + } + } else switch (func_kind) { + .normal => if (params_len != arg_count) { + try p.err(first_after, .expected_arguments, .{ params_len, arg_count }); + }, + .variadic => if (arg_count < params_len) { + try p.err(first_after, .expected_at_least_arguments, .{ params_len, arg_count }); + }, + .old_style => if (params_len != arg_count) { + if (params_len == 0) + try p.err(first_after, .passing_args_to_kr, .{}) + else + try p.err(first_after, .expected_arguments_old, .{ params_len, arg_count }); + }, } - return call_expr.finish(p, ty, list_buf_top, arg_count); + return try call_expr.finish(p, func_qt, list_buf_top, l_paren); } fn checkArrayBounds(p: *Parser, index: Result, array: Result, tok: TokenIndex) !void { if (index.val.opt_ref == .none) return; - const array_len = array.ty.arrayLen() orelse return; + const array_len = array.qt.arrayLen(p.comp) orelse return; if (array_len == 0) return; if (array_len == 1) { - if (p.getNode(array.node, .member_access_expr) orelse p.getNode(array.node, .member_access_ptr_expr)) |node| { - const data = p.nodes.items(.data)[@intFromEnum(node)]; - var lhs = p.nodes.items(.ty)[@intFromEnum(data.member.lhs)]; - if (lhs.get(.pointer)) |ptr| { - lhs = ptr.data.sub_type.*; - } - if (lhs.is(.@"struct")) { - const record = lhs.getRecord().?; - if (data.member.index + 1 == record.fields.len) { + if (p.getNode(array.node, .member_access_expr) orelse p.getNode(array.node, .member_access_ptr_expr)) |access| { + var base_ty = access.base.qt(&p.tree); + if (base_ty.get(p.comp, .pointer)) |pointer_ty| { + base_ty = pointer_ty.child; + } + if (base_ty.getRecord(p.comp)) |record_ty| { + if (access.member_index + 1 == record_ty.fields.len) { if (!index.val.isZero(p.comp)) { - try p.errStr(.old_style_flexible_struct, tok, try index.str(p)); + try p.err(tok, .old_style_flexible_struct, .{index}); } return; } @@ -7809,15 +9053,15 @@ fn checkArrayBounds(p: *Parser, index: Result, array: Result, tok: TokenIndex) ! } } const index_int = index.val.toInt(u64, p.comp) orelse std.math.maxInt(u64); - if (index.ty.isUnsignedInt(p.comp)) { + if (index.qt.signedness(p.comp) == .unsigned) { if (index_int >= array_len) { - try p.errStr(.array_after, tok, try index.str(p)); + try p.err(tok, .array_after, .{index}); } } else { - if (index.val.compare(.lt, Value.zero, p.comp)) { - try p.errStr(.array_before, tok, try index.str(p)); + if (index.val.compare(.lt, .zero, p.comp)) { + try p.err(tok, .array_before, .{index}); } else if (index_int >= array_len) { - try p.errStr(.array_after, tok, try index.str(p)); + try p.err(tok, .array_after, .{index}); } } } @@ -7834,211 +9078,266 @@ fn checkArrayBounds(p: *Parser, index: Result, array: Result, tok: TokenIndex) ! /// | STRING_LITERAL /// | '(' expr ')' /// | genericSelection -fn primaryExpr(p: *Parser) Error!Result { +/// | shufflevector +/// | convertvector +/// | typesCompatible +/// | chooseExpr +/// | vaStart +/// | offsetof +fn primaryExpr(p: *Parser) Error!?Result { if (p.eatToken(.l_paren)) |l_paren| { - var e = try p.expr(); - try e.expect(p); + var grouped_expr = try p.expect(expr); try p.expectClosing(l_paren, .r_paren); - try e.un(p, .paren_expr, l_paren); - return e; + try grouped_expr.un(p, .paren_expr, l_paren); + return grouped_expr; } + + const gpa = p.comp.gpa; switch (p.tok_ids[p.tok_i]) { .identifier, .extended_identifier => { const name_tok = try p.expectIdentifier(); const name = p.tokSlice(name_tok); - const interned_name = try StrInt.intern(p.comp, name); + const interned_name = try p.comp.internString(name); if (interned_name == p.auto_type_decl_name) { - try p.errStr(.auto_type_self_initialized, name_tok, name); + try p.err(name_tok, .auto_type_self_initialized, .{name}); return error.ParsingFailed; } + if (p.syms.findSymbol(interned_name)) |sym| { - try p.checkDeprecatedUnavailable(sym.ty, name_tok, sym.tok); + if (sym.kind == .typedef) { + try p.err(name_tok, .unexpected_type_name, .{name}); + return error.ParsingFailed; + } + if (sym.out_of_scope) { + try p.err(name_tok, .out_of_scope_use, .{name}); + try p.err(sym.tok, .previous_definition, .{}); + } + try p.checkDeprecatedUnavailable(sym.qt, name_tok, sym.tok); if (sym.kind == .constexpr) { - return Result{ + return .{ .val = sym.val, - .ty = sym.ty, + .qt = sym.qt, .node = try p.addNode(.{ - .tag = .decl_ref_expr, - .ty = sym.ty, - .data = .{ .decl_ref = name_tok }, - .loc = @enumFromInt(name_tok), + .decl_ref_expr = .{ + .name_tok = name_tok, + .qt = sym.qt, + .decl = sym.node.unpack().?, + }, }), }; } if (sym.val.is(.int, p.comp)) { switch (p.const_decl_folding) { - .gnu_folding_extension => try p.errTok(.const_decl_folded, name_tok), - .gnu_vla_folding_extension => try p.errTok(.const_decl_folded_vla, name_tok), + .gnu_folding_extension => try p.err(name_tok, .const_decl_folded, .{}), + .gnu_vla_folding_extension => try p.err(name_tok, .const_decl_folded_vla, .{}), else => {}, } } - return Result{ + + const node = try p.addNode(if (sym.kind == .enumeration) + .{ .enumeration_ref = .{ + .name_tok = name_tok, + .qt = sym.qt, + .decl = sym.node.unpack().?, + } } + else + .{ .decl_ref_expr = .{ + .name_tok = name_tok, + .qt = sym.qt, + .decl = sym.node.unpack().?, + } }); + + const res: Result = .{ .val = if (p.const_decl_folding == .no_const_decl_folding and sym.kind != .enumeration) Value{} else sym.val, - .ty = sym.ty, - .node = try p.addNode(.{ - .tag = if (sym.kind == .enumeration) .enumeration_ref else .decl_ref_expr, - .ty = sym.ty, - .data = .{ .decl_ref = name_tok }, - .loc = @enumFromInt(name_tok), - }), + .qt = sym.qt, + .node = node, }; + try res.putValue(p); + return res; } - if (try p.comp.builtins.getOrCreate(p.comp, name, p.arena)) |some| { + + // Check if this is a builtin call. + if (try p.comp.builtins.getOrCreate(p.comp, name)) |some| { for (p.tok_ids[p.tok_i..]) |id| switch (id) { .r_paren => {}, // closing grouped expr .l_paren => break, // beginning of a call else => { - try p.errTok(.builtin_must_be_called, name_tok); + try p.err(name_tok, .builtin_must_be_called, .{}); return error.ParsingFailed; }, }; if (some.builtin.properties.header != .none) { - try p.errStr(.implicit_builtin, name_tok, name); - try p.errExtra(.implicit_builtin_header_note, name_tok, .{ .builtin_with_header = .{ - .builtin = some.builtin.tag, - .header = some.builtin.properties.header, - } }); + try p.err(name_tok, .implicit_builtin, .{name}); + try p.err(name_tok, .implicit_builtin_header_note, .{ + @tagName(some.builtin.properties.header), Builtin.nameFromTag(some.builtin.tag).span(), + }); + } + + switch (some.builtin.tag) { + .__builtin_choose_expr => return try p.builtinChooseExpr(), + .__builtin_va_arg => return try p.builtinVaArg(name_tok), + .__builtin_offsetof => return try p.builtinOffsetof(name_tok, .bytes), + .__builtin_bitoffsetof => return try p.builtinOffsetof(name_tok, .bits), + .__builtin_types_compatible_p => return try p.typesCompatible(name_tok), + .__builtin_convertvector => return try p.convertvector(name_tok), + .__builtin_shufflevector => return try p.shufflevector(name_tok), + else => {}, } - return Result{ - .ty = some.ty, + return .{ + .qt = some.qt, .node = try p.addNode(.{ - .tag = .builtin_call_expr_one, - .ty = some.ty, - .data = .{ .decl = .{ .name = name_tok, .node = .none } }, - .loc = @enumFromInt(name_tok), + .builtin_ref = .{ + .name_tok = name_tok, + .qt = some.qt, + }, }), }; } + + // Check for unknown builtin or implicit function declaration. if (p.tok_ids[p.tok_i] == .l_paren and !p.comp.langopts.standard.atLeast(.c23)) { // allow implicitly declaring functions before C99 like `puts("foo")` if (mem.startsWith(u8, name, "__builtin_")) - try p.errStr(.unknown_builtin, name_tok, name) + try p.err(name_tok, .unknown_builtin, .{name}) else - try p.errStr(.implicit_func_decl, name_tok, name); + try p.err(name_tok, .implicit_func_decl, .{name}); - const func_ty = try p.arena.create(Type.Func); - func_ty.* = .{ .return_type = .{ .specifier = .int }, .params = &.{} }; - const ty: Type = .{ .specifier = .old_style_func, .data = .{ .func = func_ty } }; + const func_qt = try p.comp.type_store.put(gpa, .{ .func = .{ + .return_type = .int, + .kind = .old_style, + .params = &.{}, + } }); const node = try p.addNode(.{ - .ty = ty, - .tag = .fn_proto, - .data = .{ .decl = .{ .name = name_tok } }, - .loc = @enumFromInt(name_tok), + .function = .{ + .name_tok = name_tok, + .qt = func_qt, + .static = false, + .@"inline" = false, + .definition = null, + .body = null, + }, }); - try p.decl_buf.append(node); - try p.syms.declareSymbol(p, interned_name, ty, name_tok, node); + try p.decl_buf.append(gpa, node); + try p.syms.declareSymbol(p, interned_name, func_qt, name_tok, node); - return Result{ - .ty = ty, + return .{ + .qt = func_qt, .node = try p.addNode(.{ - .tag = .decl_ref_expr, - .ty = ty, - .data = .{ .decl_ref = name_tok }, - .loc = @enumFromInt(name_tok), + .decl_ref_expr = .{ + .name_tok = name_tok, + .qt = func_qt, + .decl = node, + }, }), }; } - try p.errStr(.undeclared_identifier, name_tok, p.tokSlice(name_tok)); + + try p.err(name_tok, .undeclared_identifier, .{p.tokSlice(name_tok)}); return error.ParsingFailed; }, .keyword_true, .keyword_false => |id| { const tok_i = p.tok_i; p.tok_i += 1; - const res = Result{ - .val = Value.fromBool(id == .keyword_true), - .ty = .{ .specifier = .bool }, - .node = try p.addNode(.{ .tag = .bool_literal, .ty = .{ .specifier = .bool }, .data = undefined, .loc = @enumFromInt(tok_i) }), + const res: Result = .{ + .val = .fromBool(id == .keyword_true), + .qt = .bool, + .node = try p.addNode(.{ + .bool_literal = .{ + .qt = .bool, + .literal_tok = tok_i, + }, + }), }; std.debug.assert(!p.in_macro); // Should have been replaced with .one / .zero - try p.value_map.put(res.node, res.val); + try res.putValue(p); return res; }, .keyword_nullptr => { defer p.tok_i += 1; - try p.errStr(.pre_c23_compat, p.tok_i, "'nullptr'"); - return Result{ - .val = Value.null, - .ty = .{ .specifier = .nullptr_t }, + try p.err(p.tok_i, .pre_c23_compat, .{"'nullptr'"}); + return .{ + .val = .null, + .qt = .nullptr_t, .node = try p.addNode(.{ - .tag = .nullptr_literal, - .ty = .{ .specifier = .nullptr_t }, - .data = undefined, - .loc = @enumFromInt(p.tok_i), + .nullptr_literal = .{ + .qt = .nullptr_t, + .literal_tok = p.tok_i, + }, }), }; }, .macro_func, .macro_function => { defer p.tok_i += 1; - var ty: Type = undefined; + var ty: QualType = undefined; var tok = p.tok_i; + if (p.func.ident) |some| { - ty = some.ty; - tok = p.nodes.items(.data)[@intFromEnum(some.node)].decl.name; - } else if (p.func.ty) |_| { + ty = some.qt; + tok = some.node.get(&p.tree).variable.name_tok; + } else if (p.func.qt) |_| { const strings_top = p.strings.items.len; defer p.strings.items.len = strings_top; - try p.strings.appendSlice(p.tokSlice(p.func.name)); - try p.strings.append(0); - const predef = try p.makePredefinedIdentifier(strings_top); - ty = predef.ty; + const name = p.tokSlice(p.func.name); + try p.strings.ensureUnusedCapacity(gpa, name.len + 1); + + p.strings.appendSliceAssumeCapacity(name); + p.strings.appendAssumeCapacity(0); + const predef = try p.makePredefinedIdentifier(p.strings.items[strings_top..]); + ty = predef.qt; p.func.ident = predef; } else { - const strings_top = p.strings.items.len; - defer p.strings.items.len = strings_top; - - try p.strings.append(0); - const predef = try p.makePredefinedIdentifier(strings_top); - ty = predef.ty; + const predef = try p.makePredefinedIdentifier("\x00"); + ty = predef.qt; p.func.ident = predef; - try p.decl_buf.append(predef.node); + try p.decl_buf.append(gpa, predef.node); } - if (p.func.ty == null) try p.err(.predefined_top_level); - return Result{ - .ty = ty, + if (p.func.qt == null) try p.err(p.tok_i, .predefined_top_level, .{}); + + return .{ + .qt = ty, .node = try p.addNode(.{ - .tag = .decl_ref_expr, - .ty = ty, - .data = .{ .decl_ref = tok }, - .loc = @enumFromInt(tok), + .decl_ref_expr = .{ + .name_tok = tok, + .qt = ty, + .decl = p.func.ident.?.node, + }, }), }; }, .macro_pretty_func => { defer p.tok_i += 1; - var ty: Type = undefined; + var qt: QualType = undefined; if (p.func.pretty_ident) |some| { - ty = some.ty; - } else if (p.func.ty) |func_ty| { - const strings_top = p.strings.items.len; - defer p.strings.items.len = strings_top; + qt = some.qt; + } else if (p.func.qt) |func_qt| { + var sf = std.heap.stackFallback(1024, gpa); + var allocating: std.Io.Writer.Allocating = .init(sf.get()); + defer allocating.deinit(); - const mapper = p.comp.string_interner.getSlowTypeMapper(); - try Type.printNamed(func_ty, p.tokSlice(p.func.name), mapper, p.comp.langopts, p.strings.writer()); - try p.strings.append(0); - const predef = try p.makePredefinedIdentifier(strings_top); - ty = predef.ty; + func_qt.printNamed(p.tokSlice(p.func.name), p.comp, &allocating.writer) catch return error.OutOfMemory; + allocating.writer.writeByte(0) catch return error.OutOfMemory; + + const predef = try p.makePredefinedIdentifier(allocating.written()); + qt = predef.qt; p.func.pretty_ident = predef; } else { - const strings_top = p.strings.items.len; - defer p.strings.items.len = strings_top; - - try p.strings.appendSlice("top level\x00"); - const predef = try p.makePredefinedIdentifier(strings_top); - ty = predef.ty; + const predef = try p.makePredefinedIdentifier("top level\x00"); + qt = predef.qt; p.func.pretty_ident = predef; - try p.decl_buf.append(predef.node); + try p.decl_buf.append(gpa, predef.node); } - if (p.func.ty == null) try p.err(.predefined_top_level); - return Result{ - .ty = ty, + if (p.func.qt == null) try p.err(p.tok_i, .predefined_top_level, .{}); + return .{ + .qt = qt, .node = try p.addNode(.{ - .tag = .decl_ref_expr, - .ty = ty, - .data = .{ .decl_ref = p.tok_i }, - .loc = @enumFromInt(p.tok_i), + .decl_ref_expr = .{ + .name_tok = p.tok_i, + .qt = qt, + .decl = p.func.pretty_ident.?.node, + }, }), }; }, @@ -8048,7 +9347,7 @@ fn primaryExpr(p: *Parser) Error!Result { .string_literal_utf_32, .string_literal_wide, .unterminated_string_literal, - => return p.stringLiteral(), + => return try p.stringLiteral(), .char_literal, .char_literal_utf_8, .char_literal_utf_16, @@ -8056,22 +9355,30 @@ fn primaryExpr(p: *Parser) Error!Result { .char_literal_wide, .empty_char_literal, .unterminated_char_literal, - => return p.charLiteral(), + => return try p.charLiteral(), .zero => { defer p.tok_i += 1; - var res: Result = .{ .val = Value.zero, .ty = if (p.in_macro) p.comp.types.intmax else Type.int }; - res.node = try p.addNode(.{ .tag = .int_literal, .ty = res.ty, .data = undefined, .loc = @enumFromInt(p.tok_i) }); - if (!p.in_macro) try p.value_map.put(res.node, res.val); + const int_qt: QualType = if (p.in_macro) p.comp.type_store.intmax else .int; + const res: Result = .{ + .val = .zero, + .qt = int_qt, + .node = try p.addNode(.{ .int_literal = .{ .qt = int_qt, .literal_tok = p.tok_i } }), + }; + try res.putValue(p); return res; }, .one => { defer p.tok_i += 1; - var res: Result = .{ .val = Value.one, .ty = if (p.in_macro) p.comp.types.intmax else Type.int }; - res.node = try p.addNode(.{ .tag = .int_literal, .ty = res.ty, .data = undefined, .loc = @enumFromInt(p.tok_i) }); - if (!p.in_macro) try p.value_map.put(res.node, res.val); + const int_qt: QualType = if (p.in_macro) p.comp.type_store.intmax else .int; + const res: Result = .{ + .val = .one, + .qt = int_qt, + .node = try p.addNode(.{ .int_literal = .{ .qt = int_qt, .literal_tok = p.tok_i } }), + }; + try res.putValue(p); return res; }, - .pp_num => return p.ppNum(), + .pp_num => return try p.ppNum(), .embed_byte => { assert(!p.in_macro); const loc = p.pp.tokens.items(.loc)[p.tok_i]; @@ -8083,49 +9390,57 @@ fn primaryExpr(p: *Parser) Error!Result { byte *= 10; byte += c - '0'; } - var res: Result = .{ .val = try Value.int(byte, p.comp) }; - res.node = try p.addNode(.{ .tag = .int_literal, .ty = res.ty, .data = undefined, .loc = @enumFromInt(p.tok_i) }); - try p.value_map.put(res.node, res.val); + const res: Result = .{ + .val = try Value.int(byte, p.comp), + .qt = .int, + .node = try p.addNode(.{ .int_literal = .{ .qt = .int, .literal_tok = p.tok_i } }), + }; + try res.putValue(p); return res; }, .keyword_generic => return p.genericSelection(), - else => return Result{}, + else => return null, } } -fn makePredefinedIdentifier(p: *Parser, strings_top: usize) !Result { - const end: u32 = @intCast(p.strings.items.len); - const elem_ty: Type = .{ .specifier = .char, .qual = .{ .@"const" = true } }; - const arr_ty = try p.arena.create(Type.Array); - arr_ty.* = .{ .elem = elem_ty, .len = end - strings_top }; - const ty: Type = .{ .specifier = .array, .data = .{ .array = arr_ty } }; +fn makePredefinedIdentifier(p: *Parser, slice: []const u8) !Result { + const gpa = p.comp.gpa; + const array_qt = try p.comp.type_store.put(gpa, .{ .array = .{ + .elem = .{ .@"const" = true, ._index = .int_char }, + .len = .{ .fixed = slice.len }, + } }); - const slice = p.strings.items[strings_top..]; const val = try Value.intern(p.comp, .{ .bytes = slice }); - const str_lit = try p.addNode(.{ .tag = .string_literal_expr, .ty = ty, .data = undefined, .loc = @enumFromInt(p.tok_i) }); - if (!p.in_macro) try p.value_map.put(str_lit, val); - - return Result{ .ty = ty, .node = try p.addNode(.{ - .tag = .implicit_static_var, - .ty = ty, - .data = .{ .decl = .{ .name = p.tok_i, .node = str_lit } }, - .loc = @enumFromInt(p.tok_i), + const str_lit = try p.addNode(.{ .string_literal_expr = .{ .qt = array_qt, .literal_tok = p.tok_i, .kind = .ascii } }); + if (!p.in_macro) try p.tree.value_map.put(gpa, str_lit, val); + + return .{ .qt = array_qt, .node = try p.addNode(.{ + .variable = .{ + .name_tok = p.tok_i, + .qt = array_qt, + .storage_class = .static, + .thread_local = false, + .implicit = true, + .initializer = str_lit, + .definition = null, + }, }) }; } fn stringLiteral(p: *Parser) Error!Result { + const gpa = p.comp.gpa; const string_start = p.tok_i; var string_end = p.tok_i; var string_kind: text_literal.Kind = .char; while (text_literal.Kind.classify(p.tok_ids[string_end], .string_literal)) |next| : (string_end += 1) { string_kind = string_kind.concat(next) catch { - try p.errTok(.unsupported_str_cat, string_end); + try p.err(string_end, .unsupported_str_cat, .{}); while (p.tok_ids[p.tok_i].isStringLiteral()) : (p.tok_i += 1) {} return error.ParsingFailed; }; if (string_kind == .unterminated) { - try p.errTok(.unterminated_string_literal_error, string_end); + // Diagnostic issued in preprocessor. p.tok_i = string_end + 1; return error.ParsingFailed; } @@ -8139,15 +9454,23 @@ fn stringLiteral(p: *Parser) Error!Result { defer p.strings.items.len = strings_top; const literal_start = mem.alignForward(usize, strings_top, @intFromEnum(char_width)); - try p.strings.resize(literal_start); + try p.strings.resize(gpa, literal_start); while (p.tok_i < string_end) : (p.tok_i += 1) { const this_kind = text_literal.Kind.classify(p.tok_ids[p.tok_i], .string_literal).?; const slice = this_kind.contentSlice(p.tokSlice(p.tok_i)); - var char_literal_parser = text_literal.Parser.init(slice, this_kind, 0x10ffff, p.comp); + var char_literal_parser: text_literal.Parser = .{ + .comp = p.comp, + .literal = slice, + .kind = this_kind, + .max_codepoint = 0x10ffff, + .loc = p.pp.tokens.items(.loc)[p.tok_i], + .expansion_locs = p.pp.expansionSlice(p.tok_i), + .incorrect_encoding_is_error = count > 1, + }; - try p.strings.ensureUnusedCapacity((slice.len + 1) * @intFromEnum(char_width)); // +1 for null terminator - while (char_literal_parser.next()) |item| switch (item) { + try p.strings.ensureUnusedCapacity(gpa, (slice.len + 1) * @intFromEnum(char_width)); // +1 for null terminator + while (try char_literal_parser.next()) |item| switch (item) { .value => |v| { switch (char_width) { .@"1" => p.strings.appendAssumeCapacity(@intCast(v)), @@ -8182,7 +9505,6 @@ fn stringLiteral(p: *Parser) Error!Result { }, .improperly_encoded => |bytes| { if (count > 1) { - try p.errTok(.illegal_char_encoding_error, p.tok_i); return error.ParsingFailed; } p.strings.appendSliceAssumeCapacity(bytes); @@ -8195,7 +9517,7 @@ fn stringLiteral(p: *Parser) Error!Result { const dest_len = std.mem.alignBackward(usize, capacity_slice.len, 2); const dest = std.mem.bytesAsSlice(u16, capacity_slice[0..dest_len]); const words_written = std.unicode.utf8ToUtf16Le(dest, view.bytes) catch unreachable; - p.strings.resize(p.strings.items.len + words_written * 2) catch unreachable; + p.strings.resize(gpa, p.strings.items.len + words_written * 2) catch unreachable; }, .@"4" => { var it = view.iterator(); @@ -8207,9 +9529,6 @@ fn stringLiteral(p: *Parser) Error!Result { } }, }; - for (char_literal_parser.errors()) |item| { - try p.errExtra(item.tag, p.tok_i, item.extra); - } } p.strings.appendNTimesAssumeCapacity(0, @intFromEnum(char_width)); const slice = p.strings.items[literal_start..]; @@ -8220,42 +9539,52 @@ fn stringLiteral(p: *Parser) Error!Result { p.comp.interner.strings.items.len, string_kind.internalStorageAlignment(p.comp), ); - try p.comp.interner.strings.resize(p.gpa, interned_align); + try p.comp.interner.strings.resize(gpa, interned_align); const val = try Value.intern(p.comp, .{ .bytes = slice }); - const arr_ty = try p.arena.create(Type.Array); - arr_ty.* = .{ .elem = string_kind.elementType(p.comp), .len = @divExact(slice.len, @intFromEnum(char_width)) }; - var res: Result = .{ - .ty = .{ - .specifier = .array, - .data = .{ .array = arr_ty }, - }, + const array_qt = try p.comp.type_store.put(gpa, .{ .array = .{ + .elem = string_kind.elementType(p.comp), + .len = .{ .fixed = @divExact(slice.len, @intFromEnum(char_width)) }, + } }); + const res: Result = .{ + .qt = array_qt, .val = val, + .node = try p.addNode(.{ .string_literal_expr = .{ + .literal_tok = string_start, + .qt = array_qt, + .kind = switch (string_kind) { + .char, .unterminated => .ascii, + .wide => .wide, + .utf_8 => .utf8, + .utf_16 => .utf16, + .utf_32 => .utf32, + }, + } }), }; - res.node = try p.addNode(.{ .tag = .string_literal_expr, .ty = res.ty, .data = undefined, .loc = @enumFromInt(string_start) }); - if (!p.in_macro) try p.value_map.put(res.node, res.val); + try res.putValue(p); return res; } -fn charLiteral(p: *Parser) Error!Result { +fn charLiteral(p: *Parser) Error!?Result { defer p.tok_i += 1; const tok_id = p.tok_ids[p.tok_i]; const char_kind = text_literal.Kind.classify(tok_id, .char_literal) orelse { if (tok_id == .empty_char_literal) { - try p.err(.empty_char_literal_error); + try p.err(p.tok_i, .empty_char_literal_error, .{}); } else if (tok_id == .unterminated_char_literal) { - try p.err(.unterminated_char_literal_error); + try p.err(p.tok_i, .unterminated_char_literal_error, .{}); } else unreachable; return .{ - .ty = Type.int, - .val = Value.zero, - .node = try p.addNode(.{ .tag = .char_literal, .ty = Type.int, .data = undefined, .loc = @enumFromInt(p.tok_i) }), + .qt = .int, + .val = .zero, + .node = try p.addNode(.{ .char_literal = .{ .qt = .int, .literal_tok = p.tok_i, .kind = .ascii } }), }; }; - if (char_kind == .utf_8) try p.err(.u8_char_lit); + if (char_kind == .utf_8) try p.err(p.tok_i, .u8_char_lit, .{}); var val: u32 = 0; + const gpa = p.comp.gpa; const slice = char_kind.contentSlice(p.tokSlice(p.tok_i)); var is_multichar = false; @@ -8264,30 +9593,40 @@ fn charLiteral(p: *Parser) Error!Result { val = slice[0]; } else { const max_codepoint = char_kind.maxCodepoint(p.comp); - var char_literal_parser = text_literal.Parser.init(slice, char_kind, max_codepoint, p.comp); + var char_literal_parser: text_literal.Parser = .{ + .comp = p.comp, + .literal = slice, + .kind = char_kind, + .max_codepoint = max_codepoint, + .loc = p.pp.tokens.items(.loc)[p.tok_i], + .expansion_locs = p.pp.expansionSlice(p.tok_i), + }; const max_chars_expected = 4; - var stack_fallback = std.heap.stackFallback(max_chars_expected * @sizeOf(u32), p.comp.gpa); - var chars = std.array_list.Managed(u32).initCapacity(stack_fallback.get(), max_chars_expected) catch unreachable; // stack allocation already succeeded - defer chars.deinit(); + var sf = std.heap.stackFallback(max_chars_expected * @sizeOf(u32), gpa); + const allocator = sf.get(); + var chars: std.ArrayList(u32) = .empty; + defer chars.deinit(allocator); - while (char_literal_parser.next()) |item| switch (item) { - .value => |v| try chars.append(v), - .codepoint => |c| try chars.append(c), + chars.ensureUnusedCapacity(allocator, max_chars_expected) catch unreachable; // stack allocation already succeeded + + while (try char_literal_parser.next()) |item| switch (item) { + .value => |v| try chars.append(allocator, v), + .codepoint => |c| try chars.append(allocator, c), .improperly_encoded => |s| { - try chars.ensureUnusedCapacity(s.len); + try chars.ensureUnusedCapacity(allocator, s.len); for (s) |c| chars.appendAssumeCapacity(c); }, .utf8_text => |view| { var it = view.iterator(); var max_codepoint_seen: u21 = 0; - try chars.ensureUnusedCapacity(view.bytes.len); + try chars.ensureUnusedCapacity(allocator, view.bytes.len); while (it.nextCodepoint()) |c| { max_codepoint_seen = @max(max_codepoint_seen, c); chars.appendAssumeCapacity(c); } if (max_codepoint_seen > max_codepoint) { - char_literal_parser.err(.char_too_large, .{ .none = {} }); + try char_literal_parser.err(.char_too_large, .{}); } }, }; @@ -8295,16 +9634,16 @@ fn charLiteral(p: *Parser) Error!Result { is_multichar = chars.items.len > 1; if (is_multichar) { if (char_kind == .char and chars.items.len == 4) { - char_literal_parser.warn(.four_char_char_literal, .{ .none = {} }); + try char_literal_parser.warn(.four_char_char_literal, .{}); } else if (char_kind == .char) { - char_literal_parser.warn(.multichar_literal_warning, .{ .none = {} }); + try char_literal_parser.warn(.multichar_literal_warning, .{}); } else { - const kind = switch (char_kind) { + const kind: []const u8 = switch (char_kind) { .wide => "wide", .utf_8, .utf_16, .utf_32 => "Unicode", else => unreachable, }; - char_literal_parser.err(.invalid_multichar_literal, .{ .str = kind }); + try char_literal_parser.err(.invalid_multichar_literal, .{kind}); } } @@ -8320,20 +9659,17 @@ fn charLiteral(p: *Parser) Error!Result { } if (multichar_overflow) { - char_literal_parser.err(.char_lit_too_wide, .{ .none = {} }); - } - - for (char_literal_parser.errors()) |item| { - try p.errExtra(item.tag, p.tok_i, item.extra); + try char_literal_parser.err(.char_lit_too_wide, .{}); } } - const ty = char_kind.charLiteralType(p.comp); + const char_literal_qt = char_kind.charLiteralType(p.comp); // This is the type the literal will have if we're in a macro; macros always operate on intmax_t/uintmax_t values - const macro_ty = if (ty.isUnsignedInt(p.comp) or (char_kind == .char and p.comp.getCharSignedness() == .unsigned)) - p.comp.types.intmax.makeIntegerUnsigned() + const macro_qt = if (char_literal_qt.signedness(p.comp) == .unsigned or + (char_kind == .char and p.comp.getCharSignedness() == .unsigned)) + try p.comp.type_store.intmax.makeIntUnsigned(p.comp) else - p.comp.types.intmax; + p.comp.type_store.intmax; var value = try Value.int(val, p.comp); // C99 6.4.4.4.10 @@ -8342,30 +9678,40 @@ fn charLiteral(p: *Parser) Error!Result { // > that of the single character or escape sequence is converted to type int. // This conversion only matters if `char` is signed and has a high-order bit of `1` if (char_kind == .char and !is_multichar and val > 0x7F and p.comp.getCharSignedness() == .signed) { - _ = try value.intCast(.{ .specifier = .char }, p.comp); + _ = try value.intCast(.char, p.comp); } - const res = Result{ - .ty = if (p.in_macro) macro_ty else ty, + const res: Result = .{ + .qt = if (p.in_macro) macro_qt else char_literal_qt, .val = value, - .node = try p.addNode(.{ .tag = .char_literal, .ty = ty, .data = undefined, .loc = @enumFromInt(p.tok_i) }), + .node = try p.addNode(.{ .char_literal = .{ + .qt = char_literal_qt, + .literal_tok = p.tok_i, + .kind = switch (char_kind) { + .char, .unterminated => .ascii, + .wide => .wide, + .utf_8 => .utf8, + .utf_16 => .utf16, + .utf_32 => .utf32, + }, + } }), }; - if (!p.in_macro) try p.value_map.put(res.node, res.val); + if (!p.in_macro) try p.tree.value_map.put(gpa, res.node, res.val); return res; } fn parseFloat(p: *Parser, buf: []const u8, suffix: NumberSuffix, tok_i: TokenIndex) !Result { - const ty = Type{ .specifier = switch (suffix) { + const qt: QualType = switch (suffix) { .None, .I => .double, .F, .IF => .float, .F16, .IF16 => .float16, .L, .IL => .long_double, - .W, .IW => p.comp.float80Type().?.specifier, + .W, .IW => p.comp.float80Type().?, .Q, .IQ, .F128, .IF128 => .float128, else => unreachable, - } }; + }; const val = try Value.intern(p.comp, key: { - try p.strings.ensureUnusedCapacity(buf.len); + try p.strings.ensureUnusedCapacity(p.comp.gpa, buf.len); const strings_top = p.strings.items.len; defer p.strings.items.len = strings_top; @@ -8374,8 +9720,7 @@ fn parseFloat(p: *Parser, buf: []const u8, suffix: NumberSuffix, tok_i: TokenInd } const float = std.fmt.parseFloat(f128, p.strings.items[strings_top..]) catch unreachable; - const bits = ty.bitSizeof(p.comp).?; - break :key switch (bits) { + break :key switch (qt.bitSizeof(p.comp)) { 16 => .{ .float = .{ .f16 = @floatCast(float) } }, 32 => .{ .float = .{ .f32 = @floatCast(float) } }, 64 => .{ .float = .{ .f64 = @floatCast(float) } }, @@ -8385,22 +9730,15 @@ fn parseFloat(p: *Parser, buf: []const u8, suffix: NumberSuffix, tok_i: TokenInd }; }); var res = Result{ - .ty = ty, - .node = try p.addNode(.{ .tag = .float_literal, .ty = ty, .data = undefined, .loc = @enumFromInt(tok_i) }), + .qt = qt, + .node = try p.addNode(.{ .float_literal = .{ .qt = qt, .literal_tok = tok_i } }), .val = val, }; if (suffix.isImaginary()) { - try p.err(.gnu_imaginary_constant); - res.ty = .{ .specifier = switch (suffix) { - .I => .complex_double, - .IF16 => .complex_float16, - .IF => .complex_float, - .IL => .complex_long_double, - .IW => p.comp.float80Type().?.makeComplex().specifier, - .IQ, .IF128 => .complex_float128, - else => unreachable, - } }; - res.val = try Value.intern(p.comp, switch (res.ty.bitSizeof(p.comp).?) { + try p.err(p.tok_i, .gnu_imaginary_constant, .{}); + res.qt = try qt.toComplex(p.comp); + + res.val = try Value.intern(p.comp, switch (res.qt.bitSizeof(p.comp)) { 32 => .{ .complex = .{ .cf16 = .{ 0.0, val.toFloat(f16, p.comp) } } }, 64 => .{ .complex = .{ .cf32 = .{ 0.0, val.toFloat(f32, p.comp) } } }, 128 => .{ .complex = .{ .cf64 = .{ 0.0, val.toFloat(f64, p.comp) } } }, @@ -8418,9 +9756,9 @@ fn getIntegerPart(p: *Parser, buf: []const u8, prefix: NumberPrefix, tok_i: Toke if (!prefix.digitAllowed(buf[0])) { switch (prefix) { - .binary => try p.errExtra(.invalid_binary_digit, tok_i, .{ .ascii = @intCast(buf[0]) }), - .octal => try p.errExtra(.invalid_octal_digit, tok_i, .{ .ascii = @intCast(buf[0]) }), - .hex => try p.errStr(.invalid_int_suffix, tok_i, buf), + .binary => try p.err(tok_i, .invalid_binary_digit, .{text_literal.Ascii.init(buf[0])}), + .octal => try p.err(tok_i, .invalid_octal_digit, .{text_literal.Ascii.init(buf[0])}), + .hex => try p.err(tok_i, .invalid_int_suffix, .{buf}), .decimal => unreachable, } return error.ParsingFailed; @@ -8431,24 +9769,24 @@ fn getIntegerPart(p: *Parser, buf: []const u8, prefix: NumberPrefix, tok_i: Toke switch (c) { '.' => return buf[0..idx], 'p', 'P' => return if (prefix == .hex) buf[0..idx] else { - try p.errStr(.invalid_int_suffix, tok_i, buf[idx..]); + try p.err(tok_i, .invalid_int_suffix, .{buf[idx..]}); return error.ParsingFailed; }, 'e', 'E' => { switch (prefix) { .hex => continue, .decimal => return buf[0..idx], - .binary => try p.errExtra(.invalid_binary_digit, tok_i, .{ .ascii = @intCast(c) }), - .octal => try p.errExtra(.invalid_octal_digit, tok_i, .{ .ascii = @intCast(c) }), + .binary => try p.err(tok_i, .invalid_binary_digit, .{text_literal.Ascii.init(c)}), + .octal => try p.err(tok_i, .invalid_octal_digit, .{text_literal.Ascii.init(c)}), } return error.ParsingFailed; }, '0'...'9', 'a'...'d', 'A'...'D', 'f', 'F' => { if (!prefix.digitAllowed(c)) { switch (prefix) { - .binary => try p.errExtra(.invalid_binary_digit, tok_i, .{ .ascii = @intCast(c) }), - .octal => try p.errExtra(.invalid_octal_digit, tok_i, .{ .ascii = @intCast(c) }), - .decimal, .hex => try p.errStr(.invalid_int_suffix, tok_i, buf[idx..]), + .binary => try p.err(tok_i, .invalid_binary_digit, .{text_literal.Ascii.init(c)}), + .octal => try p.err(tok_i, .invalid_octal_digit, .{text_literal.Ascii.init(c)}), + .decimal, .hex => try p.err(tok_i, .invalid_int_suffix, .{buf[idx..]}), } return error.ParsingFailed; } @@ -8483,33 +9821,33 @@ fn fixedSizeInt(p: *Parser, base: u8, buf: []const u8, suffix: NumberSuffix, tok if (overflowed != 0) overflow = true; val = sum; } - var res: Result = .{ .val = try Value.int(val, p.comp) }; + var res: Result = .{ + .val = try Value.int(val, p.comp), + .node = undefined, // set later + }; if (overflow) { - try p.errTok(.int_literal_too_big, tok_i); - res.ty = .{ .specifier = .ulong_long }; - res.node = try p.addNode(.{ .tag = .int_literal, .ty = res.ty, .data = undefined, .loc = @enumFromInt(tok_i) }); - if (!p.in_macro) try p.value_map.put(res.node, res.val); + try p.err(tok_i, .int_literal_too_big, .{}); + res.qt = .ulong_long; + res.node = try p.addNode(.{ .int_literal = .{ .qt = res.qt, .literal_tok = tok_i } }); + try res.putValue(p); return res; } const interned_val = try Value.int(val, p.comp); - if (suffix.isSignedInteger()) { - const max_int = try Value.maxInt(p.comp.types.intmax, p.comp); + if (suffix.isSignedInteger() and base == 10) { + const max_int = try Value.maxInt(p.comp.type_store.intmax, p.comp); if (interned_val.compare(.gt, max_int, p.comp)) { - try p.errTok(.implicitly_unsigned_literal, tok_i); + try p.err(tok_i, .implicitly_unsigned_literal, .{}); } } - const signed_specs = .{ .int, .long, .long_long }; - const unsigned_specs = .{ .uint, .ulong, .ulong_long }; - const signed_oct_hex_specs = .{ .int, .uint, .long, .ulong, .long_long, .ulong_long }; - const specs: []const Type.Specifier = if (suffix.signedness() == .unsigned) - &unsigned_specs + const qts: []const QualType = if (suffix.signedness() == .unsigned) + &.{ .uint, .ulong, .ulong_long } else if (base == 10) - &signed_specs + &.{ .int, .long, .long_long } else - &signed_oct_hex_specs; + &.{ .int, .uint, .long, .ulong, .long_long, .ulong_long }; - const suffix_ty: Type = .{ .specifier = switch (suffix) { + const suffix_qt: QualType = switch (suffix) { .None, .I => .int, .U, .IU => .uint, .UL, .IUL => .ulong, @@ -8517,35 +9855,33 @@ fn fixedSizeInt(p: *Parser, base: u8, buf: []const u8, suffix: NumberSuffix, tok .L, .IL => .long, .LL, .ILL => .long_long, else => unreachable, - } }; + }; - for (specs) |spec| { - res.ty = Type{ .specifier = spec }; - if (res.ty.compareIntegerRanks(suffix_ty, p.comp).compare(.lt)) continue; - const max_int = try Value.maxInt(res.ty, p.comp); + for (qts) |qt| { + res.qt = qt; + if (res.qt.intRankOrder(suffix_qt, p.comp).compare(.lt)) continue; + const max_int = try Value.maxInt(res.qt, p.comp); if (interned_val.compare(.lte, max_int, p.comp)) break; } else { - res.ty = .{ .specifier = spec: { - if (p.comp.langopts.emulate == .gcc) { - if (target_util.hasInt128(p.comp.target)) { - break :spec .int128; - } else { - break :spec .long_long; - } + if (p.comp.langopts.emulate == .gcc) { + if (target_util.hasInt128(p.comp.target)) { + res.qt = .int128; } else { - break :spec .ulong_long; + res.qt = .long_long; } - } }; + } else { + res.qt = .ulong_long; + } } - res.node = try p.addNode(.{ .tag = .int_literal, .ty = res.ty, .data = undefined, .loc = @enumFromInt(tok_i) }); - if (!p.in_macro) try p.value_map.put(res.node, res.val); + res.node = try p.addNode(.{ .int_literal = .{ .qt = res.qt, .literal_tok = tok_i } }); + try res.putValue(p); return res; } fn parseInt(p: *Parser, prefix: NumberPrefix, buf: []const u8, suffix: NumberSuffix, tok_i: TokenIndex) !Result { if (prefix == .binary) { - try p.errTok(.binary_integer_literal, tok_i); + try p.err(tok_i, .binary_integer_literal, .{}); } const base = @intFromEnum(prefix); var res = if (suffix.isBitInt()) @@ -8554,8 +9890,8 @@ fn parseInt(p: *Parser, prefix: NumberPrefix, buf: []const u8, suffix: NumberSuf try p.fixedSizeInt(base, buf, suffix, tok_i); if (suffix.isImaginary()) { - try p.errTok(.gnu_imaginary_constant, tok_i); - res.ty = res.ty.makeComplex(); + try p.err(tok_i, .gnu_imaginary_constant, .{}); + res.qt = try res.qt.toComplex(p.comp); res.val = .{}; try res.un(p, .imaginary_literal, tok_i); } @@ -8563,14 +9899,15 @@ fn parseInt(p: *Parser, prefix: NumberPrefix, buf: []const u8, suffix: NumberSuf } fn bitInt(p: *Parser, base: u8, buf: []const u8, suffix: NumberSuffix, tok_i: TokenIndex) Error!Result { - try p.errStr(.pre_c23_compat, tok_i, "'_BitInt' suffix for literals"); - try p.errTok(.bitint_suffix, tok_i); + const gpa = p.comp.gpa; + try p.err(tok_i, .pre_c23_compat, .{"'_BitInt' suffix for literals"}); + try p.err(tok_i, .bitint_suffix, .{}); - var managed = try big.int.Managed.init(p.gpa); + var managed = try big.int.Managed.init(gpa); defer managed.deinit(); { - try p.strings.ensureUnusedCapacity(buf.len); + try p.strings.ensureUnusedCapacity(gpa, buf.len); const strings_top = p.strings.items.len; defer p.strings.items.len = strings_top; @@ -8595,15 +9932,16 @@ fn bitInt(p: *Parser, base: u8, buf: []const u8, suffix: NumberSuffix, tok_i: To break :blk @intCast(bits_needed); }; - var res: Result = .{ + const int_qt = try p.comp.type_store.put(gpa, .{ .bit_int = .{ + .bits = bits_needed, + .signedness = suffix.signedness(), + } }); + const res: Result = .{ .val = try Value.intern(p.comp, .{ .int = .{ .big_int = c } }), - .ty = .{ - .specifier = .bit_int, - .data = .{ .int = .{ .bits = bits_needed, .signedness = suffix.signedness() } }, - }, + .qt = int_qt, + .node = try p.addNode(.{ .int_literal = .{ .qt = int_qt, .literal_tok = tok_i } }), }; - res.node = try p.addNode(.{ .tag = .int_literal, .ty = res.ty, .data = undefined, .loc = @enumFromInt(tok_i) }); - if (!p.in_macro) try p.value_map.put(res.node, res.val); + try res.putValue(p); return res; } @@ -8611,7 +9949,7 @@ fn getFracPart(p: *Parser, buf: []const u8, prefix: NumberPrefix, tok_i: TokenIn if (buf.len == 0 or buf[0] != '.') return ""; assert(prefix != .octal); if (prefix == .binary) { - try p.errStr(.invalid_int_suffix, tok_i, buf); + try p.err(tok_i, .invalid_int_suffix, .{buf}); return error.ParsingFailed; } for (buf, 0..) |c, idx| { @@ -8628,7 +9966,7 @@ fn getExponent(p: *Parser, buf: []const u8, prefix: NumberPrefix, tok_i: TokenIn switch (buf[0]) { 'e', 'E' => assert(prefix == .decimal), 'p', 'P' => if (prefix != .hex) { - try p.errStr(.invalid_float_suffix, tok_i, buf); + try p.err(tok_i, .invalid_float_suffix, .{buf}); return error.ParsingFailed; }, else => return "", @@ -8644,7 +9982,7 @@ fn getExponent(p: *Parser, buf: []const u8, prefix: NumberPrefix, tok_i: TokenIn } else buf.len; const exponent = buf[0..end]; if (std.mem.indexOfAny(u8, exponent, "0123456789") == null) { - try p.errTok(.exponent_has_no_digits, tok_i); + try p.err(tok_i, .exponent_has_no_digits, .{}); return error.ParsingFailed; } return exponent; @@ -8669,21 +10007,21 @@ pub fn parseNumberToken(p: *Parser, tok_i: TokenIndex) !Result { const is_float = (exponent.len > 0 or frac.len > 0); const suffix = NumberSuffix.fromString(suffix_str, if (is_float) .float else .int) orelse { if (is_float) { - try p.errStr(.invalid_float_suffix, tok_i, suffix_str); + try p.err(tok_i, .invalid_float_suffix, .{suffix_str}); } else { - try p.errStr(.invalid_int_suffix, tok_i, suffix_str); + try p.err(tok_i, .invalid_int_suffix, .{suffix_str}); } return error.ParsingFailed; }; if (suffix.isFloat80() and p.comp.float80Type() == null) { - try p.errStr(.invalid_float_suffix, tok_i, suffix_str); + try p.err(tok_i, .invalid_float_suffix, .{suffix_str}); return error.ParsingFailed; } if (is_float) { assert(prefix == .hex or prefix == .decimal); if (prefix == .hex and exponent.len == 0) { - try p.errTok(.hex_floating_constant_requires_exponent, tok_i); + try p.err(tok_i, .hex_floating_constant_requires_exponent, .{}); return error.ParsingFailed; } const number = buf[0 .. buf.len - suffix_str.len]; @@ -8697,107 +10035,118 @@ fn ppNum(p: *Parser) Error!Result { defer p.tok_i += 1; var res = try p.parseNumberToken(p.tok_i); if (p.in_macro) { - if (res.ty.isFloat() or !res.ty.isReal()) { - try p.errTok(.float_literal_in_pp_expr, p.tok_i); + const res_sk = res.qt.scalarKind(p.comp); + if (res_sk.isFloat() or !res_sk.isReal()) { + try p.err(p.tok_i, .float_literal_in_pp_expr, .{}); return error.ParsingFailed; } - res.ty = if (res.ty.isUnsignedInt(p.comp)) p.comp.types.intmax.makeIntegerUnsigned() else p.comp.types.intmax; + res.qt = if (res.qt.signedness(p.comp) == .unsigned) + try p.comp.type_store.intmax.makeIntUnsigned(p.comp) + else + p.comp.type_store.intmax; } else if (res.val.opt_ref != .none) { - try p.value_map.put(res.node, res.val); + try res.putValue(p); } return res; } /// Run a parser function but do not evaluate the result -fn parseNoEval(p: *Parser, comptime func: fn (*Parser) Error!Result) Error!Result { +fn parseNoEval(p: *Parser, comptime func: fn (*Parser) Error!?Result) Error!Result { const no_eval = p.no_eval; defer p.no_eval = no_eval; p.no_eval = true; + const parsed = try func(p); - try parsed.expect(p); - return parsed; + return p.expectResult(parsed); } /// genericSelection : keyword_generic '(' assignExpr ',' genericAssoc (',' genericAssoc)* ')' /// genericAssoc /// : typeName ':' assignExpr /// | keyword_default ':' assignExpr -fn genericSelection(p: *Parser) Error!Result { +fn genericSelection(p: *Parser) Error!?Result { + const gpa = p.comp.gpa; const kw_generic = p.tok_i; p.tok_i += 1; const l_paren = try p.expectToken(.l_paren); const controlling_tok = p.tok_i; + const controlling = try p.parseNoEval(assignExpr); + var controlling_qt = controlling.qt; + if (controlling_qt.is(p.comp, .array)) { + controlling_qt = try controlling_qt.decay(p.comp); + } _ = try p.expectToken(.comma); - var controlling_ty = controlling.ty; - if (controlling_ty.isArray()) controlling_ty.decayArray(); const list_buf_top = p.list_buf.items.len; defer p.list_buf.items.len = list_buf_top; - try p.list_buf.append(controlling.node); - // Use decl_buf to store the token indexes of previous cases - const decl_buf_top = p.decl_buf.items.len; - defer p.decl_buf.items.len = decl_buf_top; + // Use param_buf to store the token indexes of previous cases + const param_buf_top = p.param_buf.items.len; + defer p.param_buf.items.len = param_buf_top; var default_tok: ?TokenIndex = null; var default: Result = undefined; - var chosen_tok: TokenIndex = undefined; - var chosen: Result = .{}; + var chosen_tok: ?TokenIndex = null; + var chosen: Result = undefined; + while (true) { const start = p.tok_i; - if (try p.typeName()) |ty| blk: { - if (ty.isArray()) { - try p.errTok(.generic_array_type, start); - } else if (ty.isFunc()) { - try p.errTok(.generic_func_type, start); - } else if (ty.anyQual()) { - try p.errTok(.generic_qual_type, start); + if (try p.typeName()) |qt| blk: { + switch (qt.base(p.comp).type) { + .array => try p.err(start, .generic_array_type, .{}), + .func => try p.err(start, .generic_func_type, .{}), + else => if (qt.isQualified()) { + try p.err(start, .generic_qual_type, .{}); + }, } - _ = try p.expectToken(.colon); - const node = try p.assignExpr(); - try node.expect(p); - if (ty.eql(controlling_ty, p.comp, false)) { - if (chosen.node == .none) { - chosen = node; + const colon = try p.expectToken(.colon); + var res = try p.expect(assignExpr); + res.node = try p.addNode(.{ + .generic_association_expr = .{ + .colon_tok = colon, + .association_qt = qt, + .expr = res.node, + }, + }); + try p.list_buf.append(gpa, res.node); + try p.param_buf.append(gpa, .{ .name = undefined, .qt = qt, .name_tok = start, .node = .null }); + + if (qt.eql(controlling_qt, p.comp)) { + if (chosen_tok == null) { + chosen = res; chosen_tok = start; break :blk; } - try p.errStr(.generic_duplicate, start, try p.typeStr(ty)); - try p.errStr(.generic_duplicate_here, chosen_tok, try p.typeStr(ty)); - } - const list_buf = p.list_buf.items[list_buf_top + 1 ..]; - const decl_buf = p.decl_buf.items[decl_buf_top..]; - if (list_buf.len == decl_buf.len) { - // If these do not have the same length, there is already an error - for (list_buf, decl_buf) |item, prev_tok| { - const prev_ty = p.nodes.items(.ty)[@intFromEnum(item)]; - if (prev_ty.eql(ty, p.comp, true)) { - try p.errStr(.generic_duplicate, start, try p.typeStr(ty)); - try p.errStr(.generic_duplicate_here, @intFromEnum(prev_tok), try p.typeStr(ty)); - } + } + + const previous_items = p.param_buf.items[0 .. p.param_buf.items.len - 1][param_buf_top..]; + for (previous_items) |prev_item| { + if (prev_item.qt.eql(qt, p.comp)) { + try p.err(start, .generic_duplicate, .{qt}); + try p.err(prev_item.name_tok, .generic_duplicate_here, .{qt}); } } - try p.list_buf.append(try p.addNode(.{ - .tag = .generic_association_expr, - .ty = ty, - .data = .{ .un = node.node }, - .loc = @enumFromInt(start), - })); - try p.decl_buf.append(@enumFromInt(start)); } else if (p.eatToken(.keyword_default)) |tok| { + _ = try p.expectToken(.colon); + var res = try p.expect(assignExpr); + res.node = try p.addNode(.{ + .generic_default_expr = .{ + .default_tok = tok, + .expr = res.node, + }, + }); + if (default_tok) |prev| { - try p.errTok(.generic_duplicate_default, tok); - try p.errTok(.previous_case, prev); + try p.err(tok, .generic_duplicate_default, .{}); + try p.err(prev, .previous_case, .{}); } + default = res; default_tok = tok; - _ = try p.expectToken(.colon); - default = try p.assignExpr(); - try default.expect(p); } else { - if (p.list_buf.items.len == list_buf_top + 1) { - try p.err(.expected_type); + if (p.list_buf.items.len == list_buf_top) { + try p.err(p.tok_i, .expected_type, .{}); return error.ParsingFailed; } break; @@ -8806,53 +10155,46 @@ fn genericSelection(p: *Parser) Error!Result { } try p.expectClosing(l_paren, .r_paren); - if (chosen.node == .none) { - if (default_tok) |tok| { - try p.list_buf.insert(list_buf_top + 1, try p.addNode(.{ - .tag = .generic_default_expr, - .data = .{ .un = default.node }, - .ty = default.ty, - .loc = @enumFromInt(tok), - })); + if (chosen_tok == null) { + if (default_tok != null) { chosen = default; } else { - try p.errStr(.generic_no_match, controlling_tok, try p.typeStr(controlling_ty)); + try p.err(controlling_tok, .generic_no_match, .{controlling_qt}); return error.ParsingFailed; } - } else { - try p.list_buf.insert(list_buf_top + 1, try p.addNode(.{ - .tag = .generic_association_expr, - .data = .{ .un = chosen.node }, - .ty = chosen.ty, - .loc = @enumFromInt(chosen_tok), - })); - if (default_tok) |tok| { - try p.list_buf.append(try p.addNode(.{ - .tag = .generic_default_expr, - .data = .{ .un = default.node }, - .ty = default.ty, - .loc = @enumFromInt(tok), - })); - } - } - - var generic_node: Tree.Node = .{ - .tag = .generic_expr_one, - .ty = chosen.ty, - .data = .{ .two = .{ controlling.node, chosen.node } }, - .loc = @enumFromInt(kw_generic), - }; - const associations = p.list_buf.items[list_buf_top..]; - if (associations.len > 2) { // associations[0] == controlling.node - generic_node.tag = .generic_expr; - generic_node.data = .{ .range = try p.addList(associations) }; + } else if (default_tok != null) { + try p.list_buf.append(gpa, default.node); + } + + for (p.list_buf.items[list_buf_top..], list_buf_top..) |item, i| { + if (item == chosen.node) { + _ = p.list_buf.orderedRemove(i); + break; + } } - chosen.node = try p.addNode(generic_node); - return chosen; + + return .{ + .qt = chosen.qt, + .val = chosen.val, + .node = try p.addNode(.{ + .generic_expr = .{ + .generic_tok = kw_generic, + .controlling = controlling.node, + .chosen = chosen.node, + .qt = chosen.qt, + .rest = p.list_buf.items[list_buf_top..], + }, + }), + }; } test "Node locations" { - var comp = Compilation.init(std.testing.allocator, std.fs.cwd()); + var arena_state: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena_state.deinit(); + const arena = arena_state.allocator(); + + var diagnostics: Diagnostics = .{ .output = .ignore }; + var comp = Compilation.init(std.testing.allocator, arena, &diagnostics, std.fs.cwd()); defer comp.deinit(); const file = try comp.addSourceFromBuffer("file.c", @@ -8864,7 +10206,7 @@ test "Node locations" { const builtin_macros = try comp.generateBuiltinMacros(.no_system_defines); - var pp = Preprocessor.init(&comp); + var pp = Preprocessor.init(&comp, .default); defer pp.deinit(); try pp.addBuiltinMacros(); @@ -8876,10 +10218,9 @@ test "Node locations" { var tree = try Parser.parse(&pp); defer tree.deinit(); - try std.testing.expectEqual(0, comp.diagnostics.list.items.len); - for (tree.root_decls, 0..) |node, i| { - const tok_i = tree.nodeTok(node).?; - const slice = tree.tokSlice(tok_i); + try std.testing.expectEqual(0, comp.diagnostics.total); + for (tree.root_decls.items[tree.root_decls.items.len - 3 ..], 0..) |node, i| { + const slice = tree.tokSlice(node.tok(&tree)); const expected = switch (i) { 0 => "foo", 1 => "bar", diff --git a/lib/compiler/aro/aro/Parser/Diagnostic.zig b/lib/compiler/aro/aro/Parser/Diagnostic.zig new file mode 100644 index 000000000000..8f44e315c675 --- /dev/null +++ b/lib/compiler/aro/aro/Parser/Diagnostic.zig @@ -0,0 +1,2424 @@ +const std = @import("std"); + +const Diagnostics = @import("../Diagnostics.zig"); +const LangOpts = @import("../LangOpts.zig"); +const Compilation = @import("../Compilation.zig"); + +const Diagnostic = @This(); + +fmt: []const u8, +kind: Diagnostics.Message.Kind, +opt: ?Diagnostics.Option = null, +extension: bool = false, + +// TODO look into removing these +suppress_version: ?LangOpts.Standard = null, +suppress_unless_version: ?LangOpts.Standard = null, + +const pointer_sign_message = " converts between pointers to integer types with different sign"; + +// Maybe someday this will no longer be needed. +pub const todo: Diagnostic = .{ + .fmt = "TODO: {s}", + .kind = .@"error", +}; + +pub const closing_paren: Diagnostic = .{ + .fmt = "expected closing ')'", + .kind = .@"error", +}; + +pub const to_match_paren: Diagnostic = .{ + .fmt = "to match this '('", + .kind = .note, +}; + +pub const to_match_brace: Diagnostic = .{ + .fmt = "to match this '{'", + .kind = .note, +}; + +pub const to_match_bracket: Diagnostic = .{ + .fmt = "to match this '['", + .kind = .note, +}; + +pub const float_literal_in_pp_expr: Diagnostic = .{ + .fmt = "floating point literal in preprocessor expression", + .kind = .@"error", +}; + +pub const expected_invalid: Diagnostic = .{ + .fmt = "expected '{tok_id}', found invalid bytes", + .kind = .@"error", +}; + +pub const expected_eof: Diagnostic = .{ + .fmt = "expected '{tok_id}' before end of file", + .kind = .@"error", +}; + +pub const expected_token: Diagnostic = .{ + .fmt = "expected '{tok_id}', found '{tok_id}'", + .kind = .@"error", +}; + +pub const expected_expr: Diagnostic = .{ + .fmt = "expected expression", + .kind = .@"error", +}; + +pub const unexpected_type_name: Diagnostic = .{ + .fmt = "unexpected type name '{s}': expected expression", + .kind = .@"error", +}; + +pub const expected_integer_constant_expr: Diagnostic = .{ + .fmt = "expression is not an integer constant expression", + .kind = .@"error", +}; + +pub const missing_type_specifier: Diagnostic = .{ + .fmt = "type specifier missing, defaults to 'int'", + .opt = .@"implicit-int", + .kind = .warning, +}; + +pub const missing_type_specifier_c23: Diagnostic = .{ + .fmt = "a type specifier is required for all declarations", + .kind = .@"error", +}; + +pub const param_not_declared: Diagnostic = .{ + .fmt = "parameter '{s}' was not declared, defaults to 'int'", + .opt = .@"implicit-int", + .kind = .warning, + .extension = true, +}; + +pub const multiple_storage_class: Diagnostic = .{ + .fmt = "cannot combine with previous '{s}' declaration specifier", + .kind = .@"error", +}; + +pub const static_assert_failure: Diagnostic = .{ + .fmt = "static assertion failed", + .kind = .@"error", +}; + +pub const static_assert_failure_message: Diagnostic = .{ + .fmt = "static assertion failed {s}", + .kind = .@"error", +}; + +pub const expected_type: Diagnostic = .{ + .fmt = "expected a type", + .kind = .@"error", +}; + +pub const cannot_combine_spec: Diagnostic = .{ + .fmt = "cannot combine with previous '{s}' specifier", + .kind = .@"error", +}; + +pub const cannot_combine_spec_qt: Diagnostic = .{ + .fmt = "cannot combine with previous {qt} specifier", + .kind = .@"error", +}; + +pub const cannot_combine_with_typeof: Diagnostic = .{ + .fmt = "'{s} typeof' is invalid", + .kind = .@"error", +}; + +pub const duplicate_decl_spec: Diagnostic = .{ + .fmt = "duplicate '{s}' declaration specifier", + .opt = .@"duplicate-decl-specifier", + .kind = .warning, +}; + +pub const restrict_non_pointer: Diagnostic = .{ + .fmt = "restrict requires a pointer or reference ({qt} is invalid)", + .kind = .@"error", +}; + +pub const expected_external_decl: Diagnostic = .{ + .fmt = "expected external declaration", + .kind = .@"error", +}; + +pub const expected_ident_or_l_paren: Diagnostic = .{ + .fmt = "expected identifier or '('", + .kind = .@"error", +}; + +pub const missing_declaration: Diagnostic = .{ + .fmt = "declaration does not declare anything", + .opt = .@"missing-declaration", + .kind = .warning, + .extension = true, +}; + +pub const func_not_in_root: Diagnostic = .{ + .fmt = "function definition is not allowed here", + .kind = .@"error", +}; + +pub const illegal_initializer: Diagnostic = .{ + .fmt = "illegal initializer (only variables can be initialized)", + .kind = .@"error", +}; + +pub const extern_initializer: Diagnostic = .{ + .fmt = "extern variable has initializer", + .opt = .@"extern-initializer", + .kind = .warning, +}; + +pub const param_before_var_args: Diagnostic = .{ + .fmt = "ISO C requires a named parameter before '...'", + .kind = .@"error", + .suppress_version = .c23, +}; + +pub const void_only_param: Diagnostic = .{ + .fmt = "'void' must be the only parameter if specified", + .kind = .@"error", +}; + +pub const void_param_qualified: Diagnostic = .{ + .fmt = "'void' parameter cannot be qualified", + .kind = .@"error", +}; + +pub const void_must_be_first_param: Diagnostic = .{ + .fmt = "'void' must be the first parameter if specified", + .kind = .@"error", +}; + +pub const invalid_storage_on_param: Diagnostic = .{ + .fmt = "invalid storage class on function parameter", + .kind = .@"error", +}; + +pub const threadlocal_non_var: Diagnostic = .{ + .fmt = "_Thread_local only allowed on variables", + .kind = .@"error", +}; + +pub const func_spec_non_func: Diagnostic = .{ + .fmt = "'{s}' can only appear on functions", + .kind = .@"error", +}; + +pub const illegal_storage_on_func: Diagnostic = .{ + .fmt = "illegal storage class on function", + .kind = .@"error", +}; + +pub const illegal_storage_on_global: Diagnostic = .{ + .fmt = "illegal storage class on global variable", + .kind = .@"error", +}; + +pub const expected_stmt: Diagnostic = .{ + .fmt = "expected statement", + .kind = .@"error", +}; + +pub const func_cannot_return_func: Diagnostic = .{ + .fmt = "function cannot return a function", + .kind = .@"error", +}; + +pub const func_cannot_return_array: Diagnostic = .{ + .fmt = "function cannot return an array", + .kind = .@"error", +}; + +pub const undeclared_identifier: Diagnostic = .{ + .fmt = "use of undeclared identifier '{s}'", + .kind = .@"error", +}; + +pub const not_callable: Diagnostic = .{ + .fmt = "cannot call non function type {qt}", + .kind = .@"error", +}; + +pub const unsupported_str_cat: Diagnostic = .{ + .fmt = "unsupported string literal concatenation", + .kind = .@"error", +}; + +pub const static_func_not_global: Diagnostic = .{ + .fmt = "static functions must be global", + .kind = .@"error", +}; + +pub const implicit_func_decl: Diagnostic = .{ + .fmt = "call to undeclared function '{s}'; ISO C99 and later do not support implicit function declarations", + .opt = .@"implicit-function-declaration", + .kind = .@"error", +}; + +pub const unknown_builtin: Diagnostic = .{ + .fmt = "use of unknown builtin '{s}'", + .opt = .@"implicit-function-declaration", + .kind = .@"error", +}; + +pub const implicit_builtin: Diagnostic = .{ + .fmt = "implicitly declaring library function '{s}'", + .kind = .@"error", + .opt = .@"implicit-function-declaration", +}; + +pub const implicit_builtin_header_note: Diagnostic = .{ + .fmt = "include the header <{s}.h> or explicitly provide a declaration for '{s}'", + .kind = .note, + .opt = .@"implicit-function-declaration", +}; + +pub const expected_param_decl: Diagnostic = .{ + .fmt = "expected parameter declaration", + .kind = .@"error", +}; + +pub const invalid_old_style_params: Diagnostic = .{ + .fmt = "identifier parameter lists are only allowed in function definitions", + .kind = .@"error", +}; + +pub const expected_fn_body: Diagnostic = .{ + .fmt = "expected function body after function declaration", + .kind = .@"error", +}; + +pub const invalid_void_param: Diagnostic = .{ + .fmt = "parameter cannot have void type", + .kind = .@"error", +}; + +pub const continue_not_in_loop: Diagnostic = .{ + .fmt = "'continue' statement not in a loop", + .kind = .@"error", +}; + +pub const break_not_in_loop_or_switch: Diagnostic = .{ + .fmt = "'break' statement not in a loop or a switch", + .kind = .@"error", +}; + +pub const unreachable_code: Diagnostic = .{ + .fmt = "unreachable code", + .opt = .@"unreachable-code", + .kind = .warning, +}; + +pub const duplicate_label: Diagnostic = .{ + .fmt = "duplicate label '{s}'", + .kind = .@"error", +}; + +pub const previous_label: Diagnostic = .{ + .fmt = "previous definition of label '{s}' was here", + .kind = .note, +}; + +pub const undeclared_label: Diagnostic = .{ + .fmt = "use of undeclared label '{s}'", + .kind = .@"error", +}; + +pub const case_not_in_switch: Diagnostic = .{ + .fmt = "'{s}' statement not in a switch statement", + .kind = .@"error", +}; + +pub const duplicate_switch_case: Diagnostic = .{ + .fmt = "duplicate case value '{value}'", + .kind = .@"error", +}; + +pub const multiple_default: Diagnostic = .{ + .fmt = "multiple default cases in the same switch", + .kind = .@"error", +}; + +pub const previous_case: Diagnostic = .{ + .fmt = "previous case defined here", + .kind = .note, +}; + +pub const expected_arguments: Diagnostic = .{ + .fmt = "expected {d} argument(s) got {d}", + .kind = .@"error", +}; + +pub const expected_arguments_old: Diagnostic = .{ + .fmt = expected_arguments.fmt, + .kind = .warning, +}; + +pub const callee_with_static_array: Diagnostic = .{ + .fmt = "callee declares array parameter as static here", + .kind = .note, +}; + +pub const array_argument_too_small: Diagnostic = .{ + .fmt = "array argument is too small; contains {d} elements, callee requires at least {d}", + .kind = .warning, + .opt = .@"array-bounds", +}; + +pub const non_null_argument: Diagnostic = .{ + .fmt = "null passed to a callee that requires a non-null argument", + .kind = .warning, + .opt = .nonnull, +}; + +pub const expected_at_least_arguments: Diagnostic = .{ + .fmt = "expected at least {d} argument(s) got {d}", + .kind = .warning, +}; + +pub const invalid_static_star: Diagnostic = .{ + .fmt = "'static' may not be used with an unspecified variable length array size", + .kind = .@"error", +}; + +pub const static_non_param: Diagnostic = .{ + .fmt = "'static' used outside of function parameters", + .kind = .@"error", +}; + +pub const array_qualifiers: Diagnostic = .{ + .fmt = "type qualifier in non parameter array type", + .kind = .@"error", +}; + +pub const star_non_param: Diagnostic = .{ + .fmt = "star modifier used outside of function parameters", + .kind = .@"error", +}; + +pub const variable_len_array_file_scope: Diagnostic = .{ + .fmt = "variable length arrays not allowed at file scope", + .kind = .@"error", +}; + +pub const useless_static: Diagnostic = .{ + .fmt = "'static' useless without a constant size", + .kind = .warning, +}; + +pub const negative_array_size: Diagnostic = .{ + .fmt = "array size must be 0 or greater", + .kind = .@"error", +}; + +pub const array_incomplete_elem: Diagnostic = .{ + .fmt = "array has incomplete element type {qt}", + .kind = .@"error", +}; + +pub const array_func_elem: Diagnostic = .{ + .fmt = "arrays cannot have functions as their element type", + .kind = .@"error", +}; + +pub const static_non_outermost_array: Diagnostic = .{ + .fmt = "'static' used in non-outermost array type", + .kind = .@"error", +}; + +pub const qualifier_non_outermost_array: Diagnostic = .{ + .fmt = "type qualifier used in non-outermost array type", + .kind = .@"error", +}; + +pub const array_overflow: Diagnostic = .{ + .fmt = "the pointer incremented by {value} refers past the last possible element in {d}-bit address space containing {d}-bit ({d}-byte) elements (max possible {d} elements)", + .opt = .@"array-bounds", + .kind = .warning, +}; + +pub const overflow: Diagnostic = .{ + .fmt = "overflow in expression; result is '{value}'", + .kind = .warning, + .opt = .@"integer-overflow", +}; + +pub const int_literal_too_big: Diagnostic = .{ + .fmt = "integer literal is too large to be represented in any integer type", + .kind = .@"error", +}; + +pub const indirection_ptr: Diagnostic = .{ + .fmt = "indirection requires pointer operand", + .kind = .@"error", +}; + +pub const addr_of_rvalue: Diagnostic = .{ + .fmt = "cannot take the address of an rvalue", + .kind = .@"error", +}; + +pub const addr_of_bitfield: Diagnostic = .{ + .fmt = "address of bit-field requested", + .kind = .@"error", +}; + +pub const not_assignable: Diagnostic = .{ + .fmt = "expression is not assignable", + .kind = .@"error", +}; + +pub const ident_or_l_brace: Diagnostic = .{ + .fmt = "expected identifier or '{'", + .kind = .@"error", +}; + +pub const empty_enum: Diagnostic = .{ + .fmt = "empty enum is invalid", + .kind = .@"error", +}; + +pub const redefinition: Diagnostic = .{ + .fmt = "redefinition of '{s}'", + .kind = .@"error", +}; + +pub const previous_definition: Diagnostic = .{ + .fmt = "previous definition is here", + .kind = .note, +}; + +pub const previous_declaration: Diagnostic = .{ + .fmt = "previous declaration is here", + .kind = .note, +}; + +pub const out_of_scope_use: Diagnostic = .{ + .fmt = "use of out-of-scope declaration of '{s}'", + .kind = .warning, + .opt = .@"out-of-scope-function", +}; + +pub const expected_identifier: Diagnostic = .{ + .fmt = "expected identifier", + .kind = .@"error", +}; + +pub const expected_str_literal: Diagnostic = .{ + .fmt = "expected string literal for diagnostic message in static_assert", + .kind = .@"error", +}; + +pub const expected_str_literal_in: Diagnostic = .{ + .fmt = "expected string literal in '{s}'", + .kind = .@"error", +}; + +pub const parameter_missing: Diagnostic = .{ + .fmt = "parameter named '{s}' is missing", + .kind = .@"error", +}; + +pub const empty_record: Diagnostic = .{ + .fmt = "empty {s} is a GNU extension", + .opt = .@"gnu-empty-struct", + .kind = .off, + .extension = true, +}; + +pub const empty_record_size: Diagnostic = .{ + .fmt = "empty {s} has size 0 in C, size 1 in C++", + .opt = .@"c++-compat", + .kind = .off, +}; + +pub const wrong_tag: Diagnostic = .{ + .fmt = "use of '{s}' with tag type that does not match previous definition", + .kind = .@"error", +}; + +pub const expected_parens_around_typename: Diagnostic = .{ + .fmt = "expected parentheses around type name", + .kind = .@"error", +}; + +pub const alignof_expr: Diagnostic = .{ + .fmt = "'_Alignof' applied to an expression is a GNU extension", + .opt = .@"gnu-alignof-expression", + .kind = .warning, + .extension = true, +}; + +pub const invalid_alignof: Diagnostic = .{ + .fmt = "invalid application of 'alignof' to an incomplete type {qt}", + .kind = .@"error", +}; + +pub const invalid_sizeof: Diagnostic = .{ + .fmt = "invalid application of 'sizeof' to an incomplete type {qt}", + .kind = .@"error", +}; + +pub const generic_qual_type: Diagnostic = .{ + .fmt = "generic association with qualifiers cannot be matched with", + .opt = .@"generic-qual-type", + .kind = .warning, +}; + +pub const generic_array_type: Diagnostic = .{ + .fmt = "generic association array type cannot be matched with", + .opt = .@"generic-qual-type", + .kind = .warning, +}; + +pub const generic_func_type: Diagnostic = .{ + .fmt = "generic association function type cannot be matched with", + .opt = .@"generic-qual-type", + .kind = .warning, +}; + +pub const generic_duplicate: Diagnostic = .{ + .fmt = "type {qt} in generic association compatible with previously specified type", + .kind = .@"error", +}; + +pub const generic_duplicate_here: Diagnostic = .{ + .fmt = "compatible type {qt} specified here", + .kind = .note, +}; + +pub const generic_duplicate_default: Diagnostic = .{ + .fmt = "duplicate default generic association", + .kind = .@"error", +}; + +pub const generic_no_match: Diagnostic = .{ + .fmt = "controlling expression type {qt} not compatible with any generic association type", + .kind = .@"error", +}; + +pub const must_use_struct: Diagnostic = .{ + .fmt = "must use 'struct' tag to refer to type '{s}'", + .kind = .@"error", +}; + +pub const must_use_union: Diagnostic = .{ + .fmt = "must use 'union' tag to refer to type '{s}'", + .kind = .@"error", +}; + +pub const must_use_enum: Diagnostic = .{ + .fmt = "must use 'enum' tag to refer to type '{s}'", + .kind = .@"error", +}; + +pub const redefinition_different_sym: Diagnostic = .{ + .fmt = "redefinition of '{s}' as different kind of symbol", + .kind = .@"error", +}; + +pub const redefinition_incompatible: Diagnostic = .{ + .fmt = "redefinition of '{s}' with a different type", + .kind = .@"error", +}; + +pub const redefinition_of_parameter: Diagnostic = .{ + .fmt = "redefinition of parameter '{s}'", + .kind = .@"error", +}; + +pub const invalid_bin_types: Diagnostic = .{ + .fmt = "invalid operands to binary expression ({qt} and {qt})", + .kind = .@"error", +}; + +pub const incompatible_vec_types: Diagnostic = .{ + .fmt = "cannot convert between vector type {qt} and vector type {qt} as implicit conversion would cause truncation", + .kind = .@"error", +}; + +pub const comparison_ptr_int: Diagnostic = .{ + .fmt = "comparison between pointer and integer ({qt} and {qt})", + .kind = .warning, + .opt = .@"pointer-integer-compare", + .extension = true, +}; + +pub const comparison_distinct_ptr: Diagnostic = .{ + .fmt = "comparison of distinct pointer types ({qt} and {qt})", + .kind = .warning, + .opt = .@"compare-distinct-pointer-types", + .extension = true, +}; + +pub const incompatible_pointers: Diagnostic = .{ + .fmt = "incompatible pointer types ({qt} and {qt})", + .kind = .@"error", +}; + +pub const invalid_argument_un: Diagnostic = .{ + .fmt = "invalid argument type {qt} to unary expression", + .kind = .@"error", +}; + +pub const incompatible_assign: Diagnostic = .{ + .fmt = "assignment to {qt} from incompatible type {qt}", + .kind = .@"error", +}; + +pub const implicit_ptr_to_int: Diagnostic = .{ + .fmt = "implicit pointer to integer conversion from {qt} to {qt}", + .kind = .warning, + .opt = .@"int-conversion", +}; + +pub const invalid_cast_to_float: Diagnostic = .{ + .fmt = "pointer cannot be cast to type {qt}", + .kind = .@"error", +}; + +pub const invalid_cast_to_pointer: Diagnostic = .{ + .fmt = "operand of type {qt} cannot be cast to a pointer type", + .kind = .@"error", +}; + +pub const invalid_cast_type: Diagnostic = .{ + .fmt = "cannot cast to non arithmetic or pointer type {qt}", + .kind = .@"error", +}; + +pub const cast_to_same_type: Diagnostic = .{ + .fmt = "C99 forbids casting nonscalar type {qt} to the same type", + .kind = .off, + .extension = true, +}; + +pub const invalid_cast_operand_type: Diagnostic = .{ + .fmt = "operand of type {qt} where arithmetic or pointer type is required", + .kind = .@"error", +}; + +pub const qual_cast: Diagnostic = .{ + .fmt = "cast to type {qt} will not preserve qualifiers", + .opt = .@"cast-qualifiers", + .kind = .warning, +}; + +pub const invalid_vec_conversion: Diagnostic = .{ + .fmt = "invalid conversion between vector type {qt} and {qt} of different size", + .kind = .@"error", +}; + +pub const invalid_vec_conversion_scalar: Diagnostic = .{ + .fmt = "invalid conversion between vector type {qt} and scalar type {qt}", + .kind = .@"error", +}; + +pub const invalid_vec_conversion_int: Diagnostic = .{ + .fmt = "invalid conversion between vector type {qt} and integer type {qt} of different size", + .kind = .@"error", +}; + +pub const invalid_index: Diagnostic = .{ + .fmt = "array subscript is not an integer", + .kind = .@"error", +}; + +pub const invalid_subscript: Diagnostic = .{ + .fmt = "subscripted value is not an array, pointer or vector", + .kind = .@"error", +}; + +pub const array_after: Diagnostic = .{ + .fmt = "array index {value} is past the end of the array", + .opt = .@"array-bounds", + .kind = .warning, +}; + +pub const array_before: Diagnostic = .{ + .fmt = "array index {value} is before the beginning of the array", + .opt = .@"array-bounds", + .kind = .warning, +}; + +pub const statement_int: Diagnostic = .{ + .fmt = "statement requires expression with integer type ({qt} invalid)", + .kind = .@"error", +}; + +pub const statement_scalar: Diagnostic = .{ + .fmt = "statement requires expression with scalar type ({qt} invalid)", + .kind = .@"error", +}; + +pub const func_should_return: Diagnostic = .{ + .fmt = "non-void function '{s}' should return a value", + .opt = .@"return-type", + .kind = .@"error", +}; + +pub const incompatible_return: Diagnostic = .{ + .fmt = "returning {qt} from a function with incompatible result type {qt}", + .kind = .@"error", +}; + +pub const incompatible_return_sign: Diagnostic = .{ + .fmt = incompatible_return.fmt ++ pointer_sign_message, + .kind = .warning, + .opt = .@"pointer-sign", +}; + +pub const implicit_int_to_ptr: Diagnostic = .{ + .fmt = "implicit integer to pointer conversion from {qt} to {qt}", + .opt = .@"int-conversion", + .kind = .warning, +}; + +pub const func_does_not_return: Diagnostic = .{ + .fmt = "non-void function '{s}' does not return a value", + .opt = .@"return-type", + .kind = .warning, +}; + +pub const void_func_returns_value: Diagnostic = .{ + .fmt = "void function '{s}' should not return a value", + .opt = .@"return-type", + .kind = .@"error", +}; + +pub const incompatible_arg: Diagnostic = .{ + .fmt = "passing {qt} to parameter of incompatible type {qt}", + .kind = .@"error", +}; + +pub const incompatible_ptr_arg: Diagnostic = .{ + .fmt = "passing {qt} to parameter of incompatible type {qt}", + .kind = .warning, + .opt = .@"incompatible-pointer-types", +}; + +pub const incompatible_ptr_arg_sign: Diagnostic = .{ + .fmt = incompatible_ptr_arg.fmt ++ pointer_sign_message, + .kind = .warning, + .opt = .@"pointer-sign", +}; + +pub const parameter_here: Diagnostic = .{ + .fmt = "passing argument to parameter here", + .kind = .note, +}; + +pub const atomic_array: Diagnostic = .{ + .fmt = "_Atomic cannot be applied to array type {qt}", + .kind = .@"error", +}; + +pub const atomic_func: Diagnostic = .{ + .fmt = "_Atomic cannot be applied to function type {qt}", + .kind = .@"error", +}; + +pub const atomic_incomplete: Diagnostic = .{ + .fmt = "_Atomic cannot be applied to incomplete type {qt}", + .kind = .@"error", +}; + +pub const atomic_atomic: Diagnostic = .{ + .fmt = "_Atomic cannot be applied to atomic type {qt}", + .kind = .@"error", +}; + +pub const atomic_complex: Diagnostic = .{ + .fmt = "_Atomic cannot be applied to complex type {qt}", + .kind = .@"error", +}; + +pub const atomic_qualified: Diagnostic = .{ + .fmt = "_Atomic cannot be applied to qualified type {qt}", + .kind = .@"error", +}; + +pub const atomic_auto: Diagnostic = .{ + .fmt = "_Atomic cannot be applied to type 'auto' in C23", + .kind = .@"error", +}; + +// pub const atomic_access: Diagnostic = .{ +// .fmt = "accessing a member of an atomic structure or union is undefined behavior", +// .opt = .@"atomic-access", +// .kind = .@"error", +// }; + +pub const addr_of_register: Diagnostic = .{ + .fmt = "address of register variable requested", + .kind = .@"error", +}; + +pub const variable_incomplete_ty: Diagnostic = .{ + .fmt = "variable has incomplete type {qt}", + .kind = .@"error", +}; + +pub const parameter_incomplete_ty: Diagnostic = .{ + .fmt = "parameter has incomplete type {qt}", + .kind = .@"error", +}; + +pub const tentative_array: Diagnostic = .{ + .fmt = "tentative array definition assumed to have one element", + .kind = .warning, +}; + +pub const deref_incomplete_ty_ptr: Diagnostic = .{ + .fmt = "dereferencing pointer to incomplete type {qt}", + .kind = .@"error", +}; + +pub const alignas_on_func: Diagnostic = .{ + .fmt = "'_Alignas' attribute only applies to variables and fields", + .kind = .@"error", +}; + +pub const alignas_on_param: Diagnostic = .{ + .fmt = "'_Alignas' attribute cannot be applied to a function parameter", + .kind = .@"error", +}; + +pub const minimum_alignment: Diagnostic = .{ + .fmt = "requested alignment is less than minimum alignment of {d}", + .kind = .@"error", +}; + +pub const maximum_alignment: Diagnostic = .{ + .fmt = "requested alignment of {value} is too large", + .kind = .@"error", +}; + +pub const negative_alignment: Diagnostic = .{ + .fmt = "requested negative alignment of {value} is invalid", + .kind = .@"error", +}; + +pub const align_ignored: Diagnostic = .{ + .fmt = "'_Alignas' attribute is ignored here", + .kind = .warning, +}; + +// pub const zero_align_ignored: Diagnostic = .{ +// .fmt = "requested alignment of zero is ignored", +// .kind = .warning, +// }; + +pub const non_pow2_align: Diagnostic = .{ + .fmt = "requested alignment is not a power of 2", + .kind = .@"error", +}; + +pub const pointer_mismatch: Diagnostic = .{ + .fmt = "pointer type mismatch ({qt} and {qt})", + .opt = .@"pointer-type-mismatch", + .kind = .warning, + .extension = true, +}; + +pub const static_assert_not_constant: Diagnostic = .{ + .fmt = "static assertion expression is not an integral constant expression", + .kind = .@"error", +}; + +pub const static_assert_missing_message: Diagnostic = .{ + .fmt = "'_Static_assert' with no message is a C23 extension", + .opt = .@"c23-extensions", + .kind = .warning, + .suppress_version = .c23, + .extension = true, +}; + +pub const pre_c23_compat: Diagnostic = .{ + .fmt = "{s} is incompatible with C standards before C23", + .kind = .off, + .suppress_unless_version = .c23, + .opt = .@"pre-c23-compat", +}; + +pub const unbound_vla: Diagnostic = .{ + .fmt = "variable length array must be bound in function definition", + .kind = .@"error", +}; + +pub const array_too_large: Diagnostic = .{ + .fmt = "array is too large", + .kind = .@"error", +}; + +pub const record_too_large: Diagnostic = .{ + .fmt = "type {qt} is too large", + .kind = .@"error", +}; + +pub const incompatible_ptr_init: Diagnostic = .{ + .fmt = "incompatible pointer types initializing {qt} from incompatible type {qt}", + .opt = .@"incompatible-pointer-types", + .kind = .warning, +}; + +pub const incompatible_ptr_init_sign: Diagnostic = .{ + .fmt = incompatible_ptr_init.fmt ++ pointer_sign_message, + .opt = .@"pointer-sign", + .kind = .warning, +}; + +pub const incompatible_ptr_assign: Diagnostic = .{ + .fmt = "incompatible pointer types assigning to {qt} from incompatible type {qt}", + .opt = .@"incompatible-pointer-types", + .kind = .warning, +}; + +pub const incompatible_ptr_assign_sign: Diagnostic = .{ + .fmt = incompatible_ptr_assign.fmt ++ pointer_sign_message, + .opt = .@"pointer-sign", + .kind = .warning, +}; + +pub const vla_init: Diagnostic = .{ + .fmt = "variable-sized object may not be initialized", + .kind = .@"error", +}; + +pub const func_init: Diagnostic = .{ + .fmt = "illegal initializer type", + .kind = .@"error", +}; + +pub const incompatible_init: Diagnostic = .{ + .fmt = "initializing {qt} from incompatible type {qt}", + .kind = .@"error", +}; + +pub const excess_scalar_init: Diagnostic = .{ + .fmt = "excess elements in scalar initializer", + .kind = .warning, + .opt = .@"excess-initializers", +}; + +pub const excess_str_init: Diagnostic = .{ + .fmt = "excess elements in string initializer", + .kind = .warning, + .opt = .@"excess-initializers", +}; + +pub const excess_struct_init: Diagnostic = .{ + .fmt = "excess elements in struct initializer", + .kind = .warning, + .opt = .@"excess-initializers", +}; + +pub const excess_union_init: Diagnostic = .{ + .fmt = "excess elements in union initializer", + .kind = .warning, + .opt = .@"excess-initializers", +}; + +pub const excess_array_init: Diagnostic = .{ + .fmt = "excess elements in array initializer", + .kind = .warning, + .opt = .@"excess-initializers", +}; + +pub const excess_vector_init: Diagnostic = .{ + .fmt = "excess elements in vector initializer", + .kind = .warning, + .opt = .@"excess-initializers", +}; + +pub const str_init_too_long: Diagnostic = .{ + .fmt = "initializer-string for char array is too long", + .opt = .@"excess-initializers", + .kind = .warning, + .extension = true, +}; + +pub const arr_init_too_long: Diagnostic = .{ + .fmt = "cannot initialize type {qt} with array of type {qt}", + .kind = .@"error", +}; + +pub const empty_initializer: Diagnostic = .{ + .fmt = "use of an empty initializer is a C23 extension", + .opt = .@"c23-extensions", + .kind = .off, + .suppress_version = .c23, + .extension = true, +}; + +pub const division_by_zero: Diagnostic = .{ + .fmt = "{s} by zero is undefined", + .kind = .warning, + .opt = .@"division-by-zero", +}; + +pub const division_by_zero_macro: Diagnostic = .{ + .fmt = "{s} by zero in preprocessor expression", + .kind = .@"error", +}; + +pub const builtin_choose_cond: Diagnostic = .{ + .fmt = "'__builtin_choose_expr' requires a constant expression", + .kind = .@"error", +}; + +pub const convertvector_arg: Diagnostic = .{ + .fmt = "{s} argument to __builtin_convertvector must be a vector type", + .kind = .@"error", +}; + +pub const convertvector_size: Diagnostic = .{ + .fmt = "first two arguments to __builtin_convertvector must have the same number of elements", + .kind = .@"error", +}; + +pub const shufflevector_arg: Diagnostic = .{ + .fmt = "{s} argument to __builtin_shufflevector must be a vector type", + .kind = .@"error", +}; + +pub const shufflevector_same_type: Diagnostic = .{ + .fmt = "first two arguments to '__builtin_shufflevector' must have the same type", + .kind = .@"error", +}; + +pub const shufflevector_negative_index: Diagnostic = .{ + .fmt = "index for __builtin_shufflevector must be positive or -1", + .kind = .@"error", +}; + +pub const shufflevector_index_too_big: Diagnostic = .{ + .fmt = "index for __builtin_shufflevector must be less than the total number of vector elements", + .kind = .@"error", +}; + +pub const alignas_unavailable: Diagnostic = .{ + .fmt = "'_Alignas' attribute requires integer constant expression", + .kind = .@"error", +}; + +pub const case_val_unavailable: Diagnostic = .{ + .fmt = "case value must be an integer constant expression", + .kind = .@"error", +}; + +pub const enum_val_unavailable: Diagnostic = .{ + .fmt = "enum value must be an integer constant expression", + .kind = .@"error", +}; + +pub const incompatible_array_init: Diagnostic = .{ + .fmt = "cannot initialize array of type {qt} with array of type {qt}", + .kind = .@"error", +}; + +pub const array_init_str: Diagnostic = .{ + .fmt = "array initializer must be an initializer list or wide string literal", + .kind = .@"error", +}; + +pub const initializer_overrides: Diagnostic = .{ + .fmt = "initializer overrides previous initialization", + .opt = .@"initializer-overrides", + .kind = .warning, +}; + +pub const previous_initializer: Diagnostic = .{ + .fmt = "previous initialization", + .kind = .note, +}; + +pub const invalid_array_designator: Diagnostic = .{ + .fmt = "array designator used for non-array type {qt}", + .kind = .@"error", +}; + +pub const negative_array_designator: Diagnostic = .{ + .fmt = "array designator value {value} is negative", + .kind = .@"error", +}; + +pub const oob_array_designator: Diagnostic = .{ + .fmt = "array designator index {value} exceeds array bounds", + .kind = .@"error", +}; + +pub const invalid_field_designator: Diagnostic = .{ + .fmt = "field designator used for non-record type {qt}", + .kind = .@"error", +}; + +pub const no_such_field_designator: Diagnostic = .{ + .fmt = "record type has no field named '{s}'", + .kind = .@"error", +}; + +pub const empty_aggregate_init_braces: Diagnostic = .{ + .fmt = "initializer for aggregate with no elements requires explicit braces", + .kind = .@"error", +}; + +pub const ptr_init_discards_quals: Diagnostic = .{ + .fmt = "initializing {qt} from incompatible type {qt} discards qualifiers", + .kind = .warning, + .opt = .@"incompatible-pointer-types-discards-qualifiers", +}; + +pub const ptr_assign_discards_quals: Diagnostic = .{ + .fmt = "assigning to {qt} from incompatible type {qt} discards qualifiers", + .kind = .warning, + .opt = .@"incompatible-pointer-types-discards-qualifiers", +}; + +pub const ptr_ret_discards_quals: Diagnostic = .{ + .fmt = "returning {qt} from a function with incompatible result type {qt} discards qualifiers", + .kind = .warning, + .opt = .@"incompatible-pointer-types-discards-qualifiers", +}; + +pub const ptr_arg_discards_quals: Diagnostic = .{ + .fmt = "passing {qt} to parameter of incompatible type {qt} discards qualifiers", + .kind = .warning, + .opt = .@"incompatible-pointer-types-discards-qualifiers", +}; + +pub const unknown_attribute: Diagnostic = .{ + .fmt = "unknown attribute '{s}' ignored", + .kind = .warning, + .opt = .@"unknown-attributes", +}; + +pub const ignored_attribute: Diagnostic = .{ + .fmt = "attribute '{s}' ignored on {s}", + .kind = .warning, + .opt = .@"ignored-attributes", +}; + +pub const invalid_fallthrough: Diagnostic = .{ + .fmt = "fallthrough annotation does not directly precede switch label", + .kind = .@"error", +}; + +pub const cannot_apply_attribute_to_statement: Diagnostic = .{ + .fmt = "'{s}' attribute cannot be applied to a statement", + .kind = .@"error", +}; + +pub const gnu_label_as_value: Diagnostic = .{ + .fmt = "use of GNU address-of-label extension", + .opt = .@"gnu-label-as-value", + .kind = .off, + .extension = true, +}; + +pub const expected_record_ty: Diagnostic = .{ + .fmt = "member reference base type {qt} is not a structure or union", + .kind = .@"error", +}; + +pub const member_expr_not_ptr: Diagnostic = .{ + .fmt = "member reference type {qt} is not a pointer; did you mean to use '.'?", + .kind = .@"error", +}; + +pub const member_expr_ptr: Diagnostic = .{ + .fmt = "member reference type {qt} is a pointer; did you mean to use '->'?", + .kind = .@"error", +}; + +pub const member_expr_atomic: Diagnostic = .{ + .fmt = "accessing a member of atomic type {qt} is undefined behavior", + .kind = .@"error", +}; + +pub const no_such_member: Diagnostic = .{ + .fmt = "no member named '{s}' in {qt}", + .kind = .@"error", +}; + +pub const invalid_computed_goto: Diagnostic = .{ + .fmt = "computed goto in function with no address-of-label expressions", + .kind = .@"error", +}; + +pub const empty_translation_unit: Diagnostic = .{ + .fmt = "ISO C requires a translation unit to contain at least one declaration", + .opt = .@"empty-translation-unit", + .kind = .off, + .extension = true, +}; + +pub const omitting_parameter_name: Diagnostic = .{ + .fmt = "omitting the parameter name in a function definition is a C23 extension", + .opt = .@"c23-extensions", + .kind = .warning, + .suppress_version = .c23, + .extension = true, +}; + +pub const non_int_bitfield: Diagnostic = .{ + .fmt = "bit-field has non-integer type {qt}", + .kind = .@"error", +}; + +pub const negative_bitwidth: Diagnostic = .{ + .fmt = "bit-field has negative width ({value})", + .kind = .@"error", +}; + +pub const zero_width_named_field: Diagnostic = .{ + .fmt = "named bit-field has zero width", + .kind = .@"error", +}; + +pub const bitfield_too_big: Diagnostic = .{ + .fmt = "width of bit-field exceeds width of its type", + .kind = .@"error", +}; + +pub const invalid_utf8: Diagnostic = .{ + .fmt = "source file is not valid UTF-8", + .kind = .@"error", +}; + +pub const implicitly_unsigned_literal: Diagnostic = .{ + .fmt = "integer literal is too large to be represented in a signed integer type, interpreting as unsigned", + .opt = .@"implicitly-unsigned-literal", + .kind = .warning, + .extension = true, +}; + +pub const invalid_preproc_operator: Diagnostic = .{ + .fmt = "token is not a valid binary operator in a preprocessor subexpression", + .kind = .@"error", +}; + +pub const c99_compat: Diagnostic = .{ + .fmt = "using this character in an identifier is incompatible with C99", + .kind = .off, + .opt = .@"c99-compat", +}; + +pub const unexpected_character: Diagnostic = .{ + .fmt = "unexpected character ", + .kind = .@"error", +}; + +pub const invalid_identifier_start_char: Diagnostic = .{ + .fmt = "character not allowed at the start of an identifier", + .kind = .@"error", +}; + +pub const unicode_zero_width: Diagnostic = .{ + .fmt = "identifier contains Unicode character that is invisible in some environments", + .kind = .warning, + .opt = .@"unicode-homoglyph", +}; + +pub const unicode_homoglyph: Diagnostic = .{ + .fmt = "treating Unicode character as identifier character rather than as '{s}' symbol", + .kind = .warning, + .opt = .@"unicode-homoglyph", +}; + +pub const meaningless_asm_qual: Diagnostic = .{ + .fmt = "meaningless '{s}' on assembly outside function", + .kind = .@"error", +}; + +pub const duplicate_asm_qual: Diagnostic = .{ + .fmt = "duplicate asm qualifier '{s}'", + .kind = .@"error", +}; + +pub const invalid_asm_str: Diagnostic = .{ + .fmt = "cannot use {s} string literal in assembly", + .kind = .@"error", +}; + +pub const dollar_in_identifier_extension: Diagnostic = .{ + .fmt = "'$' in identifier", + .opt = .@"dollar-in-identifier-extension", + .kind = .off, + .extension = true, +}; + +pub const dollars_in_identifiers: Diagnostic = .{ + .fmt = "illegal character '$' in identifier", + .kind = .@"error", +}; + +pub const predefined_top_level: Diagnostic = .{ + .fmt = "predefined identifier is only valid inside function", + .opt = .@"predefined-identifier-outside-function", + .kind = .warning, +}; + +pub const incompatible_va_arg: Diagnostic = .{ + .fmt = "first argument to va_arg, is of type {qt} and not 'va_list'", + .kind = .@"error", +}; + +pub const too_many_scalar_init_braces: Diagnostic = .{ + .fmt = "too many braces around scalar initializer", + .opt = .@"many-braces-around-scalar-init", + .kind = .warning, + .extension = true, +}; + +// pub const uninitialized_in_own_init: Diagnostic = .{ +// .fmt = "variable '{s}' is uninitialized when used within its own initialization", +// .opt = .uninitialized, +// .kind = .off, +// }; + +pub const gnu_statement_expression: Diagnostic = .{ + .fmt = "use of GNU statement expression extension", + .opt = .@"gnu-statement-expression", + .kind = .off, + .extension = true, +}; + +pub const stmt_expr_not_allowed_file_scope: Diagnostic = .{ + .fmt = "statement expression not allowed at file scope", + .kind = .@"error", +}; + +pub const gnu_imaginary_constant: Diagnostic = .{ + .fmt = "imaginary constants are a GNU extension", + .opt = .@"gnu-imaginary-constant", + .kind = .off, + .extension = true, +}; + +pub const plain_complex: Diagnostic = .{ + .fmt = "plain '_Complex' requires a type specifier; assuming '_Complex double'", + .kind = .warning, + .extension = true, +}; + +pub const complex_int: Diagnostic = .{ + .fmt = "complex integer types are a GNU extension", + .opt = .@"gnu-complex-integer", + .kind = .off, + .extension = true, +}; + +pub const qual_on_ret_type: Diagnostic = .{ + .fmt = "'{s}' type qualifier on return type has no effect", + .opt = .@"ignored-qualifiers", + .kind = .off, +}; + +pub const extra_semi: Diagnostic = .{ + .fmt = "extra ';' outside of a function", + .opt = .@"extra-semi", + .kind = .off, +}; + +pub const func_field: Diagnostic = .{ + .fmt = "field declared as a function", + .kind = .@"error", +}; + +pub const expected_member_name: Diagnostic = .{ + .fmt = "expected member name after declarator", + .kind = .@"error", +}; + +pub const vla_field: Diagnostic = .{ + .fmt = "variable length array fields extension is not supported", + .kind = .@"error", +}; + +pub const field_incomplete_ty: Diagnostic = .{ + .fmt = "field has incomplete type {qt}", + .kind = .@"error", +}; + +pub const flexible_in_union: Diagnostic = .{ + .fmt = "flexible array member in union is not allowed", + .kind = .@"error", +}; + +pub const flexible_in_union_msvc: Diagnostic = .{ + .fmt = "flexible array member in union is a Microsoft extension", + .kind = .off, + .opt = .@"microsoft-flexible-array", + .extension = true, +}; + +pub const flexible_non_final: Diagnostic = .{ + .fmt = "flexible array member is not at the end of struct", + .kind = .@"error", +}; + +pub const flexible_in_empty: Diagnostic = .{ + .fmt = "flexible array member in otherwise empty struct", + .kind = .@"error", +}; + +pub const flexible_in_empty_msvc: Diagnostic = .{ + .fmt = "flexible array member in otherwise empty struct is a Microsoft extension", + .kind = .off, + .opt = .@"microsoft-flexible-array", + .extension = true, +}; + +pub const anonymous_struct: Diagnostic = .{ + .fmt = "anonymous structs are a Microsoft extension", + .kind = .warning, + .opt = .@"microsoft-anon-tag", + .extension = true, +}; + +pub const duplicate_member: Diagnostic = .{ + .fmt = "duplicate member '{s}'", + .kind = .@"error", +}; + +pub const binary_integer_literal: Diagnostic = .{ + .fmt = "binary integer literals are a C23 extension", + .opt = .@"c23-extensions", + .kind = .off, + .suppress_version = .c23, + .extension = true, +}; + +pub const builtin_must_be_called: Diagnostic = .{ + .fmt = "builtin function must be directly called", + .kind = .@"error", +}; + +pub const va_start_not_in_func: Diagnostic = .{ + .fmt = "'va_start' cannot be used outside a function", + .kind = .@"error", +}; + +pub const va_start_fixed_args: Diagnostic = .{ + .fmt = "'va_start' used in a function with fixed args", + .kind = .@"error", +}; + +pub const va_start_not_last_param: Diagnostic = .{ + .fmt = "second argument to 'va_start' is not the last named parameter", + .opt = .varargs, + .kind = .warning, +}; + +pub const attribute_not_enough_args: Diagnostic = .{ + .fmt = "'{s}' attribute takes at least {d} argument(s)", + .kind = .@"error", +}; + +pub const attribute_too_many_args: Diagnostic = .{ + .fmt = "'{s}' attribute takes at most {d} argument(s)", + .kind = .@"error", +}; + +pub const attribute_arg_invalid: Diagnostic = .{ + .fmt = "attribute argument is invalid, expected {s} but got {s}", + .kind = .@"error", +}; + +pub const unknown_attr_enum: Diagnostic = .{ + .fmt = "unknown `{s}` argument. Possible values are: {s}", + .kind = .warning, + .opt = .@"ignored-attributes", +}; + +pub const attribute_requires_identifier: Diagnostic = .{ + .fmt = "'{s}' attribute requires an identifier", + .kind = .@"error", +}; + +pub const attribute_int_out_of_range: Diagnostic = .{ + .fmt = "attribute value '{value}' out of range", + .kind = .@"error", +}; + +pub const declspec_not_enabled: Diagnostic = .{ + .fmt = "'__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes", + .kind = .@"error", +}; + +pub const declspec_attr_not_supported: Diagnostic = .{ + .fmt = "__declspec attribute '{s}' is not supported", + .opt = .@"ignored-attributes", + .kind = .warning, +}; + +pub const deprecated_declarations: Diagnostic = .{ + .fmt = "'{s}' is deprecated{s}{s}", + .opt = .@"deprecated-declarations", + .kind = .warning, +}; + +pub const deprecated_note: Diagnostic = .{ + .fmt = "'{s}' has been explicitly marked deprecated here", + .opt = .@"deprecated-declarations", + .kind = .note, +}; + +pub const unavailable: Diagnostic = .{ + .fmt = "'{s}' is unavailable{s}{s}", + .kind = .@"error", +}; + +pub const unavailable_note: Diagnostic = .{ + .fmt = "'{s}' has been explicitly marked unavailable here", + .kind = .note, +}; + +pub const warning_attribute: Diagnostic = .{ + .fmt = "call to '{s}' declared with attribute warning: {s}", + .kind = .warning, + .opt = .@"attribute-warning", +}; + +pub const error_attribute: Diagnostic = .{ + .fmt = "call to '{s}' declared with attribute error: {s}", + .kind = .@"error", +}; + +pub const ignored_record_attr: Diagnostic = .{ + .fmt = "attribute '{s}' is ignored, place it after \"{s}\" to apply attribute to type declaration", + .kind = .warning, + .opt = .@"ignored-attributes", +}; + +pub const array_size_non_int: Diagnostic = .{ + .fmt = "size of array has non-integer type {qt}", + .kind = .@"error", +}; + +pub const cast_to_smaller_int: Diagnostic = .{ + .fmt = "cast to smaller integer type {qt} from {qt}", + .kind = .warning, + .opt = .@"pointer-to-int-cast", +}; + +pub const gnu_switch_range: Diagnostic = .{ + .fmt = "use of GNU case range extension", + .opt = .@"gnu-case-range", + .kind = .off, + .extension = true, +}; + +pub const empty_case_range: Diagnostic = .{ + .fmt = "empty case range specified", + .kind = .warning, +}; + +pub const vla: Diagnostic = .{ + .fmt = "variable length array used", + .kind = .off, + .opt = .vla, +}; + +pub const int_value_changed: Diagnostic = .{ + .fmt = "implicit conversion from {qt} to {qt} changes {s}value from {value} to {value}", + .kind = .warning, + .opt = .@"constant-conversion", +}; + +pub const sign_conversion: Diagnostic = .{ + .fmt = "implicit conversion changes signedness: {qt} to {qt}", + .kind = .off, + .opt = .@"sign-conversion", +}; + +pub const float_overflow_conversion: Diagnostic = .{ + .fmt = "implicit conversion of non-finite value from {qt} to {qt} is undefined", + .kind = .off, + .opt = .@"float-overflow-conversion", +}; + +pub const float_out_of_range: Diagnostic = .{ + .fmt = "implicit conversion of out of range value from {qt} to {qt} is undefined", + .kind = .warning, + .opt = .@"literal-conversion", +}; + +pub const float_zero_conversion: Diagnostic = .{ + .fmt = "implicit conversion from {qt} to {qt} changes {s}value from {value} to {value}", + .kind = .off, + .opt = .@"float-zero-conversion", +}; + +pub const float_value_changed: Diagnostic = .{ + .fmt = "implicit conversion from {qt} to {qt} changes {s}value from {value} to {value}", + .kind = .warning, + .opt = .@"float-conversion", +}; + +pub const float_to_int: Diagnostic = .{ + .fmt = "implicit conversion turns floating-point number into integer: {qt} to {qt}", + .kind = .off, + .opt = .@"literal-conversion", +}; + +pub const const_decl_folded: Diagnostic = .{ + .fmt = "expression is not an integer constant expression; folding it to a constant is a GNU extension", + .kind = .off, + .opt = .@"gnu-folding-constant", + .extension = true, +}; + +pub const const_decl_folded_vla: Diagnostic = .{ + .fmt = "variable length array folded to constant array as an extension", + .kind = .off, + .opt = .@"gnu-folding-constant", + .extension = true, +}; + +pub const redefinition_of_typedef: Diagnostic = .{ + .fmt = "typedef redefinition with different types ({qt} vs {qt})", + .kind = .@"error", +}; + +pub const offsetof_ty: Diagnostic = .{ + .fmt = "offsetof requires struct or union type, {qt} invalid", + .kind = .@"error", +}; + +pub const offsetof_incomplete: Diagnostic = .{ + .fmt = "offsetof of incomplete type {qt}", + .kind = .@"error", +}; + +pub const offsetof_array: Diagnostic = .{ + .fmt = "offsetof requires array type, {qt} invalid", + .kind = .@"error", +}; + +pub const cond_expr_type: Diagnostic = .{ + .fmt = "used type {qt} where arithmetic or pointer type is required", + .kind = .@"error", +}; + +pub const enumerator_too_small: Diagnostic = .{ + .fmt = "ISO C restricts enumerator values to range of 'int' ({value} is too small)", + .kind = .off, + .extension = true, +}; + +pub const enumerator_too_large: Diagnostic = .{ + .fmt = "ISO C restricts enumerator values to range of 'int' ({value} is too large)", + .kind = .off, + .extension = true, +}; + +pub const enumerator_overflow: Diagnostic = .{ + .fmt = "overflow in enumeration value", + .kind = .warning, +}; + +pub const enum_not_representable: Diagnostic = .{ + .fmt = "incremented enumerator value {s} is not representable in the largest integer type", + .kind = .warning, + .opt = .@"enum-too-large", + .extension = true, +}; + +pub const enum_too_large: Diagnostic = .{ + .fmt = "enumeration values exceed range of largest integer", + .kind = .warning, + .opt = .@"enum-too-large", + .extension = true, +}; + +pub const enum_fixed: Diagnostic = .{ + .fmt = "enumeration types with a fixed underlying type are a Clang extension", + .kind = .off, + .opt = .@"fixed-enum-extension", + .extension = true, +}; + +pub const enum_prev_nonfixed: Diagnostic = .{ + .fmt = "enumeration previously declared with nonfixed underlying type", + .kind = .@"error", +}; + +pub const enum_prev_fixed: Diagnostic = .{ + .fmt = "enumeration previously declared with fixed underlying type", + .kind = .@"error", +}; + +pub const enum_different_explicit_ty: Diagnostic = .{ + .fmt = "enumeration redeclared with different underlying type {qt} (was {qt})", + .kind = .@"error", +}; + +pub const enum_not_representable_fixed: Diagnostic = .{ + .fmt = "enumerator value is not representable in the underlying type {qt}", + .kind = .@"error", +}; + +pub const transparent_union_wrong_type: Diagnostic = .{ + .fmt = "'transparent_union' attribute only applies to unions", + .opt = .@"ignored-attributes", + .kind = .warning, +}; + +pub const transparent_union_one_field: Diagnostic = .{ + .fmt = "transparent union definition must contain at least one field; transparent_union attribute ignored", + .opt = .@"ignored-attributes", + .kind = .warning, +}; + +pub const transparent_union_size: Diagnostic = .{ + .fmt = "size of field '{s}' ({d} bits) does not match the size of the first field in transparent union; transparent_union attribute ignored", + .kind = .warning, + .opt = .@"ignored-attributes", +}; + +pub const transparent_union_size_note: Diagnostic = .{ + .fmt = "size of first field is {d}", + .kind = .note, +}; + +pub const designated_init_invalid: Diagnostic = .{ + .fmt = "'designated_init' attribute is only valid on 'struct' type'", + .kind = .@"error", +}; + +pub const designated_init_needed: Diagnostic = .{ + .fmt = "positional initialization of field in 'struct' declared with 'designated_init' attribute", + .opt = .@"designated-init", + .kind = .warning, +}; + +pub const ignore_common: Diagnostic = .{ + .fmt = "ignoring attribute 'common' because it conflicts with attribute 'nocommon'", + .opt = .@"ignored-attributes", + .kind = .warning, +}; + +pub const ignore_nocommon: Diagnostic = .{ + .fmt = "ignoring attribute 'nocommon' because it conflicts with attribute 'common'", + .opt = .@"ignored-attributes", + .kind = .warning, +}; + +pub const non_string_ignored: Diagnostic = .{ + .fmt = "'nonstring' attribute ignored on objects of type {qt}", + .opt = .@"ignored-attributes", + .kind = .warning, +}; + +pub const local_variable_attribute: Diagnostic = .{ + .fmt = "'{s}' attribute only applies to local variables", + .opt = .@"ignored-attributes", + .kind = .warning, +}; + +pub const ignore_cold: Diagnostic = .{ + .fmt = "ignoring attribute 'cold' because it conflicts with attribute 'hot'", + .opt = .@"ignored-attributes", + .kind = .warning, +}; + +pub const ignore_hot: Diagnostic = .{ + .fmt = "ignoring attribute 'hot' because it conflicts with attribute 'cold'", + .opt = .@"ignored-attributes", + .kind = .warning, +}; + +pub const ignore_noinline: Diagnostic = .{ + .fmt = "ignoring attribute 'noinline' because it conflicts with attribute 'always_inline'", + .opt = .@"ignored-attributes", + .kind = .warning, +}; + +pub const ignore_always_inline: Diagnostic = .{ + .fmt = "ignoring attribute 'always_inline' because it conflicts with attribute 'noinline'", + .opt = .@"ignored-attributes", + .kind = .warning, +}; + +pub const invalid_noreturn: Diagnostic = .{ + .fmt = "function '{s}' declared 'noreturn' should not return", + .kind = .warning, + .opt = .@"invalid-noreturn", +}; + +pub const nodiscard_unused: Diagnostic = .{ + .fmt = "ignoring return value of '{s}', declared with 'nodiscard' attribute", + .kind = .warning, + .opt = .@"unused-result", +}; + +pub const warn_unused_result: Diagnostic = .{ + .fmt = "ignoring return value of '{s}', declared with 'warn_unused_result' attribute", + .kind = .warning, + .opt = .@"unused-result", +}; + +pub const builtin_unused: Diagnostic = .{ + .fmt = "ignoring return value of function declared with {s} attribute", + .kind = .warning, + .opt = .@"unused-value", +}; + +pub const unused_value: Diagnostic = .{ + .fmt = "expression result unused", + .kind = .warning, + .opt = .@"unused-value", +}; + +pub const invalid_vec_elem_ty: Diagnostic = .{ + .fmt = "invalid vector element type {qt}", + .kind = .@"error", +}; + +pub const bit_int_vec_too_small: Diagnostic = .{ + .fmt = "'_BitInt' vector element width must be at least as wide as 'CHAR_BIT'", + .kind = .@"error", +}; + +pub const bit_int_vec_not_pow2: Diagnostic = .{ + .fmt = "'_BitInt' vector element width must be a power of 2", + .kind = .@"error", +}; + +pub const vec_size_not_multiple: Diagnostic = .{ + .fmt = "vector size not an integral multiple of component size", + .kind = .@"error", +}; + +pub const invalid_imag: Diagnostic = .{ + .fmt = "invalid type {qt} to __imag operator", + .kind = .@"error", +}; + +pub const invalid_real: Diagnostic = .{ + .fmt = "invalid type {qt} to __real operator", + .kind = .@"error", +}; + +pub const zero_length_array: Diagnostic = .{ + .fmt = "zero size arrays are an extension", + .kind = .off, + .opt = .@"zero-length-array", + .extension = true, +}; + +pub const old_style_flexible_struct: Diagnostic = .{ + .fmt = "array index {value} is past the end of the array", + .kind = .off, + .opt = .@"old-style-flexible-struct", +}; + +pub const main_return_type: Diagnostic = .{ + .fmt = "return type of 'main' is not 'int'", + .kind = .warning, + .opt = .@"main-return-type", + .extension = true, +}; + +pub const invalid_int_suffix: Diagnostic = .{ + .fmt = "invalid suffix '{s}' on integer constant", + .kind = .@"error", +}; + +pub const invalid_float_suffix: Diagnostic = .{ + .fmt = "invalid suffix '{s}' on floating constant", + .kind = .@"error", +}; + +pub const invalid_octal_digit: Diagnostic = .{ + .fmt = "invalid digit '{c}' in octal constant", + .kind = .@"error", +}; + +pub const invalid_binary_digit: Diagnostic = .{ + .fmt = "invalid digit '{c}' in binary constant", + .kind = .@"error", +}; + +pub const exponent_has_no_digits: Diagnostic = .{ + .fmt = "exponent has no digits", + .kind = .@"error", +}; + +pub const hex_floating_constant_requires_exponent: Diagnostic = .{ + .fmt = "hexadecimal floating constant requires an exponent", + .kind = .@"error", +}; + +pub const sizeof_returns_zero: Diagnostic = .{ + .fmt = "sizeof returns 0", + .kind = .warning, +}; + +pub const declspec_not_allowed_after_declarator: Diagnostic = .{ + .fmt = "'declspec' attribute not allowed after declarator", + .kind = .@"error", +}; + +pub const declarator_name_tok: Diagnostic = .{ + .fmt = "this declarator", + .kind = .note, +}; + +pub const type_not_supported_on_target: Diagnostic = .{ + .fmt = "{s} is not supported on this target", + .kind = .@"error", +}; + +pub const bit_int: Diagnostic = .{ + .fmt = "'_BitInt' in C17 and earlier is a Clang extension", + .kind = .off, + .opt = .@"bit-int-extension", + .suppress_version = .c23, + .extension = true, +}; + +pub const unsigned_bit_int_too_small: Diagnostic = .{ + .fmt = "{s}unsigned _BitInt must have a bit size of at least 1", + .kind = .@"error", +}; + +pub const signed_bit_int_too_small: Diagnostic = .{ + .fmt = "{s}signed _BitInt must have a bit size of at least 2", + .kind = .@"error", +}; + +pub const unsigned_bit_int_too_big: Diagnostic = .{ + .fmt = "{s}unsigned _BitInt of bit sizes greater than " ++ std.fmt.comptimePrint("{d}", .{Compilation.bit_int_max_bits}) ++ " not supported", + .kind = .@"error", +}; + +pub const signed_bit_int_too_big: Diagnostic = .{ + .fmt = "{s}signed _BitInt of bit sizes greater than " ++ std.fmt.comptimePrint("{d}", .{Compilation.bit_int_max_bits}) ++ " not supported", + .kind = .@"error", +}; + +pub const ptr_arithmetic_incomplete: Diagnostic = .{ + .fmt = "arithmetic on a pointer to an incomplete type {qt}", + .kind = .@"error", +}; + +pub const callconv_not_supported: Diagnostic = .{ + .fmt = "'{s}' calling convention is not supported for this target", + .kind = .warning, + .opt = .@"ignored-attributes", +}; + +pub const callconv_non_func: Diagnostic = .{ + .fmt = "'{s}' only applies to function types; type here is {qt}", + .kind = .warning, + .opt = .@"ignored-attributes", +}; + +pub const pointer_arith_void: Diagnostic = .{ + .fmt = "invalid application of '{s}' to a void type", + .kind = .off, + .opt = .@"pointer-arith", + .extension = true, +}; + +pub const sizeof_array_arg: Diagnostic = .{ + .fmt = "sizeof on array function parameter will return size of {qt} instead of {qt}", + .kind = .warning, + .opt = .@"sizeof-array-argument", +}; + +pub const array_address_to_bool: Diagnostic = .{ + .fmt = "address of array '{s}' will always evaluate to 'true'", + .kind = .warning, + .opt = .@"pointer-bool-conversion", +}; + +pub const string_literal_to_bool: Diagnostic = .{ + .fmt = "implicit conversion turns string literal into bool: {qt} to {qt}", + .kind = .off, + .opt = .@"string-conversion", +}; + +// pub const constant_expression_conversion_not_allowed: Diagnostic = .{ +// .fmt = "this conversion is not allowed in a constant expression", +// .kind = .note, +// }; + +pub const invalid_object_cast: Diagnostic = .{ + .fmt = "cannot cast an object of type {qt} to {qt}", + .kind = .@"error", +}; + +pub const suggest_pointer_for_invalid_fp16: Diagnostic = .{ + .fmt = "{s} cannot have __fp16 type; did you forget * ?", + .kind = .@"error", +}; + +pub const bitint_suffix: Diagnostic = .{ + .fmt = "'_BitInt' suffix for literals is a C23 extension", + .opt = .@"c23-extensions", + .kind = .warning, + .suppress_version = .c23, + .extension = true, +}; + +pub const auto_type_extension: Diagnostic = .{ + .fmt = "'__auto_type' is a GNU extension", + .opt = .@"gnu-auto-type", + .kind = .off, + .extension = true, +}; + +pub const gnu_pointer_arith: Diagnostic = .{ + .fmt = "arithmetic on pointers to void is a GNU extension", + .opt = .@"gnu-pointer-arith", + .kind = .off, + .extension = true, +}; + +pub const auto_type_not_allowed: Diagnostic = .{ + .fmt = "'__auto_type' not allowed in {s}", + .kind = .@"error", +}; + +pub const auto_type_requires_initializer: Diagnostic = .{ + .fmt = "declaration of variable '{s}' with deduced type requires an initializer", + .kind = .@"error", +}; + +pub const auto_type_requires_single_declarator: Diagnostic = .{ + .fmt = "'__auto_type' may only be used with a single declarator", + .kind = .@"error", +}; + +pub const auto_type_requires_plain_declarator: Diagnostic = .{ + .fmt = "'__auto_type' requires a plain identifier as declarator", + .kind = .@"error", +}; + +pub const auto_type_from_bitfield: Diagnostic = .{ + .fmt = "cannot use bit-field as '__auto_type' initializer", + .kind = .@"error", +}; + +pub const auto_type_array: Diagnostic = .{ + .fmt = "'{s}' declared as array of '__auto_type'", + .kind = .@"error", +}; + +pub const auto_type_with_init_list: Diagnostic = .{ + .fmt = "cannot use '__auto_type' with initializer list", + .kind = .@"error", +}; + +pub const missing_semicolon: Diagnostic = .{ + .fmt = "expected ';' at end of declaration list", + .kind = .warning, + .extension = true, +}; + +pub const tentative_definition_incomplete: Diagnostic = .{ + .fmt = "tentative definition has type {qt} that is never completed", + .kind = .@"error", +}; + +pub const forward_declaration_here: Diagnostic = .{ + .fmt = "forward declaration of {qt}", + .kind = .note, +}; + +pub const gnu_union_cast: Diagnostic = .{ + .fmt = "cast to union type is a GNU extension", + .opt = .@"gnu-union-cast", + .kind = .off, + .extension = true, +}; + +pub const invalid_union_cast: Diagnostic = .{ + .fmt = "cast to union type from type {qt} not present in union", + .kind = .@"error", +}; + +pub const cast_to_incomplete_type: Diagnostic = .{ + .fmt = "cast to incomplete type {qt}", + .kind = .@"error", +}; + +pub const gnu_asm_disabled: Diagnostic = .{ + .fmt = "GNU-style inline assembly is disabled", + .kind = .@"error", +}; + +pub const extension_token_used: Diagnostic = .{ + .fmt = "extension used", + .kind = .off, + .opt = .@"language-extension-token", + .extension = true, +}; + +pub const complex_component_init: Diagnostic = .{ + .fmt = "complex initialization specifying real and imaginary components is an extension", + .opt = .@"complex-component-init", + .kind = .off, + .extension = true, +}; + +pub const complex_prefix_postfix_op: Diagnostic = .{ + .fmt = "ISO C does not support '++'/'--' on complex type {qt}", + .kind = .off, + .extension = true, +}; + +pub const not_floating_type: Diagnostic = .{ + .fmt = "argument type {qt} is not a real floating point type", + .kind = .@"error", +}; + +pub const argument_types_differ: Diagnostic = .{ + .fmt = "arguments are of different types ({qt} vs {qt})", + .kind = .@"error", +}; + +pub const attribute_requires_string: Diagnostic = .{ + .fmt = "attribute '{s}' requires an ordinary string", + .kind = .@"error", +}; + +pub const empty_char_literal_error: Diagnostic = .{ + .fmt = "empty character constant", + .kind = .@"error", +}; + +pub const unterminated_char_literal_error: Diagnostic = .{ + .fmt = "missing terminating ' character", + .kind = .@"error", +}; + +// pub const def_no_proto_deprecated: Diagnostic = .{ +// .fmt = "a function definition without a prototype is deprecated in all versions of C and is not supported in C23", +// .kind = .warning, +// .opt = .@"deprecated-non-prototype", +// }; + +pub const passing_args_to_kr: Diagnostic = .{ + .fmt = "passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C23", + .kind = .warning, + .opt = .@"deprecated-non-prototype", +}; + +pub const unknown_type_name: Diagnostic = .{ + .fmt = "unknown type name '{s}'", + .kind = .@"error", +}; + +pub const label_compound_end: Diagnostic = .{ + .fmt = "label at end of compound statement is a C23 extension", + .opt = .@"c23-extensions", + .kind = .warning, + .suppress_version = .c23, + .extension = true, +}; + +pub const u8_char_lit: Diagnostic = .{ + .fmt = "UTF-8 character literal is a C23 extension", + .opt = .@"c23-extensions", + .kind = .warning, + .suppress_version = .c23, + .extension = true, +}; + +pub const invalid_compound_literal_storage_class: Diagnostic = .{ + .fmt = "compound literal cannot have {s} storage class", + .kind = .@"error", +}; + +pub const identifier_not_normalized: Diagnostic = .{ + .fmt = "'{normalized}' is not in NFC", + .kind = .warning, + .opt = .normalized, +}; + +pub const c23_auto_single_declarator: Diagnostic = .{ + .fmt = "'auto' can only be used with a single declarator", + .kind = .@"error", +}; + +pub const c23_auto_requires_initializer: Diagnostic = .{ + .fmt = "'auto' requires an initializer", + .kind = .@"error", +}; + +pub const c23_auto_not_allowed: Diagnostic = .{ + .fmt = "'auto' not allowed in {s}", + .kind = .@"error", +}; + +pub const c23_auto_with_init_list: Diagnostic = .{ + .fmt = "cannot use 'auto' with array", + .kind = .@"error", +}; + +pub const c23_auto_array: Diagnostic = .{ + .fmt = "'{s}' declared as array of 'auto'", + .kind = .@"error", +}; + +pub const negative_shift_count: Diagnostic = .{ + .fmt = "shift count is negative", + .opt = .@"shift-count-negative", + .kind = .warning, +}; + +pub const too_big_shift_count: Diagnostic = .{ + .fmt = "shift count >= width of type", + .opt = .@"shift-count-overflow", + .kind = .warning, +}; + +pub const complex_conj: Diagnostic = .{ + .fmt = "ISO C does not support '~' for complex conjugation of {qt}", + .kind = .off, + .extension = true, +}; + +pub const overflow_builtin_requires_int: Diagnostic = .{ + .fmt = "operand argument to overflow builtin must be an integer ({qt} invalid)", + .kind = .@"error", +}; + +pub const overflow_result_requires_ptr: Diagnostic = .{ + .fmt = "result argument to overflow builtin must be a pointer to a non-const integer ({qt} invalid)", + .kind = .@"error", +}; + +pub const attribute_todo: Diagnostic = .{ + .fmt = "TODO: implement '{s}' attribute for {s}", + .kind = .warning, + .opt = .@"attribute-todo", +}; + +pub const invalid_type_underlying_enum: Diagnostic = .{ + .fmt = "non-integral type {qt} is an invalid underlying type", + .kind = .@"error", +}; + +pub const auto_type_self_initialized: Diagnostic = .{ + .fmt = "variable '{s}' declared with deduced type '__auto_type' cannot appear in its own initializer", + .kind = .@"error", +}; + +// pub const non_constant_initializer: Diagnostic = .{ +// .fmt = "initializer element is not a compile-time constant", +// .kind = .@"error", +// }; + +pub const constexpr_requires_const: Diagnostic = .{ + .fmt = "constexpr variable must be initialized by a constant expression", + .kind = .@"error", +}; + +pub const subtract_pointers_zero_elem_size: Diagnostic = .{ + .fmt = "subtraction of pointers to type {qt} of zero size has undefined behavior", + .kind = .warning, + .opt = .@"pointer-arith", +}; + +pub const packed_member_address: Diagnostic = .{ + .fmt = "taking address of packed member '{s}' of class or structure '{s}' may result in an unaligned pointer value", + .kind = .warning, + .opt = .@"address-of-packed-member", +}; + +pub const attribute_param_out_of_bounds: Diagnostic = .{ + .fmt = "'{s}' attribute parameter {d} is out of bounds", + .kind = .@"error", +}; + +pub const alloc_align_requires_ptr_return: Diagnostic = .{ + .fmt = "'alloc_align' attribute only applies to return values that are pointers", + .opt = .@"ignored-attributes", + .kind = .warning, +}; + +pub const alloc_align_required_int_param: Diagnostic = .{ + .fmt = "'alloc_align' attribute argument may only refer to a function parameter of integer type", + .kind = .@"error", +}; + +pub const gnu_missing_eq_designator: Diagnostic = .{ + .fmt = "use of GNU 'missing =' extension in designator", + .kind = .warning, + .opt = .@"gnu-designator", + .extension = true, +}; + +pub const empty_if_body: Diagnostic = .{ + .fmt = "if statement has empty body", + .kind = .warning, + .opt = .@"empty-body", +}; + +pub const empty_if_body_note: Diagnostic = .{ + .fmt = "put the semicolon on a separate line to silence this warning", + .kind = .note, + .opt = .@"empty-body", +}; + +pub const nullability_extension: Diagnostic = .{ + .fmt = "type nullability specifier '{s}' is a Clang extension", + .kind = .off, + .opt = .@"nullability-extension", + .extension = true, +}; + +pub const duplicate_nullability: Diagnostic = .{ + .fmt = "duplicate nullability specifier '{s}'", + .kind = .warning, + .opt = .nullability, +}; + +pub const conflicting_nullability: Diagnostic = .{ + .fmt = "nullaibility specifier '{tok_id}' conflicts with existing specifier '{tok_id}'", + .kind = .@"error", +}; + +pub const invalid_nullability: Diagnostic = .{ + .fmt = "nullability specifier cannot be applied to non-pointer type {qt}", + .kind = .@"error", +}; + +pub const array_not_assignable: Diagnostic = .{ + .fmt = "array type {qt} is not assignable", + .kind = .@"error", +}; + +pub const non_object_not_assignable: Diagnostic = .{ + .fmt = "non-object type {qt} is not assignable", + .kind = .@"error", +}; + +pub const const_var_assignment: Diagnostic = .{ + .fmt = "cannot assign to variable '{s}' with const-qualified type {qt}", + .kind = .@"error", +}; + +pub const declared_const_here: Diagnostic = .{ + .fmt = "variable '{s}' declared const here", + .kind = .note, +}; + +pub const nonnull_not_applicable: Diagnostic = .{ + .fmt = "'nonnull' attribute only applies to functions, methods, and parameters", + .kind = .warning, + .opt = .@"ignored-attributes", +}; diff --git a/lib/compiler/aro/aro/Pragma.zig b/lib/compiler/aro/aro/Pragma.zig index 279ac5f00afc..a0d639f5a000 100644 --- a/lib/compiler/aro/aro/Pragma.zig +++ b/lib/compiler/aro/aro/Pragma.zig @@ -1,7 +1,9 @@ const std = @import("std"); + const Compilation = @import("Compilation.zig"); -const Preprocessor = @import("Preprocessor.zig"); +const Diagnostics = @import("Diagnostics.zig"); const Parser = @import("Parser.zig"); +const Preprocessor = @import("Preprocessor.zig"); const TokenIndex = @import("Tree.zig").TokenIndex; pub const Error = Compilation.Error || error{ UnknownPragma, StopPreprocessing }; @@ -58,7 +60,7 @@ pub fn pasteTokens(pp: *Preprocessor, start_idx: TokenIndex) ![]const u8 { .string_literal => { if (rparen_count != 0) return error.ExpectedStringLiteral; const str = pp.expandedSlice(tok); - try pp.char_buf.appendSlice(str[1 .. str.len - 1]); + try pp.char_buf.appendSlice(pp.comp.gpa, str[1 .. str.len - 1]); }, else => return error.ExpectedStringLiteral, } @@ -69,7 +71,7 @@ pub fn pasteTokens(pp: *Preprocessor, start_idx: TokenIndex) ![]const u8 { pub fn shouldPreserveTokens(self: *Pragma, pp: *Preprocessor, start_idx: TokenIndex) bool { if (self.preserveTokens) |func| return func(self, pp, start_idx); - return false; + return true; } pub fn preprocessorCB(self: *Pragma, pp: *Preprocessor, start_idx: TokenIndex) Error!void { @@ -81,3 +83,128 @@ pub fn parserCB(self: *Pragma, p: *Parser, start_idx: TokenIndex) Compilation.Er defer std.debug.assert(tok_index == p.tok_i); if (self.parserHandler) |func| return func(self, p, start_idx); } + +pub const Diagnostic = struct { + fmt: []const u8, + kind: Diagnostics.Message.Kind, + opt: ?Diagnostics.Option = null, + extension: bool = false, + + pub const pragma_warning_message: Diagnostic = .{ + .fmt = "{s}", + .kind = .warning, + .opt = .@"#pragma-messages", + }; + + pub const pragma_error_message: Diagnostic = .{ + .fmt = "{s}", + .kind = .@"error", + }; + + pub const pragma_message: Diagnostic = .{ + .fmt = "#pragma message: {s}", + .kind = .note, + }; + + pub const pragma_requires_string_literal: Diagnostic = .{ + .fmt = "pragma {s} requires string literal", + .kind = .@"error", + }; + + pub const poisoned_identifier: Diagnostic = .{ + .fmt = "attempt to use a poisoned identifier", + .kind = .@"error", + }; + + pub const pragma_poison_identifier: Diagnostic = .{ + .fmt = "can only poison identifier tokens", + .kind = .@"error", + }; + + pub const pragma_poison_macro: Diagnostic = .{ + .fmt = "poisoning existing macro", + .kind = .warning, + }; + + pub const unknown_gcc_pragma: Diagnostic = .{ + .fmt = "pragma GCC expected 'error', 'warning', 'diagnostic', 'poison'", + .kind = .off, + .opt = .@"unknown-pragmas", + }; + + pub const unknown_gcc_pragma_directive: Diagnostic = .{ + .fmt = "pragma GCC diagnostic expected 'error', 'warning', 'ignored', 'fatal', 'push', or 'pop'", + .kind = .warning, + .opt = .@"unknown-pragmas", + .extension = true, + }; + + pub const malformed_warning_check: Diagnostic = .{ + .fmt = "{s} expected option name (e.g. \"-Wundef\")", + .opt = .@"malformed-warning-check", + .kind = .warning, + .extension = true, + }; + + pub const pragma_pack_lparen: Diagnostic = .{ + .fmt = "missing '(' after '#pragma pack' - ignoring", + .kind = .warning, + .opt = .@"ignored-pragmas", + }; + + pub const pragma_pack_rparen: Diagnostic = .{ + .fmt = "missing ')' after '#pragma pack' - ignoring", + .kind = .warning, + .opt = .@"ignored-pragmas", + }; + + pub const pragma_pack_unknown_action: Diagnostic = .{ + .fmt = "unknown action for '#pragma pack' - ignoring", + .kind = .warning, + .opt = .@"ignored-pragmas", + }; + + pub const pragma_pack_show: Diagnostic = .{ + .fmt = "value of #pragma pack(show) == {d}", + .kind = .warning, + }; + + pub const pragma_pack_int_ident: Diagnostic = .{ + .fmt = "expected integer or identifier in '#pragma pack' - ignored", + .kind = .warning, + .opt = .@"ignored-pragmas", + }; + + pub const pragma_pack_int: Diagnostic = .{ + .fmt = "expected #pragma pack parameter to be '1', '2', '4', '8', or '16'", + .opt = .@"ignored-pragmas", + .kind = .warning, + }; + + pub const pragma_pack_undefined_pop: Diagnostic = .{ + .fmt = "specifying both a name and alignment to 'pop' is undefined", + .kind = .warning, + }; + + pub const pragma_pack_empty_stack: Diagnostic = .{ + .fmt = "#pragma pack(pop, ...) failed: stack empty", + .opt = .@"ignored-pragmas", + .kind = .warning, + }; +}; + +pub fn err(pp: *Preprocessor, tok_i: TokenIndex, diagnostic: Diagnostic, args: anytype) Compilation.Error!void { + var sf = std.heap.stackFallback(1024, pp.comp.gpa); + var allocating: std.Io.Writer.Allocating = .init(sf.get()); + defer allocating.deinit(); + + Diagnostics.formatArgs(&allocating.writer, diagnostic.fmt, args) catch return error.OutOfMemory; + + try pp.diagnostics.addWithLocation(pp.comp, .{ + .kind = diagnostic.kind, + .opt = diagnostic.opt, + .text = allocating.written(), + .location = pp.tokens.items(.loc)[tok_i].expand(pp.comp), + .extension = diagnostic.extension, + }, pp.expansionSlice(tok_i), true); +} diff --git a/lib/compiler/aro/aro/Preprocessor.zig b/lib/compiler/aro/aro/Preprocessor.zig index 1ad666fecd88..e3f9decab174 100644 --- a/lib/compiler/aro/aro/Preprocessor.zig +++ b/lib/compiler/aro/aro/Preprocessor.zig @@ -2,22 +2,26 @@ const std = @import("std"); const mem = std.mem; const Allocator = mem.Allocator; const assert = std.debug.assert; + +const Attribute = @import("Attribute.zig"); const Compilation = @import("Compilation.zig"); const Error = Compilation.Error; +const Diagnostics = @import("Diagnostics.zig"); +const DepFile = @import("DepFile.zig"); +const features = @import("features.zig"); +const Hideset = @import("Hideset.zig"); +const Parser = @import("Parser.zig"); const Source = @import("Source.zig"); +const text_literal = @import("text_literal.zig"); const Tokenizer = @import("Tokenizer.zig"); const RawToken = Tokenizer.Token; -const Parser = @import("Parser.zig"); -const Diagnostics = @import("Diagnostics.zig"); +const SourceEpoch = Compilation.Environment.SourceEpoch; const Tree = @import("Tree.zig"); const Token = Tree.Token; const TokenWithExpansionLocs = Tree.TokenWithExpansionLocs; -const Attribute = @import("Attribute.zig"); -const features = @import("features.zig"); -const Hideset = @import("Hideset.zig"); -const DefineMap = std.StringHashMapUnmanaged(Macro); -const RawTokenList = std.array_list.Managed(RawToken); +const DefineMap = std.StringArrayHashMapUnmanaged(Macro); +const RawTokenList = std.ArrayList(RawToken); const max_include_depth = 200; /// Errors that can be returned when expanding a macro. @@ -25,7 +29,41 @@ const max_include_depth = 200; /// it is handled there and doesn't escape that function const MacroError = Error || error{StopPreprocessing}; -const Macro = struct { +const IfContext = struct { + const Backing = u2; + const Nesting = enum(Backing) { + until_else, + until_endif, + until_endif_seen_else, + }; + + const buf_size_bits = @bitSizeOf(Backing) * 256; + kind: [buf_size_bits / std.mem.byte_size_in_bits]u8, + level: u8, + + fn get(self: *const IfContext) Nesting { + return @enumFromInt(std.mem.readPackedIntNative(Backing, &self.kind, @as(usize, self.level) * 2)); + } + + fn set(self: *IfContext, context: Nesting) void { + std.mem.writePackedIntNative(Backing, &self.kind, @as(usize, self.level) * 2, @intFromEnum(context)); + } + + fn increment(self: *IfContext) bool { + self.level, const overflowed = @addWithOverflow(self.level, 1); + return overflowed != 0; + } + + fn decrement(self: *IfContext) void { + self.level -= 1; + } + + /// Initialize `kind` to an invalid value since it is an error to read the kind before setting it. + /// Doing so will trigger safety-checked undefined behavior in `IfContext.get` + const default: IfContext = .{ .kind = @splat(0xFF), .level = 0 }; +}; + +pub const Macro = struct { /// Parameters of the function type macro params: []const []const u8, @@ -76,15 +114,16 @@ const TokenState = struct { }; comp: *Compilation, -gpa: mem.Allocator, +diagnostics: *Diagnostics, + arena: std.heap.ArenaAllocator, -defines: DefineMap = .{}, +defines: DefineMap = .empty, /// Do not directly mutate this; use addToken / addTokenAssumeCapacity / ensureTotalTokenCapacity / ensureUnusedTokenCapacity -tokens: Token.List = .{}, +tokens: Token.List = .empty, /// Do not directly mutate this; must be kept in sync with `tokens` -expansion_entries: std.MultiArrayList(ExpansionEntry) = .{}, -token_buf: RawTokenList, -char_buf: std.array_list.Managed(u8), +expansion_entries: std.MultiArrayList(ExpansionEntry) = .empty, +token_buf: RawTokenList = .empty, +char_buf: std.ArrayList(u8) = .empty, /// Counter that is incremented each time preprocess() is called /// Can be used to distinguish multiple preprocessings of the same file preprocess_count: u32 = 0, @@ -93,7 +132,7 @@ add_expansion_nl: u32 = 0, include_depth: u8 = 0, counter: u32 = 0, expansion_source_loc: Source.Location = undefined, -poisoned_identifiers: std.StringHashMap(void), +poisoned_identifiers: std.StringHashMapUnmanaged(void) = .empty, /// Map from Source.Id to macro name in the `#ifndef` condition which guards the source, if any include_guards: std.AutoHashMapUnmanaged(Source.Id, []const u8) = .empty, @@ -103,7 +142,7 @@ include_guards: std.AutoHashMapUnmanaged(Source.Id, []const u8) = .empty, store_macro_tokens: bool = false, /// Memory is retained to avoid allocation on every single token. -top_expansion_buf: ExpandBuf, +top_expansion_buf: ExpandBuf = .empty, /// Dump current state to stderr. verbose: bool = false, @@ -114,6 +153,13 @@ linemarkers: Linemarkers = .none, hideset: Hideset, +/// Epoch used for __DATE__, __TIME__, and possibly __TIMESTAMP__ +source_epoch: SourceEpoch, +m_times: std.AutoHashMapUnmanaged(Source.Id, u64) = .empty, + +/// The dependency file tracking all includes and embeds. +dep_file: ?*DepFile = null, + pub const parse = Parser.parse; pub const Linemarkers = enum { @@ -125,16 +171,13 @@ pub const Linemarkers = enum { numeric_directives, }; -pub fn init(comp: *Compilation) Preprocessor { - const pp = Preprocessor{ +pub fn init(comp: *Compilation, source_epoch: SourceEpoch) Preprocessor { + const pp: Preprocessor = .{ .comp = comp, - .gpa = comp.gpa, - .arena = std.heap.ArenaAllocator.init(comp.gpa), - .token_buf = RawTokenList.init(comp.gpa), - .char_buf = std.array_list.Managed(u8).init(comp.gpa), - .poisoned_identifiers = std.StringHashMap(void).init(comp.gpa), - .top_expansion_buf = ExpandBuf.init(comp.gpa), + .diagnostics = comp.diagnostics, + .arena = .init(comp.gpa), .hideset = .{ .comp = comp }, + .source_epoch = source_epoch, }; comp.pragmaEvent(.before_preprocess); return pp; @@ -142,84 +185,28 @@ pub fn init(comp: *Compilation) Preprocessor { /// Initialize Preprocessor with builtin macros. pub fn initDefault(comp: *Compilation) !Preprocessor { - var pp = init(comp); + const source_epoch: SourceEpoch = comp.environment.sourceEpoch() catch |er| switch (er) { + error.InvalidEpoch => blk: { + const diagnostic: Diagnostic = .invalid_source_epoch; + try comp.diagnostics.add(.{ .text = diagnostic.fmt, .kind = diagnostic.kind, .opt = diagnostic.opt, .location = null }); + break :blk .default; + }, + }; + + var pp = init(comp, source_epoch); errdefer pp.deinit(); try pp.addBuiltinMacros(); return pp; } -const builtin_macros = struct { - const args = [1][]const u8{"X"}; - - const has_attribute = [1]RawToken{.{ - .id = .macro_param_has_attribute, - .source = .generated, - }}; - const has_c_attribute = [1]RawToken{.{ - .id = .macro_param_has_c_attribute, - .source = .generated, - }}; - const has_declspec_attribute = [1]RawToken{.{ - .id = .macro_param_has_declspec_attribute, - .source = .generated, - }}; - const has_warning = [1]RawToken{.{ - .id = .macro_param_has_warning, - .source = .generated, - }}; - const has_feature = [1]RawToken{.{ - .id = .macro_param_has_feature, - .source = .generated, - }}; - const has_extension = [1]RawToken{.{ - .id = .macro_param_has_extension, - .source = .generated, - }}; - const has_builtin = [1]RawToken{.{ - .id = .macro_param_has_builtin, - .source = .generated, - }}; - const has_include = [1]RawToken{.{ - .id = .macro_param_has_include, - .source = .generated, - }}; - const has_include_next = [1]RawToken{.{ - .id = .macro_param_has_include_next, - .source = .generated, - }}; - const has_embed = [1]RawToken{.{ - .id = .macro_param_has_embed, - .source = .generated, - }}; - - const is_identifier = [1]RawToken{.{ - .id = .macro_param_is_identifier, - .source = .generated, - }}; - - const pragma_operator = [1]RawToken{.{ - .id = .macro_param_pragma_operator, - .source = .generated, - }}; - - const file = [1]RawToken{.{ - .id = .macro_file, - .source = .generated, - }}; - const line = [1]RawToken{.{ - .id = .macro_line, - .source = .generated, - }}; - const counter = [1]RawToken{.{ - .id = .macro_counter, - .source = .generated, - }}; -}; - -fn addBuiltinMacro(pp: *Preprocessor, name: []const u8, is_func: bool, tokens: []const RawToken) !void { - try pp.defines.putNoClobber(pp.gpa, name, .{ - .params = &builtin_macros.args, - .tokens = tokens, +// `param_tok_id` is comptime so that the generated `tokens` list is unique for every macro. +fn addBuiltinMacro(pp: *Preprocessor, name: []const u8, is_func: bool, comptime param_tok_id: Token.Id) !void { + try pp.defines.putNoClobber(pp.comp.gpa, name, .{ + .params = &[1][]const u8{"X"}, + .tokens = &[1]RawToken{.{ + .id = param_tok_id, + .source = .generated, + }}, .var_args = false, .is_func = is_func, .loc = .{ .id = .generated }, @@ -228,46 +215,66 @@ fn addBuiltinMacro(pp: *Preprocessor, name: []const u8, is_func: bool, tokens: [ } pub fn addBuiltinMacros(pp: *Preprocessor) !void { - try pp.addBuiltinMacro("__has_attribute", true, &builtin_macros.has_attribute); - try pp.addBuiltinMacro("__has_c_attribute", true, &builtin_macros.has_c_attribute); - try pp.addBuiltinMacro("__has_declspec_attribute", true, &builtin_macros.has_declspec_attribute); - try pp.addBuiltinMacro("__has_warning", true, &builtin_macros.has_warning); - try pp.addBuiltinMacro("__has_feature", true, &builtin_macros.has_feature); - try pp.addBuiltinMacro("__has_extension", true, &builtin_macros.has_extension); - try pp.addBuiltinMacro("__has_builtin", true, &builtin_macros.has_builtin); - try pp.addBuiltinMacro("__has_include", true, &builtin_macros.has_include); - try pp.addBuiltinMacro("__has_include_next", true, &builtin_macros.has_include_next); - try pp.addBuiltinMacro("__has_embed", true, &builtin_macros.has_embed); - try pp.addBuiltinMacro("__is_identifier", true, &builtin_macros.is_identifier); - try pp.addBuiltinMacro("_Pragma", true, &builtin_macros.pragma_operator); - - try pp.addBuiltinMacro("__FILE__", false, &builtin_macros.file); - try pp.addBuiltinMacro("__LINE__", false, &builtin_macros.line); - try pp.addBuiltinMacro("__COUNTER__", false, &builtin_macros.counter); + try pp.addBuiltinMacro("__has_attribute", true, .macro_param_has_attribute); + try pp.addBuiltinMacro("__has_c_attribute", true, .macro_param_has_c_attribute); + try pp.addBuiltinMacro("__has_declspec_attribute", true, .macro_param_has_declspec_attribute); + try pp.addBuiltinMacro("__has_warning", true, .macro_param_has_warning); + try pp.addBuiltinMacro("__has_feature", true, .macro_param_has_feature); + try pp.addBuiltinMacro("__has_extension", true, .macro_param_has_extension); + try pp.addBuiltinMacro("__has_builtin", true, .macro_param_has_builtin); + try pp.addBuiltinMacro("__has_include", true, .macro_param_has_include); + try pp.addBuiltinMacro("__has_include_next", true, .macro_param_has_include_next); + try pp.addBuiltinMacro("__has_embed", true, .macro_param_has_embed); + try pp.addBuiltinMacro("__is_identifier", true, .macro_param_is_identifier); + try pp.addBuiltinMacro("_Pragma", true, .macro_param_pragma_operator); + + if (pp.comp.langopts.ms_extensions) { + try pp.addBuiltinMacro("__identifier", true, .macro_param_ms_identifier); + try pp.addBuiltinMacro("__pragma", true, .macro_param_ms_pragma); + } + + try pp.addBuiltinMacro("__FILE__", false, .macro_file); + try pp.addBuiltinMacro("__LINE__", false, .macro_line); + try pp.addBuiltinMacro("__COUNTER__", false, .macro_counter); + try pp.addBuiltinMacro("__DATE__", false, .macro_date); + try pp.addBuiltinMacro("__TIME__", false, .macro_time); + try pp.addBuiltinMacro("__TIMESTAMP__", false, .macro_timestamp); } pub fn deinit(pp: *Preprocessor) void { - pp.defines.deinit(pp.gpa); - pp.tokens.deinit(pp.gpa); + const gpa = pp.comp.gpa; + pp.defines.deinit(gpa); + pp.tokens.deinit(gpa); pp.arena.deinit(); - pp.token_buf.deinit(); - pp.char_buf.deinit(); - pp.poisoned_identifiers.deinit(); - pp.include_guards.deinit(pp.gpa); - pp.top_expansion_buf.deinit(); + pp.token_buf.deinit(gpa); + pp.char_buf.deinit(gpa); + pp.poisoned_identifiers.deinit(gpa); + pp.include_guards.deinit(gpa); + pp.top_expansion_buf.deinit(gpa); pp.hideset.deinit(); - for (pp.expansion_entries.items(.locs)) |locs| TokenWithExpansionLocs.free(locs, pp.gpa); - pp.expansion_entries.deinit(pp.gpa); + for (pp.expansion_entries.items(.locs)) |locs| TokenWithExpansionLocs.free(locs, gpa); + pp.expansion_entries.deinit(gpa); + pp.m_times.deinit(gpa); + pp.* = undefined; } /// Free buffers that are not needed after preprocessing fn clearBuffers(pp: *Preprocessor) void { - pp.token_buf.clearAndFree(); - pp.char_buf.clearAndFree(); - pp.top_expansion_buf.clearAndFree(); + const gpa = pp.comp.gpa; + pp.token_buf.clearAndFree(gpa); + pp.char_buf.clearAndFree(gpa); + pp.top_expansion_buf.clearAndFree(gpa); pp.hideset.clearAndFree(); } +fn mTime(pp: *Preprocessor, source_id: Source.Id) !u64 { + const gop = try pp.m_times.getOrPut(pp.comp.gpa, source_id); + if (!gop.found_existing) { + gop.value_ptr.* = pp.comp.getSourceMTimeUncached(source_id) orelse 0; + } + return gop.value_ptr.*; +} + pub fn expansionSlice(pp: *Preprocessor, tok: Tree.TokenIndex) []Source.Location { const S = struct { fn orderTokenIndex(context: Tree.TokenIndex, item: Tree.TokenIndex) std.math.Order { @@ -348,7 +355,7 @@ pub fn addIncludeResume(pp: *Preprocessor, source: Source.Id, offset: u32, line: } }); } -fn invalidTokenDiagnostic(tok_id: Token.Id) Diagnostics.Tag { +fn invalidTokenDiagnostic(tok_id: Token.Id) Diagnostic { return switch (tok_id) { .unterminated_string_literal => .unterminated_string_literal_warning, .empty_char_literal => .empty_char_literal_warning, @@ -375,6 +382,7 @@ fn findIncludeGuard(pp: *Preprocessor, source: Source) ?[]const u8 { } fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpansionLocs { + const gpa = pp.comp.gpa; var guard_name = pp.findIncludeGuard(source); pp.preprocess_count += 1; @@ -388,11 +396,7 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans const estimated_token_count = source.buf.len / 8; try pp.ensureTotalTokenCapacity(pp.tokens.len + estimated_token_count); - var if_level: u8 = 0; - var if_kind: [64]u8 = .{0} ** 64; - const until_else = 0; - const until_endif = 1; - const until_endif_seen_else = 2; + var if_context: IfContext = .default; var start_of_line = true; while (true) { @@ -400,6 +404,7 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans switch (tok.id) { .hash => if (!start_of_line) try pp.addToken(tokFromRaw(tok)) else { const directive = tokenizer.nextNoWS(); + const directive_loc: Source.Location = .{ .id = tok.source, .byte_offset = directive.start, .line = directive.line }; switch (directive.id) { .keyword_error, .keyword_warning => { // #error tokens.. @@ -411,31 +416,29 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans tok = tokenizer.next(); if (tok.id == .nl or tok.id == .eof) break; if (tok.id == .whitespace) tok.id = .macro_ws; - try pp.top_expansion_buf.append(tokFromRaw(tok)); + try pp.top_expansion_buf.append(gpa, tokFromRaw(tok)); } try pp.stringify(pp.top_expansion_buf.items); const slice = pp.char_buf.items[char_top + 1 .. pp.char_buf.items.len - 2]; - const duped = try pp.comp.diagnostics.arena.allocator().dupe(u8, slice); - try pp.comp.addDiagnostic(.{ - .tag = if (directive.id == .keyword_error) .error_directive else .warning_directive, - .loc = .{ .id = tok.source, .byte_offset = directive.start, .line = directive.line }, - .extra = .{ .str = duped }, - }, &.{}); + try pp.err( + directive_loc, + if (directive.id == .keyword_error) .error_directive else .warning_directive, + .{slice}, + ); }, .keyword_if => { - const sum, const overflowed = @addWithOverflow(if_level, 1); - if (overflowed != 0) + const overflowed = if_context.increment(); + if (overflowed) return pp.fatal(directive, "too many #if nestings", .{}); - if_level = sum; if (try pp.expr(&tokenizer)) { - std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_endif); + if_context.set(.until_endif); if (pp.verbose) { pp.verboseLog(directive, "entering then branch of #if", .{}); } } else { - std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_else); + if_context.set(.until_else); try pp.skip(&tokenizer, .until_else); if (pp.verbose) { pp.verboseLog(directive, "entering else branch of #if", .{}); @@ -443,20 +446,19 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans } }, .keyword_ifdef => { - const sum, const overflowed = @addWithOverflow(if_level, 1); - if (overflowed != 0) + const overflowed = if_context.increment(); + if (overflowed) return pp.fatal(directive, "too many #if nestings", .{}); - if_level = sum; const macro_name = (try pp.expectMacroName(&tokenizer)) orelse continue; try pp.expectNl(&tokenizer); if (pp.defines.get(macro_name) != null) { - std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_endif); + if_context.set(.until_endif); if (pp.verbose) { pp.verboseLog(directive, "entering then branch of #ifdef", .{}); } } else { - std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_else); + if_context.set(.until_else); try pp.skip(&tokenizer, .until_else); if (pp.verbose) { pp.verboseLog(directive, "entering else branch of #ifdef", .{}); @@ -464,31 +466,30 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans } }, .keyword_ifndef => { - const sum, const overflowed = @addWithOverflow(if_level, 1); - if (overflowed != 0) + const overflowed = if_context.increment(); + if (overflowed) return pp.fatal(directive, "too many #if nestings", .{}); - if_level = sum; const macro_name = (try pp.expectMacroName(&tokenizer)) orelse continue; try pp.expectNl(&tokenizer); if (pp.defines.get(macro_name) == null) { - std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_endif); + if_context.set(.until_endif); } else { - std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_else); + if_context.set(.until_else); try pp.skip(&tokenizer, .until_else); } }, .keyword_elif => { - if (if_level == 0) { - try pp.err(directive, .elif_without_if); - if_level += 1; - std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_else); - } else if (if_level == 1) { + if (if_context.level == 0) { + try pp.err(directive, .elif_without_if, .{}); + _ = if_context.increment(); + if_context.set(.until_else); + } else if (if_context.level == 1) { guard_name = null; } - switch (std.mem.readPackedIntNative(u2, &if_kind, if_level * 2)) { - until_else => if (try pp.expr(&tokenizer)) { - std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_endif); + switch (if_context.get()) { + .until_else => if (try pp.expr(&tokenizer)) { + if_context.set(.until_endif); if (pp.verbose) { pp.verboseLog(directive, "entering then branch of #elif", .{}); } @@ -498,27 +499,26 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans pp.verboseLog(directive, "entering else branch of #elif", .{}); } }, - until_endif => try pp.skip(&tokenizer, .until_endif), - until_endif_seen_else => { - try pp.err(directive, .elif_after_else); + .until_endif => try pp.skip(&tokenizer, .until_endif), + .until_endif_seen_else => { + try pp.err(directive, .elif_after_else, .{}); skipToNl(&tokenizer); }, - else => unreachable, } }, .keyword_elifdef => { - if (if_level == 0) { - try pp.err(directive, .elifdef_without_if); - if_level += 1; - std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_else); - } else if (if_level == 1) { + if (if_context.level == 0) { + try pp.err(directive, .elifdef_without_if, .{}); + _ = if_context.increment(); + if_context.set(.until_else); + } else if (if_context.level == 1) { guard_name = null; } - switch (std.mem.readPackedIntNative(u2, &if_kind, if_level * 2)) { - until_else => { + switch (if_context.get()) { + .until_else => { const macro_name = try pp.expectMacroName(&tokenizer); if (macro_name == null) { - std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_else); + if_context.set(.until_else); try pp.skip(&tokenizer, .until_else); if (pp.verbose) { pp.verboseLog(directive, "entering else branch of #elifdef", .{}); @@ -526,12 +526,12 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans } else { try pp.expectNl(&tokenizer); if (pp.defines.get(macro_name.?) != null) { - std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_endif); + if_context.set(.until_endif); if (pp.verbose) { pp.verboseLog(directive, "entering then branch of #elifdef", .{}); } } else { - std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_else); + if_context.set(.until_else); try pp.skip(&tokenizer, .until_else); if (pp.verbose) { pp.verboseLog(directive, "entering else branch of #elifdef", .{}); @@ -539,27 +539,26 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans } } }, - until_endif => try pp.skip(&tokenizer, .until_endif), - until_endif_seen_else => { - try pp.err(directive, .elifdef_after_else); + .until_endif => try pp.skip(&tokenizer, .until_endif), + .until_endif_seen_else => { + try pp.err(directive, .elifdef_after_else, .{}); skipToNl(&tokenizer); }, - else => unreachable, } }, .keyword_elifndef => { - if (if_level == 0) { - try pp.err(directive, .elifdef_without_if); - if_level += 1; - std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_else); - } else if (if_level == 1) { + if (if_context.level == 0) { + try pp.err(directive, .elifndef_without_if, .{}); + _ = if_context.increment(); + if_context.set(.until_else); + } else if (if_context.level == 1) { guard_name = null; } - switch (std.mem.readPackedIntNative(u2, &if_kind, if_level * 2)) { - until_else => { + switch (if_context.get()) { + .until_else => { const macro_name = try pp.expectMacroName(&tokenizer); if (macro_name == null) { - std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_else); + if_context.set(.until_else); try pp.skip(&tokenizer, .until_else); if (pp.verbose) { pp.verboseLog(directive, "entering else branch of #elifndef", .{}); @@ -567,12 +566,12 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans } else { try pp.expectNl(&tokenizer); if (pp.defines.get(macro_name.?) == null) { - std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_endif); + if_context.set(.until_endif); if (pp.verbose) { pp.verboseLog(directive, "entering then branch of #elifndef", .{}); } } else { - std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_else); + if_context.set(.until_else); try pp.skip(&tokenizer, .until_else); if (pp.verbose) { pp.verboseLog(directive, "entering else branch of #elifndef", .{}); @@ -580,44 +579,42 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans } } }, - until_endif => try pp.skip(&tokenizer, .until_endif), - until_endif_seen_else => { - try pp.err(directive, .elifdef_after_else); + .until_endif => try pp.skip(&tokenizer, .until_endif), + .until_endif_seen_else => { + try pp.err(directive, .elifdef_after_else, .{}); skipToNl(&tokenizer); }, - else => unreachable, } }, .keyword_else => { try pp.expectNl(&tokenizer); - if (if_level == 0) { - try pp.err(directive, .else_without_if); + if (if_context.level == 0) { + try pp.err(directive, .else_without_if, .{}); continue; - } else if (if_level == 1) { + } else if (if_context.level == 1) { guard_name = null; } - switch (std.mem.readPackedIntNative(u2, &if_kind, if_level * 2)) { - until_else => { - std.mem.writePackedIntNative(u2, &if_kind, if_level * 2, until_endif_seen_else); + switch (if_context.get()) { + .until_else => { + if_context.set(.until_endif_seen_else); if (pp.verbose) { pp.verboseLog(directive, "#else branch here", .{}); } }, - until_endif => try pp.skip(&tokenizer, .until_endif_seen_else), - until_endif_seen_else => { - try pp.err(directive, .else_after_else); + .until_endif => try pp.skip(&tokenizer, .until_endif_seen_else), + .until_endif_seen_else => { + try pp.err(directive, .else_after_else, .{}); skipToNl(&tokenizer); }, - else => unreachable, } }, .keyword_endif => { try pp.expectNl(&tokenizer); - if (if_level == 0) { + if (if_context.level == 0) { guard_name = null; - try pp.err(directive, .endif_without_if); + try pp.err(directive, .endif_without_if, .{}); continue; - } else if (if_level == 1) { + } else if (if_context.level == 1) { const saved_tokenizer = tokenizer; defer tokenizer = saved_tokenizer; @@ -625,7 +622,7 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans while (next.id == .nl) : (next = tokenizer.nextNoWS()) {} if (next.id != .eof) guard_name = null; } - if_level -= 1; + if_context.decrement(); }, .keyword_define => try pp.define(&tokenizer, directive), .keyword_undef => { @@ -634,7 +631,7 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans try pp.addToken(tokFromRaw(directive)); } - _ = pp.defines.remove(macro_name); + _ = pp.defines.orderedRemove(macro_name); try pp.expectNl(&tokenizer); }, .keyword_include => { @@ -642,15 +639,10 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans continue; }, .keyword_include_next => { - try pp.comp.addDiagnostic(.{ - .tag = .include_next, - .loc = .{ .id = tok.source, .byte_offset = directive.start, .line = directive.line }, - }, &.{}); + try pp.err(directive_loc, .include_next, .{}); + if (pp.include_depth == 0) { - try pp.comp.addDiagnostic(.{ - .tag = .include_next_outside_header, - .loc = .{ .id = tok.source, .byte_offset = directive.start, .line = directive.line }, - }, &.{}); + try pp.err(directive_loc, .include_next_outside_header, .{}); try pp.include(&tokenizer, .first); } else { try pp.include(&tokenizer, .next); @@ -664,13 +656,13 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans .keyword_line => { // #line number "file" const digits = tokenizer.nextNoWS(); - if (digits.id != .pp_num) try pp.err(digits, .line_simple_digit); + if (digits.id != .pp_num) try pp.err(digits, .line_simple_digit, .{}); // TODO: validate that the pp_num token is solely digits if (digits.id == .eof or digits.id == .nl) continue; const name = tokenizer.nextNoWS(); if (name.id == .eof or name.id == .nl) continue; - if (name.id != .string_literal) try pp.err(name, .line_invalid_filename); + if (name.id != .string_literal) try pp.err(name, .line_invalid_filename, .{}); try pp.expectNl(&tokenizer); }, .pp_num => { @@ -679,7 +671,7 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans // if not, emit `GNU line marker directive requires a simple digit sequence` const name = tokenizer.nextNoWS(); if (name.id == .eof or name.id == .nl) continue; - if (name.id != .string_literal) try pp.err(name, .line_invalid_filename); + if (name.id != .string_literal) try pp.err(name, .line_invalid_filename, .{}); const flag_1 = tokenizer.nextNoWS(); if (flag_1.id == .eof or flag_1.id == .nl) continue; @@ -693,11 +685,11 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans }, .nl => {}, .eof => { - if (if_level != 0) try pp.err(tok, .unterminated_conditional_directive); + if (if_context.level != 0) try pp.err(tok, .unterminated_conditional_directive, .{}); return tokFromRaw(directive); }, else => { - try pp.err(tok, .invalid_preprocessing_directive); + try pp.err(tok, .invalid_preprocessing_directive, .{}); skipToNl(&tokenizer); }, } @@ -712,14 +704,14 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans if (pp.preserve_whitespace) try pp.addToken(tokFromRaw(tok)); }, .eof => { - if (if_level != 0) try pp.err(tok, .unterminated_conditional_directive); + if (if_context.level != 0) try pp.err(tok, .unterminated_conditional_directive, .{}); // The following check needs to occur here and not at the top of the function // because a pragma may change the level during preprocessing if (source.buf.len > 0 and source.buf[source.buf.len - 1] != '\n') { - try pp.err(tok, .newline_eof); + try pp.err(tok, .newline_eof, .{}); } if (guard_name) |name| { - if (try pp.include_guards.fetchPut(pp.gpa, source.id, name)) |prev| { + if (try pp.include_guards.fetchPut(pp.comp.gpa, source.id, name)) |prev| { assert(mem.eql(u8, name, prev.value)); } } @@ -727,13 +719,13 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans }, .unterminated_string_literal, .unterminated_char_literal, .empty_char_literal => |tag| { start_of_line = false; - try pp.err(tok, invalidTokenDiagnostic(tag)); + try pp.err(tok, invalidTokenDiagnostic(tag), .{}); try pp.expandMacro(&tokenizer, tok); }, - .unterminated_comment => try pp.err(tok, .unterminated_comment), + .unterminated_comment => try pp.err(tok, .unterminated_comment, .{}), else => { if (tok.id.isMacroIdentifier() and pp.poisoned_identifiers.get(pp.tokSlice(tok)) != null) { - try pp.err(tok, .poisoned_identifier); + try pp.err(tok, .poisoned_identifier, .{}); } // Add the token to the buffer doing any necessary expansions. start_of_line = false; @@ -745,7 +737,7 @@ fn preprocessExtra(pp: *Preprocessor, source: Source) MacroError!TokenWithExpans /// Get raw token source string. /// Returned slice is invalidated when comp.generated_buf is updated. -pub fn tokSlice(pp: *Preprocessor, token: anytype) []const u8 { +pub fn tokSlice(pp: *const Preprocessor, token: anytype) []const u8 { if (token.id.lexeme()) |some| return some; const source = pp.comp.getSource(token.source); return source.buf[token.start..token.end]; @@ -763,69 +755,101 @@ fn tokFromRaw(raw: RawToken) TokenWithExpansionLocs { }; } -fn err(pp: *Preprocessor, raw: RawToken, tag: Diagnostics.Tag) !void { - try pp.comp.addDiagnostic(.{ - .tag = tag, - .loc = .{ - .id = raw.source, - .byte_offset = raw.start, - .line = raw.line, +pub const Diagnostic = @import("Preprocessor/Diagnostic.zig"); + +fn err(pp: *Preprocessor, loc: anytype, diagnostic: Diagnostic, args: anytype) Compilation.Error!void { + if (pp.diagnostics.effectiveKind(diagnostic) == .off) return; + const old_suppress_system = pp.diagnostics.state.suppress_system_headers; + defer pp.diagnostics.state.suppress_system_headers = old_suppress_system; + if (diagnostic.show_in_system_headers) pp.diagnostics.state.suppress_system_headers = false; + + var sf = std.heap.stackFallback(1024, pp.comp.gpa); + var allocating: std.Io.Writer.Allocating = .init(sf.get()); + defer allocating.deinit(); + + Diagnostics.formatArgs(&allocating.writer, diagnostic.fmt, args) catch return error.OutOfMemory; + try pp.diagnostics.addWithLocation(pp.comp, .{ + .kind = diagnostic.kind, + .text = allocating.written(), + .opt = diagnostic.opt, + .extension = diagnostic.extension, + .location = switch (@TypeOf(loc)) { + RawToken => (Source.Location{ + .id = loc.source, + .byte_offset = loc.start, + .line = loc.line, + }).expand(pp.comp), + TokenWithExpansionLocs, *TokenWithExpansionLocs => loc.loc.expand(pp.comp), + Source.Location => loc.expand(pp.comp), + else => @compileError("invalid token type " ++ @typeName(@TypeOf(loc))), }, - }, &.{}); -} - -fn errStr(pp: *Preprocessor, tok: TokenWithExpansionLocs, tag: Diagnostics.Tag, str: []const u8) !void { - try pp.comp.addDiagnostic(.{ - .tag = tag, - .loc = tok.loc, - .extra = .{ .str = str }, - }, tok.expansionSlice()); + }, switch (@TypeOf(loc)) { + RawToken => &.{}, + TokenWithExpansionLocs, *TokenWithExpansionLocs => loc.expansionSlice(), + Source.Location => &.{}, + else => @compileError("invalid token type"), + }, true); } fn fatal(pp: *Preprocessor, raw: RawToken, comptime fmt: []const u8, args: anytype) Compilation.Error { - try pp.comp.diagnostics.list.append(pp.gpa, .{ - .tag = .cli_error, + var sf = std.heap.stackFallback(1024, pp.comp.gpa); + var allocating: std.Io.Writer.Allocating = .init(sf.get()); + defer allocating.deinit(); + + Diagnostics.formatArgs(&allocating.writer, fmt, args) catch return error.OutOfMemory; + try pp.diagnostics.add(.{ .kind = .@"fatal error", - .extra = .{ .str = try std.fmt.allocPrint(pp.comp.diagnostics.arena.allocator(), fmt, args) }, - .loc = .{ + .text = allocating.written(), + .location = (Source.Location{ .id = raw.source, .byte_offset = raw.start, .line = raw.line, - }, + }).expand(pp.comp), }); - return error.FatalError; + unreachable; } fn fatalNotFound(pp: *Preprocessor, tok: TokenWithExpansionLocs, filename: []const u8) Compilation.Error { - const old = pp.comp.diagnostics.fatal_errors; - pp.comp.diagnostics.fatal_errors = true; - defer pp.comp.diagnostics.fatal_errors = old; + const old = pp.diagnostics.state.fatal_errors; + pp.diagnostics.state.fatal_errors = true; + defer pp.diagnostics.state.fatal_errors = old; + + var sf = std.heap.stackFallback(1024, pp.comp.gpa); + const allocator = sf.get(); + var buf: std.ArrayList(u8) = .empty; + defer buf.deinit(allocator); - try pp.comp.diagnostics.addExtra(pp.comp.langopts, .{ .tag = .cli_error, .loc = tok.loc, .extra = .{ - .str = try std.fmt.allocPrint(pp.comp.diagnostics.arena.allocator(), "'{s}' not found", .{filename}), - } }, tok.expansionSlice(), false); - unreachable; // addExtra should've returned FatalError + try buf.print(allocator, "'{s}' not found", .{filename}); + try pp.diagnostics.addWithLocation(pp.comp, .{ + .kind = .@"fatal error", + .text = buf.items, + .location = tok.loc.expand(pp.comp), + }, tok.expansionSlice(), true); + unreachable; // should've returned FatalError } fn verboseLog(pp: *Preprocessor, raw: RawToken, comptime fmt: []const u8, args: anytype) void { + @branchHint(.cold); const source = pp.comp.getSource(raw.source); const line_col = source.lineCol(.{ .id = raw.source, .line = raw.line, .byte_offset = raw.start }); - var stderr_buffer: [64]u8 = undefined; - var writer = std.debug.lockStderrWriter(&stderr_buffer); - defer std.debug.unlockStderrWriter(); - writer.print("{s}:{d}:{d}: ", .{ source.path, line_col.line_no, line_col.col }) catch return; - writer.print(fmt, args) catch return; - writer.writeByte('\n') catch return; - writer.writeAll(line_col.line) catch return; - writer.writeByte('\n') catch return; + var stderr_buf: [4096]u8 = undefined; + var stderr = std.fs.File.stderr().writer(&stderr_buf); + const w = &stderr.interface; + + w.print("{s}:{d}:{d}: ", .{ source.path, line_col.line_no, line_col.col }) catch return; + w.print(fmt, args) catch return; + w.writeByte('\n') catch return; + w.writeAll(line_col.line) catch return; + w.writeByte('\n') catch return; + w.flush() catch return; } /// Consume next token, error if it is not an identifier. fn expectMacroName(pp: *Preprocessor, tokenizer: *Tokenizer) Error!?[]const u8 { const macro_name = tokenizer.nextNoWS(); if (!macro_name.id.isMacroIdentifier()) { - try pp.err(macro_name, .macro_name_missing); + try pp.err(macro_name, .macro_name_missing, .{}); skipToNl(tokenizer); return null; } @@ -841,7 +865,7 @@ fn expectNl(pp: *Preprocessor, tokenizer: *Tokenizer) Error!void { if (tok.id == .whitespace or tok.id == .comment) continue; if (!sent_err) { sent_err = true; - try pp.err(tok, .extra_tokens_directive_end); + try pp.err(tok, .extra_tokens_directive_end, .{}); } } } @@ -860,9 +884,10 @@ fn restoreTokenState(pp: *Preprocessor, state: TokenState) void { /// Consume all tokens until a newline and parse the result into a boolean. fn expr(pp: *Preprocessor, tokenizer: *Tokenizer) MacroError!bool { + const gpa = pp.comp.gpa; const token_state = pp.getTokenState(); defer { - for (pp.top_expansion_buf.items) |tok| TokenWithExpansionLocs.free(tok.expansion_locs, pp.gpa); + for (pp.top_expansion_buf.items) |tok| TokenWithExpansionLocs.free(tok.expansion_locs, gpa); pp.restoreTokenState(token_state); } @@ -874,7 +899,7 @@ fn expr(pp: *Preprocessor, tokenizer: *Tokenizer) MacroError!bool { .whitespace => if (pp.top_expansion_buf.items.len == 0) continue, else => {}, } - try pp.top_expansion_buf.append(tokFromRaw(tok)); + try pp.top_expansion_buf.append(gpa, tokFromRaw(tok)); } else unreachable; if (pp.top_expansion_buf.items.len != 0) { pp.expansion_source_loc = pp.top_expansion_buf.items[0].loc; @@ -884,15 +909,12 @@ fn expr(pp: *Preprocessor, tokenizer: *Tokenizer) MacroError!bool { for (pp.top_expansion_buf.items) |tok| { if (tok.id == .macro_ws) continue; if (!tok.id.validPreprocessorExprStart()) { - try pp.comp.addDiagnostic(.{ - .tag = .invalid_preproc_expr_start, - .loc = tok.loc, - }, tok.expansionSlice()); + try pp.err(tok, .invalid_preproc_expr_start, .{}); return false; } break; } else { - try pp.err(eof, .expected_value_in_expr); + try pp.err(eof, .expected_value_in_expr, .{}); return false; } @@ -909,10 +931,7 @@ fn expr(pp: *Preprocessor, tokenizer: *Tokenizer) MacroError!bool { .string_literal_utf_32, .string_literal_wide, => { - try pp.comp.addDiagnostic(.{ - .tag = .string_literal_in_pp_expr, - .loc = tok.loc, - }, tok.expansionSlice()); + try pp.err(tok, .string_literal_in_pp_expr, .{}); return false; }, .plus_plus, @@ -939,10 +958,7 @@ fn expr(pp: *Preprocessor, tokenizer: *Tokenizer) MacroError!bool { .arrow, .period, => { - try pp.comp.addDiagnostic(.{ - .tag = .invalid_preproc_operator, - .loc = tok.loc, - }, tok.expansionSlice()); + try pp.err(tok, .invalid_preproc_operator, .{}); return false; }, .macro_ws, .whitespace => continue, @@ -953,12 +969,12 @@ fn expr(pp: *Preprocessor, tokenizer: *Tokenizer) MacroError!bool { const tokens_consumed = try pp.handleKeywordDefined(&tok, items[i + 1 ..], eof); i += tokens_consumed; } else { - try pp.errStr(tok, .undefined_macro, pp.expandedSlice(tok)); + try pp.err(tok, .undefined_macro, .{pp.expandedSlice(tok)}); if (i + 1 < pp.top_expansion_buf.items.len and pp.top_expansion_buf.items[i + 1].id == .l_paren) { - try pp.errStr(tok, .fn_macro_undefined, pp.expandedSlice(tok)); + try pp.err(tok, .fn_macro_undefined, .{pp.expandedSlice(tok)}); return false; } @@ -966,7 +982,7 @@ fn expr(pp: *Preprocessor, tokenizer: *Tokenizer) MacroError!bool { } }, } - pp.addTokenAssumeCapacity(tok); + pp.addTokenAssumeCapacity(try pp.unescapeUcn(tok)); } try pp.addToken(.{ .id = .eof, @@ -974,18 +990,15 @@ fn expr(pp: *Preprocessor, tokenizer: *Tokenizer) MacroError!bool { }); // Actually parse it. - var parser = Parser{ + var parser: Parser = .{ .pp = pp, .comp = pp.comp, - .gpa = pp.gpa, + .diagnostics = pp.diagnostics, .tok_ids = pp.tokens.items(.id), .tok_i = @intCast(token_state.tokens_len), - .arena = pp.arena.allocator(), .in_macro = true, - .strings = std.array_list.AlignedManaged(u8, .@"4").init(pp.comp.gpa), - .data = undefined, - .value_map = undefined, + .tree = undefined, .labels = undefined, .decl_buf = undefined, .list_buf = undefined, @@ -993,10 +1006,9 @@ fn expr(pp: *Preprocessor, tokenizer: *Tokenizer) MacroError!bool { .enum_buf = undefined, .record_buf = undefined, .attr_buf = undefined, - .field_attr_buf = undefined, .string_ids = undefined, }; - defer parser.strings.deinit(); + defer parser.strings.deinit(gpa); return parser.macroExpr(); } @@ -1006,28 +1018,25 @@ fn handleKeywordDefined(pp: *Preprocessor, macro_tok: *TokenWithExpansionLocs, t std.debug.assert(macro_tok.id == .keyword_defined); var it = TokenIterator.init(tokens); const first = it.nextNoWS() orelse { - try pp.err(eof, .macro_name_missing); + try pp.err(eof, .macro_name_missing, .{}); return it.i; }; switch (first.id) { .l_paren => {}, else => { if (!first.id.isMacroIdentifier()) { - try pp.errStr(first, .macro_name_must_be_identifier, pp.expandedSlice(first)); + try pp.err(first, .macro_name_must_be_identifier, .{}); } macro_tok.id = if (pp.defines.contains(pp.expandedSlice(first))) .one else .zero; return it.i; }, } const second = it.nextNoWS() orelse { - try pp.err(eof, .macro_name_missing); + try pp.err(eof, .macro_name_missing, .{}); return it.i; }; if (!second.id.isMacroIdentifier()) { - try pp.comp.addDiagnostic(.{ - .tag = .macro_name_must_be_identifier, - .loc = second.loc, - }, second.expansionSlice()); + try pp.err(second, .macro_name_must_be_identifier, .{}); return it.i; } macro_tok.id = if (pp.defines.contains(pp.expandedSlice(second))) .one else .zero; @@ -1035,14 +1044,8 @@ fn handleKeywordDefined(pp: *Preprocessor, macro_tok: *TokenWithExpansionLocs, t const last = it.nextNoWS(); if (last == null or last.?.id != .r_paren) { const tok = last orelse tokFromRaw(eof); - try pp.comp.addDiagnostic(.{ - .tag = .closing_paren, - .loc = tok.loc, - }, tok.expansionSlice()); - try pp.comp.addDiagnostic(.{ - .tag = .to_match_paren, - .loc = first.loc, - }, first.expansionSlice()); + try pp.err(tok, .closing_paren, .{}); + try pp.err(first, .to_match_paren, .{}); } return it.i; @@ -1069,7 +1072,7 @@ fn skip( .keyword_else => { if (ifs_seen != 0) continue; if (cont == .until_endif_seen_else) { - try pp.err(directive, .else_after_else); + try pp.err(directive, .else_after_else, .{}); continue; } tokenizer.* = saved_tokenizer; @@ -1078,7 +1081,7 @@ fn skip( .keyword_elif => { if (ifs_seen != 0 or cont == .until_endif) continue; if (cont == .until_endif_seen_else) { - try pp.err(directive, .elif_after_else); + try pp.err(directive, .elif_after_else, .{}); continue; } tokenizer.* = saved_tokenizer; @@ -1087,7 +1090,7 @@ fn skip( .keyword_elifdef => { if (ifs_seen != 0 or cont == .until_endif) continue; if (cont == .until_endif_seen_else) { - try pp.err(directive, .elifdef_after_else); + try pp.err(directive, .elifdef_after_else, .{}); continue; } tokenizer.* = saved_tokenizer; @@ -1096,7 +1099,7 @@ fn skip( .keyword_elifndef => { if (ifs_seen != 0 or cont == .until_endif) continue; if (cont == .until_endif_seen_else) { - try pp.err(directive, .elifndef_after_else); + try pp.err(directive, .elifndef_after_else, .{}); continue; } tokenizer.* = saved_tokenizer; @@ -1128,7 +1131,7 @@ fn skip( } } else { const eof = tokenizer.next(); - return pp.err(eof, .unterminated_conditional_directive); + return pp.err(eof, .unterminated_conditional_directive, .{}); } } @@ -1140,34 +1143,35 @@ fn skipToNl(tokenizer: *Tokenizer) void { } } -const ExpandBuf = std.array_list.Managed(TokenWithExpansionLocs); -fn removePlacemarkers(buf: *ExpandBuf) void { +const ExpandBuf = std.ArrayList(TokenWithExpansionLocs); +fn removePlacemarkers(gpa: Allocator, buf: *ExpandBuf) void { var i: usize = buf.items.len -% 1; while (i < buf.items.len) : (i -%= 1) { if (buf.items[i].id == .placemarker) { const placemarker = buf.orderedRemove(i); - TokenWithExpansionLocs.free(placemarker.expansion_locs, buf.allocator); + TokenWithExpansionLocs.free(placemarker.expansion_locs, gpa); } } } -const MacroArguments = std.array_list.Managed([]const TokenWithExpansionLocs); -fn deinitMacroArguments(allocator: Allocator, args: *const MacroArguments) void { +const MacroArguments = std.ArrayList([]const TokenWithExpansionLocs); +fn deinitMacroArguments(gpa: Allocator, args: *MacroArguments) void { for (args.items) |item| { - for (item) |tok| TokenWithExpansionLocs.free(tok.expansion_locs, allocator); - allocator.free(item); + for (item) |tok| TokenWithExpansionLocs.free(tok.expansion_locs, gpa); + gpa.free(item); } - args.deinit(); + args.deinit(gpa); } fn expandObjMacro(pp: *Preprocessor, simple_macro: *const Macro) Error!ExpandBuf { - var buf = ExpandBuf.init(pp.gpa); - errdefer buf.deinit(); + const gpa = pp.comp.gpa; + var buf: ExpandBuf = .empty; + errdefer buf.deinit(gpa); if (simple_macro.tokens.len == 0) { - try buf.append(.{ .id = .placemarker, .loc = .{ .id = .generated } }); + try buf.append(gpa, .{ .id = .placemarker, .loc = .{ .id = .generated } }); return buf; } - try buf.ensureTotalCapacity(simple_macro.tokens.len); + try buf.ensureTotalCapacity(gpa, simple_macro.tokens.len); // Add all of the simple_macros tokens to the new buffer handling any concats. var i: usize = 0; @@ -1193,27 +1197,44 @@ fn expandObjMacro(pp: *Preprocessor, simple_macro: *const Macro) Error!ExpandBuf .macro_file => { const start = pp.comp.generated_buf.items.len; const source = pp.comp.getSource(pp.expansion_source_loc.id); - const w = pp.comp.generated_buf.writer(pp.gpa); - try w.print("\"{s}\"\n", .{source.path}); + try pp.comp.generated_buf.print(gpa, "\"{f}\"\n", .{fmtEscapes(source.path)}); buf.appendAssumeCapacity(try pp.makeGeneratedToken(start, .string_literal, tok)); }, .macro_line => { const start = pp.comp.generated_buf.items.len; const source = pp.comp.getSource(pp.expansion_source_loc.id); - const w = pp.comp.generated_buf.writer(pp.gpa); - try w.print("{d}\n", .{source.physicalLine(pp.expansion_source_loc)}); + try pp.comp.generated_buf.print(gpa, "{d}\n", .{source.physicalLine(pp.expansion_source_loc)}); buf.appendAssumeCapacity(try pp.makeGeneratedToken(start, .pp_num, tok)); }, .macro_counter => { defer pp.counter += 1; const start = pp.comp.generated_buf.items.len; - const w = pp.comp.generated_buf.writer(pp.gpa); - try w.print("{d}\n", .{pp.counter}); + try pp.comp.generated_buf.print(gpa, "{d}\n", .{pp.counter}); buf.appendAssumeCapacity(try pp.makeGeneratedToken(start, .pp_num, tok)); }, + .macro_date, .macro_time => { + try pp.err(pp.expansion_source_loc, .date_time, .{}); + const start = pp.comp.generated_buf.items.len; + const timestamp = switch (pp.source_epoch) { + .system, .provided => |ts| ts, + }; + try pp.writeDateTimeStamp(.fromTokId(raw.id), timestamp); + buf.appendAssumeCapacity(try pp.makeGeneratedToken(start, .string_literal, tok)); + }, + .macro_timestamp => { + try pp.err(pp.expansion_source_loc, .date_time, .{}); + const start = pp.comp.generated_buf.items.len; + const timestamp = switch (pp.source_epoch) { + .provided => |ts| ts, + .system => try pp.mTime(pp.expansion_source_loc.id), + }; + + try pp.writeDateTimeStamp(.fromTokId(raw.id), timestamp); + buf.appendAssumeCapacity(try pp.makeGeneratedToken(start, .string_literal, tok)); + }, else => buf.appendAssumeCapacity(tok), } } @@ -1221,6 +1242,65 @@ fn expandObjMacro(pp: *Preprocessor, simple_macro: *const Macro) Error!ExpandBuf return buf; } +const DateTimeStampKind = enum { + date, + time, + timestamp, + + fn fromTokId(tok_id: RawToken.Id) DateTimeStampKind { + return switch (tok_id) { + .macro_date => .date, + .macro_time => .time, + .macro_timestamp => .timestamp, + else => unreachable, + }; + } +}; + +fn writeDateTimeStamp(pp: *const Preprocessor, kind: DateTimeStampKind, timestamp: u64) !void { + std.debug.assert(std.time.epoch.Month.jan.numeric() == 1); + const gpa = pp.comp.gpa; + + const epoch_seconds = std.time.epoch.EpochSeconds{ .secs = timestamp }; + const epoch_day = epoch_seconds.getEpochDay(); + const day_seconds = epoch_seconds.getDaySeconds(); + const year_day = epoch_day.calculateYearDay(); + const month_day = year_day.calculateMonthDay(); + + const day_names = [_][]const u8{ "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" }; + const month_names = [_][]const u8{ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; + const day_name = day_names[@intCast((epoch_day.day + 3) % 7)]; + const month_name = month_names[month_day.month.numeric() - 1]; + + switch (kind) { + .date => { + try pp.comp.generated_buf.print(gpa, "\"{s} {d: >2} {d}\"", .{ + month_name, + month_day.day_index + 1, + year_day.year, + }); + }, + .time => { + try pp.comp.generated_buf.print(gpa, "\"{d:0>2}:{d:0>2}:{d:0>2}\"", .{ + day_seconds.getHoursIntoDay(), + day_seconds.getMinutesIntoHour(), + day_seconds.getSecondsIntoMinute(), + }); + }, + .timestamp => { + try pp.comp.generated_buf.print(gpa, "\"{s} {s} {d: >2} {d:0>2}:{d:0>2}:{d:0>2} {d}\"", .{ + day_name, + month_name, + month_day.day_index + 1, + day_seconds.getHoursIntoDay(), + day_seconds.getMinutesIntoHour(), + day_seconds.getSecondsIntoMinute(), + year_day.year, + }); + }, + } +} + /// Join a possibly-parenthesized series of string literal tokens into a single string without /// leading or trailing quotes. The returned slice is invalidated if pp.char_buf changes. /// Returns error.ExpectedStringLiteral if parentheses are not balanced, a non-string-literal @@ -1239,7 +1319,7 @@ fn pasteStringsUnsafe(pp: *Preprocessor, toks: []const TokenWithExpansionLocs) ! if (tok.id == .macro_ws) continue; if (tok.id != .string_literal) return error.ExpectedStringLiteral; const str = pp.expandedSlice(tok); - try pp.char_buf.appendSlice(str[1 .. str.len - 1]); + try pp.char_buf.appendSlice(pp.comp.gpa, str[1 .. str.len - 1]); } return pp.char_buf.items[char_top..]; } @@ -1249,16 +1329,17 @@ fn pragmaOperator(pp: *Preprocessor, arg_tok: TokenWithExpansionLocs, operator_l const arg_slice = pp.expandedSlice(arg_tok); const content = arg_slice[1 .. arg_slice.len - 1]; const directive = "#pragma "; + const gpa = pp.comp.gpa; pp.char_buf.clearRetainingCapacity(); const total_len = directive.len + content.len + 1; // destringify can never grow the string, + 1 for newline - try pp.char_buf.ensureUnusedCapacity(total_len); + try pp.char_buf.ensureUnusedCapacity(gpa, total_len); pp.char_buf.appendSliceAssumeCapacity(directive); pp.destringify(content); pp.char_buf.appendAssumeCapacity('\n'); const start = pp.comp.generated_buf.items.len; - try pp.comp.generated_buf.appendSlice(pp.gpa, pp.char_buf.items); + try pp.comp.generated_buf.appendSlice(gpa, pp.char_buf.items); var tmp_tokenizer = Tokenizer{ .buf = pp.comp.generated_buf.items, .langopts = pp.comp.langopts, @@ -1274,6 +1355,40 @@ fn pragmaOperator(pp: *Preprocessor, arg_tok: TokenWithExpansionLocs, operator_l try pp.pragma(&tmp_tokenizer, pragma_tok, operator_loc, arg_tok.expansionSlice()); } +/// Handle Microsoft __pragma operator +fn msPragmaOperator(pp: *Preprocessor, pragma_tok: TokenWithExpansionLocs, args: []const TokenWithExpansionLocs) !void { + if (args.len == 0) { + try pp.err(pragma_tok, .unknown_pragma, .{}); + return; + } + const gpa = pp.comp.gpa; + + { + var copy = try pragma_tok.dupe(gpa); + copy.id = .keyword_pragma; + try pp.addToken(copy); + } + + const pragma_start: u32 = @intCast(pp.tokens.len); + for (args) |tok| { + switch (tok.id) { + .macro_ws, .comment => continue, + else => try pp.addToken(try tok.dupe(gpa)), + } + } + try pp.addToken(.{ .id = .nl, .loc = .{ .id = .generated } }); + + const name = pp.expandedSlice(pp.tokens.get(pragma_start)); + if (pp.comp.getPragma(name)) |prag| unknown: { + return prag.preprocessorCB(pp, pragma_start) catch |er| switch (er) { + error.UnknownPragma => break :unknown, + else => |e| return e, + }; + } + + try pp.err(args[0], .unknown_pragma, .{}); +} + /// Inverts the output of the preprocessor stringify (#) operation /// (except all whitespace is condensed to a single space) /// writes output to pp.char_buf; assumes capacity is sufficient @@ -1300,7 +1415,8 @@ fn destringify(pp: *Preprocessor, str: []const u8) void { /// Stringify `tokens` into pp.char_buf. /// See https://gcc.gnu.org/onlinedocs/gcc-11.2.0/cpp/Stringizing.html#Stringizing fn stringify(pp: *Preprocessor, tokens: []const TokenWithExpansionLocs) !void { - try pp.char_buf.append('"'); + const gpa = pp.comp.gpa; + try pp.char_buf.append(gpa, '"'); var ws_state: enum { start, need, not_needed } = .start; for (tokens) |tok| { if (tok.id == .macro_ws) { @@ -1308,7 +1424,7 @@ fn stringify(pp: *Preprocessor, tokens: []const TokenWithExpansionLocs) !void { ws_state = .need; continue; } - if (ws_state == .need) try pp.char_buf.append(' '); + if (ws_state == .need) try pp.char_buf.append(gpa, ' '); ws_state = .not_needed; // backslashes not inside strings are not escaped @@ -1328,14 +1444,14 @@ fn stringify(pp: *Preprocessor, tokens: []const TokenWithExpansionLocs) !void { for (pp.expandedSlice(tok)) |c| { if (c == '"') - try pp.char_buf.appendSlice("\\\"") + try pp.char_buf.appendSlice(gpa, "\\\"") else if (c == '\\' and is_str) - try pp.char_buf.appendSlice("\\\\") + try pp.char_buf.appendSlice(gpa, "\\\\") else - try pp.char_buf.append(c); + try pp.char_buf.append(gpa, c); } } - try pp.char_buf.ensureUnusedCapacity(2); + try pp.char_buf.ensureUnusedCapacity(gpa, 2); if (pp.char_buf.items[pp.char_buf.items.len - 1] != '\\') { pp.char_buf.appendSliceAssumeCapacity("\"\n"); return; @@ -1351,10 +1467,7 @@ fn stringify(pp: *Preprocessor, tokens: []const TokenWithExpansionLocs) !void { const item = tokenizer.next(); if (item.id == .unterminated_string_literal) { const tok = tokens[tokens.len - 1]; - try pp.comp.addDiagnostic(.{ - .tag = .invalid_pp_stringify_escape, - .loc = tok.loc, - }, tok.expansionSlice()); + try pp.err(tok, .invalid_pp_stringify_escape, .{}); pp.char_buf.items.len -= 2; // erase unpaired backslash and appended end quote pp.char_buf.appendAssumeCapacity('"'); } @@ -1363,10 +1476,7 @@ fn stringify(pp: *Preprocessor, tokens: []const TokenWithExpansionLocs) !void { fn reconstructIncludeString(pp: *Preprocessor, param_toks: []const TokenWithExpansionLocs, embed_args: ?*[]const TokenWithExpansionLocs, first: TokenWithExpansionLocs) !?[]const u8 { if (param_toks.len == 0) { - try pp.comp.addDiagnostic(.{ - .tag = .expected_filename, - .loc = first.loc, - }, first.expansionSlice()); + try pp.err(first, .expected_filename, .{}); return null; } @@ -1381,24 +1491,18 @@ fn reconstructIncludeString(pp: *Preprocessor, param_toks: []const TokenWithExpa const params = param_toks[begin..end]; if (params.len == 0) { - try pp.comp.addDiagnostic(.{ - .tag = .expected_filename, - .loc = first.loc, - }, first.expansionSlice()); + try pp.err(first, .expected_filename, .{}); return null; } // no string pasting if (embed_args == null and params[0].id == .string_literal and params.len > 1) { - try pp.comp.addDiagnostic(.{ - .tag = .closing_paren, - .loc = params[1].loc, - }, params[1].expansionSlice()); + try pp.err(params[1], .closing_paren, .{}); return null; } for (params, 0..) |tok, i| { const str = pp.expandedSliceExtra(tok, .preserve_macro_ws); - try pp.char_buf.appendSlice(str); + try pp.char_buf.appendSlice(pp.comp.gpa, str); if (embed_args) |some| { if ((i == 0 and tok.id == .string_literal) or tok.id == .angle_bracket_right) { some.* = params[i + 1 ..]; @@ -1410,16 +1514,10 @@ fn reconstructIncludeString(pp: *Preprocessor, param_toks: []const TokenWithExpa const include_str = pp.char_buf.items[char_top..]; if (include_str.len < 3) { if (include_str.len == 0) { - try pp.comp.addDiagnostic(.{ - .tag = .expected_filename, - .loc = first.loc, - }, first.expansionSlice()); + try pp.err(first, .expected_filename, .{}); return null; } - try pp.comp.addDiagnostic(.{ - .tag = .empty_filename, - .loc = params[0].loc, - }, params[0].expansionSlice()); + try pp.err(params[0], .empty_filename, .{}); return null; } @@ -1427,25 +1525,18 @@ fn reconstructIncludeString(pp: *Preprocessor, param_toks: []const TokenWithExpa '<' => { if (include_str[include_str.len - 1] != '>') { // Ugly hack to find out where the '>' should go, since we don't have the closing ')' location - const start = params[0].loc; - try pp.comp.addDiagnostic(.{ - .tag = .header_str_closing, - .loc = .{ .id = start.id, .byte_offset = start.byte_offset + @as(u32, @intCast(include_str.len)) + 1, .line = start.line }, - }, params[0].expansionSlice()); - try pp.comp.addDiagnostic(.{ - .tag = .header_str_match, - .loc = params[0].loc, - }, params[0].expansionSlice()); + var closing = params[0]; + closing.loc.byte_offset += @as(u32, @intCast(include_str.len)) + 1; + try pp.err(closing, .header_str_closing, .{}); + + try pp.err(params[0], .header_str_match, .{}); return null; } return include_str; }, '"' => return include_str, else => { - try pp.comp.addDiagnostic(.{ - .tag = .expected_filename, - .loc = params[0].loc, - }, params[0].expansionSlice()); + try pp.err(params[0], .expected_filename, .{}); return null; }, } @@ -1472,10 +1563,7 @@ fn handleBuiltinMacro(pp: *Preprocessor, builtin: RawToken.Id, param_toks: []con } if (identifier == null and invalid == null) invalid = .{ .id = .eof, .loc = src_loc }; if (invalid) |some| { - try pp.comp.addDiagnostic( - .{ .tag = .feature_check_requires_identifier, .loc = some.loc }, - some.expansionSlice(), - ); + try pp.err(some, .feature_check_requires_identifier, .{}); return false; } @@ -1489,7 +1577,11 @@ fn handleBuiltinMacro(pp: *Preprocessor, builtin: RawToken.Id, param_toks: []con false; }, .macro_param_has_feature => features.hasFeature(pp.comp, ident_str), - .macro_param_has_extension => features.hasExtension(pp.comp, ident_str), + // If -pedantic-errors is given __has_extension is equivalent to __has_feature + .macro_param_has_extension => if (pp.comp.diagnostics.state.extensions == .@"error") + features.hasFeature(pp.comp, ident_str) + else + features.hasExtension(pp.comp, ident_str), .macro_param_has_builtin => pp.comp.hasBuiltin(ident_str), else => unreachable, }; @@ -1497,13 +1589,13 @@ fn handleBuiltinMacro(pp: *Preprocessor, builtin: RawToken.Id, param_toks: []con .macro_param_has_warning => { const actual_param = pp.pasteStringsUnsafe(param_toks) catch |er| switch (er) { error.ExpectedStringLiteral => { - try pp.errStr(param_toks[0], .expected_str_literal_in, "__has_warning"); + try pp.err(param_toks[0], .expected_str_literal_in, .{"__has_warning"}); return false; }, else => |e| return e, }; if (!mem.startsWith(u8, actual_param, "-W")) { - try pp.errStr(param_toks[0], .malformed_warning_check, "__has_warning"); + try pp.err(param_toks[0], .malformed_warning_check, .{"__has_warning"}); return false; } const warning_name = actual_param[2..]; @@ -1521,11 +1613,7 @@ fn handleBuiltinMacro(pp: *Preprocessor, builtin: RawToken.Id, param_toks: []con }; if (identifier == null and invalid == null) invalid = .{ .id = .eof, .loc = src_loc }; if (invalid) |some| { - try pp.comp.addDiagnostic(.{ - .tag = .missing_tok_builtin, - .loc = some.loc, - .extra = .{ .tok_id_expected = .r_paren }, - }, some.expansionSlice()); + try pp.err(some, .builtin_missing_r_paren, .{"builtin feature-check macro"}); return false; } @@ -1542,14 +1630,11 @@ fn handleBuiltinMacro(pp: *Preprocessor, builtin: RawToken.Id, param_toks: []con const filename = include_str[1 .. include_str.len - 1]; if (builtin == .macro_param_has_include or pp.include_depth == 0) { if (builtin == .macro_param_has_include_next) { - try pp.comp.addDiagnostic(.{ - .tag = .include_next_outside_header, - .loc = src_loc, - }, &.{}); + try pp.err(src_loc, .include_next_outside_header, .{}); } - return pp.comp.hasInclude(filename, src_loc.id, include_type, .first); + return pp.comp.hasInclude(filename, src_loc.id, include_type, .first, pp.dep_file); } - return pp.comp.hasInclude(filename, src_loc.id, include_type, .next); + return pp.comp.hasInclude(filename, src_loc.id, include_type, .next, pp.dep_file); }, else => unreachable, } @@ -1574,25 +1659,26 @@ fn expandFuncMacro( expanded_args: *const MacroArguments, hideset_arg: Hideset.Index, ) MacroError!ExpandBuf { + const gpa = pp.comp.gpa; var hideset = hideset_arg; - var buf = ExpandBuf.init(pp.gpa); - try buf.ensureTotalCapacity(func_macro.tokens.len); - errdefer buf.deinit(); + var buf: ExpandBuf = .empty; + errdefer buf.deinit(gpa); + try buf.ensureTotalCapacity(gpa, func_macro.tokens.len); - var expanded_variable_arguments = ExpandBuf.init(pp.gpa); - defer expanded_variable_arguments.deinit(); - var variable_arguments = ExpandBuf.init(pp.gpa); - defer variable_arguments.deinit(); + var expanded_variable_arguments: ExpandBuf = .empty; + defer expanded_variable_arguments.deinit(gpa); + var variable_arguments: ExpandBuf = .empty; + defer variable_arguments.deinit(gpa); if (func_macro.var_args) { var i: usize = func_macro.params.len; while (i < expanded_args.items.len) : (i += 1) { - try variable_arguments.appendSlice(args.items[i]); - try expanded_variable_arguments.appendSlice(expanded_args.items[i]); + try variable_arguments.appendSlice(gpa, args.items[i]); + try expanded_variable_arguments.appendSlice(gpa, expanded_args.items[i]); if (i != expanded_args.items.len - 1) { - const comma = TokenWithExpansionLocs{ .id = .comma, .loc = .{ .id = .generated } }; - try variable_arguments.append(comma); - try expanded_variable_arguments.append(comma); + const comma: TokenWithExpansionLocs = .{ .id = .comma, .loc = .{ .id = .generated } }; + try variable_arguments.append(gpa, comma); + try expanded_variable_arguments.append(gpa, comma); } } } @@ -1606,8 +1692,8 @@ fn expandFuncMacro( const raw_next = func_macro.tokens[tok_i + 1]; tok_i += 1; - var va_opt_buf = ExpandBuf.init(pp.gpa); - defer va_opt_buf.deinit(); + var va_opt_buf: ExpandBuf = .empty; + defer va_opt_buf.deinit(gpa); const next = switch (raw_next.id) { .macro_ws => continue, @@ -1634,7 +1720,7 @@ fn expandFuncMacro( } const slice = getPasteArgs(args.items[raw.end]); const raw_loc = Source.Location{ .id = raw.source, .byte_offset = raw.start, .line = raw.line }; - try bufCopyTokens(&buf, slice, &.{raw_loc}); + try bufCopyTokens(gpa, &buf, slice, &.{raw_loc}); }, .macro_param => { if (tok_i + 1 < func_macro.tokens.len and func_macro.tokens[tok_i + 1].id == .hash_hash) { @@ -1642,11 +1728,11 @@ fn expandFuncMacro( } const arg = expanded_args.items[raw.end]; const raw_loc = Source.Location{ .id = raw.source, .byte_offset = raw.start, .line = raw.line }; - try bufCopyTokens(&buf, arg, &.{raw_loc}); + try bufCopyTokens(gpa, &buf, arg, &.{raw_loc}); }, .keyword_va_args => { const raw_loc = Source.Location{ .id = raw.source, .byte_offset = raw.start, .line = raw.line }; - try bufCopyTokens(&buf, expanded_variable_arguments.items, &.{raw_loc}); + try bufCopyTokens(gpa, &buf, expanded_variable_arguments.items, &.{raw_loc}); }, .keyword_va_opt => { try pp.expandVaOpt(&buf, raw, variable_arguments.items.len != 0); @@ -1661,9 +1747,9 @@ fn expandFuncMacro( try pp.stringify(arg); const start = pp.comp.generated_buf.items.len; - try pp.comp.generated_buf.appendSlice(pp.gpa, pp.char_buf.items); + try pp.comp.generated_buf.appendSlice(gpa, pp.char_buf.items); - try buf.append(try pp.makeGeneratedToken(start, .string_literal, tokFromRaw(raw))); + try buf.append(gpa, try pp.makeGeneratedToken(start, .string_literal, tokFromRaw(raw))); }, .macro_param_has_attribute, .macro_param_has_declspec_attribute, @@ -1677,21 +1763,19 @@ fn expandFuncMacro( => { const arg = expanded_args.items[0]; const result = if (arg.len == 0) blk: { - const extra = Diagnostics.Message.Extra{ .arguments = .{ .expected = 1, .actual = 0 } }; - try pp.comp.addDiagnostic(.{ .tag = .expected_arguments, .loc = macro_tok.loc, .extra = extra }, &.{}); + try pp.err(macro_tok, .expected_arguments, .{ 1, 0 }); break :blk false; } else try pp.handleBuiltinMacro(raw.id, arg, macro_tok.loc); const start = pp.comp.generated_buf.items.len; - const w = pp.comp.generated_buf.writer(pp.gpa); - try w.print("{}\n", .{@intFromBool(result)}); - try buf.append(try pp.makeGeneratedToken(start, .pp_num, tokFromRaw(raw))); + + try pp.comp.generated_buf.print(gpa, "{}\n", .{@intFromBool(result)}); + try buf.append(gpa, try pp.makeGeneratedToken(start, .pp_num, tokFromRaw(raw))); }, .macro_param_has_c_attribute => { const arg = expanded_args.items[0]; const not_found = "0\n"; const result = if (arg.len == 0) blk: { - const extra = Diagnostics.Message.Extra{ .arguments = .{ .expected = 1, .actual = 0 } }; - try pp.comp.addDiagnostic(.{ .tag = .expected_arguments, .loc = macro_tok.loc, .extra = extra }, &.{}); + try pp.err(macro_tok, .expected_arguments, .{ 1, 0 }); break :blk not_found; } else res: { var invalid: ?TokenWithExpansionLocs = null; @@ -1726,10 +1810,7 @@ fn expandFuncMacro( invalid = .{ .id = .eof, .loc = macro_tok.loc }; } if (invalid) |some| { - try pp.comp.addDiagnostic( - .{ .tag = .feature_check_requires_identifier, .loc = some.loc }, - some.expansionSlice(), - ); + try pp.err(some, .feature_check_requires_identifier, .{}); break :res not_found; } if (vendor_ident) |some| { @@ -1738,8 +1819,8 @@ fn expandFuncMacro( const exists = Attribute.fromString(.gnu, vendor_str, attr_str) != null; const start = pp.comp.generated_buf.items.len; - try pp.comp.generated_buf.appendSlice(pp.gpa, if (exists) "1\n" else "0\n"); - try buf.append(try pp.makeGeneratedToken(start, .pp_num, tokFromRaw(raw))); + try pp.comp.generated_buf.appendSlice(gpa, if (exists) "1\n" else "0\n"); + try buf.append(gpa, try pp.makeGeneratedToken(start, .pp_num, tokFromRaw(raw))); continue; } if (!pp.comp.langopts.standard.atLeast(.c23)) break :res not_found; @@ -1759,15 +1840,14 @@ fn expandFuncMacro( break :res attrs.get(attr_str) orelse not_found; }; const start = pp.comp.generated_buf.items.len; - try pp.comp.generated_buf.appendSlice(pp.gpa, result); - try buf.append(try pp.makeGeneratedToken(start, .pp_num, tokFromRaw(raw))); + try pp.comp.generated_buf.appendSlice(gpa, result); + try buf.append(gpa, try pp.makeGeneratedToken(start, .pp_num, tokFromRaw(raw))); }, .macro_param_has_embed => { const arg = expanded_args.items[0]; const not_found = "0\n"; const result = if (arg.len == 0) blk: { - const extra = Diagnostics.Message.Extra{ .arguments = .{ .expected = 1, .actual = 0 } }; - try pp.comp.addDiagnostic(.{ .tag = .expected_arguments, .loc = macro_tok.loc, .extra = extra }, &.{}); + try pp.err(macro_tok, .expected_arguments, .{ 1, 0 }); break :blk not_found; } else res: { var embed_args: []const TokenWithExpansionLocs = &.{}; @@ -1796,10 +1876,7 @@ fn expandFuncMacro( const param_first = it.next(); if (param_first.id == .eof) break; if (param_first.id != .identifier) { - try pp.comp.addDiagnostic( - .{ .tag = .malformed_embed_param, .loc = param_first.loc }, - param_first.expansionSlice(), - ); + try pp.err(param_first, .malformed_embed_param, .{}); continue; } @@ -1812,28 +1889,19 @@ fn expandFuncMacro( // vendor::param const param = it.next(); if (param.id != .identifier) { - try pp.comp.addDiagnostic( - .{ .tag = .malformed_embed_param, .loc = param.loc }, - param.expansionSlice(), - ); + try pp.err(param, .malformed_embed_param, .{}); continue; } const l_paren = it.next(); if (l_paren.id != .l_paren) { - try pp.comp.addDiagnostic( - .{ .tag = .malformed_embed_param, .loc = l_paren.loc }, - l_paren.expansionSlice(), - ); + try pp.err(l_paren, .malformed_embed_param, .{}); continue; } break :blk "doesn't exist"; }, .l_paren => Attribute.normalize(pp.expandedSlice(param_first)), else => { - try pp.comp.addDiagnostic( - .{ .tag = .malformed_embed_param, .loc = maybe_colon.loc }, - maybe_colon.expansionSlice(), - ); + try pp.err(maybe_colon, .malformed_embed_param, .{}); continue; }, }; @@ -1843,10 +1911,7 @@ fn expandFuncMacro( while (true) { const next = it.next(); if (next.id == .eof) { - try pp.comp.addDiagnostic( - .{ .tag = .malformed_embed_limit, .loc = param_first.loc }, - param_first.expansionSlice(), - ); + try pp.err(param_first, .malformed_embed_limit, .{}); break; } if (next.id == .r_paren) break; @@ -1856,17 +1921,11 @@ fn expandFuncMacro( if (std.mem.eql(u8, param, "limit")) { if (arg_count != 1) { - try pp.comp.addDiagnostic( - .{ .tag = .malformed_embed_limit, .loc = param_first.loc }, - param_first.expansionSlice(), - ); + try pp.err(param_first, .malformed_embed_limit, .{}); continue; } if (first_arg.id != .pp_num) { - try pp.comp.addDiagnostic( - .{ .tag = .malformed_embed_limit, .loc = param_first.loc }, - param_first.expansionSlice(), - ); + try pp.err(param_first, .malformed_embed_limit, .{}); continue; } _ = std.fmt.parseInt(u32, pp.expandedSlice(first_arg), 10) catch { @@ -1885,39 +1944,73 @@ fn expandFuncMacro( else => unreachable, }; const filename = include_str[1 .. include_str.len - 1]; - const contents = (try pp.comp.findEmbed(filename, arg[0].loc.id, include_type, 1)) orelse + const contents = (try pp.comp.findEmbed(filename, arg[0].loc.id, include_type, .limited(1), pp.dep_file)) orelse break :res not_found; - defer pp.comp.gpa.free(contents); + defer gpa.free(contents); break :res if (contents.len != 0) "1\n" else "2\n"; }; const start = pp.comp.generated_buf.items.len; - try pp.comp.generated_buf.appendSlice(pp.comp.gpa, result); - try buf.append(try pp.makeGeneratedToken(start, .pp_num, tokFromRaw(raw))); + try pp.comp.generated_buf.appendSlice(gpa, result); + try buf.append(gpa, try pp.makeGeneratedToken(start, .pp_num, tokFromRaw(raw))); }, .macro_param_pragma_operator => { - const param_toks = expanded_args.items[0]; // Clang and GCC require exactly one token (so, no parentheses or string pasting) // even though their error messages indicate otherwise. Ours is slightly more // descriptive. var invalid: ?TokenWithExpansionLocs = null; var string: ?TokenWithExpansionLocs = null; - for (param_toks) |tok| switch (tok.id) { - .string_literal => { - if (string) |_| invalid = tok else string = tok; - }, - .macro_ws => continue, - .comment => continue, - else => { - invalid = tok; - break; - }, - }; - if (string == null and invalid == null) invalid = .{ .loc = macro_tok.loc, .id = .eof }; - if (invalid) |some| try pp.comp.addDiagnostic( - .{ .tag = .pragma_operator_string_literal, .loc = some.loc }, - some.expansionSlice(), - ) else try pp.pragmaOperator(string.?, macro_tok.loc); + for (expanded_args.items[0]) |tok| { + switch (tok.id) { + .string_literal => { + if (string) |_| { + invalid = tok; + break; + } + string = tok; + }, + .macro_ws => continue, + .comment => continue, + else => { + invalid = tok; + break; + }, + } + } + if (string == null and invalid == null) invalid = macro_tok; + if (invalid) |some| + try pp.err(some, .pragma_operator_string_literal, .{}) + else + try pp.pragmaOperator(string.?, macro_tok.loc); + }, + .macro_param_ms_identifier => blk: { + // Expect '__identifier' '(' macro-identifier ')' + var ident: ?TokenWithExpansionLocs = null; + for (expanded_args.items[0]) |tok| { + switch (tok.id) { + .macro_ws => continue, + .comment => continue, + else => {}, + } + if (ident) |_| { + try pp.err(tok, .builtin_missing_r_paren, .{"identifier"}); + break :blk; + } else if (tok.id.isMacroIdentifier()) { + ident = tok; + } else { + try pp.err(tok, .cannot_convert_to_identifier, .{tok.id.symbol()}); + break :blk; + } + } + if (ident) |*some| { + some.id = .identifier; + try buf.append(gpa, some.*); + } else { + try pp.err(macro_tok, .expected_identifier, .{}); + } + }, + .macro_param_ms_pragma => { + try pp.msPragmaOperator(macro_tok, expanded_args.items[0]); }, .comma => { if (tok_i + 2 < func_macro.tokens.len and func_macro.tokens[tok_i + 1].id == .hash_hash) { @@ -1933,43 +2026,43 @@ fn expandFuncMacro( tok_i += consumed; if (func_macro.params.len == expanded_args.items.len) { // Empty __VA_ARGS__, drop the comma - try pp.err(hash_hash, .comma_deletion_va_args); + try pp.err(hash_hash, .comma_deletion_va_args, .{}); } else if (func_macro.params.len == 0 and expanded_args.items.len == 1 and expanded_args.items[0].len == 0) { // Ambiguous whether this is "empty __VA_ARGS__" or "__VA_ARGS__ omitted" if (pp.comp.langopts.standard.isGNU()) { // GNU standard, drop the comma - try pp.err(hash_hash, .comma_deletion_va_args); + try pp.err(hash_hash, .comma_deletion_va_args, .{}); } else { // C standard, retain the comma - try buf.append(tokFromRaw(raw)); + try buf.append(gpa, tokFromRaw(raw)); } } else { - try buf.append(tokFromRaw(raw)); + try buf.append(gpa, tokFromRaw(raw)); if (expanded_variable_arguments.items.len > 0 or variable_arguments.items.len == func_macro.params.len) { - try pp.err(hash_hash, .comma_deletion_va_args); + try pp.err(hash_hash, .comma_deletion_va_args, .{}); } const raw_loc = Source.Location{ .id = maybe_va_args.source, .byte_offset = maybe_va_args.start, .line = maybe_va_args.line, }; - try bufCopyTokens(&buf, expanded_variable_arguments.items, &.{raw_loc}); + try bufCopyTokens(gpa, &buf, expanded_variable_arguments.items, &.{raw_loc}); } continue; } } // Regular comma, no token pasting with __VA_ARGS__ - try buf.append(tokFromRaw(raw)); + try buf.append(gpa, tokFromRaw(raw)); }, - else => try buf.append(tokFromRaw(raw)), + else => try buf.append(gpa, tokFromRaw(raw)), } } - removePlacemarkers(&buf); + removePlacemarkers(gpa, &buf); const macro_expansion_locs = macro_tok.expansionSlice(); for (buf.items) |*tok| { - try tok.addExpansionLocation(pp.gpa, &.{macro_tok.loc}); - try tok.addExpansionLocation(pp.gpa, macro_expansion_locs); + try tok.addExpansionLocation(gpa, &.{macro_tok.loc}); + try tok.addExpansionLocation(gpa, macro_expansion_locs); const tok_hidelist = pp.hideset.get(tok.loc); const new_hidelist = try pp.hideset.@"union"(tok_hidelist, hideset); try pp.hideset.put(tok.loc, new_hidelist); @@ -1996,16 +2089,16 @@ fn expandVaOpt( }; while (tokenizer.index < raw.end) { const tok = tokenizer.next(); - try buf.append(tokFromRaw(tok)); + try buf.append(pp.comp.gpa, tokFromRaw(tok)); } } -fn bufCopyTokens(buf: *ExpandBuf, tokens: []const TokenWithExpansionLocs, src: []const Source.Location) !void { - try buf.ensureUnusedCapacity(tokens.len); +fn bufCopyTokens(gpa: Allocator, buf: *ExpandBuf, tokens: []const TokenWithExpansionLocs, src: []const Source.Location) !void { + try buf.ensureUnusedCapacity(gpa, tokens.len); for (tokens) |tok| { - var copy = try tok.dupe(buf.allocator); - errdefer TokenWithExpansionLocs.free(copy.expansion_locs, buf.allocator); - try copy.addExpansionLocation(buf.allocator, src); + var copy = try tok.dupe(gpa); + errdefer TokenWithExpansionLocs.free(copy.expansion_locs, gpa); + try copy.addExpansionLocation(gpa, src); buf.appendAssumeCapacity(copy); } } @@ -2024,16 +2117,16 @@ fn nextBufToken( const raw_tok = tokenizer.next(); if (raw_tok.id.isMacroIdentifier() and pp.poisoned_identifiers.get(pp.tokSlice(raw_tok)) != null) - try pp.err(raw_tok, .poisoned_identifier); + try pp.err(raw_tok, .poisoned_identifier, .{}); if (raw_tok.id == .nl) pp.add_expansion_nl += 1; const new_tok = tokFromRaw(raw_tok); end_idx.* += 1; - try buf.append(new_tok); + try buf.append(pp.comp.gpa, new_tok); return new_tok; } else { - return TokenWithExpansionLocs{ .id = .eof, .loc = .{ .id = .generated } }; + return .{ .id = .eof, .loc = .{ .id = .generated } }; } } else { return buf.items[start_idx.*]; @@ -2050,6 +2143,7 @@ fn collectMacroFuncArguments( is_builtin: bool, r_paren: *TokenWithExpansionLocs, ) !MacroArguments { + const gpa = pp.comp.gpa; const name_tok = buf.items[start_idx.*]; const saved_tokenizer = tokenizer.*; const old_end = end_idx.*; @@ -2061,7 +2155,7 @@ fn collectMacroFuncArguments( .l_paren => break, else => { if (is_builtin) { - try pp.errStr(name_tok, .missing_lparen_after_builtin, pp.expandedSlice(name_tok)); + try pp.err(name_tok, .missing_lparen_after_builtin, .{pp.expandedSlice(name_tok)}); } // Not a macro function call, go over normal identifier, rewind tokenizer.* = saved_tokenizer; @@ -2073,65 +2167,62 @@ fn collectMacroFuncArguments( // collect the arguments. var parens: u32 = 0; - var args = MacroArguments.init(pp.gpa); - errdefer deinitMacroArguments(pp.gpa, &args); - var curArgument = std.array_list.Managed(TokenWithExpansionLocs).init(pp.gpa); - defer curArgument.deinit(); + var args: MacroArguments = .empty; + errdefer deinitMacroArguments(gpa, &args); + var cur_argument: std.ArrayList(TokenWithExpansionLocs) = .empty; + defer cur_argument.deinit(gpa); while (true) { var tok = try nextBufToken(pp, tokenizer, buf, start_idx, end_idx, extend_buf); tok.flags.is_macro_arg = true; switch (tok.id) { .comma => { if (parens == 0) { - const owned = try curArgument.toOwnedSlice(); - errdefer pp.gpa.free(owned); - try args.append(owned); + const owned = try cur_argument.toOwnedSlice(gpa); + errdefer gpa.free(owned); + try args.append(gpa, owned); } else { - const duped = try tok.dupe(pp.gpa); - errdefer TokenWithExpansionLocs.free(duped.expansion_locs, pp.gpa); - try curArgument.append(duped); + const duped = try tok.dupe(gpa); + errdefer TokenWithExpansionLocs.free(duped.expansion_locs, gpa); + try cur_argument.append(gpa, duped); } }, .l_paren => { - const duped = try tok.dupe(pp.gpa); - errdefer TokenWithExpansionLocs.free(duped.expansion_locs, pp.gpa); - try curArgument.append(duped); + const duped = try tok.dupe(gpa); + errdefer TokenWithExpansionLocs.free(duped.expansion_locs, gpa); + try cur_argument.append(gpa, duped); parens += 1; }, .r_paren => { if (parens == 0) { - const owned = try curArgument.toOwnedSlice(); - errdefer pp.gpa.free(owned); - try args.append(owned); + const owned = try cur_argument.toOwnedSlice(gpa); + errdefer gpa.free(owned); + try args.append(gpa, owned); r_paren.* = tok; break; } else { - const duped = try tok.dupe(pp.gpa); - errdefer TokenWithExpansionLocs.free(duped.expansion_locs, pp.gpa); - try curArgument.append(duped); + const duped = try tok.dupe(gpa); + errdefer TokenWithExpansionLocs.free(duped.expansion_locs, gpa); + try cur_argument.append(gpa, duped); parens -= 1; } }, .eof => { { - const owned = try curArgument.toOwnedSlice(); - errdefer pp.gpa.free(owned); - try args.append(owned); + const owned = try cur_argument.toOwnedSlice(gpa); + errdefer gpa.free(owned); + try args.append(gpa, owned); } tokenizer.* = saved_tokenizer; - try pp.comp.addDiagnostic( - .{ .tag = .unterminated_macro_arg_list, .loc = name_tok.loc }, - name_tok.expansionSlice(), - ); + try pp.err(name_tok, .unterminated_macro_arg_list, .{}); return error.Unterminated; }, .nl, .whitespace => { - try curArgument.append(.{ .id = .macro_ws, .loc = tok.loc }); + try cur_argument.append(gpa, .{ .id = .macro_ws, .loc = tok.loc }); }, else => { - const duped = try tok.dupe(pp.gpa); - errdefer TokenWithExpansionLocs.free(duped.expansion_locs, pp.gpa); - try curArgument.append(duped); + const duped = try tok.dupe(gpa); + errdefer TokenWithExpansionLocs.free(duped.expansion_locs, gpa); + try cur_argument.append(gpa, duped); }, } } @@ -2140,8 +2231,9 @@ fn collectMacroFuncArguments( } fn removeExpandedTokens(pp: *Preprocessor, buf: *ExpandBuf, start: usize, len: usize, moving_end_idx: *usize) !void { - for (buf.items[start .. start + len]) |tok| TokenWithExpansionLocs.free(tok.expansion_locs, pp.gpa); - try buf.replaceRange(start, len, &.{}); + const gpa = pp.comp.gpa; + for (buf.items[start .. start + len]) |tok| TokenWithExpansionLocs.free(tok.expansion_locs, gpa); + try buf.replaceRange(gpa, start, len, &.{}); moving_end_idx.* -|= len; } @@ -2184,6 +2276,7 @@ fn expandMacroExhaustive( extend_buf: bool, eval_ctx: EvalContext, ) MacroError!void { + const gpa = pp.comp.gpa; var moving_end_idx = end_idx; var advance_index: usize = 0; // rescan loop @@ -2230,7 +2323,7 @@ fn expandMacroExhaustive( var r_paren: TokenWithExpansionLocs = undefined; var macro_scan_idx = idx; // to be saved in case this doesn't turn out to be a call - const args = pp.collectMacroFuncArguments( + var args = pp.collectMacroFuncArguments( tokenizer, buf, ¯o_scan_idx, @@ -2255,10 +2348,10 @@ fn expandMacroExhaustive( var free_arg_expansion_locs = false; defer { for (args.items) |item| { - if (free_arg_expansion_locs) for (item) |tok| TokenWithExpansionLocs.free(tok.expansion_locs, pp.gpa); - pp.gpa.free(item); + if (free_arg_expansion_locs) for (item) |tok| TokenWithExpansionLocs.free(tok.expansion_locs, gpa); + gpa.free(item); } - args.deinit(); + args.deinit(gpa); } const r_paren_hidelist = pp.hideset.get(r_paren.loc); var hs = try pp.hideset.intersection(macro_hidelist, r_paren_hidelist); @@ -2277,48 +2370,39 @@ fn expandMacroExhaustive( } // Validate argument count. - const extra = Diagnostics.Message.Extra{ - .arguments = .{ .expected = @intCast(macro.params.len), .actual = args_count }, - }; if (macro.var_args and args_count < macro.params.len) { free_arg_expansion_locs = true; - try pp.comp.addDiagnostic( - .{ .tag = .expected_at_least_arguments, .loc = buf.items[idx].loc, .extra = extra }, - buf.items[idx].expansionSlice(), - ); + try pp.err(buf.items[idx], .expected_at_least_arguments, .{ macro.params.len, args_count }); idx += 1; try pp.removeExpandedTokens(buf, idx, macro_scan_idx - idx + 1, &moving_end_idx); continue; } if (!macro.var_args and args_count != macro.params.len) { free_arg_expansion_locs = true; - try pp.comp.addDiagnostic( - .{ .tag = .expected_arguments, .loc = buf.items[idx].loc, .extra = extra }, - buf.items[idx].expansionSlice(), - ); + try pp.err(buf.items[idx], .expected_arguments, .{ macro.params.len, args_count }); idx += 1; try pp.removeExpandedTokens(buf, idx, macro_scan_idx - idx + 1, &moving_end_idx); continue; } - var expanded_args = MacroArguments.init(pp.gpa); - defer deinitMacroArguments(pp.gpa, &expanded_args); - try expanded_args.ensureTotalCapacity(args.items.len); + var expanded_args: MacroArguments = .empty; + defer deinitMacroArguments(gpa, &expanded_args); + try expanded_args.ensureTotalCapacity(gpa, args.items.len); for (args.items) |arg| { - var expand_buf = ExpandBuf.init(pp.gpa); - errdefer expand_buf.deinit(); - try expand_buf.appendSlice(arg); + var expand_buf: ExpandBuf = .empty; + errdefer expand_buf.deinit(gpa); + try expand_buf.appendSlice(gpa, arg); try pp.expandMacroExhaustive(tokenizer, &expand_buf, 0, expand_buf.items.len, false, eval_ctx); - expanded_args.appendAssumeCapacity(try expand_buf.toOwnedSlice()); + expanded_args.appendAssumeCapacity(try expand_buf.toOwnedSlice(gpa)); } var res = try pp.expandFuncMacro(macro_tok, macro, &args, &expanded_args, hs); - defer res.deinit(); + defer res.deinit(gpa); const tokens_added = res.items.len; const tokens_removed = macro_scan_idx - idx + 1; - for (buf.items[idx .. idx + tokens_removed]) |tok| TokenWithExpansionLocs.free(tok.expansion_locs, pp.gpa); - try buf.replaceRange(idx, tokens_removed, res.items); + for (buf.items[idx .. idx + tokens_removed]) |tok| TokenWithExpansionLocs.free(tok.expansion_locs, gpa); + try buf.replaceRange(gpa, idx, tokens_removed, res.items); moving_end_idx += tokens_added; // Overflow here means that we encountered an unterminated argument list @@ -2327,8 +2411,8 @@ fn expandMacroExhaustive( idx += tokens_added; do_rescan = true; } else { - const res = try pp.expandObjMacro(macro); - defer res.deinit(); + var res = try pp.expandObjMacro(macro); + defer res.deinit(gpa); const hs = try pp.hideset.prepend(macro_tok.loc, macro_hidelist); @@ -2336,18 +2420,19 @@ fn expandMacroExhaustive( var increment_idx_by = res.items.len; for (res.items, 0..) |*tok, i| { tok.flags.is_macro_arg = macro_tok.flags.is_macro_arg; - try tok.addExpansionLocation(pp.gpa, &.{macro_tok.loc}); - try tok.addExpansionLocation(pp.gpa, macro_expansion_locs); + try tok.addExpansionLocation(gpa, &.{macro_tok.loc}); + try tok.addExpansionLocation(gpa, macro_expansion_locs); const tok_hidelist = pp.hideset.get(tok.loc); const new_hidelist = try pp.hideset.@"union"(tok_hidelist, hs); try pp.hideset.put(tok.loc, new_hidelist); if (tok.id == .keyword_defined and eval_ctx == .expr) { - try pp.comp.addDiagnostic(.{ - .tag = .expansion_to_defined, - .loc = tok.loc, - }, tok.expansionSlice()); + if (macro.is_func) { + try pp.err(tok, .expansion_to_defined_func, .{}); + } else { + try pp.err(tok, .expansion_to_defined_obj, .{}); + } } if (i < increment_idx_by and (tok.id == .keyword_defined or pp.defines.contains(pp.expandedSlice(tok.*)))) { @@ -2355,8 +2440,8 @@ fn expandMacroExhaustive( } } - TokenWithExpansionLocs.free(buf.items[idx].expansion_locs, pp.gpa); - try buf.replaceRange(idx, 1, res.items); + TokenWithExpansionLocs.free(buf.items[idx].expansion_locs, gpa); + try buf.replaceRange(gpa, idx, 1, res.items); idx += increment_idx_by; moving_end_idx = moving_end_idx + res.items.len - 1; do_rescan = true; @@ -2371,11 +2456,60 @@ fn expandMacroExhaustive( // trim excess buffer for (buf.items[moving_end_idx..]) |item| { - TokenWithExpansionLocs.free(item.expansion_locs, pp.gpa); + TokenWithExpansionLocs.free(item.expansion_locs, gpa); } buf.items.len = moving_end_idx; } +fn unescapeUcn(pp: *Preprocessor, tok: TokenWithExpansionLocs) !TokenWithExpansionLocs { + switch (tok.id) { + .incomplete_ucn => { + @branchHint(.cold); + try pp.err(tok, .incomplete_ucn, .{}); + }, + .extended_identifier => { + @branchHint(.cold); + const identifier = pp.expandedSlice(tok); + const gpa = pp.comp.gpa; + if (mem.indexOfScalar(u8, identifier, '\\') != null) { + @branchHint(.cold); + const start = pp.comp.generated_buf.items.len; + try pp.comp.generated_buf.ensureUnusedCapacity(gpa, identifier.len + 1); + var identifier_parser: text_literal.Parser = .{ + .comp = pp.comp, + .literal = pp.expandedSlice(tok), // re-expand since previous line may have caused a reallocation, invalidating `identifier` + .kind = .utf_8, + .max_codepoint = 0x10ffff, + .loc = tok.loc, + .expansion_locs = tok.expansionSlice(), + .diagnose_incorrect_encoding = false, + }; + while (try identifier_parser.next()) |decoded| { + switch (decoded) { + .value => unreachable, // validated by tokenizer + .codepoint => |c| { + var buf: [4]u8 = undefined; + const written = std.unicode.utf8Encode(c, &buf) catch unreachable; + pp.comp.generated_buf.appendSliceAssumeCapacity(buf[0..written]); + }, + .improperly_encoded => |bytes| { + pp.comp.generated_buf.appendSliceAssumeCapacity(bytes); + }, + .utf8_text => |view| { + pp.comp.generated_buf.appendSliceAssumeCapacity(view.bytes); + }, + } + } + pp.comp.generated_buf.appendAssumeCapacity('\n'); + defer TokenWithExpansionLocs.free(tok.expansion_locs, gpa); + return pp.makeGeneratedToken(start, .extended_identifier, tok); + } + }, + else => {}, + } + return tok; +} + /// Try to expand a macro after a possible candidate has been read from the `tokenizer` /// into the `raw` token passed as argument fn expandMacro(pp: *Preprocessor, tokenizer: *Tokenizer, raw: RawToken) MacroError!void { @@ -2384,8 +2518,9 @@ fn expandMacro(pp: *Preprocessor, tokenizer: *Tokenizer, raw: RawToken) MacroErr source_tok.id.simplifyMacroKeyword(); return pp.addToken(source_tok); } + const gpa = pp.comp.gpa; pp.top_expansion_buf.items.len = 0; - try pp.top_expansion_buf.append(source_tok); + try pp.top_expansion_buf.append(gpa, source_tok); pp.expansion_source_loc = source_tok.loc; pp.hideset.clearRetainingCapacity(); @@ -2393,19 +2528,19 @@ fn expandMacro(pp: *Preprocessor, tokenizer: *Tokenizer, raw: RawToken) MacroErr try pp.ensureUnusedTokenCapacity(pp.top_expansion_buf.items.len); for (pp.top_expansion_buf.items) |*tok| { if (tok.id == .macro_ws and !pp.preserve_whitespace) { - TokenWithExpansionLocs.free(tok.expansion_locs, pp.gpa); + TokenWithExpansionLocs.free(tok.expansion_locs, gpa); continue; } if (tok.id == .comment and !pp.comp.langopts.preserve_comments_in_macros) { - TokenWithExpansionLocs.free(tok.expansion_locs, pp.gpa); + TokenWithExpansionLocs.free(tok.expansion_locs, gpa); continue; } if (tok.id == .placemarker) { - TokenWithExpansionLocs.free(tok.expansion_locs, pp.gpa); + TokenWithExpansionLocs.free(tok.expansion_locs, gpa); continue; } tok.id.simplifyMacroKeywordExtra(true); - pp.addTokenAssumeCapacity(tok.*); + pp.addTokenAssumeCapacity(try pp.unescapeUcn(tok.*)); } if (pp.preserve_whitespace) { try pp.ensureUnusedTokenCapacity(pp.add_expansion_nl); @@ -2422,7 +2557,7 @@ fn expandedSliceExtra(pp: *const Preprocessor, tok: anytype, macro_ws_handling: if (tok.id.lexeme()) |some| { if (!tok.id.allowsDigraphs(pp.comp.langopts) and !(tok.id == .macro_ws and macro_ws_handling == .preserve_macro_ws)) return some; } - var tmp_tokenizer = Tokenizer{ + var tmp_tokenizer: Tokenizer = .{ .buf = pp.comp.getSource(tok.loc.id).buf, .langopts = pp.comp.langopts, .index = tok.loc.byte_offset, @@ -2445,14 +2580,15 @@ pub fn expandedSlice(pp: *const Preprocessor, tok: anytype) []const u8 { /// Concat two tokens and add the result to pp.generated fn pasteTokens(pp: *Preprocessor, lhs_toks: *ExpandBuf, rhs_toks: []const TokenWithExpansionLocs) Error!void { + const gpa = pp.comp.gpa; const lhs = while (lhs_toks.pop()) |lhs| { if ((pp.comp.langopts.preserve_comments_in_macros and lhs.id == .comment) or (lhs.id != .macro_ws and lhs.id != .comment)) break lhs; - TokenWithExpansionLocs.free(lhs.expansion_locs, pp.gpa); + TokenWithExpansionLocs.free(lhs.expansion_locs, gpa); } else { - return bufCopyTokens(lhs_toks, rhs_toks, &.{}); + return bufCopyTokens(gpa, lhs_toks, rhs_toks, &.{}); }; var rhs_rest: u32 = 1; @@ -2465,11 +2601,11 @@ fn pasteTokens(pp: *Preprocessor, lhs_toks: *ExpandBuf, rhs_toks: []const TokenW } else { return lhs_toks.appendAssumeCapacity(lhs); }; - defer TokenWithExpansionLocs.free(lhs.expansion_locs, pp.gpa); + defer TokenWithExpansionLocs.free(lhs.expansion_locs, gpa); const start = pp.comp.generated_buf.items.len; const end = start + pp.expandedSlice(lhs).len + pp.expandedSlice(rhs).len; - try pp.comp.generated_buf.ensureTotalCapacity(pp.gpa, end + 1); // +1 for a newline + try pp.comp.generated_buf.ensureTotalCapacity(gpa, end + 1); // +1 for a newline // We cannot use the same slices here since they might be invalidated by `ensureCapacity` pp.comp.generated_buf.appendSliceAssumeCapacity(pp.expandedSlice(lhs)); pp.comp.generated_buf.appendSliceAssumeCapacity(pp.expandedSlice(rhs)); @@ -2488,53 +2624,49 @@ fn pasteTokens(pp: *Preprocessor, lhs_toks: *ExpandBuf, rhs_toks: []const TokenW .placemarker else pasted_token.id; - try lhs_toks.append(try pp.makeGeneratedToken(start, pasted_id, lhs)); + try lhs_toks.append(gpa, try pp.makeGeneratedToken(start, pasted_id, lhs)); if (next.id != .nl and next.id != .eof) { - try pp.errStr( - lhs, - .pasting_formed_invalid, - try pp.comp.diagnostics.arena.allocator().dupe(u8, pp.comp.generated_buf.items[start..end]), - ); - try lhs_toks.append(tokFromRaw(next)); + try pp.err(lhs, .pasting_formed_invalid, .{pp.comp.generated_buf.items[start..end]}); + try lhs_toks.append(gpa, tokFromRaw(next)); } - try bufCopyTokens(lhs_toks, rhs_toks[rhs_rest..], &.{}); + try bufCopyTokens(gpa, lhs_toks, rhs_toks[rhs_rest..], &.{}); } fn makeGeneratedToken(pp: *Preprocessor, start: usize, id: Token.Id, source: TokenWithExpansionLocs) !TokenWithExpansionLocs { + const gpa = pp.comp.gpa; var pasted_token = TokenWithExpansionLocs{ .id = id, .loc = .{ .id = .generated, .byte_offset = @intCast(start), .line = pp.generated_line, } }; pp.generated_line += 1; - try pasted_token.addExpansionLocation(pp.gpa, &.{source.loc}); - try pasted_token.addExpansionLocation(pp.gpa, source.expansionSlice()); + try pasted_token.addExpansionLocation(gpa, &.{source.loc}); + try pasted_token.addExpansionLocation(gpa, source.expansionSlice()); return pasted_token; } /// Defines a new macro and warns if it is a duplicate -fn defineMacro(pp: *Preprocessor, define_tok: RawToken, name_tok: RawToken, macro: Macro) Error!void { - const name_str = pp.tokSlice(name_tok); - const gop = try pp.defines.getOrPut(pp.gpa, name_str); +fn defineMacro(pp: *Preprocessor, define_tok: RawToken, name_tok: TokenWithExpansionLocs, macro: Macro) Error!void { + const name_str = pp.expandedSlice(name_tok); + const gop = try pp.defines.getOrPut(pp.comp.gpa, name_str); if (gop.found_existing and !gop.value_ptr.eql(macro, pp)) { - const tag: Diagnostics.Tag = if (gop.value_ptr.is_builtin) .builtin_macro_redefined else .macro_redefined; - const start = pp.comp.diagnostics.list.items.len; - try pp.comp.addDiagnostic(.{ - .tag = tag, - .loc = .{ .id = name_tok.source, .byte_offset = name_tok.start, .line = name_tok.line }, - .extra = .{ .str = name_str }, - }, &.{}); - if (!gop.value_ptr.is_builtin and pp.comp.diagnostics.list.items.len != start) { - try pp.comp.addDiagnostic(.{ - .tag = .previous_definition, - .loc = gop.value_ptr.loc, - }, &.{}); + const loc = name_tok.loc; + const prev_total = pp.diagnostics.total; + if (gop.value_ptr.is_builtin) { + try pp.err(loc, .builtin_macro_redefined, .{}); + } else { + try pp.err(loc, .macro_redefined, .{name_str}); + } + + if (!gop.value_ptr.is_builtin and pp.diagnostics.total != prev_total) { + try pp.err(gop.value_ptr.loc, .previous_definition, .{}); } } if (pp.verbose) { - pp.verboseLog(name_tok, "macro {s} defined", .{name_str}); + const raw: RawToken = .{ .id = name_tok.id, .source = name_tok.loc.id, .start = name_tok.loc.byte_offset, .line = name_tok.loc.line }; + pp.verboseLog(raw, "macro {s} defined", .{name_str}); } if (pp.store_macro_tokens) { try pp.addToken(tokFromRaw(define_tok)); @@ -2545,21 +2677,28 @@ fn defineMacro(pp: *Preprocessor, define_tok: RawToken, name_tok: RawToken, macr /// Handle a #define directive. fn define(pp: *Preprocessor, tokenizer: *Tokenizer, define_tok: RawToken) Error!void { // Get macro name and validate it. - const macro_name = tokenizer.nextNoWS(); - if (macro_name.id == .keyword_defined) { - try pp.err(macro_name, .defined_as_macro_name); + const escaped_macro_name = tokenizer.nextNoWS(); + if (escaped_macro_name.id == .keyword_defined) { + try pp.err(escaped_macro_name, .defined_as_macro_name, .{}); return skipToNl(tokenizer); } - if (!macro_name.id.isMacroIdentifier()) { - try pp.err(macro_name, .macro_name_must_be_identifier); + if (!escaped_macro_name.id.isMacroIdentifier()) { + try pp.err(escaped_macro_name, .macro_name_must_be_identifier, .{}); return skipToNl(tokenizer); } + const gpa = pp.comp.gpa; + const macro_name = try pp.unescapeUcn(tokFromRaw(escaped_macro_name)); + defer TokenWithExpansionLocs.free(macro_name.expansion_locs, gpa); + var macro_name_token_id = macro_name.id; macro_name_token_id.simplifyMacroKeyword(); switch (macro_name_token_id) { .identifier, .extended_identifier => {}, - else => if (macro_name_token_id.isMacroIdentifier()) { - try pp.err(macro_name, .keyword_macro); + // TODO allow #define and #define extern|inline|static|const + else => if (macro_name_token_id.isMacroIdentifier() and + !mem.eql(u8, pp.comp.getSource(tokenizer.source).path, "")) + { + try pp.err(macro_name, .keyword_macro, .{}); }, } @@ -2570,15 +2709,15 @@ fn define(pp: *Preprocessor, tokenizer: *Tokenizer, define_tok: RawToken) Error! .params = &.{}, .tokens = &.{}, .var_args = false, - .loc = tokFromRaw(macro_name).loc, + .loc = macro_name.loc, .is_func = false, }), .whitespace => first = tokenizer.next(), .l_paren => return pp.defineFn(tokenizer, define_tok, macro_name, first), - else => try pp.err(first, .whitespace_after_macro_name), + else => try pp.err(first, .whitespace_after_macro_name, .{}), } if (first.id == .hash_hash) { - try pp.err(first, .hash_hash_at_start); + try pp.err(first, .hash_hash_at_start, .{}); return skipToNl(tokenizer); } first.id.simplifyMacroKeyword(); @@ -2595,38 +2734,42 @@ fn define(pp: *Preprocessor, tokenizer: *Tokenizer, define_tok: RawToken) Error! const next = tokenizer.nextNoWSComments(); switch (next.id) { .nl, .eof => { - try pp.err(tok, .hash_hash_at_end); + try pp.err(tok, .hash_hash_at_end, .{}); return; }, .hash_hash => { - try pp.err(next, .hash_hash_at_end); + try pp.err(next, .hash_hash_at_end, .{}); return; }, else => {}, } - try pp.token_buf.append(tok); - try pp.token_buf.append(next); + try pp.token_buf.append(gpa, tok); + try pp.token_buf.append(gpa, next); }, .nl, .eof => break, .comment => if (pp.comp.langopts.preserve_comments_in_macros) { if (need_ws) { need_ws = false; - try pp.token_buf.append(.{ .id = .macro_ws, .source = .generated }); + try pp.token_buf.append(gpa, .{ .id = .macro_ws, .source = .generated }); } - try pp.token_buf.append(tok); + try pp.token_buf.append(gpa, tok); }, .whitespace => need_ws = true, .unterminated_string_literal, .unterminated_char_literal, .empty_char_literal => |tag| { - try pp.err(tok, invalidTokenDiagnostic(tag)); - try pp.token_buf.append(tok); + try pp.err(tok, invalidTokenDiagnostic(tag), .{}); + try pp.token_buf.append(gpa, tok); }, - .unterminated_comment => try pp.err(tok, .unterminated_comment), + .unterminated_comment => try pp.err(tok, .unterminated_comment, .{}), else => { + if (tok.id == .incomplete_ucn) { + @branchHint(.cold); + try pp.err(tok, .incomplete_ucn, .{}); + } if (tok.id != .whitespace and need_ws) { need_ws = false; - try pp.token_buf.append(.{ .id = .macro_ws, .source = .generated }); + try pp.token_buf.append(gpa, .{ .id = .macro_ws, .source = .generated }); } - try pp.token_buf.append(tok); + try pp.token_buf.append(gpa, tok); }, } tok = tokenizer.next(); @@ -2634,19 +2777,20 @@ fn define(pp: *Preprocessor, tokenizer: *Tokenizer, define_tok: RawToken) Error! const list = try pp.arena.allocator().dupe(RawToken, pp.token_buf.items); try pp.defineMacro(define_tok, macro_name, .{ - .loc = tokFromRaw(macro_name).loc, + .loc = macro_name.loc, .tokens = list, - .params = undefined, + .params = &.{}, .is_func = false, .var_args = false, }); } /// Handle a function like #define directive. -fn defineFn(pp: *Preprocessor, tokenizer: *Tokenizer, define_tok: RawToken, macro_name: RawToken, l_paren: RawToken) Error!void { +fn defineFn(pp: *Preprocessor, tokenizer: *Tokenizer, define_tok: RawToken, macro_name: TokenWithExpansionLocs, l_paren: RawToken) Error!void { assert(macro_name.id.isMacroIdentifier()); - var params = std.array_list.Managed([]const u8).init(pp.gpa); - defer params.deinit(); + const gpa = pp.comp.gpa; + var params: std.ArrayList([]const u8) = .empty; + defer params.deinit(gpa); // Parse the parameter list. var gnu_var_args: []const u8 = ""; @@ -2654,39 +2798,39 @@ fn defineFn(pp: *Preprocessor, tokenizer: *Tokenizer, define_tok: RawToken, macr while (true) { var tok = tokenizer.nextNoWS(); if (tok.id == .r_paren) break; - if (tok.id == .eof) return pp.err(tok, .unterminated_macro_param_list); + if (tok.id == .eof) return pp.err(tok, .unterminated_macro_param_list, .{}); if (tok.id == .ellipsis) { var_args = true; const r_paren = tokenizer.nextNoWS(); if (r_paren.id != .r_paren) { - try pp.err(r_paren, .missing_paren_param_list); - try pp.err(l_paren, .to_match_paren); + try pp.err(r_paren, .missing_paren_param_list, .{}); + try pp.err(l_paren, .to_match_paren, .{}); return skipToNl(tokenizer); } break; } if (!tok.id.isMacroIdentifier()) { - try pp.err(tok, .invalid_token_param_list); + try pp.err(tok, .invalid_token_param_list, .{}); return skipToNl(tokenizer); } - try params.append(pp.tokSlice(tok)); + try params.append(gpa, pp.tokSlice(tok)); tok = tokenizer.nextNoWS(); if (tok.id == .ellipsis) { - try pp.err(tok, .gnu_va_macro); + try pp.err(tok, .gnu_va_macro, .{}); gnu_var_args = params.pop().?; const r_paren = tokenizer.nextNoWS(); if (r_paren.id != .r_paren) { - try pp.err(r_paren, .missing_paren_param_list); - try pp.err(l_paren, .to_match_paren); + try pp.err(r_paren, .missing_paren_param_list, .{}); + try pp.err(l_paren, .to_match_paren, .{}); return skipToNl(tokenizer); } break; } else if (tok.id == .r_paren) { break; } else if (tok.id != .comma) { - try pp.err(tok, .expected_comma_param_list); + try pp.err(tok, .expected_comma_param_list, .{}); return skipToNl(tokenizer); } } @@ -2702,39 +2846,39 @@ fn defineFn(pp: *Preprocessor, tokenizer: *Tokenizer, define_tok: RawToken, macr .comment => if (!pp.comp.langopts.preserve_comments_in_macros) continue else { if (need_ws) { need_ws = false; - try pp.token_buf.append(.{ .id = .macro_ws, .source = .generated }); + try pp.token_buf.append(gpa, .{ .id = .macro_ws, .source = .generated }); } - try pp.token_buf.append(tok); + try pp.token_buf.append(gpa, tok); }, .hash => { if (tok.id != .whitespace and need_ws) { need_ws = false; - try pp.token_buf.append(.{ .id = .macro_ws, .source = .generated }); + try pp.token_buf.append(gpa, .{ .id = .macro_ws, .source = .generated }); } const param = tokenizer.nextNoWS(); blk: { if (var_args and param.id == .keyword_va_args) { tok.id = .stringify_va_args; - try pp.token_buf.append(tok); + try pp.token_buf.append(gpa, tok); continue :tok_loop; } if (!param.id.isMacroIdentifier()) break :blk; const s = pp.tokSlice(param); if (mem.eql(u8, s, gnu_var_args)) { tok.id = .stringify_va_args; - try pp.token_buf.append(tok); + try pp.token_buf.append(gpa, tok); continue :tok_loop; } for (params.items, 0..) |p, i| { if (mem.eql(u8, p, s)) { tok.id = .stringify_param; tok.end = @intCast(i); - try pp.token_buf.append(tok); + try pp.token_buf.append(gpa, tok); continue :tok_loop; } } } - try pp.err(param, .hash_not_followed_param); + try pp.err(param, .hash_not_followed_param, .{}); return skipToNl(tokenizer); }, .hash_hash => { @@ -2742,13 +2886,13 @@ fn defineFn(pp: *Preprocessor, tokenizer: *Tokenizer, define_tok: RawToken, macr // if ## appears at the beginning, the token buf is still empty // in this case, error out if (pp.token_buf.items.len == 0) { - try pp.err(tok, .hash_hash_at_start); + try pp.err(tok, .hash_hash_at_start, .{}); return skipToNl(tokenizer); } const saved_tokenizer = tokenizer.*; const next = tokenizer.nextNoWSComments(); if (next.id == .nl or next.id == .eof) { - try pp.err(tok, .hash_hash_at_end); + try pp.err(tok, .hash_hash_at_end, .{}); return; } tokenizer.* = saved_tokenizer; @@ -2756,24 +2900,24 @@ fn defineFn(pp: *Preprocessor, tokenizer: *Tokenizer, define_tok: RawToken, macr if (pp.token_buf.items[pp.token_buf.items.len - 1].id == .macro_param) { pp.token_buf.items[pp.token_buf.items.len - 1].id = .macro_param_no_expand; } - try pp.token_buf.append(tok); + try pp.token_buf.append(gpa, tok); }, .unterminated_string_literal, .unterminated_char_literal, .empty_char_literal => |tag| { - try pp.err(tok, invalidTokenDiagnostic(tag)); - try pp.token_buf.append(tok); + try pp.err(tok, invalidTokenDiagnostic(tag), .{}); + try pp.token_buf.append(gpa, tok); }, - .unterminated_comment => try pp.err(tok, .unterminated_comment), + .unterminated_comment => try pp.err(tok, .unterminated_comment, .{}), else => { if (tok.id != .whitespace and need_ws) { need_ws = false; - try pp.token_buf.append(.{ .id = .macro_ws, .source = .generated }); + try pp.token_buf.append(gpa, .{ .id = .macro_ws, .source = .generated }); } if (var_args and tok.id == .keyword_va_args) { // do nothing } else if (var_args and tok.id == .keyword_va_opt) { const opt_l_paren = tokenizer.next(); if (opt_l_paren.id != .l_paren) { - try pp.err(opt_l_paren, .va_opt_lparen); + try pp.err(opt_l_paren, .va_opt_lparen, .{}); return skipToNl(tokenizer); } tok.start = opt_l_paren.end; @@ -2789,8 +2933,8 @@ fn defineFn(pp: *Preprocessor, tokenizer: *Tokenizer, define_tok: RawToken, macr parens -= 1; }, .nl, .eof => { - try pp.err(opt_tok, .va_opt_rparen); - try pp.err(opt_l_paren, .to_match_paren); + try pp.err(opt_tok, .va_opt_rparen, .{}); + try pp.err(opt_l_paren, .to_match_paren, .{}); return skipToNl(tokenizer); }, .whitespace => {}, @@ -2813,7 +2957,7 @@ fn defineFn(pp: *Preprocessor, tokenizer: *Tokenizer, define_tok: RawToken, macr } } } - try pp.token_buf.append(tok); + try pp.token_buf.append(gpa, tok); }, } } @@ -2825,7 +2969,7 @@ fn defineFn(pp: *Preprocessor, tokenizer: *Tokenizer, define_tok: RawToken, macr .params = param_list, .var_args = var_args or gnu_var_args.len != 0, .tokens = token_list, - .loc = tokFromRaw(macro_name).loc, + .loc = macro_name.loc, }); } @@ -2833,17 +2977,18 @@ fn defineFn(pp: *Preprocessor, tokenizer: *Tokenizer, define_tok: RawToken, macr /// embedDirective : ("FILENAME" | ) embedParam* /// embedParam : IDENTIFIER (:: IDENTIFIER)? '(' ')' fn embed(pp: *Preprocessor, tokenizer: *Tokenizer) MacroError!void { + const gpa = pp.comp.gpa; const first = tokenizer.nextNoWS(); const filename_tok = pp.findIncludeFilenameToken(first, tokenizer, .ignore_trailing_tokens) catch |er| switch (er) { error.InvalidInclude => return, else => |e| return e, }; - defer TokenWithExpansionLocs.free(filename_tok.expansion_locs, pp.gpa); + defer TokenWithExpansionLocs.free(filename_tok.expansion_locs, gpa); // Check for empty filename. const tok_slice = pp.expandedSliceExtra(filename_tok, .single_macro_ws); if (tok_slice.len < 3) { - try pp.err(first, .empty_filename); + try pp.err(first, .empty_filename, .{}); return; } const filename = tok_slice[1 .. tok_slice.len - 1]; @@ -2868,7 +3013,7 @@ fn embed(pp: *Preprocessor, tokenizer: *Tokenizer) MacroError!void { }; pp.token_buf.items.len = 0; - var limit: ?u32 = null; + var limit: ?std.Io.Limit = null; var prefix: ?Range = null; var suffix: ?Range = null; var if_empty: ?Range = null; @@ -2878,7 +3023,7 @@ fn embed(pp: *Preprocessor, tokenizer: *Tokenizer) MacroError!void { .nl, .eof => break, .identifier => {}, else => { - try pp.err(param_first, .malformed_embed_param); + try pp.err(param_first, .malformed_embed_param, .{}); continue; }, } @@ -2892,22 +3037,25 @@ fn embed(pp: *Preprocessor, tokenizer: *Tokenizer) MacroError!void { // vendor::param const param = tokenizer.nextNoWS(); if (param.id != .identifier) { - try pp.err(param, .malformed_embed_param); + try pp.err(param, .malformed_embed_param, .{}); continue; } const l_paren = tokenizer.nextNoWS(); if (l_paren.id != .l_paren) { - try pp.err(l_paren, .malformed_embed_param); + try pp.err(l_paren, .malformed_embed_param, .{}); continue; } - try pp.char_buf.appendSlice(Attribute.normalize(pp.tokSlice(param_first))); - try pp.char_buf.appendSlice("::"); - try pp.char_buf.appendSlice(Attribute.normalize(pp.tokSlice(param))); + const vendor = Attribute.normalize(pp.tokSlice(param_first)); + const param_name = Attribute.normalize(pp.tokSlice(param)); + try pp.char_buf.ensureUnusedCapacity(gpa, vendor.len + 2 + param_name.len); + pp.char_buf.appendSliceAssumeCapacity(vendor); + pp.char_buf.appendSliceAssumeCapacity("::"); + pp.char_buf.appendSliceAssumeCapacity(param_name); break :blk pp.char_buf.items; }, .l_paren => Attribute.normalize(pp.tokSlice(param_first)), else => { - try pp.err(maybe_colon, .malformed_embed_param); + try pp.err(maybe_colon, .malformed_embed_param, .{}); continue; }, }; @@ -2917,63 +3065,59 @@ fn embed(pp: *Preprocessor, tokenizer: *Tokenizer) MacroError!void { const next = tokenizer.nextNoWS(); if (next.id == .r_paren) break; if (next.id == .eof) { - try pp.err(maybe_colon, .malformed_embed_param); + try pp.err(maybe_colon, .malformed_embed_param, .{}); break; } - try pp.token_buf.append(next); + try pp.token_buf.append(gpa, next); } const end: u32 = @intCast(pp.token_buf.items.len); if (std.mem.eql(u8, param, "limit")) { if (limit != null) { - try pp.errStr(tokFromRaw(param_first), .duplicate_embed_param, "limit"); + try pp.err(tokFromRaw(param_first), .duplicate_embed_param, .{"limit"}); continue; } if (start + 1 != end) { - try pp.err(param_first, .malformed_embed_limit); + try pp.err(param_first, .malformed_embed_limit, .{}); continue; } const limit_tok = pp.token_buf.items[start]; if (limit_tok.id != .pp_num) { - try pp.err(param_first, .malformed_embed_limit); + try pp.err(param_first, .malformed_embed_limit, .{}); continue; } - limit = std.fmt.parseInt(u32, pp.tokSlice(limit_tok), 10) catch { - try pp.err(limit_tok, .malformed_embed_limit); + limit = .limited(std.fmt.parseInt(u32, pp.tokSlice(limit_tok), 10) catch { + try pp.err(limit_tok, .malformed_embed_limit, .{}); continue; - }; + }); pp.token_buf.items.len = start; } else if (std.mem.eql(u8, param, "prefix")) { if (prefix != null) { - try pp.errStr(tokFromRaw(param_first), .duplicate_embed_param, "prefix"); + try pp.err(tokFromRaw(param_first), .duplicate_embed_param, .{"prefix"}); continue; } prefix = .{ .start = start, .end = end }; } else if (std.mem.eql(u8, param, "suffix")) { if (suffix != null) { - try pp.errStr(tokFromRaw(param_first), .duplicate_embed_param, "suffix"); + try pp.err(tokFromRaw(param_first), .duplicate_embed_param, .{"suffix"}); continue; } suffix = .{ .start = start, .end = end }; } else if (std.mem.eql(u8, param, "if_empty")) { if (if_empty != null) { - try pp.errStr(tokFromRaw(param_first), .duplicate_embed_param, "if_empty"); + try pp.err(tokFromRaw(param_first), .duplicate_embed_param, .{"if_empty"}); continue; } if_empty = .{ .start = start, .end = end }; } else { - try pp.errStr( - tokFromRaw(param_first), - .unsupported_embed_param, - try pp.comp.diagnostics.arena.allocator().dupe(u8, param), - ); + try pp.err(tokFromRaw(param_first), .unsupported_embed_param, .{param}); pp.token_buf.items.len = start; } } - const embed_bytes = (try pp.comp.findEmbed(filename, first.source, include_type, limit)) orelse + const embed_bytes = (try pp.comp.findEmbed(filename, first.source, include_type, limit orelse .unlimited, pp.dep_file)) orelse return pp.fatalNotFound(filename_tok, filename); - defer pp.comp.gpa.free(embed_bytes); + defer gpa.free(embed_bytes); try Range.expand(prefix, pp, tokenizer); @@ -2988,22 +3132,20 @@ fn embed(pp: *Preprocessor, tokenizer: *Tokenizer) MacroError!void { // TODO: We currently only support systems with CHAR_BIT == 8 // If the target's CHAR_BIT is not 8, we need to write out correctly-sized embed_bytes // and correctly account for the target's endianness - const writer = pp.comp.generated_buf.writer(pp.gpa); - { const byte = embed_bytes[0]; const start = pp.comp.generated_buf.items.len; - try writer.print("{d}", .{byte}); + try pp.comp.generated_buf.print(gpa, "{d}", .{byte}); pp.addTokenAssumeCapacity(try pp.makeGeneratedToken(start, .embed_byte, filename_tok)); } for (embed_bytes[1..]) |byte| { const start = pp.comp.generated_buf.items.len; - try writer.print(",{d}", .{byte}); + try pp.comp.generated_buf.print(gpa, ",{d}", .{byte}); pp.addTokenAssumeCapacity(.{ .id = .comma, .loc = .{ .id = .generated, .byte_offset = @intCast(start) } }); pp.addTokenAssumeCapacity(try pp.makeGeneratedToken(start + 1, .embed_byte, filename_tok)); } - try pp.comp.generated_buf.append(pp.gpa, '\n'); + try pp.comp.generated_buf.append(gpa, '\n'); try Range.expand(suffix, pp, tokenizer); } @@ -3015,15 +3157,14 @@ fn include(pp: *Preprocessor, tokenizer: *Tokenizer, which: Compilation.WhichInc error.InvalidInclude => return, else => |e| return e, }; + const gpa = pp.comp.gpa; // Prevent stack overflow pp.include_depth += 1; defer pp.include_depth -= 1; if (pp.include_depth > max_include_depth) { - try pp.comp.addDiagnostic(.{ - .tag = .too_many_includes, - .loc = .{ .id = first.source, .byte_offset = first.start, .line = first.line }, - }, &.{}); + const loc: Source.Location = .{ .id = first.source, .byte_offset = first.start, .line = first.line }; + try pp.err(loc, .too_many_includes, .{}); return error.StopPreprocessing; } @@ -3031,6 +3172,7 @@ fn include(pp: *Preprocessor, tokenizer: *Tokenizer, which: Compilation.WhichInc if (pp.defines.contains(guard)) return; } + if (pp.dep_file) |dep| try dep.addDependency(gpa, new_source.path); if (pp.verbose) { pp.verboseLog(first, "include file {s}", .{new_source.path}); } @@ -3039,7 +3181,7 @@ fn include(pp: *Preprocessor, tokenizer: *Tokenizer, which: Compilation.WhichInc try pp.addIncludeStart(new_source); const eof = pp.preprocessExtra(new_source) catch |er| switch (er) { error.StopPreprocessing => { - for (pp.expansion_entries.items(.locs)[token_state.expansion_entries_len..]) |loc| TokenWithExpansionLocs.free(loc, pp.gpa); + for (pp.expansion_entries.items(.locs)[token_state.expansion_entries_len..]) |loc| TokenWithExpansionLocs.free(loc, gpa); pp.restoreTokenState(token_state); return; }, @@ -3070,19 +3212,22 @@ fn include(pp: *Preprocessor, tokenizer: *Tokenizer, which: Compilation.WhichInc /// operator_loc: Location of `_Pragma`; null if this is from #pragma /// arg_locs: expansion locations of the argument to _Pragma. empty if #pragma or a raw string literal was used fn makePragmaToken(pp: *Preprocessor, raw: RawToken, operator_loc: ?Source.Location, arg_locs: []const Source.Location) !TokenWithExpansionLocs { + const gpa = pp.comp.gpa; var tok = tokFromRaw(raw); if (operator_loc) |loc| { - try tok.addExpansionLocation(pp.gpa, &.{loc}); + try tok.addExpansionLocation(gpa, &.{loc}); } - try tok.addExpansionLocation(pp.gpa, arg_locs); + try tok.addExpansionLocation(gpa, arg_locs); return tok; } -pub fn addToken(pp: *Preprocessor, tok: TokenWithExpansionLocs) !void { +pub fn addToken(pp: *Preprocessor, tok_arg: TokenWithExpansionLocs) !void { + const gpa = pp.comp.gpa; + const tok = try pp.unescapeUcn(tok_arg); if (tok.expansion_locs) |expansion_locs| { - try pp.expansion_entries.append(pp.gpa, .{ .idx = @intCast(pp.tokens.len), .locs = expansion_locs }); + try pp.expansion_entries.append(gpa, .{ .idx = @intCast(pp.tokens.len), .locs = expansion_locs }); } - try pp.tokens.append(pp.gpa, .{ .id = tok.id, .loc = tok.loc }); + try pp.tokens.append(gpa, .{ .id = tok.id, .loc = tok.loc }); } pub fn addTokenAssumeCapacity(pp: *Preprocessor, tok: TokenWithExpansionLocs) void { @@ -3093,13 +3238,15 @@ pub fn addTokenAssumeCapacity(pp: *Preprocessor, tok: TokenWithExpansionLocs) vo } pub fn ensureTotalTokenCapacity(pp: *Preprocessor, capacity: usize) !void { - try pp.tokens.ensureTotalCapacity(pp.gpa, capacity); - try pp.expansion_entries.ensureTotalCapacity(pp.gpa, capacity); + const gpa = pp.comp.gpa; + try pp.tokens.ensureTotalCapacity(gpa, capacity); + try pp.expansion_entries.ensureTotalCapacity(gpa, capacity); } pub fn ensureUnusedTokenCapacity(pp: *Preprocessor, capacity: usize) !void { - try pp.tokens.ensureUnusedCapacity(pp.gpa, capacity); - try pp.expansion_entries.ensureUnusedCapacity(pp.gpa, capacity); + const gpa = pp.comp.gpa; + try pp.tokens.ensureUnusedCapacity(gpa, capacity); + try pp.expansion_entries.ensureUnusedCapacity(gpa, capacity); } /// Handle a pragma directive @@ -3107,10 +3254,10 @@ fn pragma(pp: *Preprocessor, tokenizer: *Tokenizer, pragma_tok: RawToken, operat const name_tok = tokenizer.nextNoWS(); if (name_tok.id == .nl or name_tok.id == .eof) return; - const name = pp.tokSlice(name_tok); try pp.addToken(try pp.makePragmaToken(pragma_tok, operator_loc, arg_locs)); const pragma_start: u32 = @intCast(pp.tokens.len); + const name = pp.tokSlice(name_tok); const pragma_name_tok = try pp.makePragmaToken(name_tok, operator_loc, arg_locs); try pp.addToken(pragma_name_tok); while (true) { @@ -3132,10 +3279,8 @@ fn pragma(pp: *Preprocessor, tokenizer: *Tokenizer, pragma_tok: RawToken, operat else => |e| return e, }; } - return pp.comp.addDiagnostic(.{ - .tag = .unknown_pragma, - .loc = pragma_name_tok.loc, - }, pragma_name_tok.expansionSlice()); + + try pp.err(pragma_name_tok, .unknown_pragma, .{}); } fn findIncludeFilenameToken( @@ -3160,21 +3305,20 @@ fn findIncludeFilenameToken( else => {}, } } - try pp.comp.addDiagnostic(.{ - .tag = .header_str_closing, - .loc = .{ .id = first.source, .byte_offset = tokenizer.index, .line = first.line }, - }, &.{}); - try pp.err(first, .header_str_match); + const loc: Source.Location = .{ .id = first.source, .byte_offset = tokenizer.index, .line = first.line }; + try pp.err(loc, .header_str_closing, .{}); + try pp.err(first, .header_str_match, .{}); } const source_tok = tokFromRaw(first); const filename_tok, const expanded_trailing = switch (source_tok.id) { .string_literal, .macro_string => .{ source_tok, false }, else => expanded: { + const gpa = pp.comp.gpa; // Try to expand if the argument is a macro. pp.top_expansion_buf.items.len = 0; - defer for (pp.top_expansion_buf.items) |tok| TokenWithExpansionLocs.free(tok.expansion_locs, pp.gpa); - try pp.top_expansion_buf.append(source_tok); + defer for (pp.top_expansion_buf.items) |tok| TokenWithExpansionLocs.free(tok.expansion_locs, gpa); + try pp.top_expansion_buf.append(gpa, source_tok); pp.expansion_source_loc = source_tok.loc; try pp.expandMacroExhaustive(tokenizer, &pp.top_expansion_buf, 0, 1, true, .non_expr); @@ -3184,7 +3328,7 @@ fn findIncludeFilenameToken( return error.InvalidInclude; }; const start = pp.comp.generated_buf.items.len; - try pp.comp.generated_buf.appendSlice(pp.gpa, include_str); + try pp.comp.generated_buf.appendSlice(gpa, include_str); break :expanded .{ try pp.makeGeneratedToken(start, switch (include_str[0]) { '"' => .string_literal, @@ -3200,17 +3344,11 @@ fn findIncludeFilenameToken( const nl = tokenizer.nextNoWS(); if ((nl.id != .nl and nl.id != .eof) or expanded_trailing) { skipToNl(tokenizer); - try pp.comp.diagnostics.addExtra(pp.comp.langopts, .{ - .tag = .extra_tokens_directive_end, - .loc = filename_tok.loc, - }, filename_tok.expansionSlice(), false); + try pp.err(filename_tok, .extra_tokens_directive_end, .{}); } }, .ignore_trailing_tokens => if (expanded_trailing) { - try pp.comp.diagnostics.addExtra(pp.comp.langopts, .{ - .tag = .extra_tokens_directive_end, - .loc = filename_tok.loc, - }, filename_tok.expansionSlice(), false); + try pp.err(filename_tok, .extra_tokens_directive_end, .{}); }, } return filename_tok; @@ -3218,12 +3356,12 @@ fn findIncludeFilenameToken( fn findIncludeSource(pp: *Preprocessor, tokenizer: *Tokenizer, first: RawToken, which: Compilation.WhichInclude) !Source { const filename_tok = try pp.findIncludeFilenameToken(first, tokenizer, .expect_nl_eof); - defer TokenWithExpansionLocs.free(filename_tok.expansion_locs, pp.gpa); + defer TokenWithExpansionLocs.free(filename_tok.expansion_locs, pp.comp.gpa); // Check for empty filename. const tok_slice = pp.expandedSliceExtra(filename_tok, .single_macro_ws); if (tok_slice.len < 3) { - try pp.err(first, .empty_filename); + try pp.err(first, .empty_filename, .{}); return error.InvalidInclude; } @@ -3241,31 +3379,14 @@ fn findIncludeSource(pp: *Preprocessor, tokenizer: *Tokenizer, first: RawToken, fn printLinemarker( pp: *Preprocessor, - w: anytype, + w: *std.Io.Writer, line_no: u32, source: Source, start_resume: enum(u8) { start, @"resume", none }, ) !void { try w.writeByte('#'); if (pp.linemarkers == .line_directives) try w.writeAll("line"); - try w.print(" {d} \"", .{line_no}); - for (source.path) |byte| switch (byte) { - '\n' => try w.writeAll("\\n"), - '\r' => try w.writeAll("\\r"), - '\t' => try w.writeAll("\\t"), - '\\' => try w.writeAll("\\\\"), - '"' => try w.writeAll("\\\""), - ' ', '!', '#'...'&', '('...'[', ']'...'~' => try w.writeByte(byte), - // Use hex escapes for any non-ASCII/unprintable characters. - // This ensures that the parsed version of this string will end up - // containing the same bytes as the input regardless of encoding. - else => { - try w.writeAll("\\x"); - // TODO try w.printInt(byte, 16, .lower, .{ .width = 2, .fill = '0' }); - try w.print("{x:0>2}", .{byte}); - }, - }; - try w.writeByte('"'); + try w.print(" {d} \"{f}\"", .{ line_no, fmtEscapes(source.path) }); if (pp.linemarkers == .numeric_directives) { switch (start_resume) { .none => {}, @@ -3301,7 +3422,7 @@ pub const DumpMode = enum { /// Pretty-print the macro define or undef at location `loc`. /// We re-tokenize the directive because we are printing a macro that may have the same name as one in /// `pp.defines` but a different definition (due to being #undef'ed and then redefined) -fn prettyPrintMacro(pp: *Preprocessor, w: anytype, loc: Source.Location, parts: enum { name_only, name_and_body }) !void { +fn prettyPrintMacro(pp: *Preprocessor, w: *std.Io.Writer, loc: Source.Location, parts: enum { name_only, name_and_body }) !void { const source = pp.comp.getSource(loc.id); var tokenizer: Tokenizer = .{ .buf = source.buf, @@ -3339,9 +3460,8 @@ fn prettyPrintMacro(pp: *Preprocessor, w: anytype, loc: Source.Location, parts: } } -fn prettyPrintMacrosOnly(pp: *Preprocessor, w: anytype) !void { - var it = pp.defines.valueIterator(); - while (it.next()) |macro| { +fn prettyPrintMacrosOnly(pp: *Preprocessor, w: *std.Io.Writer) !void { + for (pp.defines.values()) |macro| { if (macro.is_builtin) continue; try w.writeAll("#define "); @@ -3351,7 +3471,7 @@ fn prettyPrintMacrosOnly(pp: *Preprocessor, w: anytype) !void { } /// Pretty print tokens and try to preserve whitespace. -pub fn prettyPrintTokens(pp: *Preprocessor, w: anytype, macro_dump_mode: DumpMode) !void { +pub fn prettyPrintTokens(pp: *Preprocessor, w: *std.Io.Writer, macro_dump_mode: DumpMode) !void { if (macro_dump_mode == .macros_only) { return pp.prettyPrintMacrosOnly(w); } @@ -3365,6 +3485,7 @@ pub fn prettyPrintTokens(pp: *Preprocessor, w: anytype, macro_dump_mode: DumpMod switch (cur.id) { .eof => { if (!last_nl) try w.writeByte('\n'); + try w.flush(); return; }, .nl => { @@ -3374,6 +3495,7 @@ pub fn prettyPrintTokens(pp: *Preprocessor, w: anytype, macro_dump_mode: DumpMod newlines += 1; } else if (id == .eof) { if (!last_nl) try w.writeByte('\n'); + try w.flush(); return; } else if (id != .whitespace) { if (pp.linemarkers == .none) { @@ -3467,19 +3589,44 @@ pub fn prettyPrintTokens(pp: *Preprocessor, w: anytype, macro_dump_mode: DumpMod } } +/// Like `std.zig.fmtEscapes`, but for C strings. Hex escapes are used for any +/// non-ASCII/unprintable bytes to ensure that the string bytes do not change if +/// the encoding of the file is not UTF-8. +fn fmtEscapes(bytes: []const u8) FmtEscapes { + return .{ .bytes = bytes }; +} +const FmtEscapes = struct { + bytes: []const u8, + pub fn format(ctx: FmtEscapes, w: *std.Io.Writer) !void { + for (ctx.bytes) |byte| switch (byte) { + '\n' => try w.writeAll("\\n"), + '\r' => try w.writeAll("\\r"), + '\t' => try w.writeAll("\\t"), + '\\' => try w.writeAll("\\\\"), + '"' => try w.writeAll("\\\""), + ' ', '!', '#'...'&', '('...'[', ']'...'~' => try w.writeByte(byte), + // Use hex escapes for any non-ASCII/unprintable characters. + // This ensures that the parsed version of this string will end up + // containing the same bytes as the input regardless of encoding. + else => try w.print("\\x{x:0>2}", .{byte}), + }; + } +}; + test "Preserve pragma tokens sometimes" { - const allocator = std.testing.allocator; + const gpa = std.testing.allocator; const Test = struct { fn runPreprocessor(source_text: []const u8) ![]const u8 { - var buf = std.array_list.Managed(u8).init(allocator); - defer buf.deinit(); + var arena: std.heap.ArenaAllocator = .init(gpa); + defer arena.deinit(); - var comp = Compilation.init(allocator, std.fs.cwd()); + var diagnostics: Diagnostics = .{ .output = .ignore }; + var comp = Compilation.init(gpa, arena.allocator(), &diagnostics, std.fs.cwd()); defer comp.deinit(); try comp.addDefaultPragmaHandlers(); - var pp = Preprocessor.init(&comp); + var pp = Preprocessor.init(&comp, .default); defer pp.deinit(); pp.preserve_whitespace = true; @@ -3488,13 +3635,17 @@ test "Preserve pragma tokens sometimes" { const test_runner_macros = try comp.addSourceFromBuffer("", source_text); const eof = try pp.preprocess(test_runner_macros); try pp.addToken(eof); - try pp.prettyPrintTokens(buf.writer(), .result_only); - return allocator.dupe(u8, buf.items); + + var allocating: std.Io.Writer.Allocating = .init(gpa); + defer allocating.deinit(); + + try pp.prettyPrintTokens(&allocating.writer, .result_only); + return allocating.toOwnedSlice(); } fn check(source_text: []const u8, expected: []const u8) !void { const output = try runPreprocessor(source_text); - defer allocator.free(output); + defer gpa.free(output); try std.testing.expectEqualStrings(expected, output); } @@ -3525,18 +3676,21 @@ test "Preserve pragma tokens sometimes" { } test "destringify" { - const allocator = std.testing.allocator; + const gpa = std.testing.allocator; const Test = struct { fn testDestringify(pp: *Preprocessor, stringified: []const u8, destringified: []const u8) !void { pp.char_buf.clearRetainingCapacity(); - try pp.char_buf.ensureUnusedCapacity(stringified.len); + try pp.char_buf.ensureUnusedCapacity(gpa, stringified.len); pp.destringify(stringified); try std.testing.expectEqualStrings(destringified, pp.char_buf.items); } }; - var comp = Compilation.init(allocator, std.fs.cwd()); + var arena: std.heap.ArenaAllocator = .init(gpa); + defer arena.deinit(); + var diagnostics: Diagnostics = .{ .output = .ignore }; + var comp = Compilation.init(gpa, arena.allocator(), &diagnostics, std.fs.cwd()); defer comp.deinit(); - var pp = Preprocessor.init(&comp); + var pp = Preprocessor.init(&comp, .default); defer pp.deinit(); try Test.testDestringify(&pp, "hello\tworld\n", "hello\tworld\n"); @@ -3591,30 +3745,33 @@ test "Include guards" { }; } - fn testIncludeGuard(allocator: std.mem.Allocator, comptime template: []const u8, tok_id: RawToken.Id, expected_guards: u32) !void { - var comp = Compilation.init(allocator, std.fs.cwd()); + fn testIncludeGuard(gpa: std.mem.Allocator, comptime template: []const u8, tok_id: RawToken.Id, expected_guards: u32) !void { + var arena_state: std.heap.ArenaAllocator = .init(gpa); + defer arena_state.deinit(); + const arena = arena_state.allocator(); + + var diagnostics: Diagnostics = .{ .output = .ignore }; + var comp = Compilation.init(gpa, arena, &diagnostics, std.fs.cwd()); defer comp.deinit(); - var pp = Preprocessor.init(&comp); + var pp = Preprocessor.init(&comp, .default); defer pp.deinit(); - const path = try std.fs.path.join(allocator, &.{ ".", "bar.h" }); - defer allocator.free(path); + const path = try std.fs.path.join(arena, &.{ ".", "bar.h" }); _ = try comp.addSourceFromBuffer(path, "int bar = 5;\n"); - var buf = std.array_list.Managed(u8).init(allocator); - defer buf.deinit(); + var buf: std.ArrayList(u8) = .empty; + defer buf.deinit(gpa); - var writer = buf.writer(); switch (tok_id) { - .keyword_include, .keyword_include_next => try writer.print(template, .{ tok_id.lexeme().?, " \"bar.h\"" }), - .keyword_define, .keyword_undef => try writer.print(template, .{ tok_id.lexeme().?, " BAR" }), + .keyword_include, .keyword_include_next => try buf.print(gpa, template, .{ tok_id.lexeme().?, " \"bar.h\"" }), + .keyword_define, .keyword_undef => try buf.print(gpa, template, .{ tok_id.lexeme().?, " BAR" }), .keyword_ifndef, .keyword_ifdef, .keyword_elifdef, .keyword_elifndef, - => try writer.print(template, .{ tok_id.lexeme().?, " BAR\n#endif" }), - else => try writer.print(template, .{ tok_id.lexeme().?, "" }), + => try buf.print(gpa, template, .{ tok_id.lexeme().?, " BAR\n#endif" }), + else => try buf.print(gpa, template, .{ tok_id.lexeme().?, "" }), } const source = try comp.addSourceFromBuffer("test.h", buf.items); _ = try pp.preprocess(source); diff --git a/lib/compiler/aro/aro/Preprocessor/Diagnostic.zig b/lib/compiler/aro/aro/Preprocessor/Diagnostic.zig new file mode 100644 index 000000000000..f80afb409c2e --- /dev/null +++ b/lib/compiler/aro/aro/Preprocessor/Diagnostic.zig @@ -0,0 +1,451 @@ +const std = @import("std"); + +const Diagnostics = @import("../Diagnostics.zig"); +const LangOpts = @import("../LangOpts.zig"); +const Compilation = @import("../Compilation.zig"); + +const Diagnostic = @This(); + +fmt: []const u8, +kind: Diagnostics.Message.Kind, +opt: ?Diagnostics.Option = null, +extension: bool = false, +show_in_system_headers: bool = false, + +pub const elif_without_if: Diagnostic = .{ + .fmt = "#elif without #if", + .kind = .@"error", +}; + +pub const elif_after_else: Diagnostic = .{ + .fmt = "#elif after #else", + .kind = .@"error", +}; + +pub const elifdef_without_if: Diagnostic = .{ + .fmt = "#elifdef without #if", + .kind = .@"error", +}; + +pub const elifdef_after_else: Diagnostic = .{ + .fmt = "#elifdef after #else", + .kind = .@"error", +}; + +pub const elifndef_without_if: Diagnostic = .{ + .fmt = "#elifndef without #if", + .kind = .@"error", +}; + +pub const elifndef_after_else: Diagnostic = .{ + .fmt = "#elifndef after #else", + .kind = .@"error", +}; + +pub const else_without_if: Diagnostic = .{ + .fmt = "#else without #if", + .kind = .@"error", +}; + +pub const else_after_else: Diagnostic = .{ + .fmt = "#else after #else", + .kind = .@"error", +}; + +pub const endif_without_if: Diagnostic = .{ + .fmt = "#endif without #if", + .kind = .@"error", +}; + +pub const unknown_pragma: Diagnostic = .{ + .fmt = "unknown pragma ignored", + .opt = .@"unknown-pragmas", + .kind = .off, +}; + +pub const line_simple_digit: Diagnostic = .{ + .fmt = "#line directive requires a simple digit sequence", + .kind = .@"error", +}; + +pub const line_invalid_filename: Diagnostic = .{ + .fmt = "invalid filename for #line directive", + .kind = .@"error", +}; + +pub const unterminated_conditional_directive: Diagnostic = .{ + .fmt = "unterminated conditional directive", + .kind = .@"error", +}; + +pub const invalid_preprocessing_directive: Diagnostic = .{ + .fmt = "invalid preprocessing directive", + .kind = .@"error", +}; + +pub const error_directive: Diagnostic = .{ + .fmt = "{s}", + .kind = .@"error", +}; + +pub const warning_directive: Diagnostic = .{ + .fmt = "{s}", + .opt = .@"#warnings", + .kind = .warning, + .show_in_system_headers = true, +}; + +pub const macro_name_missing: Diagnostic = .{ + .fmt = "macro name missing", + .kind = .@"error", +}; + +pub const extra_tokens_directive_end: Diagnostic = .{ + .fmt = "extra tokens at end of macro directive", + .kind = .@"error", +}; + +pub const expected_value_in_expr: Diagnostic = .{ + .fmt = "expected value in expression", + .kind = .@"error", +}; + +pub const defined_as_macro_name: Diagnostic = .{ + .fmt = "'defined' cannot be used as a macro name", + .kind = .@"error", +}; + +pub const macro_name_must_be_identifier: Diagnostic = .{ + .fmt = "macro name must be an identifier", + .kind = .@"error", +}; + +pub const whitespace_after_macro_name: Diagnostic = .{ + .fmt = "ISO C99 requires whitespace after the macro name", + .opt = .@"c99-extensions", + .kind = .warning, + .extension = true, +}; + +pub const hash_hash_at_start: Diagnostic = .{ + .fmt = "'##' cannot appear at the start of a macro expansion", + .kind = .@"error", +}; + +pub const hash_hash_at_end: Diagnostic = .{ + .fmt = "'##' cannot appear at the end of a macro expansion", + .kind = .@"error", +}; + +pub const pasting_formed_invalid: Diagnostic = .{ + .fmt = "pasting formed '{s}', an invalid preprocessing token", + .kind = .@"error", +}; + +pub const missing_paren_param_list: Diagnostic = .{ + .fmt = "missing ')' in macro parameter list", + .kind = .@"error", +}; + +pub const unterminated_macro_param_list: Diagnostic = .{ + .fmt = "unterminated macro param list", + .kind = .@"error", +}; + +pub const invalid_token_param_list: Diagnostic = .{ + .fmt = "invalid token in macro parameter list", + .kind = .@"error", +}; + +pub const expected_comma_param_list: Diagnostic = .{ + .fmt = "expected comma in macro parameter list", + .kind = .@"error", +}; + +pub const hash_not_followed_param: Diagnostic = .{ + .fmt = "'#' is not followed by a macro parameter", + .kind = .@"error", +}; + +pub const expected_filename: Diagnostic = .{ + .fmt = "expected \"FILENAME\" or ", + .kind = .@"error", +}; + +pub const empty_filename: Diagnostic = .{ + .fmt = "empty filename", + .kind = .@"error", +}; + +pub const header_str_closing: Diagnostic = .{ + .fmt = "expected closing '>'", + .kind = .@"error", +}; + +pub const header_str_match: Diagnostic = .{ + .fmt = "to match this '<'", + .kind = .note, +}; + +pub const string_literal_in_pp_expr: Diagnostic = .{ + .fmt = "string literal in preprocessor expression", + .kind = .@"error", +}; + +pub const empty_char_literal_warning: Diagnostic = .{ + .fmt = "empty character constant", + .kind = .warning, + .opt = .@"invalid-pp-token", + .extension = true, +}; + +pub const unterminated_char_literal_warning: Diagnostic = .{ + .fmt = "missing terminating ' character", + .kind = .warning, + .opt = .@"invalid-pp-token", + .extension = true, +}; + +pub const unterminated_string_literal_warning: Diagnostic = .{ + .fmt = "missing terminating '\"' character", + .kind = .warning, + .opt = .@"invalid-pp-token", + .extension = true, +}; + +pub const unterminated_comment: Diagnostic = .{ + .fmt = "unterminated comment", + .kind = .@"error", +}; + +pub const malformed_embed_param: Diagnostic = .{ + .fmt = "unexpected token in embed parameter", + .kind = .@"error", +}; + +pub const malformed_embed_limit: Diagnostic = .{ + .fmt = "the limit parameter expects one non-negative integer as a parameter", + .kind = .@"error", +}; + +pub const duplicate_embed_param: Diagnostic = .{ + .fmt = "duplicate embed parameter '{s}'", + .kind = .warning, + .opt = .@"duplicate-embed-param", +}; + +pub const unsupported_embed_param: Diagnostic = .{ + .fmt = "unsupported embed parameter '{s}' embed parameter", + .kind = .warning, + .opt = .@"unsupported-embed-param", +}; + +pub const va_opt_lparen: Diagnostic = .{ + .fmt = "missing '(' following __VA_OPT__", + .kind = .@"error", +}; + +pub const va_opt_rparen: Diagnostic = .{ + .fmt = "unterminated __VA_OPT__ argument list", + .kind = .@"error", +}; + +pub const keyword_macro: Diagnostic = .{ + .fmt = "keyword is hidden by macro definition", + .kind = .off, + .opt = .@"keyword-macro", + .extension = true, +}; + +pub const undefined_macro: Diagnostic = .{ + .fmt = "'{s}' is not defined, evaluates to 0", + .kind = .off, + .opt = .undef, +}; + +pub const fn_macro_undefined: Diagnostic = .{ + .fmt = "function-like macro '{s}' is not defined", + .kind = .@"error", +}; + +// pub const preprocessing_directive_only: Diagnostic = .{ +// .fmt = "'{s}' must be used within a preprocessing directive", +// .extra = .tok_id_expected, +// .kind = .@"error", +// }; + +pub const missing_lparen_after_builtin: Diagnostic = .{ + .fmt = "Missing '(' after built-in macro '{s}'", + .kind = .@"error", +}; + +pub const too_many_includes: Diagnostic = .{ + .fmt = "#include nested too deeply", + .kind = .@"error", +}; + +pub const include_next: Diagnostic = .{ + .fmt = "#include_next is a language extension", + .kind = .off, + .opt = .@"gnu-include-next", + .extension = true, +}; + +pub const include_next_outside_header: Diagnostic = .{ + .fmt = "#include_next in primary source file; will search from start of include path", + .kind = .warning, + .opt = .@"include-next-outside-header", +}; + +pub const comma_deletion_va_args: Diagnostic = .{ + .fmt = "token pasting of ',' and __VA_ARGS__ is a GNU extension", + .kind = .off, + .opt = .@"gnu-zero-variadic-macro-arguments", + .extension = true, +}; + +pub const expansion_to_defined_obj: Diagnostic = .{ + .fmt = "macro expansion producing 'defined' has undefined behavior", + .kind = .off, + .opt = .@"expansion-to-defined", +}; + +pub const expansion_to_defined_func: Diagnostic = .{ + .fmt = expansion_to_defined_obj.fmt, + .kind = .off, + .opt = .@"expansion-to-defined", + .extension = true, +}; + +pub const invalid_pp_stringify_escape: Diagnostic = .{ + .fmt = "invalid string literal, ignoring final '\\'", + .kind = .warning, +}; + +pub const gnu_va_macro: Diagnostic = .{ + .fmt = "named variadic macros are a GNU extension", + .opt = .@"variadic-macros", + .kind = .off, + .extension = true, +}; + +pub const pragma_operator_string_literal: Diagnostic = .{ + .fmt = "_Pragma requires exactly one string literal token", + .kind = .@"error", +}; + +pub const invalid_preproc_expr_start: Diagnostic = .{ + .fmt = "invalid token at start of a preprocessor expression", + .kind = .@"error", +}; + +pub const newline_eof: Diagnostic = .{ + .fmt = "no newline at end of file", + .opt = .@"newline-eof", + .kind = .off, + .extension = true, +}; + +pub const malformed_warning_check: Diagnostic = .{ + .fmt = "{s} expected option name (e.g. \"-Wundef\")", + .opt = .@"malformed-warning-check", + .kind = .warning, + .extension = true, +}; + +pub const feature_check_requires_identifier: Diagnostic = .{ + .fmt = "builtin feature check macro requires a parenthesized identifier", + .kind = .@"error", +}; + +pub const builtin_macro_redefined: Diagnostic = .{ + .fmt = "redefining builtin macro", + .opt = .@"builtin-macro-redefined", + .kind = .warning, + .extension = true, +}; + +pub const macro_redefined: Diagnostic = .{ + .fmt = "'{s}' macro redefined", + .opt = .@"macro-redefined", + .kind = .warning, + .extension = true, +}; + +pub const previous_definition: Diagnostic = .{ + .fmt = "previous definition is here", + .kind = .note, +}; + +pub const unterminated_macro_arg_list: Diagnostic = .{ + .fmt = "unterminated function macro argument list", + .kind = .@"error", +}; + +pub const to_match_paren: Diagnostic = .{ + .fmt = "to match this '('", + .kind = .note, +}; + +pub const closing_paren: Diagnostic = .{ + .fmt = "expected closing ')'", + .kind = .@"error", +}; + +pub const poisoned_identifier: Diagnostic = .{ + .fmt = "attempt to use a poisoned identifier", + .kind = .@"error", +}; + +pub const expected_arguments: Diagnostic = .{ + .fmt = "expected {d} argument(s) got {d}", + .kind = .@"error", +}; + +pub const expected_at_least_arguments: Diagnostic = .{ + .fmt = "expected at least {d} argument(s) got {d}", + .kind = .warning, +}; + +pub const invalid_preproc_operator: Diagnostic = .{ + .fmt = "token is not a valid binary operator in a preprocessor subexpression", + .kind = .@"error", +}; + +pub const expected_str_literal_in: Diagnostic = .{ + .fmt = "expected string literal in '{s}'", + .kind = .@"error", +}; + +pub const builtin_missing_r_paren: Diagnostic = .{ + .fmt = "missing ')', after {s}", + .kind = .@"error", +}; + +pub const cannot_convert_to_identifier: Diagnostic = .{ + .fmt = "cannot convert {s} to an identifier", + .kind = .@"error", +}; + +pub const expected_identifier: Diagnostic = .{ + .fmt = "expected identifier argument", + .kind = .@"error", +}; + +pub const incomplete_ucn: Diagnostic = .{ + .fmt = "incomplete universal character name; treating as '\\' followed by identifier", + .kind = .warning, + .opt = .unicode, +}; + +pub const invalid_source_epoch: Diagnostic = .{ + .fmt = "environment variable SOURCE_DATE_EPOCH must expand to a non-negative integer less than or equal to 253402300799", + .kind = .@"error", +}; + +pub const date_time: Diagnostic = .{ + .fmt = "expansion of date or time macro is not reproducible", + .kind = .off, + .opt = .@"date-time", + .show_in_system_headers = true, +}; diff --git a/lib/compiler/aro/aro/Source.zig b/lib/compiler/aro/aro/Source.zig index 20788af21c3e..b2d72ea11cf7 100644 --- a/lib/compiler/aro/aro/Source.zig +++ b/lib/compiler/aro/aro/Source.zig @@ -24,6 +24,21 @@ pub const Location = struct { pub fn eql(a: Location, b: Location) bool { return a.id == b.id and a.byte_offset == b.byte_offset and a.line == b.line; } + + pub fn expand(loc: Location, comp: *const @import("Compilation.zig")) ExpandedLocation { + const source = comp.getSource(loc.id); + return source.lineCol(loc); + } +}; + +pub const ExpandedLocation = struct { + path: []const u8, + line: []const u8, + line_no: u32, + col: u32, + width: u32, + end_with_splice: bool, + kind: Kind, }; const Source = @This(); @@ -51,9 +66,7 @@ pub fn physicalLine(source: Source, loc: Location) u32 { return loc.line + source.numSplicesBefore(loc.byte_offset); } -const LineCol = struct { line: []const u8, line_no: u32, col: u32, width: u32, end_with_splice: bool }; - -pub fn lineCol(source: Source, loc: Location) LineCol { +pub fn lineCol(source: Source, loc: Location) ExpandedLocation { var start: usize = 0; // find the start of the line which is either a newline or a splice if (std.mem.lastIndexOfScalar(u8, source.buf[0..loc.byte_offset], '\n')) |some| start = some + 1; @@ -102,11 +115,13 @@ pub fn lineCol(source: Source, loc: Location) LineCol { nl = source.splice_locs[splice_index]; } return .{ + .path = source.path, .line = source.buf[start..nl], .line_no = loc.line + splice_index, .col = col, .width = width, .end_with_splice = end_with_splice, + .kind = source.kind, }; } diff --git a/lib/compiler/aro/aro/StringInterner.zig b/lib/compiler/aro/aro/StringInterner.zig index b6e0cd79a583..e22ec23a467f 100644 --- a/lib/compiler/aro/aro/StringInterner.zig +++ b/lib/compiler/aro/aro/StringInterner.zig @@ -2,82 +2,34 @@ const std = @import("std"); const mem = std.mem; const Compilation = @import("Compilation.zig"); -const StringToIdMap = std.StringHashMapUnmanaged(StringId); +const StringInterner = @This(); pub const StringId = enum(u32) { - empty, + empty = std.math.maxInt(u32), _, -}; - -pub const TypeMapper = struct { - const LookupSpeed = enum { - fast, - slow, - }; - - data: union(LookupSpeed) { - fast: []const []const u8, - slow: *const StringToIdMap, - }, - pub fn lookup(self: TypeMapper, string_id: StringInterner.StringId) []const u8 { - if (string_id == .empty) return ""; - switch (self.data) { - .fast => |arr| return arr[@intFromEnum(string_id)], - .slow => |map| { - var it = map.iterator(); - while (it.next()) |entry| { - if (entry.value_ptr.* == string_id) return entry.key_ptr.*; - } - unreachable; - }, - } + pub fn lookup(id: StringId, comp: *const Compilation) []const u8 { + if (id == .empty) return ""; + return comp.string_interner.table.keys()[@intFromEnum(id)]; } - pub fn deinit(self: TypeMapper, allocator: mem.Allocator) void { - switch (self.data) { - .slow => {}, - .fast => |arr| allocator.free(arr), - } + pub fn lookupExtra(id: StringId, si: StringInterner) []const u8 { + if (id == .empty) return ""; + return si.table.keys()[@intFromEnum(id)]; } }; -const StringInterner = @This(); - -string_table: StringToIdMap = .{}, -next_id: StringId = @enumFromInt(@intFromEnum(StringId.empty) + 1), - -pub fn deinit(self: *StringInterner, allocator: mem.Allocator) void { - self.string_table.deinit(allocator); -} +table: std.StringArrayHashMapUnmanaged(void) = .empty, -pub fn intern(comp: *Compilation, str: []const u8) !StringId { - return comp.string_interner.internExtra(comp.gpa, str); +pub fn deinit(si: *StringInterner, allocator: mem.Allocator) void { + si.table.deinit(allocator); + si.* = undefined; } -pub fn internExtra(self: *StringInterner, allocator: mem.Allocator, str: []const u8) !StringId { +/// Intern externally owned string. +pub fn intern(si: *StringInterner, allocator: mem.Allocator, str: []const u8) !StringId { if (str.len == 0) return .empty; - const gop = try self.string_table.getOrPut(allocator, str); - if (gop.found_existing) return gop.value_ptr.*; - - defer self.next_id = @enumFromInt(@intFromEnum(self.next_id) + 1); - gop.value_ptr.* = self.next_id; - return self.next_id; -} - -/// deinit for the returned TypeMapper is a no-op and does not need to be called -pub fn getSlowTypeMapper(self: *const StringInterner) TypeMapper { - return TypeMapper{ .data = .{ .slow = &self.string_table } }; -} - -/// Caller must call `deinit` on the returned TypeMapper -pub fn getFastTypeMapper(self: *const StringInterner, allocator: mem.Allocator) !TypeMapper { - var strings = try allocator.alloc([]const u8, @intFromEnum(self.next_id)); - var it = self.string_table.iterator(); - strings[0] = ""; - while (it.next()) |entry| { - strings[@intFromEnum(entry.value_ptr.*)] = entry.key_ptr.*; - } - return TypeMapper{ .data = .{ .fast = strings } }; + const gop = try si.table.getOrPut(allocator, str); + return @enumFromInt(gop.index); } diff --git a/lib/compiler/aro/aro/SymbolStack.zig b/lib/compiler/aro/aro/SymbolStack.zig index 4c01e3d3567f..781e19f4e29a 100644 --- a/lib/compiler/aro/aro/SymbolStack.zig +++ b/lib/compiler/aro/aro/SymbolStack.zig @@ -2,22 +2,24 @@ const std = @import("std"); const mem = std.mem; const Allocator = mem.Allocator; const assert = std.debug.assert; + +const Parser = @import("Parser.zig"); +const StringId = @import("StringInterner.zig").StringId; const Tree = @import("Tree.zig"); const Token = Tree.Token; const TokenIndex = Tree.TokenIndex; -const NodeIndex = Tree.NodeIndex; -const Type = @import("Type.zig"); -const Parser = @import("Parser.zig"); +const Node = Tree.Node; +const QualType = @import("TypeStore.zig").QualType; const Value = @import("Value.zig"); -const StringId = @import("StringInterner.zig").StringId; const SymbolStack = @This(); pub const Symbol = struct { name: StringId, - ty: Type, + qt: QualType, tok: TokenIndex, - node: NodeIndex = .none, + node: Node.OptIndex = .null, + out_of_scope: bool = false, kind: Kind, val: Value, }; @@ -33,7 +35,7 @@ pub const Kind = enum { constexpr, }; -scopes: std.ArrayListUnmanaged(Scope) = .empty, +scopes: std.ArrayList(Scope) = .empty, /// allocations from nested scopes are retained after popping; `active_len` is the number /// of currently-active items in `scopes`. active_len: usize = 0, @@ -64,7 +66,7 @@ pub fn deinit(s: *SymbolStack, gpa: Allocator) void { pub fn pushScope(s: *SymbolStack, p: *Parser) !void { if (s.active_len + 1 > s.scopes.items.len) { - try s.scopes.append(p.gpa, .{}); + try s.scopes.append(p.comp.gpa, .{}); s.active_len = s.scopes.items.len; } else { s.scopes.items[s.active_len].clearRetainingCapacity(); @@ -82,17 +84,17 @@ pub fn findTypedef(s: *SymbolStack, p: *Parser, name: StringId, name_tok: TokenI .typedef => return prev, .@"struct" => { if (no_type_yet) return null; - try p.errStr(.must_use_struct, name_tok, p.tokSlice(name_tok)); + try p.err(name_tok, .must_use_struct, .{p.tokSlice(name_tok)}); return prev; }, .@"union" => { if (no_type_yet) return null; - try p.errStr(.must_use_union, name_tok, p.tokSlice(name_tok)); + try p.err(name_tok, .must_use_union, .{p.tokSlice(name_tok)}); return prev; }, .@"enum" => { if (no_type_yet) return null; - try p.errStr(.must_use_enum, name_tok, p.tokSlice(name_tok)); + try p.err(name_tok, .must_use_enum, .{p.tokSlice(name_tok)}); return prev; }, else => return null, @@ -120,8 +122,8 @@ pub fn findTag( else => unreachable, } if (s.get(name, .tags) == null) return null; - try p.errStr(.wrong_tag, name_tok, p.tokSlice(name_tok)); - try p.errTok(.previous_definition, prev.tok); + try p.err(name_tok, .wrong_tag, .{p.tokSlice(name_tok)}); + try p.err(prev.tok, .previous_definition, .{}); return null; } @@ -171,38 +173,34 @@ pub fn defineTypedef( s: *SymbolStack, p: *Parser, name: StringId, - ty: Type, + qt: QualType, tok: TokenIndex, - node: NodeIndex, + node: Node.Index, ) !void { if (s.get(name, .vars)) |prev| { switch (prev.kind) { .typedef => { - if (!prev.ty.is(.invalid)) { - if (!ty.eql(prev.ty, p.comp, true)) { - try p.errStr(.redefinition_of_typedef, tok, try p.typePairStrExtra(ty, " vs ", prev.ty)); - if (prev.tok != 0) try p.errTok(.previous_definition, prev.tok); - } + if (!prev.qt.isInvalid() and !qt.eqlQualified(prev.qt, p.comp)) { + if (qt.isInvalid()) return; + const non_typedef_qt = qt.type(p.comp).typedef.base; + const non_typedef_prev_qt = prev.qt.type(p.comp).typedef.base; + try p.err(tok, .redefinition_of_typedef, .{ non_typedef_qt, non_typedef_prev_qt }); + if (prev.tok != 0) try p.err(prev.tok, .previous_definition, .{}); } }, .enumeration, .decl, .def, .constexpr => { - try p.errStr(.redefinition_different_sym, tok, p.tokSlice(tok)); - try p.errTok(.previous_definition, prev.tok); + try p.err(tok, .redefinition_different_sym, .{p.tokSlice(tok)}); + try p.err(prev.tok, .previous_definition, .{}); }, else => unreachable, } } - try s.define(p.gpa, .{ + try s.define(p.comp.gpa, .{ .kind = .typedef, .name = name, .tok = tok, - .ty = .{ - .name = name, - .specifier = ty.specifier, - .qual = ty.qual, - .data = ty.data, - }, - .node = node, + .qt = qt, + .node = .pack(node), .val = .{}, }); } @@ -211,42 +209,48 @@ pub fn defineSymbol( s: *SymbolStack, p: *Parser, name: StringId, - ty: Type, + qt: QualType, tok: TokenIndex, - node: NodeIndex, + node: Node.Index, val: Value, constexpr: bool, ) !void { if (s.get(name, .vars)) |prev| { switch (prev.kind) { .enumeration => { - try p.errStr(.redefinition_different_sym, tok, p.tokSlice(tok)); - try p.errTok(.previous_definition, prev.tok); + if (qt.isInvalid()) return; + try p.err(tok, .redefinition_different_sym, .{p.tokSlice(tok)}); + try p.err(prev.tok, .previous_definition, .{}); }, .decl => { - if (!ty.eql(prev.ty, p.comp, true)) { - try p.errStr(.redefinition_incompatible, tok, p.tokSlice(tok)); - try p.errTok(.previous_definition, prev.tok); + if (!prev.qt.isInvalid() and !qt.eqlQualified(prev.qt, p.comp)) { + if (qt.isInvalid()) return; + try p.err(tok, .redefinition_incompatible, .{p.tokSlice(tok)}); + try p.err(prev.tok, .previous_definition, .{}); + } else { + if (prev.node.unpack()) |some| p.setTentativeDeclDefinition(some, node); } }, - .def, .constexpr => { - try p.errStr(.redefinition, tok, p.tokSlice(tok)); - try p.errTok(.previous_definition, prev.tok); + .def, .constexpr => if (!prev.qt.isInvalid()) { + if (qt.isInvalid()) return; + try p.err(tok, .redefinition, .{p.tokSlice(tok)}); + try p.err(prev.tok, .previous_definition, .{}); }, .typedef => { - try p.errStr(.redefinition_different_sym, tok, p.tokSlice(tok)); - try p.errTok(.previous_definition, prev.tok); + if (qt.isInvalid()) return; + try p.err(tok, .redefinition_different_sym, .{p.tokSlice(tok)}); + try p.err(prev.tok, .previous_definition, .{}); }, else => unreachable, } } - try s.define(p.gpa, .{ + try s.define(p.comp.gpa, .{ .kind = if (constexpr) .constexpr else .def, .name = name, .tok = tok, - .ty = ty, - .node = node, + .qt = qt, + .node = .pack(node), .val = val, }); } @@ -264,69 +268,96 @@ pub fn declareSymbol( s: *SymbolStack, p: *Parser, name: StringId, - ty: Type, + qt: QualType, tok: TokenIndex, - node: NodeIndex, + node: Node.Index, ) !void { if (s.get(name, .vars)) |prev| { switch (prev.kind) { .enumeration => { - try p.errStr(.redefinition_different_sym, tok, p.tokSlice(tok)); - try p.errTok(.previous_definition, prev.tok); + if (qt.isInvalid()) return; + try p.err(tok, .redefinition_different_sym, .{p.tokSlice(tok)}); + try p.err(prev.tok, .previous_definition, .{}); }, .decl => { - if (!ty.eql(prev.ty, p.comp, true)) { - try p.errStr(.redefinition_incompatible, tok, p.tokSlice(tok)); - try p.errTok(.previous_definition, prev.tok); + if (!prev.qt.isInvalid() and !qt.eqlQualified(prev.qt, p.comp)) { + if (qt.isInvalid()) return; + try p.err(tok, .redefinition_incompatible, .{p.tokSlice(tok)}); + try p.err(prev.tok, .previous_definition, .{}); + } else { + if (prev.node.unpack()) |some| p.setTentativeDeclDefinition(node, some); } }, .def, .constexpr => { - if (!ty.eql(prev.ty, p.comp, true)) { - try p.errStr(.redefinition_incompatible, tok, p.tokSlice(tok)); - try p.errTok(.previous_definition, prev.tok); + if (!prev.qt.isInvalid() and !qt.eqlQualified(prev.qt, p.comp)) { + if (qt.isInvalid()) return; + try p.err(tok, .redefinition_incompatible, .{p.tokSlice(tok)}); + try p.err(prev.tok, .previous_definition, .{}); } else { + if (prev.node.unpack()) |some| p.setTentativeDeclDefinition(node, some); return; } }, .typedef => { - try p.errStr(.redefinition_different_sym, tok, p.tokSlice(tok)); - try p.errTok(.previous_definition, prev.tok); + if (qt.isInvalid()) return; + try p.err(tok, .redefinition_different_sym, .{p.tokSlice(tok)}); + try p.err(prev.tok, .previous_definition, .{}); }, else => unreachable, } } - try s.define(p.gpa, .{ + try s.define(p.comp.gpa, .{ .kind = .decl, .name = name, .tok = tok, - .ty = ty, - .node = node, + .qt = qt, + .node = .pack(node), .val = .{}, }); + + // Declare out of scope symbol for functions declared in functions. + if (s.active_len > 1 and !p.comp.langopts.standard.atLeast(.c23) and qt.is(p.comp, .func)) { + try s.scopes.items[0].vars.put(p.comp.gpa, name, .{ + .kind = .decl, + .name = name, + .tok = tok, + .qt = qt, + .node = .pack(node), + .val = .{}, + .out_of_scope = true, + }); + } } -pub fn defineParam(s: *SymbolStack, p: *Parser, name: StringId, ty: Type, tok: TokenIndex) !void { +pub fn defineParam( + s: *SymbolStack, + p: *Parser, + name: StringId, + qt: QualType, + tok: TokenIndex, + node: ?Node.Index, +) !void { if (s.get(name, .vars)) |prev| { switch (prev.kind) { - .enumeration, .decl, .def, .constexpr => { - try p.errStr(.redefinition_of_parameter, tok, p.tokSlice(tok)); - try p.errTok(.previous_definition, prev.tok); + .enumeration, .decl, .def, .constexpr => if (!prev.qt.isInvalid()) { + if (qt.isInvalid()) return; + try p.err(tok, .redefinition_of_parameter, .{p.tokSlice(tok)}); + try p.err(prev.tok, .previous_definition, .{}); }, .typedef => { - try p.errStr(.redefinition_different_sym, tok, p.tokSlice(tok)); - try p.errTok(.previous_definition, prev.tok); + if (qt.isInvalid()) return; + try p.err(tok, .redefinition_different_sym, .{p.tokSlice(tok)}); + try p.err(prev.tok, .previous_definition, .{}); }, else => unreachable, } } - if (ty.is(.fp16) and !p.comp.hasHalfPrecisionFloatABI()) { - try p.errStr(.suggest_pointer_for_invalid_fp16, tok, "parameters"); - } - try s.define(p.gpa, .{ + try s.define(p.comp.gpa, .{ .kind = .def, .name = name, .tok = tok, - .ty = ty, + .qt = qt, + .node = .packOpt(node), .val = .{}, }); } @@ -342,20 +373,20 @@ pub fn defineTag( switch (prev.kind) { .@"enum" => { if (kind == .keyword_enum) return prev; - try p.errStr(.wrong_tag, tok, p.tokSlice(tok)); - try p.errTok(.previous_definition, prev.tok); + try p.err(tok, .wrong_tag, .{p.tokSlice(tok)}); + try p.err(prev.tok, .previous_definition, .{}); return null; }, .@"struct" => { if (kind == .keyword_struct) return prev; - try p.errStr(.wrong_tag, tok, p.tokSlice(tok)); - try p.errTok(.previous_definition, prev.tok); + try p.err(tok, .wrong_tag, .{p.tokSlice(tok)}); + try p.err(prev.tok, .previous_definition, .{}); return null; }, .@"union" => { if (kind == .keyword_union) return prev; - try p.errStr(.wrong_tag, tok, p.tokSlice(tok)); - try p.errTok(.previous_definition, prev.tok); + try p.err(tok, .wrong_tag, .{p.tokSlice(tok)}); + try p.err(prev.tok, .previous_definition, .{}); return null; }, else => unreachable, @@ -366,34 +397,39 @@ pub fn defineEnumeration( s: *SymbolStack, p: *Parser, name: StringId, - ty: Type, + qt: QualType, tok: TokenIndex, val: Value, + node: Node.Index, ) !void { if (s.get(name, .vars)) |prev| { switch (prev.kind) { - .enumeration => { - try p.errStr(.redefinition, tok, p.tokSlice(tok)); - try p.errTok(.previous_definition, prev.tok); + .enumeration => if (!prev.qt.isInvalid()) { + if (qt.isInvalid()) return; + try p.err(tok, .redefinition, .{p.tokSlice(tok)}); + try p.err(prev.tok, .previous_definition, .{}); return; }, .decl, .def, .constexpr => { - try p.errStr(.redefinition_different_sym, tok, p.tokSlice(tok)); - try p.errTok(.previous_definition, prev.tok); + if (qt.isInvalid()) return; + try p.err(tok, .redefinition_different_sym, .{p.tokSlice(tok)}); + try p.err(prev.tok, .previous_definition, .{}); return; }, .typedef => { - try p.errStr(.redefinition_different_sym, tok, p.tokSlice(tok)); - try p.errTok(.previous_definition, prev.tok); + if (qt.isInvalid()) return; + try p.err(tok, .redefinition_different_sym, .{p.tokSlice(tok)}); + try p.err(prev.tok, .previous_definition, .{}); }, else => unreachable, } } - try s.define(p.gpa, .{ + try s.define(p.comp.gpa, .{ .kind = .enumeration, .name = name, .tok = tok, - .ty = ty, + .qt = qt, .val = val, + .node = .pack(node), }); } diff --git a/lib/compiler/aro/aro/Tokenizer.zig b/lib/compiler/aro/aro/Tokenizer.zig index f703940fd8ea..1a06dcb3d861 100644 --- a/lib/compiler/aro/aro/Tokenizer.zig +++ b/lib/compiler/aro/aro/Tokenizer.zig @@ -1,8 +1,45 @@ const std = @import("std"); const assert = std.debug.assert; + const Compilation = @import("Compilation.zig"); -const Source = @import("Source.zig"); const LangOpts = @import("LangOpts.zig"); +const Source = @import("Source.zig"); + +/// Value for valid escapes indicates how many characters to consume, not counting leading backslash +const UCNKind = enum(u8) { + /// Just `\` + none, + /// \u or \U followed by an insufficient number of hex digits + incomplete, + /// `\uxxxx` + hex4 = 5, + /// `\Uxxxxxxxx` + hex8 = 9, + + /// In the classification phase we do not care if the escape represents a valid universal character name + /// e.g. \UFFFFFFFF is acceptable. + fn classify(buf: []const u8) UCNKind { + assert(buf[0] == '\\'); + if (buf.len == 1) return .none; + switch (buf[1]) { + 'u' => { + if (buf.len < 6) return .incomplete; + for (buf[2..6]) |c| { + if (!std.ascii.isHex(c)) return .incomplete; + } + return .hex4; + }, + 'U' => { + if (buf.len < 10) return .incomplete; + for (buf[2..10]) |c| { + if (!std.ascii.isHex(c)) return .incomplete; + } + return .hex8; + }, + else => return .none, + } + } +}; pub const Token = struct { id: Id, @@ -18,7 +55,7 @@ pub const Token = struct { eof, /// identifier containing solely basic character set characters identifier, - /// identifier with at least one extended character + /// identifier with at least one extended character or UCN escape sequence extended_identifier, // string literals with prefixes @@ -147,6 +184,10 @@ pub const Token = struct { macro_counter, /// Special token for implementing _Pragma macro_param_pragma_operator, + /// Special token for implementing __identifier (MS extension) + macro_param_ms_identifier, + /// Special token for implementing __pragma (MS extension) + macro_param_ms_pragma, /// Special identifier for implementing __func__ macro_func, @@ -154,6 +195,12 @@ pub const Token = struct { macro_function, /// Special identifier for implementing __PRETTY_FUNCTION__ macro_pretty_func, + /// Special identifier for implementing __DATE__ + macro_date, + /// Special identifier for implementing __TIME__ + macro_time, + /// Special identifier for implementing __TIMESTAMP__ + macro_timestamp, keyword_auto, keyword_auto_type, @@ -290,13 +337,21 @@ pub const Token = struct { keyword_thiscall2, keyword_vectorcall, keyword_vectorcall2, - - // builtins that require special parsing - builtin_choose_expr, - builtin_va_arg, - builtin_offsetof, - builtin_bitoffsetof, - builtin_types_compatible_p, + keyword_fastcall, + keyword_fastcall2, + keyword_regcall, + keyword_cdecl, + keyword_cdecl2, + keyword_forceinline, + keyword_forceinline2, + keyword_unaligned, + keyword_unaligned2, + + // Type nullability + keyword_nonnull, + keyword_nullable, + keyword_nullable_result, + keyword_null_unspecified, /// Generated by #embed directive /// Decimal value with no prefix or suffix @@ -323,6 +378,12 @@ pub const Token = struct { /// A comment token if asked to preserve comments. comment, + /// Incomplete universal character name + /// This happens if the source text contains `\u` or `\U` followed by an insufficient number of hex + /// digits. This token id represents just the backslash; the subsequent `u` or `U` will be treated as the + /// leading character of the following identifier token. + incomplete_ucn, + /// Return true if token is identifier or keyword. pub fn isMacroIdentifier(id: Id) bool { switch (id) { @@ -347,6 +408,9 @@ pub const Token = struct { .macro_func, .macro_function, .macro_pretty_func, + .macro_date, + .macro_time, + .macro_timestamp, .keyword_auto, .keyword_auto_type, .keyword_break, @@ -409,11 +473,6 @@ pub const Token = struct { .keyword_restrict2, .keyword_alignof1, .keyword_alignof2, - .builtin_choose_expr, - .builtin_va_arg, - .builtin_offsetof, - .builtin_bitoffsetof, - .builtin_types_compatible_p, .keyword_attribute1, .keyword_attribute2, .keyword_extension, @@ -444,6 +503,19 @@ pub const Token = struct { .keyword_thiscall2, .keyword_vectorcall, .keyword_vectorcall2, + .keyword_fastcall, + .keyword_fastcall2, + .keyword_regcall, + .keyword_cdecl, + .keyword_cdecl2, + .keyword_forceinline, + .keyword_forceinline2, + .keyword_unaligned, + .keyword_unaligned2, + .keyword_nonnull, + .keyword_nullable, + .keyword_nullable_result, + .keyword_null_unspecified, .keyword_bit_int, .keyword_c23_alignas, .keyword_c23_alignof, @@ -547,11 +619,18 @@ pub const Token = struct { .macro_file, .macro_line, .macro_counter, + .macro_time, + .macro_date, + .macro_timestamp, .macro_param_pragma_operator, + .macro_param_ms_identifier, + .macro_param_ms_pragma, .placemarker, => "", .macro_ws => " ", + .incomplete_ucn => "\\", + .macro_func => "__func__", .macro_function => "__FUNCTION__", .macro_pretty_func => "__PRETTY_FUNCTION__", @@ -695,11 +774,6 @@ pub const Token = struct { .keyword_alignof2 => "__alignof__", .keyword_typeof1 => "__typeof", .keyword_typeof2 => "__typeof__", - .builtin_choose_expr => "__builtin_choose_expr", - .builtin_va_arg => "__builtin_va_arg", - .builtin_offsetof => "__builtin_offsetof", - .builtin_bitoffsetof => "__builtin_bitoffsetof", - .builtin_types_compatible_p => "__builtin_types_compatible_p", .keyword_attribute1 => "__attribute", .keyword_attribute2 => "__attribute__", .keyword_extension => "__extension__", @@ -730,6 +804,19 @@ pub const Token = struct { .keyword_thiscall2 => "_thiscall", .keyword_vectorcall => "__vectorcall", .keyword_vectorcall2 => "_vectorcall", + .keyword_fastcall => "__fastcall", + .keyword_fastcall2 => "_fastcall", + .keyword_regcall => "__regcall", + .keyword_cdecl => "__cdecl", + .keyword_cdecl2 => "_cdecl", + .keyword_forceinline => "__forceinline", + .keyword_forceinline2 => "_forceinline", + .keyword_unaligned => "__unaligned", + .keyword_unaligned2 => "_unaligned", + .keyword_nonnull => "_Nonnull", + .keyword_nullable => "_Nullable", + .keyword_nullable_result => "_Nullable_result", + .keyword_null_unspecified => "_Null_unspecified", }; } @@ -742,11 +829,6 @@ pub const Token = struct { .macro_func, .macro_function, .macro_pretty_func, - .builtin_choose_expr, - .builtin_va_arg, - .builtin_offsetof, - .builtin_bitoffsetof, - .builtin_types_compatible_p, => "an identifier", .string_literal, .string_literal_utf_16, @@ -763,7 +845,7 @@ pub const Token = struct { .unterminated_char_literal, .empty_char_literal, => "a character literal", - .pp_num, .embed_byte => "A number", + .pp_num, .embed_byte => "a number", else => id.lexeme().?, }; } @@ -871,6 +953,12 @@ pub const Token = struct { .keyword_stdcall2, .keyword_thiscall2, .keyword_vectorcall2, + .keyword_fastcall2, + .keyword_cdecl2, + .keyword_forceinline, + .keyword_forceinline2, + .keyword_unaligned, + .keyword_unaligned2, => if (langopts.ms_extensions) kw else .identifier, else => kw, }; @@ -1013,13 +1101,21 @@ pub const Token = struct { .{ "_thiscall", .keyword_thiscall2 }, .{ "__vectorcall", .keyword_vectorcall }, .{ "_vectorcall", .keyword_vectorcall2 }, - - // builtins that require special parsing - .{ "__builtin_choose_expr", .builtin_choose_expr }, - .{ "__builtin_va_arg", .builtin_va_arg }, - .{ "__builtin_offsetof", .builtin_offsetof }, - .{ "__builtin_bitoffsetof", .builtin_bitoffsetof }, - .{ "__builtin_types_compatible_p", .builtin_types_compatible_p }, + .{ "__fastcall", .keyword_fastcall }, + .{ "_fastcall", .keyword_fastcall2 }, + .{ "_regcall", .keyword_regcall }, + .{ "__cdecl", .keyword_cdecl }, + .{ "_cdecl", .keyword_cdecl2 }, + .{ "__forceinline", .keyword_forceinline }, + .{ "_forceinline", .keyword_forceinline2 }, + .{ "__unaligned", .keyword_unaligned }, + .{ "_unaligned", .keyword_unaligned2 }, + + // Type nullability + .{ "_Nonnull", .keyword_nonnull }, + .{ "_Nullable", .keyword_nullable }, + .{ "_Nullable_result", .keyword_nullable_result }, + .{ "_Null_unspecified", .keyword_null_unspecified }, }); }; @@ -1099,6 +1195,26 @@ pub fn next(self: *Tokenizer) Token { 'u' => state = .u, 'U' => state = .U, 'L' => state = .L, + '\\' => { + const ucn_kind = UCNKind.classify(self.buf[self.index..]); + switch (ucn_kind) { + .none => { + self.index += 1; + id = .invalid; + break; + }, + .incomplete => { + self.index += 1; + id = .incomplete_ucn; + break; + }, + .hex4, .hex8 => { + self.index += @intFromEnum(ucn_kind); + id = .extended_identifier; + state = .extended_identifier; + }, + } + }, 'a'...'t', 'v'...'z', 'A'...'K', 'M'...'T', 'V'...'Z', '_' => state = .identifier, '=' => state = .equal, '!' => state = .bang, @@ -1324,6 +1440,20 @@ pub fn next(self: *Tokenizer) Token { break; }, 0x80...0xFF => state = .extended_identifier, + '\\' => { + const ucn_kind = UCNKind.classify(self.buf[self.index..]); + switch (ucn_kind) { + .none, .incomplete => { + id = if (state == .identifier) Token.getTokenId(self.langopts, self.buf[start..self.index]) else .extended_identifier; + break; + }, + .hex4, .hex8 => { + state = .extended_identifier; + self.index += @intFromEnum(ucn_kind); + }, + } + }, + else => { id = if (state == .identifier) Token.getTokenId(self.langopts, self.buf[start..self.index]) else .extended_identifier; break; @@ -1731,7 +1861,10 @@ pub fn next(self: *Tokenizer) Token { } } else if (self.index == self.buf.len) { switch (state) { - .start, .line_comment => {}, + .start => {}, + .line_comment => if (self.langopts.preserve_comments) { + id = .comment; + }, .u, .u8, .U, .L, .identifier => id = Token.getTokenId(self.langopts, self.buf[start..self.index]), .extended_identifier => id = .extended_identifier, @@ -2105,6 +2238,15 @@ test "comments" { .hash, .identifier, }); + try expectTokensExtra( + \\//foo + \\void + \\//bar + , &.{ + .comment, .nl, + .keyword_void, .nl, + .comment, + }, .{ .preserve_comments = true }); } test "extended identifiers" { @@ -2147,36 +2289,76 @@ test "C23 keywords" { .keyword_c23_thread_local, .keyword_nullptr, .keyword_typeof_unqual, - }, .c23); + }, .{ .standard = .c23 }); } -test "Tokenizer fuzz test" { - var comp = Compilation.init(std.testing.allocator, std.fs.cwd()); - defer comp.deinit(); - - const input_bytes = std.testing.fuzzInput(.{}); - if (input_bytes.len == 0) return; - - const source = try comp.addSourceFromBuffer("fuzz.c", input_bytes); +test "Universal character names" { + try expectTokens("\\", &.{.invalid}); + try expectTokens("\\g", &.{ .invalid, .identifier }); + try expectTokens("\\u", &.{ .incomplete_ucn, .identifier }); + try expectTokens("\\ua", &.{ .incomplete_ucn, .identifier }); + try expectTokens("\\U9", &.{ .incomplete_ucn, .identifier }); + try expectTokens("\\ug", &.{ .incomplete_ucn, .identifier }); + try expectTokens("\\uag", &.{ .incomplete_ucn, .identifier }); + + try expectTokens("\\ ", &.{ .invalid, .eof }); + try expectTokens("\\g ", &.{ .invalid, .identifier, .eof }); + try expectTokens("\\u ", &.{ .incomplete_ucn, .identifier, .eof }); + try expectTokens("\\ua ", &.{ .incomplete_ucn, .identifier, .eof }); + try expectTokens("\\U9 ", &.{ .incomplete_ucn, .identifier, .eof }); + try expectTokens("\\ug ", &.{ .incomplete_ucn, .identifier, .eof }); + try expectTokens("\\uag ", &.{ .incomplete_ucn, .identifier, .eof }); + + try expectTokens("a\\", &.{ .identifier, .invalid }); + try expectTokens("a\\g", &.{ .identifier, .invalid, .identifier }); + try expectTokens("a\\u", &.{ .identifier, .incomplete_ucn, .identifier }); + try expectTokens("a\\ua", &.{ .identifier, .incomplete_ucn, .identifier }); + try expectTokens("a\\U9", &.{ .identifier, .incomplete_ucn, .identifier }); + try expectTokens("a\\ug", &.{ .identifier, .incomplete_ucn, .identifier }); + try expectTokens("a\\uag", &.{ .identifier, .incomplete_ucn, .identifier }); + + try expectTokens("a\\ ", &.{ .identifier, .invalid, .eof }); + try expectTokens("a\\g ", &.{ .identifier, .invalid, .identifier, .eof }); + try expectTokens("a\\u ", &.{ .identifier, .incomplete_ucn, .identifier, .eof }); + try expectTokens("a\\ua ", &.{ .identifier, .incomplete_ucn, .identifier, .eof }); + try expectTokens("a\\U9 ", &.{ .identifier, .incomplete_ucn, .identifier, .eof }); + try expectTokens("a\\ug ", &.{ .identifier, .incomplete_ucn, .identifier, .eof }); + try expectTokens("a\\uag ", &.{ .identifier, .incomplete_ucn, .identifier, .eof }); +} - var tokenizer: Tokenizer = .{ - .buf = source.buf, - .source = source.id, - .langopts = comp.langopts, +test "Tokenizer fuzz test" { + const Context = struct { + fn testOne(_: @This(), input_bytes: []const u8) anyerror!void { + var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena.deinit(); + var comp = Compilation.init(std.testing.allocator, arena.allocator(), undefined, std.fs.cwd()); + defer comp.deinit(); + + const source = try comp.addSourceFromBuffer("fuzz.c", input_bytes); + + var tokenizer: Tokenizer = .{ + .buf = source.buf, + .source = source.id, + .langopts = comp.langopts, + }; + while (true) { + const prev_index = tokenizer.index; + const tok = tokenizer.next(); + if (tok.id == .eof) break; + try std.testing.expect(prev_index < tokenizer.index); // ensure that the tokenizer always makes progress + } + } }; - while (true) { - const prev_index = tokenizer.index; - const tok = tokenizer.next(); - if (tok.id == .eof) break; - try std.testing.expect(prev_index < tokenizer.index); // ensure that the tokenizer always makes progress - } + return std.testing.fuzz(Context{}, Context.testOne, .{}); } -fn expectTokensExtra(contents: []const u8, expected_tokens: []const Token.Id, standard: ?LangOpts.Standard) !void { - var comp = Compilation.init(std.testing.allocator, std.fs.cwd()); +fn expectTokensExtra(contents: []const u8, expected_tokens: []const Token.Id, langopts: ?LangOpts) !void { + var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena.deinit(); + var comp = Compilation.init(std.testing.allocator, arena.allocator(), undefined, std.fs.cwd()); defer comp.deinit(); - if (standard) |provided| { - comp.langopts.standard = provided; + if (langopts) |provided| { + comp.langopts = provided; } const source = try comp.addSourceFromBuffer("path", contents); var tokenizer = Tokenizer{ diff --git a/lib/compiler/aro/aro/Toolchain.zig b/lib/compiler/aro/aro/Toolchain.zig index 71365b7b75ee..75c04d72158c 100644 --- a/lib/compiler/aro/aro/Toolchain.zig +++ b/lib/compiler/aro/aro/Toolchain.zig @@ -1,14 +1,15 @@ const std = @import("std"); -const Driver = @import("Driver.zig"); -const Compilation = @import("Compilation.zig"); const mem = std.mem; + const system_defaults = @import("system_defaults"); -const target_util = @import("target.zig"); -const Linux = @import("toolchains/Linux.zig"); -const Multilib = @import("Driver/Multilib.zig"); + +const Compilation = @import("Compilation.zig"); +const Driver = @import("Driver.zig"); const Filesystem = @import("Driver/Filesystem.zig").Filesystem; +const Multilib = @import("Driver/Multilib.zig"); +const target_util = @import("target.zig"); -pub const PathList = std.ArrayListUnmanaged([]const u8); +pub const PathList = std.ArrayList([]const u8); pub const RuntimeLibKind = enum { compiler_rt, @@ -35,22 +36,13 @@ pub const UnwindLibKind = enum { const Inner = union(enum) { uninitialized, - linux: Linux, unknown: void, - - fn deinit(self: *Inner, allocator: mem.Allocator) void { - switch (self.*) { - .linux => |*linux| linux.deinit(allocator), - .uninitialized, .unknown => {}, - } - } }; const Toolchain = @This(); -filesystem: Filesystem = .{ .real = {} }, +filesystem: Filesystem, driver: *Driver, -arena: mem.Allocator, /// The list of toolchain specific path prefixes to search for libraries. library_paths: PathList = .{}, @@ -72,7 +64,6 @@ pub fn getTarget(tc: *const Toolchain) std.Target { fn getDefaultLinker(tc: *const Toolchain) []const u8 { return switch (tc.inner) { .uninitialized => unreachable, - .linux => |linux| linux.getDefaultLinker(tc.getTarget()), .unknown => "ld", }; } @@ -81,36 +72,26 @@ fn getDefaultLinker(tc: *const Toolchain) []const u8 { pub fn discover(tc: *Toolchain) !void { if (tc.inner != .uninitialized) return; - const target = tc.getTarget(); - tc.inner = switch (target.os.tag) { - .linux => if (target.cpu.arch == .hexagon) - .{ .unknown = {} } // TODO - else if (target.cpu.arch.isMIPS()) - .{ .unknown = {} } // TODO - else if (target.cpu.arch.isPowerPC()) - .{ .unknown = {} } // TODO - else if (target.cpu.arch == .ve) - .{ .unknown = {} } // TODO - else - .{ .linux = .{} }, - else => .{ .unknown = {} }, // TODO - }; + tc.inner = .unknown; return switch (tc.inner) { .uninitialized => unreachable, - .linux => |*linux| linux.discover(tc), .unknown => {}, }; } pub fn deinit(tc: *Toolchain) void { const gpa = tc.driver.comp.gpa; - tc.inner.deinit(gpa); tc.library_paths.deinit(gpa); tc.file_paths.deinit(gpa); tc.program_paths.deinit(gpa); } +/// Write assembler path to `buf` and return a slice of it +pub fn getAssemblerPath(tc: *const Toolchain, buf: []u8) ![]const u8 { + return tc.getProgramPath("as", buf); +} + /// Write linker path to `buf` and return a slice of it pub fn getLinkerPath(tc: *const Toolchain, buf: []u8) ![]const u8 { // --ld-path= takes precedence over -fuse-ld= and specifies the executable @@ -149,7 +130,12 @@ pub fn getLinkerPath(tc: *const Toolchain, buf: []u8) ![]const u8 { // to a relative path is surprising. This is more complex due to priorities // among -B, COMPILER_PATH and PATH. --ld-path= should be used instead. if (mem.indexOfScalar(u8, use_linker, '/') != null) { - try tc.driver.comp.addDiagnostic(.{ .tag = .fuse_ld_path }, &.{}); + try tc.driver.comp.diagnostics.add(.{ + .text = "'-fuse-ld=' taking a path is deprecated; use '--ld-path=' instead", + .kind = .off, + .opt = .@"fuse-ld-path", + .location = null, + }); } if (std.fs.path.isAbsolute(use_linker)) { @@ -157,8 +143,11 @@ pub fn getLinkerPath(tc: *const Toolchain, buf: []u8) ![]const u8 { return use_linker; } } else { - var linker_name = try std.array_list.Managed(u8).initCapacity(tc.driver.comp.gpa, 5 + use_linker.len); // "ld64." ++ use_linker - defer linker_name.deinit(); + const gpa = tc.driver.comp.gpa; + var linker_name: std.ArrayList(u8) = .empty; + defer linker_name.deinit(gpa); + try linker_name.ensureUnusedCapacity(tc.driver.comp.gpa, 5 + use_linker.len); // "ld64." ++ use_linker + if (tc.getTarget().os.tag.isDarwin()) { linker_name.appendSliceAssumeCapacity("ld64."); } else { @@ -185,27 +174,33 @@ pub fn getLinkerPath(tc: *const Toolchain, buf: []u8) ![]const u8 { /// TODO: this isn't exactly right since our target names don't necessarily match up /// with GCC's. /// For example the Zig target `arm-freestanding-eabi` would need the `arm-none-eabi` tools -fn possibleProgramNames(raw_triple: ?[]const u8, name: []const u8, buf: *[64]u8) std.BoundedArray([]const u8, 2) { - var possible_names: std.BoundedArray([]const u8, 2) = .{}; +fn possibleProgramNames( + raw_triple: ?[]const u8, + name: []const u8, + buf: *[64]u8, + possible_name_buf: *[2][]const u8, +) []const []const u8 { + var i: u32 = 0; if (raw_triple) |triple| { if (std.fmt.bufPrint(buf, "{s}-{s}", .{ triple, name })) |res| { - possible_names.appendAssumeCapacity(res); + possible_name_buf[i] = res; + i += 1; } else |_| {} } - possible_names.appendAssumeCapacity(name); + possible_name_buf[i] = name; - return possible_names; + return possible_name_buf[0..i]; } /// Add toolchain `file_paths` to argv as `-L` arguments -pub fn addFilePathLibArgs(tc: *const Toolchain, argv: *std.array_list.Managed([]const u8)) !void { - try argv.ensureUnusedCapacity(tc.file_paths.items.len); +pub fn addFilePathLibArgs(tc: *const Toolchain, argv: *std.ArrayList([]const u8)) !void { + try argv.ensureUnusedCapacity(tc.driver.comp.gpa, tc.file_paths.items.len); var bytes_needed: usize = 0; for (tc.file_paths.items) |path| { bytes_needed += path.len + 2; // +2 for `-L` } - var bytes = try tc.arena.alloc(u8, bytes_needed); + var bytes = try tc.driver.comp.arena.alloc(u8, bytes_needed); var index: usize = 0; for (tc.file_paths.items) |path| { @memcpy(bytes[index..][0..2], "-L"); @@ -223,9 +218,10 @@ fn getProgramPath(tc: *const Toolchain, name: []const u8, buf: []u8) []const u8 var fib = std.heap.FixedBufferAllocator.init(&path_buf); var tool_specific_buf: [64]u8 = undefined; - const possible_names = possibleProgramNames(tc.driver.raw_target_triple, name, &tool_specific_buf); + var possible_name_buf: [2][]const u8 = undefined; + const possible_names = possibleProgramNames(tc.driver.raw_target_triple, name, &tool_specific_buf, &possible_name_buf); - for (possible_names.constSlice()) |tool_name| { + for (possible_names) |tool_name| { for (tc.program_paths.items) |program_path| { defer fib.reset(); @@ -252,6 +248,7 @@ pub fn getFilePath(tc: *const Toolchain, name: []const u8) ![]const u8 { var path_buf: [std.fs.max_path_bytes]u8 = undefined; var fib = std.heap.FixedBufferAllocator.init(&path_buf); const allocator = fib.allocator(); + const arena = tc.driver.comp.arena; const sysroot = tc.getSysroot(); @@ -260,15 +257,15 @@ pub fn getFilePath(tc: *const Toolchain, name: []const u8) ![]const u8 { const aro_dir = std.fs.path.dirname(tc.driver.aro_name) orelse ""; const candidate = try std.fs.path.join(allocator, &.{ aro_dir, "..", name }); if (tc.filesystem.exists(candidate)) { - return tc.arena.dupe(u8, candidate); + return arena.dupe(u8, candidate); } if (tc.searchPaths(&fib, sysroot, tc.library_paths.items, name)) |path| { - return tc.arena.dupe(u8, path); + return arena.dupe(u8, path); } if (tc.searchPaths(&fib, sysroot, tc.file_paths.items, name)) |path| { - return try tc.arena.dupe(u8, path); + return try arena.dupe(u8, path); } return name; @@ -299,7 +296,7 @@ const PathKind = enum { program, }; -/// Join `components` into a path. If the path exists, dupe it into the toolchain arena and +/// Join `components` into a path. If the path exists, dupe it into the Compilation arena and /// add it to the specified path list. pub fn addPathIfExists(tc: *Toolchain, components: []const []const u8, dest_kind: PathKind) !void { var path_buf: [std.fs.max_path_bytes]u8 = undefined; @@ -308,7 +305,7 @@ pub fn addPathIfExists(tc: *Toolchain, components: []const []const u8, dest_kind const candidate = try std.fs.path.join(fib.allocator(), components); if (tc.filesystem.exists(candidate)) { - const duped = try tc.arena.dupe(u8, candidate); + const duped = try tc.driver.comp.arena.dupe(u8, candidate); const dest = switch (dest_kind) { .library => &tc.library_paths, .file => &tc.file_paths, @@ -318,10 +315,10 @@ pub fn addPathIfExists(tc: *Toolchain, components: []const []const u8, dest_kind } } -/// Join `components` using the toolchain arena and add the resulting path to `dest_kind`. Does not check +/// Join `components` using the Compilation arena and add the resulting path to `dest_kind`. Does not check /// whether the path actually exists pub fn addPathFromComponents(tc: *Toolchain, components: []const []const u8, dest_kind: PathKind) !void { - const full_path = try std.fs.path.join(tc.arena, components); + const full_path = try std.fs.path.join(tc.driver.comp.arena, components); const dest = switch (dest_kind) { .library => &tc.library_paths, .file => &tc.file_paths, @@ -330,16 +327,6 @@ pub fn addPathFromComponents(tc: *Toolchain, components: []const []const u8, des try dest.append(tc.driver.comp.gpa, full_path); } -/// Add linker args to `argv`. Does not add path to linker executable as first item; that must be handled separately -/// Items added to `argv` will be string literals or owned by `tc.arena` so they must not be individually freed -pub fn buildLinkerArgs(tc: *Toolchain, argv: *std.array_list.Managed([]const u8)) !void { - return switch (tc.inner) { - .uninitialized => unreachable, - .linux => |*linux| linux.buildLinkerArgs(tc, argv), - .unknown => @panic("This toolchain does not support linking yet"), - }; -} - fn getDefaultRuntimeLibKind(tc: *const Toolchain) RuntimeLibKind { if (tc.getTarget().abi.isAndroid()) { return .compiler_rt; @@ -396,7 +383,7 @@ fn getUnwindLibKind(tc: *const Toolchain) !UnwindLibKind { return .libgcc; } else if (mem.eql(u8, libname, "libunwind")) { if (tc.getRuntimeLibKind() == .libgcc) { - try tc.driver.comp.addDiagnostic(.{ .tag = .incompatible_unwindlib }, &.{}); + try tc.driver.err("--rtlib=libgcc requires --unwindlib=libgcc", .{}); } return .compiler_rt; } else { @@ -412,7 +399,7 @@ fn getAsNeededOption(is_solaris: bool, needed: bool) []const u8 { } } -fn addUnwindLibrary(tc: *const Toolchain, argv: *std.array_list.Managed([]const u8)) !void { +fn addUnwindLibrary(tc: *const Toolchain, argv: *std.ArrayList([]const u8)) !void { const unw = try tc.getUnwindLibKind(); const target = tc.getTarget(); if ((target.abi.isAndroid() and unw == .libgcc) or @@ -422,46 +409,49 @@ fn addUnwindLibrary(tc: *const Toolchain, argv: *std.array_list.Managed([]const const lgk = tc.getLibGCCKind(); const as_needed = lgk == .unspecified and !target.abi.isAndroid() and !target_util.isCygwinMinGW(target) and target.os.tag != .aix; + + try argv.ensureUnusedCapacity(tc.driver.comp.gpa, 3); if (as_needed) { - try argv.append(getAsNeededOption(target.os.tag == .solaris, true)); + argv.appendAssumeCapacity(getAsNeededOption(target.os.tag == .solaris, true)); } switch (unw) { .none => return, - .libgcc => if (lgk == .static) try argv.append("-lgcc_eh") else try argv.append("-lgcc_s"), + .libgcc => argv.appendAssumeCapacity(if (lgk == .static) "-lgcc_eh" else "-lgcc_s"), .compiler_rt => if (target.os.tag == .aix) { if (lgk != .static) { - try argv.append("-lunwind"); + argv.appendAssumeCapacity("-lunwind"); } } else if (lgk == .static) { - try argv.append("-l:libunwind.a"); + argv.appendAssumeCapacity("-l:libunwind.a"); } else if (lgk == .shared) { if (target_util.isCygwinMinGW(target)) { - try argv.append("-l:libunwind.dll.a"); + argv.appendAssumeCapacity("-l:libunwind.dll.a"); } else { - try argv.append("-l:libunwind.so"); + argv.appendAssumeCapacity("-l:libunwind.so"); } } else { - try argv.append("-lunwind"); + argv.appendAssumeCapacity("-lunwind"); }, } if (as_needed) { - try argv.append(getAsNeededOption(target.os.tag == .solaris, false)); + argv.appendAssumeCapacity(getAsNeededOption(target.os.tag == .solaris, false)); } } -fn addLibGCC(tc: *const Toolchain, argv: *std.array_list.Managed([]const u8)) !void { +fn addLibGCC(tc: *const Toolchain, argv: *std.ArrayList([]const u8)) !void { + const gpa = tc.driver.comp.gpa; const libgcc_kind = tc.getLibGCCKind(); if (libgcc_kind == .static or libgcc_kind == .unspecified) { - try argv.append("-lgcc"); + try argv.append(gpa, "-lgcc"); } try tc.addUnwindLibrary(argv); if (libgcc_kind == .shared) { - try argv.append("-lgcc"); + try argv.append(gpa, "-lgcc"); } } -pub fn addRuntimeLibs(tc: *const Toolchain, argv: *std.array_list.Managed([]const u8)) !void { +pub fn addRuntimeLibs(tc: *const Toolchain, argv: *std.ArrayList([]const u8)) !void { const target = tc.getTarget(); const rlt = tc.getRuntimeLibKind(); switch (rlt) { @@ -472,7 +462,7 @@ pub fn addRuntimeLibs(tc: *const Toolchain, argv: *std.array_list.Managed([]cons if (target_util.isKnownWindowsMSVCEnvironment(target)) { const rtlib_str = tc.driver.rtlib orelse system_defaults.rtlib; if (!mem.eql(u8, rtlib_str, "platform")) { - try tc.driver.comp.addDiagnostic(.{ .tag = .unsupported_rtlib_gcc, .extra = .{ .str = "MSVC" } }, &.{}); + try tc.driver.err("unsupported runtime library 'libgcc' for platform 'MSVC'", .{}); } } else { try tc.addLibGCC(argv); @@ -481,20 +471,19 @@ pub fn addRuntimeLibs(tc: *const Toolchain, argv: *std.array_list.Managed([]cons } if (target.abi.isAndroid() and !tc.driver.static and !tc.driver.static_pie) { - try argv.append("-ldl"); + try argv.append(tc.driver.comp.gpa, "-ldl"); } } pub fn defineSystemIncludes(tc: *Toolchain) !void { return switch (tc.inner) { .uninitialized => unreachable, - .linux => |*linux| linux.defineSystemIncludes(tc), .unknown => { if (tc.driver.nostdinc) return; const comp = tc.driver.comp; if (!tc.driver.nobuiltininc) { - try comp.addBuiltinIncludeDir(tc.driver.aro_name); + try comp.addBuiltinIncludeDir(tc.driver.aro_name, tc.driver.resource_dir); } if (!tc.driver.nostdlibinc) { diff --git a/lib/compiler/aro/aro/Tree.zig b/lib/compiler/aro/aro/Tree.zig index f03b8e2293de..9a64b11df18a 100644 --- a/lib/compiler/aro/aro/Tree.zig +++ b/lib/compiler/aro/aro/Tree.zig @@ -1,14 +1,15 @@ const std = @import("std"); + const Interner = @import("../backend.zig").Interner; + const Attribute = @import("Attribute.zig"); const CodeGen = @import("CodeGen.zig"); const Compilation = @import("Compilation.zig"); const number_affixes = @import("Tree/number_affixes.zig"); const Source = @import("Source.zig"); const Tokenizer = @import("Tokenizer.zig"); -const Type = @import("Type.zig"); +const QualType = @import("TypeStore.zig").QualType; const Value = @import("Value.zig"); -const StringInterner = @import("StringInterner.zig"); pub const Token = struct { id: Id, @@ -41,7 +42,7 @@ pub const TokenWithExpansionLocs = struct { pub fn addExpansionLocation(tok: *TokenWithExpansionLocs, gpa: std.mem.Allocator, new: []const Source.Location) !void { if (new.len == 0 or tok.id == .whitespace or tok.id == .macro_ws or tok.id == .placemarker) return; - var list = std.array_list.Managed(Source.Location).init(gpa); + var list: std.ArrayList(Source.Location) = .empty; defer { @memset(list.items.ptr[list.items.len..list.capacity], .{}); // Add a sentinel to indicate the end of the list since @@ -64,7 +65,7 @@ pub const TokenWithExpansionLocs = struct { const min_len = @max(list.items.len + new.len + 1, 4); const wanted_len = std.math.ceilPowerOfTwo(usize, min_len) catch return error.OutOfMemory; - try list.ensureTotalCapacity(wanted_len); + try list.ensureTotalCapacity(gpa, wanted_len); for (new) |new_loc| { if (new_loc.id == .generated) continue; @@ -90,532 +91,2702 @@ pub const TokenWithExpansionLocs = struct { pub fn checkMsEof(tok: TokenWithExpansionLocs, source: Source, comp: *Compilation) !void { std.debug.assert(tok.id == .eof); if (source.buf.len > tok.loc.byte_offset and source.buf[tok.loc.byte_offset] == 0x1A) { - try comp.addDiagnostic(.{ - .tag = .ctrl_z_eof, - .loc = .{ + const diagnostic: Compilation.Diagnostic = .ctrl_z_eof; + try comp.diagnostics.add(.{ + .text = diagnostic.fmt, + .kind = diagnostic.kind, + .opt = diagnostic.opt, + .extension = diagnostic.extension, + .location = source.lineCol(.{ .id = source.id, .byte_offset = tok.loc.byte_offset, .line = tok.loc.line, - }, - }, &.{}); + }), + }); + } + } +}; + +pub const TokenIndex = u32; +pub const ValueMap = std.AutoHashMapUnmanaged(Node.Index, Value); + +const Tree = @This(); + +comp: *Compilation, + +// Values from Preprocessor. +tokens: Token.List.Slice, + +// Values owned by this Tree +nodes: std.MultiArrayList(Node.Repr) = .empty, +extra: std.ArrayList(u32) = .empty, +root_decls: std.ArrayList(Node.Index) = .empty, +value_map: ValueMap = .empty, + +pub const genIr = CodeGen.genIr; + +pub fn deinit(tree: *Tree) void { + tree.nodes.deinit(tree.comp.gpa); + tree.extra.deinit(tree.comp.gpa); + tree.root_decls.deinit(tree.comp.gpa); + tree.value_map.deinit(tree.comp.gpa); + tree.* = undefined; +} + +pub const GNUAssemblyQualifiers = struct { + @"volatile": bool = false, + @"inline": bool = false, + goto: bool = false, +}; + +pub const Node = union(enum) { + empty_decl: EmptyDecl, + static_assert: StaticAssert, + function: Function, + param: Param, + variable: Variable, + typedef: Typedef, + global_asm: SimpleAsm, + + struct_decl: ContainerDecl, + union_decl: ContainerDecl, + enum_decl: ContainerDecl, + struct_forward_decl: ContainerForwardDecl, + union_forward_decl: ContainerForwardDecl, + enum_forward_decl: ContainerForwardDecl, + + enum_field: EnumField, + record_field: RecordField, + + labeled_stmt: LabeledStmt, + compound_stmt: CompoundStmt, + if_stmt: IfStmt, + switch_stmt: SwitchStmt, + case_stmt: CaseStmt, + default_stmt: DefaultStmt, + while_stmt: WhileStmt, + do_while_stmt: DoWhileStmt, + for_stmt: ForStmt, + goto_stmt: GotoStmt, + computed_goto_stmt: ComputedGotoStmt, + continue_stmt: ContinueStmt, + break_stmt: BreakStmt, + null_stmt: NullStmt, + return_stmt: ReturnStmt, + gnu_asm_simple: SimpleAsm, + + assign_expr: Binary, + mul_assign_expr: Binary, + div_assign_expr: Binary, + mod_assign_expr: Binary, + add_assign_expr: Binary, + sub_assign_expr: Binary, + shl_assign_expr: Binary, + shr_assign_expr: Binary, + bit_and_assign_expr: Binary, + bit_xor_assign_expr: Binary, + bit_or_assign_expr: Binary, + compound_assign_dummy_expr: Unary, + + comma_expr: Binary, + bool_or_expr: Binary, + bool_and_expr: Binary, + bit_or_expr: Binary, + bit_xor_expr: Binary, + bit_and_expr: Binary, + equal_expr: Binary, + not_equal_expr: Binary, + less_than_expr: Binary, + less_than_equal_expr: Binary, + greater_than_expr: Binary, + greater_than_equal_expr: Binary, + shl_expr: Binary, + shr_expr: Binary, + add_expr: Binary, + sub_expr: Binary, + mul_expr: Binary, + div_expr: Binary, + mod_expr: Binary, + + cast: Cast, + + addr_of_expr: Unary, + deref_expr: Unary, + plus_expr: Unary, + negate_expr: Unary, + bit_not_expr: Unary, + bool_not_expr: Unary, + pre_inc_expr: Unary, + pre_dec_expr: Unary, + imag_expr: Unary, + real_expr: Unary, + post_inc_expr: Unary, + post_dec_expr: Unary, + paren_expr: Unary, + stmt_expr: Unary, + + addr_of_label: AddrOfLabel, + + array_access_expr: ArrayAccess, + member_access_expr: MemberAccess, + member_access_ptr_expr: MemberAccess, + + call_expr: Call, + + decl_ref_expr: DeclRef, + enumeration_ref: DeclRef, + + builtin_call_expr: BuiltinCall, + builtin_ref: BuiltinRef, + builtin_types_compatible_p: TypesCompatible, + builtin_choose_expr: Conditional, + builtin_convertvector: Convertvector, + builtin_shufflevector: Shufflevector, + + /// C23 bool literal `true` / `false` + bool_literal: Literal, + /// C23 nullptr literal + nullptr_literal: Literal, + /// integer literal, always unsigned + int_literal: Literal, + /// Same as int_literal, but originates from a char literal + char_literal: CharLiteral, + /// a floating point literal + float_literal: Literal, + string_literal_expr: CharLiteral, + /// wraps a float or double literal + imaginary_literal: Unary, + /// A compound literal (type){ init } + compound_literal_expr: CompoundLiteral, + + sizeof_expr: TypeInfo, + alignof_expr: TypeInfo, + + generic_expr: Generic, + generic_association_expr: Generic.Association, + generic_default_expr: Generic.Default, + + binary_cond_expr: Conditional, + /// Used as the base for casts of the lhs in `binary_cond_expr`. + cond_dummy_expr: Unary, + cond_expr: Conditional, + + array_init_expr: ContainerInit, + struct_init_expr: ContainerInit, + union_init_expr: UnionInit, + /// Inserted in array_init_expr to represent unspecified elements. + /// data.int contains the amount of elements. + array_filler_expr: ArrayFiller, + /// Inserted in record and scalar initializers for unspecified elements. + default_init_expr: DefaultInit, + + pub const EmptyDecl = struct { + semicolon: TokenIndex, + }; + + pub const StaticAssert = struct { + assert_tok: TokenIndex, + cond: Node.Index, + message: ?Node.Index, + }; + + pub const Function = struct { + name_tok: TokenIndex, + qt: QualType, + static: bool, + @"inline": bool, + body: ?Node.Index, + /// Actual, non-tentative definition of this function. + definition: ?Node.Index, + }; + + pub const Param = struct { + name_tok: TokenIndex, + qt: QualType, + storage_class: enum { + auto, + register, + }, + }; + + pub const Variable = struct { + name_tok: TokenIndex, + qt: QualType, + storage_class: enum { + auto, + static, + @"extern", + register, + }, + thread_local: bool, + /// From predefined macro __func__, __FUNCTION__ or __PRETTY_FUNCTION__. + /// Implies `static == true`. + implicit: bool, + initializer: ?Node.Index, + /// Actual, non-tentative definition of this variable. + definition: ?Node.Index, + }; + + pub const Typedef = struct { + name_tok: TokenIndex, + qt: QualType, + implicit: bool, + }; + + pub const SimpleAsm = struct { + asm_tok: TokenIndex, + asm_str: Node.Index, + }; + + pub const ContainerDecl = struct { + name_or_kind_tok: TokenIndex, + container_qt: QualType, + fields: []const Node.Index, + }; + + pub const ContainerForwardDecl = struct { + name_or_kind_tok: TokenIndex, + container_qt: QualType, + /// The definition for this forward declaration if one exists. + definition: ?Node.Index, + }; + + pub const EnumField = struct { + name_tok: TokenIndex, + qt: QualType, + init: ?Node.Index, + }; + + pub const RecordField = struct { + name_or_first_tok: TokenIndex, + qt: QualType, + bit_width: ?Node.Index, + }; + + pub const LabeledStmt = struct { + label_tok: TokenIndex, + body: Node.Index, + qt: QualType, + }; + + pub const CompoundStmt = struct { + l_brace_tok: TokenIndex, + body: []const Node.Index, + }; + + pub const IfStmt = struct { + if_tok: TokenIndex, + cond: Node.Index, + then_body: Node.Index, + else_body: ?Node.Index, + }; + + pub const SwitchStmt = struct { + switch_tok: TokenIndex, + cond: Node.Index, + body: Node.Index, + }; + + pub const CaseStmt = struct { + case_tok: TokenIndex, + start: Node.Index, + end: ?Node.Index, + body: Node.Index, + }; + + pub const DefaultStmt = struct { + default_tok: TokenIndex, + body: Node.Index, + }; + + pub const WhileStmt = struct { + while_tok: TokenIndex, + cond: Node.Index, + body: Node.Index, + }; + + pub const DoWhileStmt = struct { + do_tok: TokenIndex, + cond: Node.Index, + body: Node.Index, + }; + + pub const ForStmt = struct { + for_tok: TokenIndex, + init: union(enum) { + decls: []const Node.Index, + expr: ?Node.Index, + }, + cond: ?Node.Index, + incr: ?Node.Index, + body: Node.Index, + }; + + pub const GotoStmt = struct { + label_tok: TokenIndex, + }; + + pub const ComputedGotoStmt = struct { + goto_tok: TokenIndex, + expr: Node.Index, + }; + + pub const ContinueStmt = struct { + continue_tok: TokenIndex, + }; + + pub const BreakStmt = struct { + break_tok: TokenIndex, + }; + + pub const NullStmt = struct { + semicolon_or_r_brace_tok: TokenIndex, + qt: QualType, + }; + + pub const ReturnStmt = struct { + return_tok: TokenIndex, + return_qt: QualType, + operand: union(enum) { + expr: Node.Index, + /// True if the function is called "main" and return_qt is compatible with int + implicit: bool, + none, + }, + }; + + pub const Binary = struct { + qt: QualType, + lhs: Node.Index, + op_tok: TokenIndex, + rhs: Node.Index, + }; + + pub const Cast = struct { + qt: QualType, + l_paren: TokenIndex, + kind: Kind, + operand: Node.Index, + implicit: bool, + + pub const Kind = enum { + /// Does nothing except possibly add qualifiers + no_op, + /// Interpret one bit pattern as another. Used for operands which have the same + /// size and unrelated types, e.g. casting one pointer type to another + bitcast, + /// Convert T[] to T * + array_to_pointer, + /// Converts an lvalue to an rvalue + lval_to_rval, + /// Convert a function type to a pointer to a function + function_to_pointer, + /// Convert a pointer type to a _Bool + pointer_to_bool, + /// Convert a pointer type to an integer type + pointer_to_int, + /// Convert _Bool to an integer type + bool_to_int, + /// Convert _Bool to a floating type + bool_to_float, + /// Convert a _Bool to a pointer; will cause a warning + bool_to_pointer, + /// Convert an integer type to _Bool + int_to_bool, + /// Convert an integer to a floating type + int_to_float, + /// Convert a complex integer to a complex floating type + complex_int_to_complex_float, + /// Convert an integer type to a pointer type + int_to_pointer, + /// Convert a floating type to a _Bool + float_to_bool, + /// Convert a floating type to an integer + float_to_int, + /// Convert a complex floating type to a complex integer + complex_float_to_complex_int, + /// Convert one integer type to another + int_cast, + /// Convert one complex integer type to another + complex_int_cast, + /// Convert real part of complex integer to a integer + complex_int_to_real, + /// Create a complex integer type using operand as the real part + real_to_complex_int, + /// Convert one floating type to another + float_cast, + /// Convert one complex floating type to another + complex_float_cast, + /// Convert real part of complex float to a float + complex_float_to_real, + /// Create a complex floating type using operand as the real part + real_to_complex_float, + /// Convert type to void + to_void, + /// Convert a literal 0 to a null pointer + null_to_pointer, + /// GNU cast-to-union extension + union_cast, + /// Create vector where each value is same as the input scalar. + vector_splat, + /// Convert an atomic type to its non atomic base type. + atomic_to_non_atomic, + /// Convert a non atomic type to an atomic type. + non_atomic_to_atomic, + }; + }; + + pub const Unary = struct { + qt: QualType, + op_tok: TokenIndex, + operand: Node.Index, + }; + + pub const AddrOfLabel = struct { + label_tok: TokenIndex, + qt: QualType, + }; + + pub const ArrayAccess = struct { + l_bracket_tok: TokenIndex, + qt: QualType, + base: Node.Index, + index: Node.Index, + }; + + pub const MemberAccess = struct { + qt: QualType, + base: Node.Index, + access_tok: TokenIndex, + member_index: u32, + + pub fn isBitFieldWidth(access: MemberAccess, tree: *const Tree) ?u32 { + var qt = access.base.qt(tree); + if (qt.isInvalid()) return null; + if (qt.get(tree.comp, .pointer)) |pointer| qt = pointer.child; + const record_ty = switch (qt.base(tree.comp).type) { + .@"struct", .@"union" => |record| record, + else => return null, + }; + return record_ty.fields[access.member_index].bit_width.unpack(); } + }; + + pub const Call = struct { + l_paren_tok: TokenIndex, + qt: QualType, + callee: Node.Index, + args: []const Node.Index, + }; + + pub const DeclRef = struct { + name_tok: TokenIndex, + qt: QualType, + decl: Node.Index, + }; + + pub const BuiltinCall = struct { + builtin_tok: TokenIndex, + qt: QualType, + args: []const Node.Index, + }; + + pub const BuiltinRef = struct { + name_tok: TokenIndex, + qt: QualType, + }; + + pub const TypesCompatible = struct { + builtin_tok: TokenIndex, + lhs: QualType, + rhs: QualType, + }; + + pub const Convertvector = struct { + builtin_tok: TokenIndex, + dest_qt: QualType, + operand: Node.Index, + }; + + pub const Shufflevector = struct { + builtin_tok: TokenIndex, + qt: QualType, + lhs: Node.Index, + rhs: Node.Index, + indexes: []const Node.Index, + }; + + pub const Literal = struct { + literal_tok: TokenIndex, + qt: QualType, + }; + + pub const CharLiteral = struct { + literal_tok: TokenIndex, + qt: QualType, + kind: enum { + ascii, + wide, + utf8, + utf16, + utf32, + }, + }; + + pub const CompoundLiteral = struct { + l_paren_tok: TokenIndex, + qt: QualType, + thread_local: bool, + storage_class: enum { + auto, + static, + register, + }, + initializer: Node.Index, + }; + + pub const TypeInfo = struct { + qt: QualType, + op_tok: TokenIndex, + expr: ?Node.Index, + operand_qt: QualType, + }; + + pub const Generic = struct { + generic_tok: TokenIndex, + qt: QualType, + + // `Generic` child nodes are either an `Association` a `Default` + controlling: Node.Index, + chosen: Node.Index, + rest: []const Node.Index, + + pub const Association = struct { + colon_tok: TokenIndex, + association_qt: QualType, + expr: Node.Index, + }; + + pub const Default = struct { + default_tok: TokenIndex, + expr: Node.Index, + }; + }; + + pub const Conditional = struct { + cond_tok: TokenIndex, + qt: QualType, + cond: Node.Index, + then_expr: Node.Index, + else_expr: Node.Index, + }; + + pub const ContainerInit = struct { + l_brace_tok: TokenIndex, + container_qt: QualType, + items: []const Node.Index, + }; + + pub const UnionInit = struct { + l_brace_tok: TokenIndex, + union_qt: QualType, + field_index: u32, + initializer: ?Node.Index, + }; + + pub const ArrayFiller = struct { + last_tok: TokenIndex, + qt: QualType, + count: u64, + }; + + pub const DefaultInit = struct { + last_tok: TokenIndex, + qt: QualType, + }; + + pub const Index = enum(u32) { + _, + + pub fn get(index: Index, tree: *const Tree) Node { + const node_tok = tree.nodes.items(.tok)[@intFromEnum(index)]; + const node_data = &tree.nodes.items(.data)[@intFromEnum(index)]; + return switch (tree.nodes.items(.tag)[@intFromEnum(index)]) { + .empty_decl => .{ + .empty_decl = .{ + .semicolon = node_tok, + }, + }, + .static_assert => .{ + .static_assert = .{ + .assert_tok = node_tok, + .cond = @enumFromInt(node_data[0]), + .message = unpackOptIndex(node_data[1]), + }, + }, + .fn_proto => { + const attr: Node.Repr.DeclAttr = @bitCast(node_data[1]); + return .{ + .function = .{ + .name_tok = node_tok, + .qt = @bitCast(node_data[0]), + .static = attr.static, + .@"inline" = attr.@"inline", + .body = null, + .definition = unpackOptIndex(node_data[2]), + }, + }; + }, + .fn_def => { + const attr: Node.Repr.DeclAttr = @bitCast(node_data[1]); + return .{ + .function = .{ + .name_tok = node_tok, + .qt = @bitCast(node_data[0]), + .static = attr.static, + .@"inline" = attr.@"inline", + .body = @enumFromInt(node_data[2]), + .definition = null, + }, + }; + }, + .param => { + const attr: Node.Repr.DeclAttr = @bitCast(node_data[1]); + return .{ + .param = .{ + .name_tok = node_tok, + .qt = @bitCast(node_data[0]), + .storage_class = if (attr.register) + .register + else + .auto, + }, + }; + }, + .variable => { + const attr: Node.Repr.DeclAttr = @bitCast(node_data[1]); + return .{ + .variable = .{ + .name_tok = node_tok, + .qt = @bitCast(node_data[0]), + .storage_class = if (attr.static) + .static + else if (attr.@"extern") + .@"extern" + else if (attr.register) + .register + else + .auto, + .thread_local = attr.thread_local, + .implicit = attr.implicit, + .initializer = null, + .definition = unpackOptIndex(node_data[2]), + }, + }; + }, + .variable_def => { + const attr: Node.Repr.DeclAttr = @bitCast(node_data[1]); + return .{ + .variable = .{ + .name_tok = node_tok, + .qt = @bitCast(node_data[0]), + .storage_class = if (attr.static) + .static + else if (attr.@"extern") + .@"extern" + else if (attr.register) + .register + else + .auto, + .thread_local = attr.thread_local, + .implicit = attr.implicit, + .initializer = unpackOptIndex(node_data[2]), + .definition = null, + }, + }; + }, + .typedef => .{ + .typedef = .{ + .name_tok = node_tok, + .qt = @bitCast(node_data[0]), + .implicit = node_data[1] != 0, + }, + }, + .global_asm => .{ + .global_asm = .{ + .asm_tok = node_tok, + .asm_str = @enumFromInt(node_data[0]), + }, + }, + .struct_decl => .{ + .struct_decl = .{ + .name_or_kind_tok = node_tok, + .container_qt = @bitCast(node_data[0]), + .fields = @ptrCast(tree.extra.items[node_data[1]..][0..node_data[2]]), + }, + }, + .struct_decl_two => .{ + .struct_decl = .{ + .name_or_kind_tok = node_tok, + .container_qt = @bitCast(node_data[0]), + .fields = unPackElems(node_data[1..]), + }, + }, + .union_decl => .{ + .union_decl = .{ + .name_or_kind_tok = node_tok, + .container_qt = @bitCast(node_data[0]), + .fields = @ptrCast(tree.extra.items[node_data[1]..][0..node_data[2]]), + }, + }, + .union_decl_two => .{ + .union_decl = .{ + .name_or_kind_tok = node_tok, + .container_qt = @bitCast(node_data[0]), + .fields = unPackElems(node_data[1..]), + }, + }, + .enum_decl => .{ + .enum_decl = .{ + .name_or_kind_tok = node_tok, + .container_qt = @bitCast(node_data[0]), + .fields = @ptrCast(tree.extra.items[node_data[1]..][0..node_data[2]]), + }, + }, + .enum_decl_two => .{ + .enum_decl = .{ + .name_or_kind_tok = node_tok, + .container_qt = @bitCast(node_data[0]), + .fields = unPackElems(node_data[1..]), + }, + }, + .struct_forward_decl => .{ + .struct_forward_decl = .{ + .name_or_kind_tok = node_tok, + .container_qt = @bitCast(node_data[0]), + .definition = null, + }, + }, + .union_forward_decl => .{ + .union_forward_decl = .{ + .name_or_kind_tok = node_tok, + .container_qt = @bitCast(node_data[0]), + .definition = null, + }, + }, + .enum_forward_decl => .{ + .enum_forward_decl = .{ + .name_or_kind_tok = node_tok, + .container_qt = @bitCast(node_data[0]), + .definition = null, + }, + }, + .enum_field => .{ + .enum_field = .{ + .name_tok = node_tok, + .qt = @bitCast(node_data[0]), + .init = unpackOptIndex(node_data[1]), + }, + }, + .record_field => .{ + .record_field = .{ + .name_or_first_tok = node_tok, + .qt = @bitCast(node_data[0]), + .bit_width = unpackOptIndex(node_data[1]), + }, + }, + .labeled_stmt => .{ + .labeled_stmt = .{ + .label_tok = node_tok, + .qt = @bitCast(node_data[0]), + .body = @enumFromInt(node_data[1]), + }, + }, + .compound_stmt => .{ + .compound_stmt = .{ + .l_brace_tok = node_tok, + .body = @ptrCast(tree.extra.items[node_data[0]..][0..node_data[1]]), + }, + }, + .compound_stmt_three => .{ + .compound_stmt = .{ + .l_brace_tok = node_tok, + .body = unPackElems(node_data), + }, + }, + .if_stmt => .{ + .if_stmt = .{ + .if_tok = node_tok, + .cond = @enumFromInt(node_data[0]), + .then_body = @enumFromInt(node_data[1]), + .else_body = unpackOptIndex(node_data[2]), + }, + }, + .switch_stmt => .{ + .switch_stmt = .{ + .switch_tok = node_tok, + .cond = @enumFromInt(node_data[0]), + .body = @enumFromInt(node_data[1]), + }, + }, + .case_stmt => .{ + .case_stmt = .{ + .case_tok = node_tok, + .start = @enumFromInt(node_data[0]), + .end = unpackOptIndex(node_data[1]), + .body = @enumFromInt(node_data[2]), + }, + }, + .default_stmt => .{ + .default_stmt = .{ + .default_tok = node_tok, + .body = @enumFromInt(node_data[0]), + }, + }, + .while_stmt => .{ + .while_stmt = .{ + .while_tok = node_tok, + .cond = @enumFromInt(node_data[0]), + .body = @enumFromInt(node_data[1]), + }, + }, + .do_while_stmt => .{ + .do_while_stmt = .{ + .do_tok = node_tok, + .cond = @enumFromInt(node_data[0]), + .body = @enumFromInt(node_data[1]), + }, + }, + .for_decl => .{ + .for_stmt = .{ + .for_tok = node_tok, + .init = .{ .decls = @ptrCast(tree.extra.items[node_data[0]..][0 .. node_data[1] - 2]) }, + .cond = unpackOptIndex(tree.extra.items[node_data[0] + node_data[1] - 2]), + .incr = unpackOptIndex(tree.extra.items[node_data[0] + node_data[1] - 1]), + .body = @enumFromInt(node_data[2]), + }, + }, + .for_expr => .{ + .for_stmt = .{ + .for_tok = node_tok, + .init = .{ .expr = unpackOptIndex(node_data[0]) }, + .cond = unpackOptIndex(tree.extra.items[node_data[1]]), + .incr = unpackOptIndex(tree.extra.items[node_data[1] + 1]), + .body = @enumFromInt(node_data[2]), + }, + }, + .goto_stmt => .{ + .goto_stmt = .{ + .label_tok = node_tok, + }, + }, + .computed_goto_stmt => .{ + .computed_goto_stmt = .{ + .goto_tok = node_tok, + .expr = @enumFromInt(node_data[0]), + }, + }, + .continue_stmt => .{ + .continue_stmt = .{ + .continue_tok = node_tok, + }, + }, + .break_stmt => .{ + .break_stmt = .{ + .break_tok = node_tok, + }, + }, + .null_stmt => .{ + .null_stmt = .{ + .semicolon_or_r_brace_tok = node_tok, + .qt = @bitCast(node_data[0]), + }, + }, + .return_stmt => .{ + .return_stmt = .{ + .return_tok = node_tok, + .return_qt = @bitCast(node_data[0]), + .operand = .{ + .expr = @enumFromInt(node_data[1]), + }, + }, + }, + .return_none_stmt => .{ + .return_stmt = .{ + .return_tok = node_tok, + .return_qt = @bitCast(node_data[0]), + .operand = .none, + }, + }, + .implicit_return => .{ + .return_stmt = .{ + .return_tok = node_tok, + .return_qt = @bitCast(node_data[0]), + .operand = .{ + .implicit = node_data[1] != 0, + }, + }, + }, + .gnu_asm_simple => .{ + .gnu_asm_simple = .{ + .asm_tok = node_tok, + .asm_str = @enumFromInt(node_data[0]), + }, + }, + .assign_expr => .{ + .assign_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .lhs = @enumFromInt(node_data[1]), + .rhs = @enumFromInt(node_data[2]), + }, + }, + .mul_assign_expr => .{ + .mul_assign_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .lhs = @enumFromInt(node_data[1]), + .rhs = @enumFromInt(node_data[2]), + }, + }, + .div_assign_expr => .{ + .div_assign_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .lhs = @enumFromInt(node_data[1]), + .rhs = @enumFromInt(node_data[2]), + }, + }, + .mod_assign_expr => .{ + .mod_assign_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .lhs = @enumFromInt(node_data[1]), + .rhs = @enumFromInt(node_data[2]), + }, + }, + .add_assign_expr => .{ + .add_assign_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .lhs = @enumFromInt(node_data[1]), + .rhs = @enumFromInt(node_data[2]), + }, + }, + .sub_assign_expr => .{ + .sub_assign_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .lhs = @enumFromInt(node_data[1]), + .rhs = @enumFromInt(node_data[2]), + }, + }, + .shl_assign_expr => .{ + .shl_assign_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .lhs = @enumFromInt(node_data[1]), + .rhs = @enumFromInt(node_data[2]), + }, + }, + .shr_assign_expr => .{ + .shr_assign_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .lhs = @enumFromInt(node_data[1]), + .rhs = @enumFromInt(node_data[2]), + }, + }, + .bit_and_assign_expr => .{ + .bit_and_assign_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .lhs = @enumFromInt(node_data[1]), + .rhs = @enumFromInt(node_data[2]), + }, + }, + .bit_xor_assign_expr => .{ + .bit_xor_assign_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .lhs = @enumFromInt(node_data[1]), + .rhs = @enumFromInt(node_data[2]), + }, + }, + .bit_or_assign_expr => .{ + .bit_or_assign_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .lhs = @enumFromInt(node_data[1]), + .rhs = @enumFromInt(node_data[2]), + }, + }, + .compound_assign_dummy_expr => .{ + .compound_assign_dummy_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .operand = @enumFromInt(node_data[1]), + }, + }, + .comma_expr => .{ + .comma_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .lhs = @enumFromInt(node_data[1]), + .rhs = @enumFromInt(node_data[2]), + }, + }, + .bool_or_expr => .{ + .bool_or_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .lhs = @enumFromInt(node_data[1]), + .rhs = @enumFromInt(node_data[2]), + }, + }, + .bool_and_expr => .{ + .bool_and_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .lhs = @enumFromInt(node_data[1]), + .rhs = @enumFromInt(node_data[2]), + }, + }, + .bit_or_expr => .{ + .bit_or_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .lhs = @enumFromInt(node_data[1]), + .rhs = @enumFromInt(node_data[2]), + }, + }, + .bit_xor_expr => .{ + .bit_xor_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .lhs = @enumFromInt(node_data[1]), + .rhs = @enumFromInt(node_data[2]), + }, + }, + .bit_and_expr => .{ + .bit_and_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .lhs = @enumFromInt(node_data[1]), + .rhs = @enumFromInt(node_data[2]), + }, + }, + .equal_expr => .{ + .equal_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .lhs = @enumFromInt(node_data[1]), + .rhs = @enumFromInt(node_data[2]), + }, + }, + .not_equal_expr => .{ + .not_equal_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .lhs = @enumFromInt(node_data[1]), + .rhs = @enumFromInt(node_data[2]), + }, + }, + .less_than_expr => .{ + .less_than_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .lhs = @enumFromInt(node_data[1]), + .rhs = @enumFromInt(node_data[2]), + }, + }, + .less_than_equal_expr => .{ + .less_than_equal_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .lhs = @enumFromInt(node_data[1]), + .rhs = @enumFromInt(node_data[2]), + }, + }, + .greater_than_expr => .{ + .greater_than_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .lhs = @enumFromInt(node_data[1]), + .rhs = @enumFromInt(node_data[2]), + }, + }, + .greater_than_equal_expr => .{ + .greater_than_equal_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .lhs = @enumFromInt(node_data[1]), + .rhs = @enumFromInt(node_data[2]), + }, + }, + .shl_expr => .{ + .shl_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .lhs = @enumFromInt(node_data[1]), + .rhs = @enumFromInt(node_data[2]), + }, + }, + .shr_expr => .{ + .shr_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .lhs = @enumFromInt(node_data[1]), + .rhs = @enumFromInt(node_data[2]), + }, + }, + .add_expr => .{ + .add_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .lhs = @enumFromInt(node_data[1]), + .rhs = @enumFromInt(node_data[2]), + }, + }, + .sub_expr => .{ + .sub_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .lhs = @enumFromInt(node_data[1]), + .rhs = @enumFromInt(node_data[2]), + }, + }, + .mul_expr => .{ + .mul_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .lhs = @enumFromInt(node_data[1]), + .rhs = @enumFromInt(node_data[2]), + }, + }, + .div_expr => .{ + .div_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .lhs = @enumFromInt(node_data[1]), + .rhs = @enumFromInt(node_data[2]), + }, + }, + .mod_expr => .{ + .mod_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .lhs = @enumFromInt(node_data[1]), + .rhs = @enumFromInt(node_data[2]), + }, + }, + .explicit_cast => .{ + .cast = .{ + .l_paren = node_tok, + .qt = @bitCast(node_data[0]), + .kind = @enumFromInt(node_data[1]), + .operand = @enumFromInt(node_data[2]), + .implicit = false, + }, + }, + .implicit_cast => .{ + .cast = .{ + .l_paren = node_tok, + .qt = @bitCast(node_data[0]), + .kind = @enumFromInt(node_data[1]), + .operand = @enumFromInt(node_data[2]), + .implicit = true, + }, + }, + .addr_of_expr => .{ + .addr_of_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .operand = @enumFromInt(node_data[1]), + }, + }, + .deref_expr => .{ + .deref_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .operand = @enumFromInt(node_data[1]), + }, + }, + .plus_expr => .{ + .plus_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .operand = @enumFromInt(node_data[1]), + }, + }, + .negate_expr => .{ + .negate_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .operand = @enumFromInt(node_data[1]), + }, + }, + .bit_not_expr => .{ + .bit_not_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .operand = @enumFromInt(node_data[1]), + }, + }, + .bool_not_expr => .{ + .bool_not_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .operand = @enumFromInt(node_data[1]), + }, + }, + .pre_inc_expr => .{ + .pre_inc_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .operand = @enumFromInt(node_data[1]), + }, + }, + .pre_dec_expr => .{ + .pre_dec_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .operand = @enumFromInt(node_data[1]), + }, + }, + .imag_expr => .{ + .imag_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .operand = @enumFromInt(node_data[1]), + }, + }, + .real_expr => .{ + .real_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .operand = @enumFromInt(node_data[1]), + }, + }, + .post_inc_expr => .{ + .post_inc_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .operand = @enumFromInt(node_data[1]), + }, + }, + .post_dec_expr => .{ + .post_dec_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .operand = @enumFromInt(node_data[1]), + }, + }, + .paren_expr => .{ + .paren_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .operand = @enumFromInt(node_data[1]), + }, + }, + .stmt_expr => .{ + .stmt_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .operand = @enumFromInt(node_data[1]), + }, + }, + .cond_dummy_expr => .{ + .cond_dummy_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .operand = @enumFromInt(node_data[1]), + }, + }, + .addr_of_label => .{ + .addr_of_label = .{ + .label_tok = node_tok, + .qt = @bitCast(node_data[0]), + }, + }, + .array_access_expr => .{ + .array_access_expr = .{ + .l_bracket_tok = node_tok, + .qt = @bitCast(node_data[0]), + .base = @enumFromInt(node_data[1]), + .index = @enumFromInt(node_data[2]), + }, + }, + .call_expr => .{ + .call_expr = .{ + .l_paren_tok = node_tok, + .qt = @bitCast(node_data[0]), + .callee = @enumFromInt(tree.extra.items[node_data[1]]), + .args = @ptrCast(tree.extra.items[node_data[1] + 1 ..][0 .. node_data[2] - 1]), + }, + }, + .call_expr_one => .{ + .call_expr = .{ + .l_paren_tok = node_tok, + .qt = @bitCast(node_data[0]), + .callee = @enumFromInt(node_data[1]), + .args = unPackElems(node_data[2..]), + }, + }, + .builtin_call_expr => .{ + .builtin_call_expr = .{ + .builtin_tok = node_tok, + .qt = @bitCast(node_data[0]), + .args = @ptrCast(tree.extra.items[node_data[1]..][0..node_data[2]]), + }, + }, + .builtin_call_expr_two => .{ + .builtin_call_expr = .{ + .builtin_tok = node_tok, + .qt = @bitCast(node_data[0]), + .args = unPackElems(node_data[1..]), + }, + }, + .member_access_expr => .{ + .member_access_expr = .{ + .access_tok = node_tok, + .qt = @bitCast(node_data[0]), + .base = @enumFromInt(node_data[1]), + .member_index = node_data[2], + }, + }, + .member_access_ptr_expr => .{ + .member_access_ptr_expr = .{ + .access_tok = node_tok, + .qt = @bitCast(node_data[0]), + .base = @enumFromInt(node_data[1]), + .member_index = node_data[2], + }, + }, + .decl_ref_expr => .{ + .decl_ref_expr = .{ + .name_tok = node_tok, + .qt = @bitCast(node_data[0]), + .decl = @enumFromInt(node_data[1]), + }, + }, + .enumeration_ref => .{ + .enumeration_ref = .{ + .name_tok = node_tok, + .qt = @bitCast(node_data[0]), + .decl = @enumFromInt(node_data[1]), + }, + }, + .builtin_ref => .{ + .builtin_ref = .{ + .name_tok = node_tok, + .qt = @bitCast(node_data[0]), + }, + }, + .bool_literal => .{ + .bool_literal = .{ + .literal_tok = node_tok, + .qt = @bitCast(node_data[0]), + }, + }, + .nullptr_literal => .{ + .nullptr_literal = .{ + .literal_tok = node_tok, + .qt = @bitCast(node_data[0]), + }, + }, + .int_literal => .{ + .int_literal = .{ + .literal_tok = node_tok, + .qt = @bitCast(node_data[0]), + }, + }, + .char_literal => .{ + .char_literal = .{ + .literal_tok = node_tok, + .qt = @bitCast(node_data[0]), + .kind = @enumFromInt(node_data[1]), + }, + }, + .float_literal => .{ + .float_literal = .{ + .literal_tok = node_tok, + .qt = @bitCast(node_data[0]), + }, + }, + .string_literal_expr => .{ + .string_literal_expr = .{ + .literal_tok = node_tok, + .qt = @bitCast(node_data[0]), + .kind = @enumFromInt(node_data[1]), + }, + }, + .imaginary_literal => .{ + .imaginary_literal = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .operand = @enumFromInt(node_data[1]), + }, + }, + .sizeof_expr => .{ + .sizeof_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .expr = unpackOptIndex(node_data[1]), + .operand_qt = @bitCast(node_data[2]), + }, + }, + .alignof_expr => .{ + .alignof_expr = .{ + .op_tok = node_tok, + .qt = @bitCast(node_data[0]), + .expr = unpackOptIndex(node_data[1]), + .operand_qt = @bitCast(node_data[2]), + }, + }, + + .generic_expr_zero => .{ + .generic_expr = .{ + .generic_tok = node_tok, + .qt = @bitCast(node_data[0]), + .controlling = @enumFromInt(node_data[1]), + .chosen = @enumFromInt(node_data[2]), + .rest = &.{}, + }, + }, + .generic_expr => .{ + .generic_expr = .{ + .generic_tok = node_tok, + .qt = @bitCast(node_data[0]), + .controlling = @enumFromInt(tree.extra.items[node_data[1]]), + .chosen = @enumFromInt(tree.extra.items[node_data[1] + 1]), + .rest = @ptrCast(tree.extra.items[node_data[1] + 2 ..][0 .. node_data[2] - 2]), + }, + }, + .generic_association_expr => .{ + .generic_association_expr = .{ + .colon_tok = node_tok, + .association_qt = @bitCast(node_data[0]), + .expr = @enumFromInt(node_data[1]), + }, + }, + .generic_default_expr => .{ + .generic_default_expr = .{ + .default_tok = node_tok, + .expr = @enumFromInt(node_data[0]), + }, + }, + .binary_cond_expr => .{ + .binary_cond_expr = .{ + .cond_tok = node_tok, + .qt = @bitCast(node_data[0]), + .cond = @enumFromInt(node_data[1]), + .then_expr = @enumFromInt(tree.extra.items[node_data[2]]), + .else_expr = @enumFromInt(tree.extra.items[node_data[2] + 1]), + }, + }, + .cond_expr => .{ + .cond_expr = .{ + .cond_tok = node_tok, + .qt = @bitCast(node_data[0]), + .cond = @enumFromInt(node_data[1]), + .then_expr = @enumFromInt(tree.extra.items[node_data[2]]), + .else_expr = @enumFromInt(tree.extra.items[node_data[2] + 1]), + }, + }, + .builtin_choose_expr => .{ + .builtin_choose_expr = .{ + .cond_tok = node_tok, + .qt = @bitCast(node_data[0]), + .cond = @enumFromInt(node_data[1]), + .then_expr = @enumFromInt(tree.extra.items[node_data[2]]), + .else_expr = @enumFromInt(tree.extra.items[node_data[2] + 1]), + }, + }, + .builtin_types_compatible_p => .{ + .builtin_types_compatible_p = .{ + .builtin_tok = node_tok, + .lhs = @bitCast(node_data[0]), + .rhs = @bitCast(node_data[1]), + }, + }, + .builtin_convertvector => .{ + .builtin_convertvector = .{ + .builtin_tok = node_tok, + .dest_qt = @bitCast(node_data[0]), + .operand = @enumFromInt(node_data[1]), + }, + }, + .builtin_shufflevector => .{ + .builtin_shufflevector = .{ + .builtin_tok = node_tok, + .qt = @bitCast(node_data[0]), + .lhs = @enumFromInt(tree.extra.items[node_data[1]]), + .rhs = @enumFromInt(tree.extra.items[node_data[1] + 1]), + .indexes = @ptrCast(tree.extra.items[node_data[1] + 2 ..][0..node_data[2]]), + }, + }, + .array_init_expr_two => .{ + .array_init_expr = .{ + .l_brace_tok = node_tok, + .container_qt = @bitCast(node_data[0]), + .items = unPackElems(node_data[1..]), + }, + }, + .array_init_expr => .{ + .array_init_expr = .{ + .l_brace_tok = node_tok, + .container_qt = @bitCast(node_data[0]), + .items = @ptrCast(tree.extra.items[node_data[1]..][0..node_data[2]]), + }, + }, + .struct_init_expr_two => .{ + .struct_init_expr = .{ + .l_brace_tok = node_tok, + .container_qt = @bitCast(node_data[0]), + .items = unPackElems(node_data[1..]), + }, + }, + .struct_init_expr => .{ + .struct_init_expr = .{ + .l_brace_tok = node_tok, + .container_qt = @bitCast(node_data[0]), + .items = @ptrCast(tree.extra.items[node_data[1]..][0..node_data[2]]), + }, + }, + .union_init_expr => .{ + .union_init_expr = .{ + .l_brace_tok = node_tok, + .union_qt = @bitCast(node_data[0]), + .field_index = node_data[1], + .initializer = unpackOptIndex(node_data[2]), + }, + }, + .array_filler_expr => .{ + .array_filler_expr = .{ + .last_tok = node_tok, + .qt = @bitCast(node_data[0]), + .count = @bitCast(node_data[1..].*), + }, + }, + .default_init_expr => .{ + .default_init_expr = .{ + .last_tok = node_tok, + .qt = @bitCast(node_data[0]), + }, + }, + .compound_literal_expr => { + const attr: Node.Repr.DeclAttr = @bitCast(node_data[1]); + return .{ + .compound_literal_expr = .{ + .l_paren_tok = node_tok, + .qt = @bitCast(node_data[0]), + .storage_class = if (attr.static) + .static + else if (attr.register) + .register + else + .auto, + .thread_local = attr.thread_local, + .initializer = @enumFromInt(node_data[2]), + }, + }; + }, + }; + } + + pub fn tok(index: Index, tree: *const Tree) TokenIndex { + return tree.nodes.items(.tok)[@intFromEnum(index)]; + } + + pub fn loc(index: Index, tree: *const Tree) ?Source.Location { + const tok_i = index.tok(tree); + return tree.tokens.items(.loc)[@intFromEnum(tok_i)]; + } + + pub fn qt(index: Index, tree: *const Tree) QualType { + return index.qtOrNull(tree) orelse .void; + } + + pub fn qtOrNull(index: Index, tree: *const Tree) ?QualType { + return switch (tree.nodes.items(.tag)[@intFromEnum(index)]) { + .empty_decl, + .static_assert, + .compound_stmt, + .compound_stmt_three, + .if_stmt, + .switch_stmt, + .case_stmt, + .default_stmt, + .while_stmt, + .do_while_stmt, + .for_decl, + .for_expr, + .goto_stmt, + .computed_goto_stmt, + .continue_stmt, + .break_stmt, + .gnu_asm_simple, + .global_asm, + .generic_association_expr, + .generic_default_expr, + => null, + .builtin_types_compatible_p => .int, + else => { + // If a node is typed the type is stored in data[0]. + return @bitCast(tree.nodes.items(.data)[@intFromEnum(index)][0]); + }, + }; + } + }; + + pub const OptIndex = enum(u32) { + null = std.math.maxInt(u32), + _, + + pub fn unpack(opt: OptIndex) ?Index { + return if (opt == .null) null else @enumFromInt(@intFromEnum(opt)); + } + + pub fn pack(index: Index) OptIndex { + return @enumFromInt(@intFromEnum(index)); + } + + pub fn packOpt(optional: ?Index) OptIndex { + return if (optional) |some| @enumFromInt(@intFromEnum(some)) else .null; + } + }; + + pub const Repr = struct { + tag: Tag, + /// If a node is typed the type is stored in data[0] + data: [3]u32, + tok: TokenIndex, + + pub const DeclAttr = packed struct(u32) { + @"extern": bool = false, + static: bool = false, + @"inline": bool = false, + thread_local: bool = false, + implicit: bool = false, + register: bool = false, + _: u26 = 0, + }; + + pub const Tag = enum(u8) { + empty_decl, + static_assert, + fn_proto, + fn_def, + param, + variable, + variable_def, + typedef, + global_asm, + struct_decl, + union_decl, + enum_decl, + struct_decl_two, + union_decl_two, + enum_decl_two, + struct_forward_decl, + union_forward_decl, + enum_forward_decl, + enum_field, + record_field, + labeled_stmt, + compound_stmt, + compound_stmt_three, + if_stmt, + switch_stmt, + case_stmt, + default_stmt, + while_stmt, + do_while_stmt, + for_expr, + for_decl, + goto_stmt, + computed_goto_stmt, + continue_stmt, + break_stmt, + null_stmt, + return_stmt, + return_none_stmt, + implicit_return, + gnu_asm_simple, + comma_expr, + assign_expr, + mul_assign_expr, + div_assign_expr, + mod_assign_expr, + add_assign_expr, + sub_assign_expr, + shl_assign_expr, + shr_assign_expr, + bit_and_assign_expr, + bit_xor_assign_expr, + bit_or_assign_expr, + compound_assign_dummy_expr, + bool_or_expr, + bool_and_expr, + bit_or_expr, + bit_xor_expr, + bit_and_expr, + equal_expr, + not_equal_expr, + less_than_expr, + less_than_equal_expr, + greater_than_expr, + greater_than_equal_expr, + shl_expr, + shr_expr, + add_expr, + sub_expr, + mul_expr, + div_expr, + mod_expr, + explicit_cast, + implicit_cast, + addr_of_expr, + deref_expr, + plus_expr, + negate_expr, + bit_not_expr, + bool_not_expr, + pre_inc_expr, + pre_dec_expr, + imag_expr, + real_expr, + post_inc_expr, + post_dec_expr, + paren_expr, + stmt_expr, + addr_of_label, + array_access_expr, + call_expr_one, + call_expr, + builtin_call_expr, + builtin_call_expr_two, + member_access_expr, + member_access_ptr_expr, + decl_ref_expr, + enumeration_ref, + builtin_ref, + bool_literal, + nullptr_literal, + int_literal, + char_literal, + float_literal, + string_literal_expr, + imaginary_literal, + sizeof_expr, + alignof_expr, + generic_expr, + generic_expr_zero, + generic_association_expr, + generic_default_expr, + binary_cond_expr, + cond_dummy_expr, + cond_expr, + builtin_choose_expr, + builtin_types_compatible_p, + builtin_convertvector, + builtin_shufflevector, + array_init_expr, + array_init_expr_two, + struct_init_expr, + struct_init_expr_two, + union_init_expr, + array_filler_expr, + default_init_expr, + compound_literal_expr, + }; + }; + + pub fn isImplicit(node: Node) bool { + return switch (node) { + .array_filler_expr, + .default_init_expr, + .cond_dummy_expr, + .compound_assign_dummy_expr, + => true, + .return_stmt => |ret| ret.operand == .implicit, + .cast => |cast| cast.implicit, + .variable => |info| info.implicit, + .typedef => |info| info.implicit, + else => false, + }; + } +}; + +pub fn addNode(tree: *Tree, node: Node) !Node.Index { + const index = try tree.nodes.addOne(tree.comp.gpa); + try tree.setNode(node, index); + return @enumFromInt(index); +} + +pub fn setNode(tree: *Tree, node: Node, index: usize) !void { + var repr: Node.Repr = undefined; + switch (node) { + .empty_decl => |empty| { + repr.tag = .empty_decl; + repr.tok = empty.semicolon; + }, + .static_assert => |assert| { + repr.tag = .static_assert; + repr.data[0] = @intFromEnum(assert.cond); + repr.data[1] = packOptIndex(assert.message); + repr.tok = assert.assert_tok; + }, + .function => |function| { + repr.tag = if (function.body != null) .fn_def else .fn_proto; + repr.data[0] = @bitCast(function.qt); + repr.data[1] = @bitCast(Node.Repr.DeclAttr{ + .static = function.static, + .@"inline" = function.@"inline", + }); + if (function.body) |some| { + repr.data[2] = @intFromEnum(some); + } else { + repr.data[2] = packOptIndex(function.definition); + } + repr.tok = function.name_tok; + }, + .param => |param| { + repr.tag = .param; + repr.data[0] = @bitCast(param.qt); + repr.data[1] = @bitCast(Node.Repr.DeclAttr{ + .register = param.storage_class == .register, + }); + repr.tok = param.name_tok; + }, + .variable => |variable| { + repr.tag = if (variable.initializer != null) .variable_def else .variable; + repr.data[0] = @bitCast(variable.qt); + repr.data[1] = @bitCast(Node.Repr.DeclAttr{ + .@"extern" = variable.storage_class == .@"extern", + .static = variable.storage_class == .static, + .thread_local = variable.thread_local, + .implicit = variable.implicit, + .register = variable.storage_class == .register, + }); + if (variable.initializer) |some| { + repr.data[2] = @intFromEnum(some); + } else { + repr.data[2] = packOptIndex(variable.definition); + } + repr.tok = variable.name_tok; + }, + .typedef => |typedef| { + repr.tag = .typedef; + repr.data[0] = @bitCast(typedef.qt); + repr.data[1] = @intFromBool(typedef.implicit); + repr.tok = typedef.name_tok; + }, + .global_asm => |global_asm| { + repr.tag = .global_asm; + repr.data[0] = @intFromEnum(global_asm.asm_str); + repr.tok = global_asm.asm_tok; + }, + .struct_decl => |decl| { + repr.data[0] = @bitCast(decl.container_qt); + if (decl.fields.len > 2) { + repr.tag = .struct_decl; + repr.data[1], repr.data[2] = try tree.addExtra(decl.fields); + } else { + repr.tag = .struct_decl_two; + repr.data[1] = packElem(decl.fields, 0); + repr.data[2] = packElem(decl.fields, 1); + } + repr.tok = decl.name_or_kind_tok; + }, + .union_decl => |decl| { + repr.data[0] = @bitCast(decl.container_qt); + if (decl.fields.len > 2) { + repr.tag = .union_decl; + repr.data[1], repr.data[2] = try tree.addExtra(decl.fields); + } else { + repr.tag = .union_decl_two; + repr.data[1] = packElem(decl.fields, 0); + repr.data[2] = packElem(decl.fields, 1); + } + repr.tok = decl.name_or_kind_tok; + }, + .enum_decl => |decl| { + repr.data[0] = @bitCast(decl.container_qt); + if (decl.fields.len > 2) { + repr.tag = .enum_decl; + repr.data[1], repr.data[2] = try tree.addExtra(decl.fields); + } else { + repr.tag = .enum_decl_two; + repr.data[1] = packElem(decl.fields, 0); + repr.data[2] = packElem(decl.fields, 1); + } + repr.tok = decl.name_or_kind_tok; + }, + .struct_forward_decl => |decl| { + repr.tag = .struct_forward_decl; + repr.data[0] = @bitCast(decl.container_qt); + // TODO decide how to handle definition + // repr.data[1] = decl.definition; + repr.tok = decl.name_or_kind_tok; + }, + .union_forward_decl => |decl| { + repr.tag = .union_forward_decl; + repr.data[0] = @bitCast(decl.container_qt); + // TODO decide how to handle definition + // repr.data[1] = decl.definition; + repr.tok = decl.name_or_kind_tok; + }, + .enum_forward_decl => |decl| { + repr.tag = .enum_forward_decl; + repr.data[0] = @bitCast(decl.container_qt); + // TODO decide how to handle definition + // repr.data[1] = decl.definition; + repr.tok = decl.name_or_kind_tok; + }, + .enum_field => |field| { + repr.tag = .enum_field; + repr.data[0] = @bitCast(field.qt); + repr.data[1] = packOptIndex(field.init); + repr.tok = field.name_tok; + }, + .record_field => |field| { + repr.tag = .record_field; + repr.data[0] = @bitCast(field.qt); + repr.data[1] = packOptIndex(field.bit_width); + repr.tok = field.name_or_first_tok; + }, + .labeled_stmt => |labeled| { + repr.tag = .labeled_stmt; + repr.data[0] = @bitCast(labeled.qt); + repr.data[1] = @intFromEnum(labeled.body); + repr.tok = labeled.label_tok; + }, + .compound_stmt => |compound| { + if (compound.body.len > 3) { + repr.tag = .compound_stmt; + repr.data[0], repr.data[1] = try tree.addExtra(compound.body); + } else { + repr.tag = .compound_stmt_three; + for (&repr.data, 0..) |*data, idx| + data.* = packElem(compound.body, idx); + } + repr.tok = compound.l_brace_tok; + }, + .if_stmt => |@"if"| { + repr.tag = .if_stmt; + repr.data[0] = @intFromEnum(@"if".cond); + repr.data[1] = @intFromEnum(@"if".then_body); + repr.data[2] = packOptIndex(@"if".else_body); + repr.tok = @"if".if_tok; + }, + .switch_stmt => |@"switch"| { + repr.tag = .switch_stmt; + repr.data[0] = @intFromEnum(@"switch".cond); + repr.data[1] = @intFromEnum(@"switch".body); + repr.tok = @"switch".switch_tok; + }, + .case_stmt => |case| { + repr.tag = .case_stmt; + repr.data[0] = @intFromEnum(case.start); + repr.data[1] = packOptIndex(case.end); + repr.data[2] = packOptIndex(case.body); + repr.tok = case.case_tok; + }, + .default_stmt => |default| { + repr.tag = .default_stmt; + repr.data[0] = @intFromEnum(default.body); + repr.tok = default.default_tok; + }, + .while_stmt => |@"while"| { + repr.tag = .while_stmt; + repr.data[0] = @intFromEnum(@"while".cond); + repr.data[1] = @intFromEnum(@"while".body); + repr.tok = @"while".while_tok; + }, + .do_while_stmt => |do_while| { + repr.tag = .do_while_stmt; + repr.data[0] = @intFromEnum(do_while.cond); + repr.data[1] = @intFromEnum(do_while.body); + repr.tok = do_while.do_tok; + }, + .for_stmt => |@"for"| { + switch (@"for".init) { + .decls => |decls| { + repr.tag = .for_decl; + repr.data[0] = @intCast(tree.extra.items.len); + const len: u32 = @intCast(decls.len + 2); + try tree.extra.ensureUnusedCapacity(tree.comp.gpa, len); + repr.data[1] = len; + tree.extra.appendSliceAssumeCapacity(@ptrCast(decls)); + tree.extra.appendAssumeCapacity(packOptIndex(@"for".cond)); + tree.extra.appendAssumeCapacity(packOptIndex(@"for".incr)); + }, + .expr => |expr| { + repr.tag = .for_expr; + repr.data[0] = packOptIndex(expr); + repr.data[1] = @intCast(tree.extra.items.len); + try tree.extra.ensureUnusedCapacity(tree.comp.gpa, 2); + tree.extra.appendAssumeCapacity(packOptIndex(@"for".cond)); + tree.extra.appendAssumeCapacity(packOptIndex(@"for".incr)); + }, + } + repr.data[2] = @intFromEnum(@"for".body); + repr.tok = @"for".for_tok; + }, + .goto_stmt => |goto| { + repr.tag = .goto_stmt; + repr.tok = goto.label_tok; + }, + .computed_goto_stmt => |computed_goto| { + repr.tag = .computed_goto_stmt; + repr.data[0] = @intFromEnum(computed_goto.expr); + repr.tok = computed_goto.goto_tok; + }, + .continue_stmt => |@"continue"| { + repr.tag = .continue_stmt; + repr.tok = @"continue".continue_tok; + }, + .break_stmt => |@"break"| { + repr.tag = .break_stmt; + repr.tok = @"break".break_tok; + }, + .null_stmt => |@"null"| { + repr.tag = .null_stmt; + repr.data[0] = @bitCast(@"null".qt); + repr.tok = @"null".semicolon_or_r_brace_tok; + }, + .return_stmt => |@"return"| { + repr.data[0] = @bitCast(@"return".return_qt); + switch (@"return".operand) { + .expr => |expr| { + repr.tag = .return_stmt; + repr.data[1] = @intFromEnum(expr); + }, + .none => { + repr.tag = .return_none_stmt; + }, + .implicit => |zeroes| { + repr.tag = .implicit_return; + repr.data[1] = @intFromBool(zeroes); + }, + } + repr.tok = @"return".return_tok; + }, + .gnu_asm_simple => |gnu_asm_simple| { + repr.tag = .gnu_asm_simple; + repr.data[0] = @intFromEnum(gnu_asm_simple.asm_str); + repr.tok = gnu_asm_simple.asm_tok; + }, + .assign_expr => |bin| { + repr.tag = .assign_expr; + repr.data[0] = @bitCast(bin.qt); + repr.data[1] = @intFromEnum(bin.lhs); + repr.data[2] = @intFromEnum(bin.rhs); + repr.tok = bin.op_tok; + }, + .mul_assign_expr => |bin| { + repr.tag = .mul_assign_expr; + repr.data[0] = @bitCast(bin.qt); + repr.data[1] = @intFromEnum(bin.lhs); + repr.data[2] = @intFromEnum(bin.rhs); + repr.tok = bin.op_tok; + }, + .div_assign_expr => |bin| { + repr.tag = .div_assign_expr; + repr.data[0] = @bitCast(bin.qt); + repr.data[1] = @intFromEnum(bin.lhs); + repr.data[2] = @intFromEnum(bin.rhs); + repr.tok = bin.op_tok; + }, + .mod_assign_expr => |bin| { + repr.tag = .mod_assign_expr; + repr.data[0] = @bitCast(bin.qt); + repr.data[1] = @intFromEnum(bin.lhs); + repr.data[2] = @intFromEnum(bin.rhs); + repr.tok = bin.op_tok; + }, + .add_assign_expr => |bin| { + repr.tag = .add_assign_expr; + repr.data[0] = @bitCast(bin.qt); + repr.data[1] = @intFromEnum(bin.lhs); + repr.data[2] = @intFromEnum(bin.rhs); + repr.tok = bin.op_tok; + }, + .sub_assign_expr => |bin| { + repr.tag = .sub_assign_expr; + repr.data[0] = @bitCast(bin.qt); + repr.data[1] = @intFromEnum(bin.lhs); + repr.data[2] = @intFromEnum(bin.rhs); + repr.tok = bin.op_tok; + }, + .shl_assign_expr => |bin| { + repr.tag = .shl_assign_expr; + repr.data[0] = @bitCast(bin.qt); + repr.data[1] = @intFromEnum(bin.lhs); + repr.data[2] = @intFromEnum(bin.rhs); + repr.tok = bin.op_tok; + }, + .shr_assign_expr => |bin| { + repr.tag = .shr_assign_expr; + repr.data[0] = @bitCast(bin.qt); + repr.data[1] = @intFromEnum(bin.lhs); + repr.data[2] = @intFromEnum(bin.rhs); + repr.tok = bin.op_tok; + }, + .bit_and_assign_expr => |bin| { + repr.tag = .bit_and_assign_expr; + repr.data[0] = @bitCast(bin.qt); + repr.data[1] = @intFromEnum(bin.lhs); + repr.data[2] = @intFromEnum(bin.rhs); + repr.tok = bin.op_tok; + }, + .bit_xor_assign_expr => |bin| { + repr.tag = .bit_xor_assign_expr; + repr.data[0] = @bitCast(bin.qt); + repr.data[1] = @intFromEnum(bin.lhs); + repr.data[2] = @intFromEnum(bin.rhs); + repr.tok = bin.op_tok; + }, + .bit_or_assign_expr => |bin| { + repr.tag = .bit_or_assign_expr; + repr.data[0] = @bitCast(bin.qt); + repr.data[1] = @intFromEnum(bin.lhs); + repr.data[2] = @intFromEnum(bin.rhs); + repr.tok = bin.op_tok; + }, + .compound_assign_dummy_expr => |un| { + repr.tag = .compound_assign_dummy_expr; + repr.data[0] = @bitCast(un.qt); + repr.data[1] = @intFromEnum(un.operand); + repr.tok = un.op_tok; + }, + .comma_expr => |bin| { + repr.tag = .comma_expr; + repr.data[0] = @bitCast(bin.qt); + repr.data[1] = @intFromEnum(bin.lhs); + repr.data[2] = @intFromEnum(bin.rhs); + repr.tok = bin.op_tok; + }, + .bool_or_expr => |bin| { + repr.tag = .bool_or_expr; + repr.data[0] = @bitCast(bin.qt); + repr.data[1] = @intFromEnum(bin.lhs); + repr.data[2] = @intFromEnum(bin.rhs); + repr.tok = bin.op_tok; + }, + .bool_and_expr => |bin| { + repr.tag = .bool_and_expr; + repr.data[0] = @bitCast(bin.qt); + repr.data[1] = @intFromEnum(bin.lhs); + repr.data[2] = @intFromEnum(bin.rhs); + repr.tok = bin.op_tok; + }, + .bit_or_expr => |bin| { + repr.tag = .bit_or_expr; + repr.data[0] = @bitCast(bin.qt); + repr.data[1] = @intFromEnum(bin.lhs); + repr.data[2] = @intFromEnum(bin.rhs); + repr.tok = bin.op_tok; + }, + .bit_xor_expr => |bin| { + repr.tag = .bit_xor_expr; + repr.data[0] = @bitCast(bin.qt); + repr.data[1] = @intFromEnum(bin.lhs); + repr.data[2] = @intFromEnum(bin.rhs); + repr.tok = bin.op_tok; + }, + .bit_and_expr => |bin| { + repr.tag = .bit_and_expr; + repr.data[0] = @bitCast(bin.qt); + repr.data[1] = @intFromEnum(bin.lhs); + repr.data[2] = @intFromEnum(bin.rhs); + repr.tok = bin.op_tok; + }, + .equal_expr => |bin| { + repr.tag = .equal_expr; + repr.data[0] = @bitCast(bin.qt); + repr.data[1] = @intFromEnum(bin.lhs); + repr.data[2] = @intFromEnum(bin.rhs); + repr.tok = bin.op_tok; + }, + .not_equal_expr => |bin| { + repr.tag = .not_equal_expr; + repr.data[0] = @bitCast(bin.qt); + repr.data[1] = @intFromEnum(bin.lhs); + repr.data[2] = @intFromEnum(bin.rhs); + repr.tok = bin.op_tok; + }, + .less_than_expr => |bin| { + repr.tag = .less_than_expr; + repr.data[0] = @bitCast(bin.qt); + repr.data[1] = @intFromEnum(bin.lhs); + repr.data[2] = @intFromEnum(bin.rhs); + repr.tok = bin.op_tok; + }, + .less_than_equal_expr => |bin| { + repr.tag = .less_than_equal_expr; + repr.data[0] = @bitCast(bin.qt); + repr.data[1] = @intFromEnum(bin.lhs); + repr.data[2] = @intFromEnum(bin.rhs); + repr.tok = bin.op_tok; + }, + .greater_than_expr => |bin| { + repr.tag = .greater_than_expr; + repr.data[0] = @bitCast(bin.qt); + repr.data[1] = @intFromEnum(bin.lhs); + repr.data[2] = @intFromEnum(bin.rhs); + repr.tok = bin.op_tok; + }, + .greater_than_equal_expr => |bin| { + repr.tag = .greater_than_equal_expr; + repr.data[0] = @bitCast(bin.qt); + repr.data[1] = @intFromEnum(bin.lhs); + repr.data[2] = @intFromEnum(bin.rhs); + repr.tok = bin.op_tok; + }, + .shl_expr => |bin| { + repr.tag = .shl_expr; + repr.data[0] = @bitCast(bin.qt); + repr.data[1] = @intFromEnum(bin.lhs); + repr.data[2] = @intFromEnum(bin.rhs); + repr.tok = bin.op_tok; + }, + .shr_expr => |bin| { + repr.tag = .shr_expr; + repr.data[0] = @bitCast(bin.qt); + repr.data[1] = @intFromEnum(bin.lhs); + repr.data[2] = @intFromEnum(bin.rhs); + repr.tok = bin.op_tok; + }, + .add_expr => |bin| { + repr.tag = .add_expr; + repr.data[0] = @bitCast(bin.qt); + repr.data[1] = @intFromEnum(bin.lhs); + repr.data[2] = @intFromEnum(bin.rhs); + repr.tok = bin.op_tok; + }, + .sub_expr => |bin| { + repr.tag = .sub_expr; + repr.data[0] = @bitCast(bin.qt); + repr.data[1] = @intFromEnum(bin.lhs); + repr.data[2] = @intFromEnum(bin.rhs); + repr.tok = bin.op_tok; + }, + .mul_expr => |bin| { + repr.tag = .mul_expr; + repr.data[0] = @bitCast(bin.qt); + repr.data[1] = @intFromEnum(bin.lhs); + repr.data[2] = @intFromEnum(bin.rhs); + repr.tok = bin.op_tok; + }, + .div_expr => |bin| { + repr.tag = .div_expr; + repr.data[0] = @bitCast(bin.qt); + repr.data[1] = @intFromEnum(bin.lhs); + repr.data[2] = @intFromEnum(bin.rhs); + repr.tok = bin.op_tok; + }, + .mod_expr => |bin| { + repr.tag = .mod_expr; + repr.data[0] = @bitCast(bin.qt); + repr.data[1] = @intFromEnum(bin.lhs); + repr.data[2] = @intFromEnum(bin.rhs); + repr.tok = bin.op_tok; + }, + .cast => |cast| { + repr.tag = if (cast.implicit) .implicit_cast else .explicit_cast; + repr.data[0] = @bitCast(cast.qt); + repr.data[1] = @intFromEnum(cast.kind); + repr.data[2] = @intFromEnum(cast.operand); + repr.tok = cast.l_paren; + }, + .addr_of_expr => |un| { + repr.tag = .addr_of_expr; + repr.data[0] = @bitCast(un.qt); + repr.data[1] = @intFromEnum(un.operand); + repr.tok = un.op_tok; + }, + .deref_expr => |un| { + repr.tag = .deref_expr; + repr.data[0] = @bitCast(un.qt); + repr.data[1] = @intFromEnum(un.operand); + repr.tok = un.op_tok; + }, + .plus_expr => |un| { + repr.tag = .plus_expr; + repr.data[0] = @bitCast(un.qt); + repr.data[1] = @intFromEnum(un.operand); + repr.tok = un.op_tok; + }, + .negate_expr => |un| { + repr.tag = .negate_expr; + repr.data[0] = @bitCast(un.qt); + repr.data[1] = @intFromEnum(un.operand); + repr.tok = un.op_tok; + }, + .bit_not_expr => |un| { + repr.tag = .bit_not_expr; + repr.data[0] = @bitCast(un.qt); + repr.data[1] = @intFromEnum(un.operand); + repr.tok = un.op_tok; + }, + .bool_not_expr => |un| { + repr.tag = .bool_not_expr; + repr.data[0] = @bitCast(un.qt); + repr.data[1] = @intFromEnum(un.operand); + repr.tok = un.op_tok; + }, + .pre_inc_expr => |un| { + repr.tag = .pre_inc_expr; + repr.data[0] = @bitCast(un.qt); + repr.data[1] = @intFromEnum(un.operand); + repr.tok = un.op_tok; + }, + .pre_dec_expr => |un| { + repr.tag = .pre_dec_expr; + repr.data[0] = @bitCast(un.qt); + repr.data[1] = @intFromEnum(un.operand); + repr.tok = un.op_tok; + }, + .imag_expr => |un| { + repr.tag = .imag_expr; + repr.data[0] = @bitCast(un.qt); + repr.data[1] = @intFromEnum(un.operand); + repr.tok = un.op_tok; + }, + .real_expr => |un| { + repr.tag = .real_expr; + repr.data[0] = @bitCast(un.qt); + repr.data[1] = @intFromEnum(un.operand); + repr.tok = un.op_tok; + }, + .post_inc_expr => |un| { + repr.tag = .post_inc_expr; + repr.data[0] = @bitCast(un.qt); + repr.data[1] = @intFromEnum(un.operand); + repr.tok = un.op_tok; + }, + .post_dec_expr => |un| { + repr.tag = .post_dec_expr; + repr.data[0] = @bitCast(un.qt); + repr.data[1] = @intFromEnum(un.operand); + repr.tok = un.op_tok; + }, + .paren_expr => |un| { + repr.tag = .paren_expr; + repr.data[0] = @bitCast(un.qt); + repr.data[1] = @intFromEnum(un.operand); + repr.tok = un.op_tok; + }, + .stmt_expr => |un| { + repr.tag = .stmt_expr; + repr.data[0] = @bitCast(un.qt); + repr.data[1] = @intFromEnum(un.operand); + repr.tok = un.op_tok; + }, + .cond_dummy_expr => |un| { + repr.tag = .cond_dummy_expr; + repr.data[0] = @bitCast(un.qt); + repr.data[1] = @intFromEnum(un.operand); + repr.tok = un.op_tok; + }, + .addr_of_label => |addr_of| { + repr.tag = .addr_of_label; + repr.data[0] = @bitCast(addr_of.qt); + repr.tok = addr_of.label_tok; + }, + .array_access_expr => |access| { + repr.tag = .array_access_expr; + repr.data[0] = @bitCast(access.qt); + repr.data[1] = @intFromEnum(access.base); + repr.data[2] = @intFromEnum(access.index); + repr.tok = access.l_bracket_tok; + }, + .call_expr => |call| { + repr.data[0] = @bitCast(call.qt); + if (call.args.len > 1) { + repr.tag = .call_expr; + repr.data[1] = @intCast(tree.extra.items.len); + const len: u32 = @intCast(call.args.len + 1); + repr.data[2] = len; + try tree.extra.ensureUnusedCapacity(tree.comp.gpa, len); + tree.extra.appendAssumeCapacity(@intFromEnum(call.callee)); + tree.extra.appendSliceAssumeCapacity(@ptrCast(call.args)); + } else { + repr.tag = .call_expr_one; + repr.data[1] = @intFromEnum(call.callee); + repr.data[2] = packElem(call.args, 0); + } + repr.tok = call.l_paren_tok; + }, + .builtin_call_expr => |call| { + repr.data[0] = @bitCast(call.qt); + if (call.args.len > 2) { + repr.tag = .builtin_call_expr; + repr.data[1], repr.data[2] = try tree.addExtra(call.args); + } else { + repr.tag = .builtin_call_expr_two; + repr.data[1] = packElem(call.args, 0); + repr.data[2] = packElem(call.args, 1); + } + repr.tok = call.builtin_tok; + }, + .member_access_expr => |access| { + repr.tag = .member_access_expr; + repr.data[0] = @bitCast(access.qt); + repr.data[1] = @intFromEnum(access.base); + repr.data[2] = access.member_index; + repr.tok = access.access_tok; + }, + .member_access_ptr_expr => |access| { + repr.tag = .member_access_ptr_expr; + repr.data[0] = @bitCast(access.qt); + repr.data[1] = @intFromEnum(access.base); + repr.data[2] = access.member_index; + repr.tok = access.access_tok; + }, + .decl_ref_expr => |decl_ref| { + repr.tag = .decl_ref_expr; + repr.data[0] = @bitCast(decl_ref.qt); + repr.data[1] = @intFromEnum(decl_ref.decl); + repr.tok = decl_ref.name_tok; + }, + .enumeration_ref => |enumeration_ref| { + repr.tag = .enumeration_ref; + repr.data[0] = @bitCast(enumeration_ref.qt); + repr.data[1] = @intFromEnum(enumeration_ref.decl); + repr.tok = enumeration_ref.name_tok; + }, + .builtin_ref => |builtin_ref| { + repr.tag = .builtin_ref; + repr.data[0] = @bitCast(builtin_ref.qt); + repr.tok = builtin_ref.name_tok; + }, + .bool_literal => |literal| { + repr.tag = .bool_literal; + repr.data[0] = @bitCast(literal.qt); + repr.tok = literal.literal_tok; + }, + .nullptr_literal => |literal| { + repr.tag = .nullptr_literal; + repr.data[0] = @bitCast(literal.qt); + repr.tok = literal.literal_tok; + }, + .int_literal => |literal| { + repr.tag = .int_literal; + repr.data[0] = @bitCast(literal.qt); + repr.tok = literal.literal_tok; + }, + .char_literal => |literal| { + repr.tag = .char_literal; + repr.data[0] = @bitCast(literal.qt); + repr.data[1] = @intFromEnum(literal.kind); + repr.tok = literal.literal_tok; + }, + .float_literal => |literal| { + repr.tag = .float_literal; + repr.data[0] = @bitCast(literal.qt); + repr.tok = literal.literal_tok; + }, + .string_literal_expr => |literal| { + repr.tag = .string_literal_expr; + repr.data[0] = @bitCast(literal.qt); + repr.data[1] = @intFromEnum(literal.kind); + repr.tok = literal.literal_tok; + }, + .imaginary_literal => |un| { + repr.tag = .imaginary_literal; + repr.data[0] = @bitCast(un.qt); + repr.data[1] = @intFromEnum(un.operand); + repr.tok = un.op_tok; + }, + .sizeof_expr => |type_info| { + repr.tag = .sizeof_expr; + repr.data[0] = @bitCast(type_info.qt); + repr.data[1] = packOptIndex(type_info.expr); + repr.data[2] = @bitCast(type_info.operand_qt); + repr.tok = type_info.op_tok; + }, + .alignof_expr => |type_info| { + repr.tag = .alignof_expr; + repr.data[0] = @bitCast(type_info.qt); + repr.data[1] = packOptIndex(type_info.expr); + repr.data[2] = @bitCast(type_info.operand_qt); + repr.tok = type_info.op_tok; + }, + .generic_expr => |generic| { + repr.data[0] = @bitCast(generic.qt); + if (generic.rest.len > 0) { + repr.tag = .generic_expr; + repr.data[1] = @intCast(tree.extra.items.len); + const len: u32 = @intCast(generic.rest.len + 2); + repr.data[2] = len; + try tree.extra.ensureUnusedCapacity(tree.comp.gpa, len); + tree.extra.appendAssumeCapacity(@intFromEnum(generic.controlling)); + tree.extra.appendAssumeCapacity(@intFromEnum(generic.chosen)); + tree.extra.appendSliceAssumeCapacity(@ptrCast(generic.rest)); + } else { + repr.tag = .generic_expr_zero; + repr.data[1] = @intFromEnum(generic.controlling); + repr.data[2] = @intFromEnum(generic.chosen); + } + repr.tok = generic.generic_tok; + }, + .generic_association_expr => |association| { + repr.tag = .generic_association_expr; + repr.data[0] = @bitCast(association.association_qt); + repr.data[1] = @intFromEnum(association.expr); + repr.tok = association.colon_tok; + }, + .generic_default_expr => |default| { + repr.tag = .generic_default_expr; + repr.data[0] = @intFromEnum(default.expr); + repr.tok = default.default_tok; + }, + .binary_cond_expr => |cond| { + repr.tag = .binary_cond_expr; + repr.data[0] = @bitCast(cond.qt); + repr.data[1] = @intFromEnum(cond.cond); + repr.data[2], _ = try tree.addExtra(&.{ cond.then_expr, cond.else_expr }); + repr.tok = cond.cond_tok; + }, + .cond_expr => |cond| { + repr.tag = .cond_expr; + repr.data[0] = @bitCast(cond.qt); + repr.data[1] = @intFromEnum(cond.cond); + repr.data[2], _ = try tree.addExtra(&.{ cond.then_expr, cond.else_expr }); + repr.tok = cond.cond_tok; + }, + .builtin_choose_expr => |cond| { + repr.tag = .builtin_choose_expr; + repr.data[0] = @bitCast(cond.qt); + repr.data[1] = @intFromEnum(cond.cond); + repr.data[2], _ = try tree.addExtra(&.{ cond.then_expr, cond.else_expr }); + repr.tok = cond.cond_tok; + }, + .builtin_types_compatible_p => |builtin| { + repr.tag = .builtin_types_compatible_p; + repr.data[0] = @bitCast(builtin.lhs); + repr.data[1] = @bitCast(builtin.rhs); + repr.tok = builtin.builtin_tok; + }, + .builtin_convertvector => |builtin| { + repr.tag = .builtin_convertvector; + repr.data[0] = @bitCast(builtin.dest_qt); + repr.data[1] = @intFromEnum(builtin.operand); + repr.tok = builtin.builtin_tok; + }, + .builtin_shufflevector => |builtin| { + repr.tag = .builtin_shufflevector; + repr.data[0] = @bitCast(builtin.qt); + repr.data[1] = @intCast(tree.extra.items.len); + repr.data[2] = @intCast(builtin.indexes.len); + repr.tok = builtin.builtin_tok; + try tree.extra.ensureUnusedCapacity(tree.comp.gpa, builtin.indexes.len + 2); + tree.extra.appendAssumeCapacity(@intFromEnum(builtin.lhs)); + tree.extra.appendAssumeCapacity(@intFromEnum(builtin.rhs)); + tree.extra.appendSliceAssumeCapacity(@ptrCast(builtin.indexes)); + }, + .array_init_expr => |init| { + repr.data[0] = @bitCast(init.container_qt); + if (init.items.len > 2) { + repr.tag = .array_init_expr; + repr.data[1], repr.data[2] = try tree.addExtra(init.items); + } else { + repr.tag = .array_init_expr_two; + repr.data[1] = packElem(init.items, 0); + repr.data[2] = packElem(init.items, 1); + } + repr.tok = init.l_brace_tok; + }, + .struct_init_expr => |init| { + repr.data[0] = @bitCast(init.container_qt); + if (init.items.len > 2) { + repr.tag = .struct_init_expr; + repr.data[1], repr.data[2] = try tree.addExtra(init.items); + } else { + repr.tag = .struct_init_expr_two; + repr.data[1] = packElem(init.items, 0); + repr.data[2] = packElem(init.items, 1); + } + repr.tok = init.l_brace_tok; + }, + .union_init_expr => |init| { + repr.tag = .union_init_expr; + repr.data[0] = @bitCast(init.union_qt); + repr.data[1] = init.field_index; + repr.data[2] = packOptIndex(init.initializer); + repr.tok = init.l_brace_tok; + }, + .array_filler_expr => |filler| { + repr.tag = .array_filler_expr; + repr.data[0] = @bitCast(filler.qt); + repr.data[1], repr.data[2] = @as([2]u32, @bitCast(filler.count)); + repr.tok = filler.last_tok; + }, + .default_init_expr => |default| { + repr.tag = .default_init_expr; + repr.data[0] = @bitCast(default.qt); + repr.tok = default.last_tok; + }, + .compound_literal_expr => |literal| { + repr.tag = .compound_literal_expr; + repr.data[0] = @bitCast(literal.qt); + repr.data[1] = @bitCast(Node.Repr.DeclAttr{ + .static = literal.storage_class == .static, + .register = literal.storage_class == .register, + .thread_local = literal.thread_local, + }); + repr.data[2] = @intFromEnum(literal.initializer); + repr.tok = literal.l_paren_tok; + }, } -}; - -pub const TokenIndex = u32; -pub const NodeIndex = enum(u32) { none, _ }; -pub const ValueMap = std.AutoHashMap(NodeIndex, Value); - -const Tree = @This(); - -comp: *Compilation, -arena: std.heap.ArenaAllocator, -generated: []const u8, -tokens: Token.List.Slice, -nodes: Node.List.Slice, -data: []const NodeIndex, -root_decls: []const NodeIndex, -value_map: ValueMap, - -pub const genIr = CodeGen.genIr; - -pub fn deinit(tree: *Tree) void { - tree.comp.gpa.free(tree.root_decls); - tree.comp.gpa.free(tree.data); - tree.nodes.deinit(tree.comp.gpa); - tree.arena.deinit(); - tree.value_map.deinit(); + tree.nodes.set(index, repr); } -pub const GNUAssemblyQualifiers = struct { - @"volatile": bool = false, - @"inline": bool = false, - goto: bool = false, -}; - -pub const Node = struct { - tag: Tag, - ty: Type = .{ .specifier = .void }, - data: Data, - loc: Loc = .none, - - pub const Range = struct { start: u32, end: u32 }; - - pub const Loc = enum(u32) { - none = std.math.maxInt(u32), - _, - }; - - pub const Data = union { - decl: struct { - name: TokenIndex, - node: NodeIndex = .none, - }, - decl_ref: TokenIndex, - two: [2]NodeIndex, - range: Range, - if3: struct { - cond: NodeIndex, - body: u32, - }, - un: NodeIndex, - bin: struct { - lhs: NodeIndex, - rhs: NodeIndex, - }, - member: struct { - lhs: NodeIndex, - index: u32, - }, - union_init: struct { - field_index: u32, - node: NodeIndex, - }, - cast: struct { - operand: NodeIndex, - kind: CastKind, - }, - int: u64, - return_zero: bool, - - pub fn forDecl(data: Data, tree: *const Tree) struct { - decls: []const NodeIndex, - cond: NodeIndex, - incr: NodeIndex, - body: NodeIndex, - } { - const items = tree.data[data.range.start..data.range.end]; - const decls = items[0 .. items.len - 3]; - - return .{ - .decls = decls, - .cond = items[items.len - 3], - .incr = items[items.len - 2], - .body = items[items.len - 1], - }; - } - - pub fn forStmt(data: Data, tree: *const Tree) struct { - init: NodeIndex, - cond: NodeIndex, - incr: NodeIndex, - body: NodeIndex, - } { - const items = tree.data[data.if3.body..]; - - return .{ - .init = items[0], - .cond = items[1], - .incr = items[2], - .body = data.if3.cond, - }; - } - }; - - pub const List = std.MultiArrayList(Node); -}; - -pub const CastKind = enum(u8) { - /// Does nothing except possibly add qualifiers - no_op, - /// Interpret one bit pattern as another. Used for operands which have the same - /// size and unrelated types, e.g. casting one pointer type to another - bitcast, - /// Convert T[] to T * - array_to_pointer, - /// Converts an lvalue to an rvalue - lval_to_rval, - /// Convert a function type to a pointer to a function - function_to_pointer, - /// Convert a pointer type to a _Bool - pointer_to_bool, - /// Convert a pointer type to an integer type - pointer_to_int, - /// Convert _Bool to an integer type - bool_to_int, - /// Convert _Bool to a floating type - bool_to_float, - /// Convert a _Bool to a pointer; will cause a warning - bool_to_pointer, - /// Convert an integer type to _Bool - int_to_bool, - /// Convert an integer to a floating type - int_to_float, - /// Convert a complex integer to a complex floating type - complex_int_to_complex_float, - /// Convert an integer type to a pointer type - int_to_pointer, - /// Convert a floating type to a _Bool - float_to_bool, - /// Convert a floating type to an integer - float_to_int, - /// Convert a complex floating type to a complex integer - complex_float_to_complex_int, - /// Convert one integer type to another - int_cast, - /// Convert one complex integer type to another - complex_int_cast, - /// Convert real part of complex integer to a integer - complex_int_to_real, - /// Create a complex integer type using operand as the real part - real_to_complex_int, - /// Convert one floating type to another - float_cast, - /// Convert one complex floating type to another - complex_float_cast, - /// Convert real part of complex float to a float - complex_float_to_real, - /// Create a complex floating type using operand as the real part - real_to_complex_float, - /// Convert type to void - to_void, - /// Convert a literal 0 to a null pointer - null_to_pointer, - /// GNU cast-to-union extension - union_cast, - /// Create vector where each value is same as the input scalar. - vector_splat, -}; +fn packOptIndex(opt: ?Node.Index) u32 { + return @intFromEnum(Node.OptIndex.packOpt(opt)); +} -pub const Tag = enum(u8) { - /// Must appear at index 0. Also used as the tag for __builtin_types_compatible_p arguments, since the arguments are types - /// Reaching it is always the result of a bug. - invalid, - - // ====== Decl ====== - - /// _Static_assert - /// loc is token index of _Static_assert - static_assert, - - // function prototype - fn_proto, - static_fn_proto, - inline_fn_proto, - inline_static_fn_proto, - - // function definition - fn_def, - static_fn_def, - inline_fn_def, - inline_static_fn_def, - - // variable declaration - @"var", - extern_var, - static_var, - // same as static_var, used for __func__, __FUNCTION__ and __PRETTY_FUNCTION__ - implicit_static_var, - threadlocal_var, - threadlocal_extern_var, - threadlocal_static_var, - - /// __asm__("...") at file scope - /// loc is token index of __asm__ keyword - file_scope_asm, - - // typedef declaration - typedef, - - // container declarations - /// { two[0]; two[1]; } - struct_decl_two, - /// { two[0]; two[1]; } - union_decl_two, - /// { two[0], two[1], } - enum_decl_two, - /// { range } - struct_decl, - /// { range } - union_decl, - /// { range } - enum_decl, - /// struct decl_ref; - struct_forward_decl, - /// union decl_ref; - union_forward_decl, - /// enum decl_ref; - enum_forward_decl, - - /// name = node - enum_field_decl, - /// ty name : node - /// name == 0 means unnamed - record_field_decl, - /// Used when a record has an unnamed record as a field - indirect_record_field_decl, - - // ====== Stmt ====== - - labeled_stmt, - /// { two[0]; two[1]; } first and second may be null - compound_stmt_two, - /// { data } - compound_stmt, - /// if (first) data[second] else data[second+1]; - if_then_else_stmt, - /// if (first) second; second may be null - if_then_stmt, - /// switch (first) second - switch_stmt, - /// case first: second - case_stmt, - /// case data[body]...data[body+1]: cond - case_range_stmt, - /// default: first - default_stmt, - /// while (first) second - while_stmt, - /// do second while(first); - do_while_stmt, - /// for (data[..]; data[len-3]; data[len-2]) data[len-1] - for_decl_stmt, - /// for (;;;) first - forever_stmt, - /// for (data[first]; data[first+1]; data[first+2]) second - for_stmt, - /// goto first; - goto_stmt, - /// goto *un; - computed_goto_stmt, - // continue; first and second unused - continue_stmt, - // break; first and second unused - break_stmt, - // null statement (just a semicolon); first and second unused - null_stmt, - /// return first; first may be null - return_stmt, - /// Assembly statement of the form __asm__("string literal") - gnu_asm_simple, - - // ====== Expr ====== - - /// lhs , rhs - comma_expr, - /// lhs ? data[0] : data[1] - binary_cond_expr, - /// Used as the base for casts of the lhs in `binary_cond_expr`. - cond_dummy_expr, - /// lhs ? data[0] : data[1] - cond_expr, - /// lhs = rhs - assign_expr, - /// lhs *= rhs - mul_assign_expr, - /// lhs /= rhs - div_assign_expr, - /// lhs %= rhs - mod_assign_expr, - /// lhs += rhs - add_assign_expr, - /// lhs -= rhs - sub_assign_expr, - /// lhs <<= rhs - shl_assign_expr, - /// lhs >>= rhs - shr_assign_expr, - /// lhs &= rhs - bit_and_assign_expr, - /// lhs ^= rhs - bit_xor_assign_expr, - /// lhs |= rhs - bit_or_assign_expr, - /// lhs || rhs - bool_or_expr, - /// lhs && rhs - bool_and_expr, - /// lhs | rhs - bit_or_expr, - /// lhs ^ rhs - bit_xor_expr, - /// lhs & rhs - bit_and_expr, - /// lhs == rhs - equal_expr, - /// lhs != rhs - not_equal_expr, - /// lhs < rhs - less_than_expr, - /// lhs <= rhs - less_than_equal_expr, - /// lhs > rhs - greater_than_expr, - /// lhs >= rhs - greater_than_equal_expr, - /// lhs << rhs - shl_expr, - /// lhs >> rhs - shr_expr, - /// lhs + rhs - add_expr, - /// lhs - rhs - sub_expr, - /// lhs * rhs - mul_expr, - /// lhs / rhs - div_expr, - /// lhs % rhs - mod_expr, - /// Explicit: (type) cast - explicit_cast, - /// Implicit: cast - implicit_cast, - /// &un - addr_of_expr, - /// &&decl_ref - addr_of_label, - /// *un - deref_expr, - /// +un - plus_expr, - /// -un - negate_expr, - /// ~un - bit_not_expr, - /// !un - bool_not_expr, - /// ++un - pre_inc_expr, - /// --un - pre_dec_expr, - /// __imag un - imag_expr, - /// __real un - real_expr, - /// lhs[rhs] lhs is pointer/array type, rhs is integer type - array_access_expr, - /// two[0](two[1]) two[1] may be 0 - call_expr_one, - /// data[0](data[1..]) - call_expr, - /// decl - builtin_call_expr_one, - builtin_call_expr, - /// lhs.member - member_access_expr, - /// lhs->member - member_access_ptr_expr, - /// un++ - post_inc_expr, - /// un-- - post_dec_expr, - /// (un) - paren_expr, - /// decl_ref - decl_ref_expr, - /// decl_ref - enumeration_ref, - /// C23 bool literal `true` / `false` - bool_literal, - /// C23 nullptr literal - nullptr_literal, - /// integer literal, always unsigned - int_literal, - /// Same as int_literal, but originates from a char literal - char_literal, - /// a floating point literal - float_literal, - /// wraps a float or double literal: un - imaginary_literal, - /// tree.str[index..][0..len] - string_literal_expr, - /// sizeof(un?) - sizeof_expr, - /// _Alignof(un?) - alignof_expr, - /// _Generic(controlling two[0], chosen two[1]) - generic_expr_one, - /// _Generic(controlling range[0], chosen range[1], rest range[2..]) - generic_expr, - /// ty: un - generic_association_expr, - // default: un - generic_default_expr, - /// __builtin_choose_expr(lhs, data[0], data[1]) - builtin_choose_expr, - /// __builtin_types_compatible_p(lhs, rhs) - builtin_types_compatible_p, - /// decl - special builtins require custom parsing - special_builtin_call_one, - /// ({ un }) - stmt_expr, - - // ====== Initializer expressions ====== - - /// { two[0], two[1] } - array_init_expr_two, - /// { range } - array_init_expr, - /// { two[0], two[1] } - struct_init_expr_two, - /// { range } - struct_init_expr, - /// { union_init } - union_init_expr, - - /// (ty){ un } - /// loc is token index of l_paren - compound_literal_expr, - /// (static ty){ un } - /// loc is token index of l_paren - static_compound_literal_expr, - /// (thread_local ty){ un } - /// loc is token index of l_paren - thread_local_compound_literal_expr, - /// (static thread_local ty){ un } - /// loc is token index of l_paren - static_thread_local_compound_literal_expr, - - /// Inserted at the end of a function body if no return stmt is found. - /// ty is the functions return type - /// data is return_zero which is true if the function is called "main" and ty is compatible with int - /// loc is token index of closing r_brace of function - implicit_return, +fn unpackOptIndex(idx: u32) ?Node.Index { + return @as(Node.OptIndex, @enumFromInt(idx)).unpack(); +} - /// Inserted in array_init_expr to represent unspecified elements. - /// data.int contains the amount of elements. - array_filler_expr, - /// Inserted in record and scalar initializers for unspecified elements. - default_init_expr, +fn packElem(nodes: []const Node.Index, index: usize) u32 { + return if (nodes.len > index) @intFromEnum(nodes[index]) else @intFromEnum(Node.OptIndex.null); +} - pub fn isImplicit(tag: Tag) bool { - return switch (tag) { - .implicit_cast, - .implicit_return, - .array_filler_expr, - .default_init_expr, - .implicit_static_var, - .cond_dummy_expr, - => true, - else => false, - }; +fn unPackElems(data: []const u32) []const Node.Index { + const sentinel = @intFromEnum(Node.OptIndex.null); + for (data, 0..) |item, i| { + if (item == sentinel) return @ptrCast(data[0..i]); } -}; + return @ptrCast(data); +} + +/// Returns index to `tree.extra` and length of data +fn addExtra(tree: *Tree, data: []const Node.Index) !struct { u32, u32 } { + const index: u32 = @intCast(tree.extra.items.len); + try tree.extra.appendSlice(tree.comp.gpa, @ptrCast(data)); + return .{ index, @intCast(data.len) }; +} -pub fn isBitfield(tree: *const Tree, node: NodeIndex) bool { +pub fn isBitfield(tree: *const Tree, node: Node.Index) bool { return tree.bitfieldWidth(node, false) != null; } /// Returns null if node is not a bitfield. If inspect_lval is true, this function will /// recurse into implicit lval_to_rval casts (useful for arithmetic conversions) -pub fn bitfieldWidth(tree: *const Tree, node: NodeIndex, inspect_lval: bool) ?u32 { - if (node == .none) return null; - switch (tree.nodes.items(.tag)[@intFromEnum(node)]) { - .member_access_expr, .member_access_ptr_expr => { - const member = tree.nodes.items(.data)[@intFromEnum(node)].member; - var ty = tree.nodes.items(.ty)[@intFromEnum(member.lhs)]; - if (ty.isPtr()) ty = ty.elemType(); - const record_ty = ty.get(.@"struct") orelse ty.get(.@"union") orelse return null; - const field = record_ty.data.record.fields[member.index]; - return field.bit_width; - }, - .implicit_cast => { +pub fn bitfieldWidth(tree: *const Tree, node: Node.Index, inspect_lval: bool) ?u32 { + switch (node.get(tree)) { + .member_access_expr, .member_access_ptr_expr => |access| return access.isBitFieldWidth(tree), + .cast => |cast| { if (!inspect_lval) return null; - const data = tree.nodes.items(.data)[@intFromEnum(node)]; - return switch (data.cast.kind) { - .lval_to_rval => tree.bitfieldWidth(data.cast.operand, false), + return switch (cast.kind) { + .lval_to_rval => tree.bitfieldWidth(cast.operand, false), else => null, }; }, @@ -632,34 +2803,29 @@ const CallableResultUsage = struct { warn_unused_result: bool, }; -pub fn callableResultUsage(tree: *const Tree, node: NodeIndex) ?CallableResultUsage { - const data = tree.nodes.items(.data); - +pub fn callableResultUsage(tree: *const Tree, node: Node.Index) ?CallableResultUsage { var cur_node = node; - while (true) switch (tree.nodes.items(.tag)[@intFromEnum(cur_node)]) { - .decl_ref_expr => { - const tok = data[@intFromEnum(cur_node)].decl_ref; - const fn_ty = tree.nodes.items(.ty)[@intFromEnum(node)].elemType(); - return .{ - .tok = tok, - .nodiscard = fn_ty.hasAttribute(.nodiscard), - .warn_unused_result = fn_ty.hasAttribute(.warn_unused_result), - }; + while (true) switch (cur_node.get(tree)) { + .decl_ref_expr => |decl_ref| return .{ + .tok = decl_ref.name_tok, + .nodiscard = decl_ref.qt.hasAttribute(tree.comp, .nodiscard), + .warn_unused_result = decl_ref.qt.hasAttribute(tree.comp, .warn_unused_result), }, - .paren_expr => cur_node = data[@intFromEnum(cur_node)].un, - .comma_expr => cur_node = data[@intFromEnum(cur_node)].bin.rhs, - - .explicit_cast, .implicit_cast => cur_node = data[@intFromEnum(cur_node)].cast.operand, - .addr_of_expr, .deref_expr => cur_node = data[@intFromEnum(cur_node)].un, - .call_expr_one => cur_node = data[@intFromEnum(cur_node)].two[0], - .call_expr => cur_node = tree.data[data[@intFromEnum(cur_node)].range.start], - .member_access_expr, .member_access_ptr_expr => { - const member = data[@intFromEnum(cur_node)].member; - var ty = tree.nodes.items(.ty)[@intFromEnum(member.lhs)]; - if (ty.isPtr()) ty = ty.elemType(); - const record = ty.getRecord().?; - const field = record.fields[member.index]; - const attributes = if (record.field_attributes) |attrs| attrs[member.index] else &.{}; + + .paren_expr, .addr_of_expr, .deref_expr => |un| cur_node = un.operand, + .comma_expr => |bin| cur_node = bin.rhs, + .cast => |cast| cur_node = cast.operand, + .call_expr => |call| cur_node = call.callee, + .member_access_expr, .member_access_ptr_expr => |access| { + var qt = access.base.qt(tree); + if (qt.get(tree.comp, .pointer)) |pointer| qt = pointer.child; + const record_ty = switch (qt.base(tree.comp).type) { + .@"struct", .@"union" => |record| record, + else => return null, + }; + + const field = record_ty.fields[access.member_index]; + const attributes = field.attributes(tree.comp); return .{ .tok = field.name_tok, .nodiscard = for (attributes) |attr| { @@ -674,177 +2840,115 @@ pub fn callableResultUsage(tree: *const Tree, node: NodeIndex) ?CallableResultUs }; } -pub fn isLval(tree: *const Tree, node: NodeIndex) bool { +pub fn isLval(tree: *const Tree, node: Node.Index) bool { var is_const: bool = undefined; return tree.isLvalExtra(node, &is_const); } -pub fn isLvalExtra(tree: *const Tree, node: NodeIndex, is_const: *bool) bool { +pub fn isLvalExtra(tree: *const Tree, node: Node.Index, is_const: *bool) bool { is_const.* = false; - switch (tree.nodes.items(.tag)[@intFromEnum(node)]) { - .compound_literal_expr, - .static_compound_literal_expr, - .thread_local_compound_literal_expr, - .static_thread_local_compound_literal_expr, - => { - is_const.* = tree.nodes.items(.ty)[@intFromEnum(node)].isConst(); + var cur_node = node; + switch (cur_node.get(tree)) { + .compound_literal_expr => |literal| { + is_const.* = literal.qt.@"const"; return true; }, .string_literal_expr => return true, - .member_access_ptr_expr => { - const lhs_expr = tree.nodes.items(.data)[@intFromEnum(node)].member.lhs; - const ptr_ty = tree.nodes.items(.ty)[@intFromEnum(lhs_expr)]; - if (ptr_ty.isPtr()) is_const.* = ptr_ty.elemType().isConst(); + .member_access_ptr_expr => |access| { + const ptr_qt = access.base.qt(tree); + if (ptr_qt.get(tree.comp, .pointer)) |pointer| is_const.* = pointer.child.@"const"; return true; }, - .array_access_expr => { - const lhs_expr = tree.nodes.items(.data)[@intFromEnum(node)].bin.lhs; - if (lhs_expr != .none) { - const array_ty = tree.nodes.items(.ty)[@intFromEnum(lhs_expr)]; - if (array_ty.isPtr() or array_ty.isArray()) is_const.* = array_ty.elemType().isConst(); - } - return true; + .member_access_expr => |access| { + return tree.isLvalExtra(access.base, is_const); }, - .decl_ref_expr => { - const decl_ty = tree.nodes.items(.ty)[@intFromEnum(node)]; - is_const.* = decl_ty.isConst(); + .array_access_expr => |access| { + const base_qt = access.base.qt(tree); + // Array access operand undergoes lval conversions so the base can never + // be a pure array type. + if (base_qt.get(tree.comp, .pointer)) |pointer| is_const.* = pointer.child.@"const"; return true; }, - .deref_expr => { - const data = tree.nodes.items(.data)[@intFromEnum(node)]; - const operand_ty = tree.nodes.items(.ty)[@intFromEnum(data.un)]; - if (operand_ty.isFunc()) return false; - if (operand_ty.isPtr() or operand_ty.isArray()) is_const.* = operand_ty.elemType().isConst(); + .decl_ref_expr => |decl_ref| { + is_const.* = decl_ref.qt.@"const"; return true; }, - .member_access_expr => { - const data = tree.nodes.items(.data)[@intFromEnum(node)]; - return tree.isLvalExtra(data.member.lhs, is_const); + .deref_expr => |un| { + const operand_qt = un.operand.qt(tree); + switch (operand_qt.base(tree.comp).type) { + .func => return false, + .pointer => |pointer| is_const.* = pointer.child.@"const", + else => {}, + } + return true; }, - .paren_expr => { - const data = tree.nodes.items(.data)[@intFromEnum(node)]; - return tree.isLvalExtra(data.un, is_const); + .paren_expr => |un| { + return tree.isLvalExtra(un.operand, is_const); }, - .builtin_choose_expr => { - const data = tree.nodes.items(.data)[@intFromEnum(node)]; - - if (tree.value_map.get(data.if3.cond)) |val| { - const offset = @intFromBool(val.isZero(tree.comp)); - return tree.isLvalExtra(tree.data[data.if3.body + offset], is_const); + .builtin_choose_expr => |conditional| { + if (tree.value_map.get(conditional.cond)) |val| { + if (!val.isZero(tree.comp)) { + return tree.isLvalExtra(conditional.then_expr, is_const); + } else { + return tree.isLvalExtra(conditional.else_expr, is_const); + } } return false; }, + .compound_assign_dummy_expr => return true, else => return false, } } -/// This should only be used for node tags that represent AST nodes which have an arbitrary number of children -/// It particular it should *not* be used for nodes with .un or .bin data types -/// -/// For call expressions, child_nodes[0] is the function pointer being called and child_nodes[1..] -/// are the arguments -/// -/// For generic selection expressions, child_nodes[0] is the controlling expression, -/// child_nodes[1] is the chosen expression (it is a syntax error for there to be no chosen expression), -/// and child_nodes[2..] are the remaining expressions. -pub fn childNodes(tree: *const Tree, node: NodeIndex) []const NodeIndex { - const tags = tree.nodes.items(.tag); - const data = tree.nodes.items(.data); - switch (tags[@intFromEnum(node)]) { - .compound_stmt_two, - .array_init_expr_two, - .struct_init_expr_two, - .enum_decl_two, - .struct_decl_two, - .union_decl_two, - .call_expr_one, - .generic_expr_one, - => { - const index: u32 = @intFromEnum(node); - const end = std.mem.indexOfScalar(NodeIndex, &data[index].two, .none) orelse 2; - return data[index].two[0..end]; - }, - .compound_stmt, - .array_init_expr, - .struct_init_expr, - .enum_decl, - .struct_decl, - .union_decl, - .call_expr, - .generic_expr, - => { - const range = data[@intFromEnum(node)].range; - return tree.data[range.start..range.end]; - }, - else => unreachable, - } -} - pub fn tokSlice(tree: *const Tree, tok_i: TokenIndex) []const u8 { if (tree.tokens.items(.id)[tok_i].lexeme()) |some| return some; const loc = tree.tokens.items(.loc)[tok_i]; return tree.comp.locSlice(loc); } -pub fn nodeTok(tree: *const Tree, node: NodeIndex) ?TokenIndex { - std.debug.assert(node != .none); - const loc = tree.nodes.items(.loc)[@intFromEnum(node)]; - return switch (loc) { - .none => null, - else => |tok_i| @intFromEnum(tok_i), - }; -} - -pub fn nodeLoc(tree: *const Tree, node: NodeIndex) ?Source.Location { - const tok_i = tree.nodeTok(node) orelse return null; - return tree.tokens.items(.loc)[@intFromEnum(tok_i)]; -} - -pub fn dump(tree: *const Tree, config: std.io.tty.Config, writer: anytype) !void { - const mapper = tree.comp.string_interner.getFastTypeMapper(tree.comp.gpa) catch tree.comp.string_interner.getSlowTypeMapper(); - defer mapper.deinit(tree.comp.gpa); - - for (tree.root_decls) |i| { - try tree.dumpNode(i, 0, mapper, config, writer); - try writer.writeByte('\n'); +pub fn dump(tree: *const Tree, config: std.Io.tty.Config, w: *std.Io.Writer) std.Io.tty.Config.SetColorError!void { + for (tree.root_decls.items) |i| { + try tree.dumpNode(i, 0, config, w); + try w.writeByte('\n'); } + try w.flush(); } -fn dumpFieldAttributes(tree: *const Tree, attributes: []const Attribute, level: u32, writer: anytype) !void { +fn dumpFieldAttributes(tree: *const Tree, attributes: []const Attribute, level: u32, w: *std.Io.Writer) !void { for (attributes) |attr| { - try writer.writeByteNTimes(' ', level); - try writer.print("field attr: {s}", .{@tagName(attr.tag)}); - try tree.dumpAttribute(attr, writer); + try w.splatByteAll(' ', level); + try w.print("field attr: {s}", .{@tagName(attr.tag)}); + try tree.dumpAttribute(attr, w); } } -fn dumpAttribute(tree: *const Tree, attr: Attribute, writer: anytype) !void { +fn dumpAttribute(tree: *const Tree, attr: Attribute, w: *std.Io.Writer) !void { switch (attr.tag) { inline else => |tag| { const args = @field(attr.args, @tagName(tag)); const fields = @typeInfo(@TypeOf(args)).@"struct".fields; if (fields.len == 0) { - try writer.writeByte('\n'); + try w.writeByte('\n'); return; } - try writer.writeByte(' '); + try w.writeByte(' '); inline for (fields, 0..) |f, i| { if (comptime std.mem.eql(u8, f.name, "__name_tok")) continue; if (i != 0) { - try writer.writeAll(", "); + try w.writeAll(", "); } - try writer.writeAll(f.name); - try writer.writeAll(": "); + try w.writeAll(f.name); + try w.writeAll(": "); switch (f.type) { - Interner.Ref => try writer.print("\"{s}\"", .{tree.interner.get(@field(args, f.name)).bytes}), - ?Interner.Ref => try writer.print("\"{?s}\"", .{if (@field(args, f.name)) |str| tree.interner.get(str).bytes else null}), + Interner.Ref => try w.print("\"{s}\"", .{tree.interner.get(@field(args, f.name)).bytes}), + ?Interner.Ref => try w.print("\"{?s}\"", .{if (@field(args, f.name)) |str| tree.interner.get(str).bytes else null}), else => switch (@typeInfo(f.type)) { - .@"enum" => try writer.writeAll(@tagName(@field(args, f.name))), - else => try writer.print("{any}", .{@field(args, f.name)}), + .@"enum" => try w.writeAll(@tagName(@field(args, f.name))), + else => try w.print("{any}", .{@field(args, f.name)}), }, } } - try writer.writeByte('\n'); + try w.writeByte('\n'); return; }, } @@ -852,57 +2956,76 @@ fn dumpAttribute(tree: *const Tree, attr: Attribute, writer: anytype) !void { fn dumpNode( tree: *const Tree, - node: NodeIndex, + node_index: Node.Index, level: u32, - mapper: StringInterner.TypeMapper, - config: std.io.tty.Config, - w: anytype, + config: std.Io.tty.Config, + w: *std.Io.Writer, ) !void { const delta = 2; const half = delta / 2; - const TYPE = std.io.tty.Color.bright_magenta; - const TAG = std.io.tty.Color.bright_cyan; - const IMPLICIT = std.io.tty.Color.bright_blue; - const NAME = std.io.tty.Color.bright_red; - const LITERAL = std.io.tty.Color.bright_green; - const ATTRIBUTE = std.io.tty.Color.bright_yellow; - std.debug.assert(node != .none); - - const tag = tree.nodes.items(.tag)[@intFromEnum(node)]; - const data = tree.nodes.items(.data)[@intFromEnum(node)]; - const ty = tree.nodes.items(.ty)[@intFromEnum(node)]; - try w.writeByteNTimes(' ', level); - - try config.setColor(w, if (tag.isImplicit()) IMPLICIT else TAG); - try w.print("{s}: ", .{@tagName(tag)}); - if (tag == .implicit_cast or tag == .explicit_cast) { - try config.setColor(w, .white); - try w.print("({s}) ", .{@tagName(data.cast.kind)}); + const TYPE = std.Io.tty.Color.bright_magenta; + const TAG = std.Io.tty.Color.bright_cyan; + const IMPLICIT = std.Io.tty.Color.bright_blue; + const NAME = std.Io.tty.Color.bright_red; + const LITERAL = std.Io.tty.Color.bright_green; + const ATTRIBUTE = std.Io.tty.Color.bright_yellow; + + const node = node_index.get(tree); + try w.splatByteAll(' ', level); + + if (config == .no_color) { + if (node.isImplicit()) try w.writeAll("implicit "); + } else { + try config.setColor(w, if (node.isImplicit()) IMPLICIT else TAG); } - try config.setColor(w, TYPE); - try w.writeByte('\''); - const name = ty.getName(); - if (name != .empty) { - try w.print("{s}': '", .{mapper.lookup(name)}); + try w.print("{s}", .{@tagName(node)}); + + if (node_index.qtOrNull(tree)) |qt| { + try w.writeAll(": "); + switch (node) { + .cast => |cast| { + try config.setColor(w, .white); + try w.print("({s}) ", .{@tagName(cast.kind)}); + }, + else => {}, + } + + try config.setColor(w, TYPE); + try w.writeByte('\''); + try qt.dump(tree.comp, w); + try w.writeByte('\''); } - try ty.dump(mapper, tree.comp.langopts, w); - try w.writeByte('\''); - if (tree.isLval(node)) { + if (tree.isLval(node_index)) { try config.setColor(w, ATTRIBUTE); try w.writeAll(" lvalue"); } - if (tree.isBitfield(node)) { + if (tree.isBitfield(node_index)) { try config.setColor(w, ATTRIBUTE); try w.writeAll(" bitfield"); } - if (tree.value_map.get(node)) |val| { + + if (tree.value_map.get(node_index)) |val| { try config.setColor(w, LITERAL); try w.writeAll(" (value: "); - try val.print(ty, tree.comp, w); + if (try val.print(node_index.qt(tree), tree.comp, w)) |nested| switch (nested) { + .pointer => |ptr| { + switch (tree.nodes.items(.tag)[ptr.node]) { + .compound_literal_expr => { + try w.writeAll("(compound literal) "); + _ = try ptr.offset.print(tree.comp.type_store.ptrdiff, tree.comp, w); + }, + else => { + const ptr_node: Node.Index = @enumFromInt(ptr.node); + const decl_name = tree.tokSlice(ptr_node.tok(tree)); + try ptr.offset.printPointer(decl_name, tree.comp, w); + }, + } + }, + }; try w.writeByte(')'); } - if (tag == .implicit_return and data.return_zero) { + if (node == .return_stmt and node.return_stmt.operand == .implicit and node.return_stmt.operand.implicit) { try config.setColor(w, IMPLICIT); try w.writeAll(" (value: 0)"); try config.setColor(w, .reset); @@ -911,379 +3034,428 @@ fn dumpNode( try w.writeAll("\n"); try config.setColor(w, .reset); - if (ty.specifier == .attributed) { + if (node_index.qtOrNull(tree)) |qt| { try config.setColor(w, ATTRIBUTE); - var it = Attribute.Iterator.initType(ty); + var it = Attribute.Iterator.initType(qt, tree.comp); while (it.next()) |item| { const attr, _ = item; - try w.writeByteNTimes(' ', level + half); + try w.splatByteAll(' ', level + half); try w.print("attr: {s}", .{@tagName(attr.tag)}); try tree.dumpAttribute(attr, w); } try config.setColor(w, .reset); } - switch (tag) { - .invalid => unreachable, - .file_scope_asm => { - try w.writeByteNTimes(' ', level + 1); - try tree.dumpNode(data.decl.node, level + delta, mapper, config, w); + switch (node) { + .empty_decl => {}, + .global_asm, .gnu_asm_simple => |@"asm"| { + try w.splatByteAll(' ', level + 1); + try tree.dumpNode(@"asm".asm_str, level + delta, config, w); }, - .gnu_asm_simple => { - try w.writeByteNTimes(' ', level); - try tree.dumpNode(data.un, level, mapper, config, w); - }, - .static_assert => { - try w.writeByteNTimes(' ', level + 1); + .static_assert => |assert| { + try w.splatByteAll(' ', level + 1); try w.writeAll("condition:\n"); - try tree.dumpNode(data.bin.lhs, level + delta, mapper, config, w); - if (data.bin.rhs != .none) { - try w.writeByteNTimes(' ', level + 1); + try tree.dumpNode(assert.cond, level + delta, config, w); + if (assert.message) |some| { + try w.splatByteAll(' ', level + 1); try w.writeAll("diagnostic:\n"); - try tree.dumpNode(data.bin.rhs, level + delta, mapper, config, w); + try tree.dumpNode(some, level + delta, config, w); + } + }, + .function => |function| { + try w.splatByteAll(' ', level + half); + + try config.setColor(w, ATTRIBUTE); + if (function.static) try w.writeAll("static "); + if (function.@"inline") try w.writeAll("inline "); + + try config.setColor(w, .reset); + try w.writeAll("name: "); + try config.setColor(w, NAME); + try w.print("{s}\n", .{tree.tokSlice(function.name_tok)}); + try config.setColor(w, .reset); + + if (function.body) |body| { + try w.splatByteAll(' ', level + half); + try w.writeAll("body:\n"); + try tree.dumpNode(body, level + delta, config, w); + } + if (function.definition) |definition| { + try w.splatByteAll(' ', level + half); + try w.writeAll("definition: "); + try config.setColor(w, NAME); + try w.print("0x{X}\n", .{@intFromEnum(definition)}); + try config.setColor(w, .reset); } }, - .fn_proto, - .static_fn_proto, - .inline_fn_proto, - .inline_static_fn_proto, - => { - try w.writeByteNTimes(' ', level + half); + .typedef => |typedef| { + try w.splatByteAll(' ', level + half); try w.writeAll("name: "); try config.setColor(w, NAME); - try w.print("{s}\n", .{tree.tokSlice(data.decl.name)}); + try w.print("{s}\n", .{tree.tokSlice(typedef.name_tok)}); try config.setColor(w, .reset); }, - .fn_def, - .static_fn_def, - .inline_fn_def, - .inline_static_fn_def, - => { - try w.writeByteNTimes(' ', level + half); + .param => |param| { + try w.splatByteAll(' ', level + half); + + switch (param.storage_class) { + .auto => {}, + .register => { + try config.setColor(w, ATTRIBUTE); + try w.writeAll("register "); + try config.setColor(w, .reset); + }, + } + try w.writeAll("name: "); try config.setColor(w, NAME); - try w.print("{s}\n", .{tree.tokSlice(data.decl.name)}); + try w.print("{s}\n", .{tree.tokSlice(param.name_tok)}); try config.setColor(w, .reset); - try w.writeByteNTimes(' ', level + half); - try w.writeAll("body:\n"); - try tree.dumpNode(data.decl.node, level + delta, mapper, config, w); - }, - .typedef, - .@"var", - .extern_var, - .static_var, - .implicit_static_var, - .threadlocal_var, - .threadlocal_extern_var, - .threadlocal_static_var, - => { - try w.writeByteNTimes(' ', level + half); + }, + .variable => |variable| { + try w.splatByteAll(' ', level + half); + + try config.setColor(w, ATTRIBUTE); + switch (variable.storage_class) { + .auto => {}, + .static => try w.writeAll("static "), + .@"extern" => try w.writeAll("extern "), + .register => try w.writeAll("register "), + } + if (variable.thread_local) try w.writeAll("thread_local "); + try config.setColor(w, .reset); + try w.writeAll("name: "); try config.setColor(w, NAME); - try w.print("{s}\n", .{tree.tokSlice(data.decl.name)}); + try w.print("{s}\n", .{tree.tokSlice(variable.name_tok)}); try config.setColor(w, .reset); - if (data.decl.node != .none) { - try w.writeByteNTimes(' ', level + half); + + if (variable.initializer) |some| { + try config.setColor(w, .reset); + try w.splatByteAll(' ', level + half); try w.writeAll("init:\n"); - try tree.dumpNode(data.decl.node, level + delta, mapper, config, w); + try tree.dumpNode(some, level + delta, config, w); + } + if (variable.definition) |definition| { + try w.splatByteAll(' ', level + half); + try w.writeAll("definition: "); + try config.setColor(w, NAME); + try w.print("0x{X}\n", .{@intFromEnum(definition)}); + try config.setColor(w, .reset); } }, - .enum_field_decl => { - try w.writeByteNTimes(' ', level + half); + .enum_field => |field| { + try w.splatByteAll(' ', level + half); try w.writeAll("name: "); try config.setColor(w, NAME); - try w.print("{s}\n", .{tree.tokSlice(data.decl.name)}); + try w.print("{s}\n", .{tree.tokSlice(field.name_tok)}); try config.setColor(w, .reset); - if (data.decl.node != .none) { - try w.writeByteNTimes(' ', level + half); - try w.writeAll("value:\n"); - try tree.dumpNode(data.decl.node, level + delta, mapper, config, w); + if (field.init) |some| { + try w.splatByteAll(' ', level + half); + try w.writeAll("init:\n"); + try tree.dumpNode(some, level + delta, config, w); } }, - .record_field_decl => { - if (data.decl.name != 0) { - try w.writeByteNTimes(' ', level + half); + .record_field => |field| { + const name_tok_id = tree.tokens.items(.id)[field.name_or_first_tok]; + if (name_tok_id == .identifier or name_tok_id == .extended_identifier) { + try w.splatByteAll(' ', level + half); try w.writeAll("name: "); try config.setColor(w, NAME); - try w.print("{s}\n", .{tree.tokSlice(data.decl.name)}); + try w.print("{s}\n", .{tree.tokSlice(field.name_or_first_tok)}); try config.setColor(w, .reset); } - if (data.decl.node != .none) { - try w.writeByteNTimes(' ', level + half); + if (field.bit_width) |some| { + try w.splatByteAll(' ', level + half); try w.writeAll("bits:\n"); - try tree.dumpNode(data.decl.node, level + delta, mapper, config, w); + try tree.dumpNode(some, level + delta, config, w); + } + }, + .compound_stmt => |compound| { + for (compound.body, 0..) |stmt, i| { + if (i != 0) try w.writeByte('\n'); + try tree.dumpNode(stmt, level + delta, config, w); + } + }, + .enum_decl => |decl| { + for (decl.fields, 0..) |field, i| { + if (i != 0) try w.writeByte('\n'); + try tree.dumpNode(field, level + delta, config, w); } }, - .indirect_record_field_decl => {}, - .compound_stmt, - .array_init_expr, - .struct_init_expr, - .enum_decl, - .struct_decl, - .union_decl, - .compound_stmt_two, - .array_init_expr_two, - .struct_init_expr_two, - .enum_decl_two, - .struct_decl_two, - .union_decl_two, - => { - const child_nodes = tree.childNodes(node); - const maybe_field_attributes = if (ty.getRecord()) |record| record.field_attributes else null; - for (child_nodes, 0..) |stmt, i| { + .struct_decl, .union_decl => |decl| { + const fields = switch (node_index.qt(tree).base(tree.comp).type) { + .@"struct", .@"union" => |record| record.fields, + else => unreachable, + }; + + var field_i: u32 = 0; + for (decl.fields, 0..) |field_node, i| { if (i != 0) try w.writeByte('\n'); - try tree.dumpNode(stmt, level + delta, mapper, config, w); - if (maybe_field_attributes) |field_attributes| { - if (field_attributes[i].len == 0) continue; + try tree.dumpNode(field_node, level + delta, config, w); - try config.setColor(w, ATTRIBUTE); - try tree.dumpFieldAttributes(field_attributes[i], level + delta + half, w); - try config.setColor(w, .reset); - } + if (field_node.get(tree) != .record_field) continue; + if (fields.len == 0) continue; + + const field_attributes = fields[field_i].attributes(tree.comp); + field_i += 1; + + if (field_attributes.len == 0) continue; + + try config.setColor(w, ATTRIBUTE); + try tree.dumpFieldAttributes(field_attributes, level + delta + half, w); + try config.setColor(w, .reset); + } + }, + .array_init_expr, .struct_init_expr => |init| { + for (init.items, 0..) |item, i| { + if (i != 0) try w.writeByte('\n'); + try tree.dumpNode(item, level + delta, config, w); } }, - .union_init_expr => { - try w.writeByteNTimes(' ', level + half); + .union_init_expr => |init| { + try w.splatByteAll(' ', level + half); try w.writeAll("field index: "); try config.setColor(w, LITERAL); - try w.print("{d}\n", .{data.union_init.field_index}); + try w.print("{d}\n", .{init.field_index}); try config.setColor(w, .reset); - if (data.union_init.node != .none) { - try tree.dumpNode(data.union_init.node, level + delta, mapper, config, w); + if (init.initializer) |some| { + try tree.dumpNode(some, level + delta, config, w); } }, - .compound_literal_expr, - .static_compound_literal_expr, - .thread_local_compound_literal_expr, - .static_thread_local_compound_literal_expr, - => { - try tree.dumpNode(data.un, level + half, mapper, config, w); + .compound_literal_expr => |literal| { + if (literal.storage_class != .auto or literal.thread_local) { + try w.splatByteAll(' ', level + half - 1); + + try config.setColor(w, ATTRIBUTE); + switch (literal.storage_class) { + .auto => {}, + .static => try w.writeAll(" static"), + .register => try w.writeAll(" register"), + } + if (literal.thread_local) try w.writeAll(" thread_local"); + try w.writeByte('\n'); + try config.setColor(w, .reset); + } + + try tree.dumpNode(literal.initializer, level + half, config, w); }, - .labeled_stmt => { - try w.writeByteNTimes(' ', level + half); + .labeled_stmt => |labeled| { + try w.splatByteAll(' ', level + half); try w.writeAll("label: "); try config.setColor(w, LITERAL); - try w.print("{s}\n", .{tree.tokSlice(data.decl.name)}); + try w.print("{s}\n", .{tree.tokSlice(labeled.label_tok)}); + try config.setColor(w, .reset); - if (data.decl.node != .none) { - try w.writeByteNTimes(' ', level + half); - try w.writeAll("stmt:\n"); - try tree.dumpNode(data.decl.node, level + delta, mapper, config, w); - } - }, - .case_stmt => { - try w.writeByteNTimes(' ', level + half); - try w.writeAll("value:\n"); - try tree.dumpNode(data.bin.lhs, level + delta, mapper, config, w); - if (data.bin.rhs != .none) { - try w.writeByteNTimes(' ', level + half); - try w.writeAll("stmt:\n"); - try tree.dumpNode(data.bin.rhs, level + delta, mapper, config, w); - } + try w.splatByteAll(' ', level + half); + try w.writeAll("stmt:\n"); + try tree.dumpNode(labeled.body, level + delta, config, w); }, - .case_range_stmt => { - try w.writeByteNTimes(' ', level + half); - try w.writeAll("range start:\n"); - try tree.dumpNode(tree.data[data.if3.body], level + delta, mapper, config, w); + .case_stmt => |case| { + try w.splatByteAll(' ', level + half); - try w.writeByteNTimes(' ', level + half); - try w.writeAll("range end:\n"); - try tree.dumpNode(tree.data[data.if3.body + 1], level + delta, mapper, config, w); + if (case.end) |some| { + try w.writeAll("range start:\n"); + try tree.dumpNode(case.start, level + delta, config, w); - if (data.if3.cond != .none) { - try w.writeByteNTimes(' ', level + half); - try w.writeAll("stmt:\n"); - try tree.dumpNode(data.if3.cond, level + delta, mapper, config, w); + try w.splatByteAll(' ', level + half); + try w.writeAll("range end:\n"); + try tree.dumpNode(some, level + delta, config, w); + } else { + try w.writeAll("value:\n"); + try tree.dumpNode(case.start, level + delta, config, w); } + + try w.splatByteAll(' ', level + half); + try w.writeAll("stmt:\n"); + try tree.dumpNode(case.body, level + delta, config, w); }, - .default_stmt => { - if (data.un != .none) { - try w.writeByteNTimes(' ', level + half); - try w.writeAll("stmt:\n"); - try tree.dumpNode(data.un, level + delta, mapper, config, w); - } + .default_stmt => |default| { + try w.splatByteAll(' ', level + half); + try w.writeAll("stmt:\n"); + try tree.dumpNode(default.body, level + delta, config, w); }, - .binary_cond_expr, .cond_expr, .if_then_else_stmt, .builtin_choose_expr => { - try w.writeByteNTimes(' ', level + half); + .binary_cond_expr, .cond_expr, .builtin_choose_expr => |conditional| { + try w.splatByteAll(' ', level + half); try w.writeAll("cond:\n"); - try tree.dumpNode(data.if3.cond, level + delta, mapper, config, w); + try tree.dumpNode(conditional.cond, level + delta, config, w); - try w.writeByteNTimes(' ', level + half); + try w.splatByteAll(' ', level + half); try w.writeAll("then:\n"); - try tree.dumpNode(tree.data[data.if3.body], level + delta, mapper, config, w); + try tree.dumpNode(conditional.then_expr, level + delta, config, w); - try w.writeByteNTimes(' ', level + half); + try w.splatByteAll(' ', level + half); try w.writeAll("else:\n"); - try tree.dumpNode(tree.data[data.if3.body + 1], level + delta, mapper, config, w); + try tree.dumpNode(conditional.else_expr, level + delta, config, w); }, - .builtin_types_compatible_p => { - std.debug.assert(tree.nodes.items(.tag)[@intFromEnum(data.bin.lhs)] == .invalid); - std.debug.assert(tree.nodes.items(.tag)[@intFromEnum(data.bin.rhs)] == .invalid); - - try w.writeByteNTimes(' ', level + half); + .builtin_types_compatible_p => |call| { + try w.splatByteAll(' ', level + half); try w.writeAll("lhs: "); - - const lhs_ty = tree.nodes.items(.ty)[@intFromEnum(data.bin.lhs)]; try config.setColor(w, TYPE); - try lhs_ty.dump(mapper, tree.comp.langopts, w); - try config.setColor(w, .reset); + try call.lhs.dump(tree.comp, w); try w.writeByte('\n'); + try config.setColor(w, .reset); - try w.writeByteNTimes(' ', level + half); + try w.splatByteAll(' ', level + half); try w.writeAll("rhs: "); - - const rhs_ty = tree.nodes.items(.ty)[@intFromEnum(data.bin.rhs)]; try config.setColor(w, TYPE); - try rhs_ty.dump(mapper, tree.comp.langopts, w); - try config.setColor(w, .reset); + try call.rhs.dump(tree.comp, w); try w.writeByte('\n'); + try config.setColor(w, .reset); }, - .if_then_stmt => { - try w.writeByteNTimes(' ', level + half); - try w.writeAll("cond:\n"); - try tree.dumpNode(data.bin.lhs, level + delta, mapper, config, w); + .builtin_convertvector => |convert| { + try w.splatByteAll(' ', level + half); + try w.writeAll("operand:\n"); + try tree.dumpNode(convert.operand, level + delta, config, w); + }, + .builtin_shufflevector => |shuffle| { + try w.splatByteAll(' ', level + half); + try w.writeAll("lhs:\n"); + try tree.dumpNode(shuffle.lhs, level + delta, config, w); + + try w.splatByteAll(' ', level + half); + try w.writeAll("rhs:\n"); + try tree.dumpNode(shuffle.rhs, level + delta, config, w); - if (data.bin.rhs != .none) { - try w.writeByteNTimes(' ', level + half); - try w.writeAll("then:\n"); - try tree.dumpNode(data.bin.rhs, level + delta, mapper, config, w); + if (shuffle.indexes.len > 0) { + try w.splatByteAll(' ', level + half); + try w.writeAll("indexes:\n"); + for (shuffle.indexes) |index| { + try tree.dumpNode(index, level + delta, config, w); + } } }, - .switch_stmt, .while_stmt, .do_while_stmt => { - try w.writeByteNTimes(' ', level + half); + .if_stmt => |@"if"| { + try w.splatByteAll(' ', level + half); try w.writeAll("cond:\n"); - try tree.dumpNode(data.bin.lhs, level + delta, mapper, config, w); + try tree.dumpNode(@"if".cond, level + delta, config, w); - if (data.bin.rhs != .none) { - try w.writeByteNTimes(' ', level + half); - try w.writeAll("body:\n"); - try tree.dumpNode(data.bin.rhs, level + delta, mapper, config, w); + try w.splatByteAll(' ', level + half); + try w.writeAll("then:\n"); + try tree.dumpNode(@"if".then_body, level + delta, config, w); + + if (@"if".else_body) |some| { + try w.splatByteAll(' ', level + half); + try w.writeAll("else:\n"); + try tree.dumpNode(some, level + delta, config, w); } }, - .for_decl_stmt => { - const for_decl = data.forDecl(tree); + .switch_stmt => |@"switch"| { + try w.splatByteAll(' ', level + half); + try w.writeAll("cond:\n"); + try tree.dumpNode(@"switch".cond, level + delta, config, w); - try w.writeByteNTimes(' ', level + half); - try w.writeAll("decl:\n"); - for (for_decl.decls) |decl| { - try tree.dumpNode(decl, level + delta, mapper, config, w); - try w.writeByte('\n'); - } - if (for_decl.cond != .none) { - try w.writeByteNTimes(' ', level + half); - try w.writeAll("cond:\n"); - try tree.dumpNode(for_decl.cond, level + delta, mapper, config, w); - } - if (for_decl.incr != .none) { - try w.writeByteNTimes(' ', level + half); - try w.writeAll("incr:\n"); - try tree.dumpNode(for_decl.incr, level + delta, mapper, config, w); - } - if (for_decl.body != .none) { - try w.writeByteNTimes(' ', level + half); - try w.writeAll("body:\n"); - try tree.dumpNode(for_decl.body, level + delta, mapper, config, w); - } + try w.splatByteAll(' ', level + half); + try w.writeAll("body:\n"); + try tree.dumpNode(@"switch".body, level + delta, config, w); }, - .forever_stmt => { - if (data.un != .none) { - try w.writeByteNTimes(' ', level + half); - try w.writeAll("body:\n"); - try tree.dumpNode(data.un, level + delta, mapper, config, w); - } + .while_stmt => |@"while"| { + try w.splatByteAll(' ', level + half); + try w.writeAll("cond:\n"); + try tree.dumpNode(@"while".cond, level + delta, config, w); + + try w.splatByteAll(' ', level + half); + try w.writeAll("body:\n"); + try tree.dumpNode(@"while".body, level + delta, config, w); }, - .for_stmt => { - const for_stmt = data.forStmt(tree); + .do_while_stmt => |do| { + try w.splatByteAll(' ', level + half); + try w.writeAll("cond:\n"); + try tree.dumpNode(do.cond, level + delta, config, w); - if (for_stmt.init != .none) { - try w.writeByteNTimes(' ', level + half); - try w.writeAll("init:\n"); - try tree.dumpNode(for_stmt.init, level + delta, mapper, config, w); + try w.splatByteAll(' ', level + half); + try w.writeAll("body:\n"); + try tree.dumpNode(do.body, level + delta, config, w); + }, + .for_stmt => |@"for"| { + switch (@"for".init) { + .decls => |decls| { + try w.splatByteAll(' ', level + half); + try w.writeAll("decl:\n"); + for (decls) |decl| { + try tree.dumpNode(decl, level + delta, config, w); + try w.writeByte('\n'); + } + }, + .expr => |expr| if (expr) |some| { + try w.splatByteAll(' ', level + half); + try w.writeAll("init:\n"); + try tree.dumpNode(some, level + delta, config, w); + }, } - if (for_stmt.cond != .none) { - try w.writeByteNTimes(' ', level + half); + if (@"for".cond) |some| { + try w.splatByteAll(' ', level + half); try w.writeAll("cond:\n"); - try tree.dumpNode(for_stmt.cond, level + delta, mapper, config, w); + try tree.dumpNode(some, level + delta, config, w); } - if (for_stmt.incr != .none) { - try w.writeByteNTimes(' ', level + half); + if (@"for".incr) |some| { + try w.splatByteAll(' ', level + half); try w.writeAll("incr:\n"); - try tree.dumpNode(for_stmt.incr, level + delta, mapper, config, w); - } - if (for_stmt.body != .none) { - try w.writeByteNTimes(' ', level + half); - try w.writeAll("body:\n"); - try tree.dumpNode(for_stmt.body, level + delta, mapper, config, w); + try tree.dumpNode(some, level + delta, config, w); } + try w.splatByteAll(' ', level + half); + try w.writeAll("body:\n"); + try tree.dumpNode(@"for".body, level + delta, config, w); }, - .goto_stmt, .addr_of_label => { - try w.writeByteNTimes(' ', level + half); + .addr_of_label => |addr| { + try w.splatByteAll(' ', level + half); try w.writeAll("label: "); try config.setColor(w, LITERAL); - try w.print("{s}\n", .{tree.tokSlice(data.decl_ref)}); + try w.print("{s}\n", .{tree.tokSlice(addr.label_tok)}); try config.setColor(w, .reset); }, - .continue_stmt, .break_stmt, .implicit_return, .null_stmt => {}, - .return_stmt => { - if (data.un != .none) { - try w.writeByteNTimes(' ', level + half); - try w.writeAll("expr:\n"); - try tree.dumpNode(data.un, level + delta, mapper, config, w); + .goto_stmt => |goto| { + try w.splatByteAll(' ', level + half); + try w.writeAll("label: "); + try config.setColor(w, LITERAL); + try w.print("{s}\n", .{tree.tokSlice(goto.label_tok)}); + try config.setColor(w, .reset); + }, + .computed_goto_stmt => |goto| { + try w.splatByteAll(' ', level + half); + try w.writeAll("expr:\n"); + try tree.dumpNode(goto.expr, level + delta, config, w); + }, + .continue_stmt, .break_stmt, .null_stmt => {}, + .return_stmt => |ret| { + switch (ret.operand) { + .expr => |expr| { + try w.splatByteAll(' ', level + half); + try w.writeAll("expr:\n"); + try tree.dumpNode(expr, level + delta, config, w); + }, + .implicit => {}, + .none => {}, } }, - .call_expr, .call_expr_one => { - const child_nodes = tree.childNodes(node); - const fn_ptr = child_nodes[0]; - const args = child_nodes[1..]; - - try w.writeByteNTimes(' ', level + half); - try w.writeAll("lhs:\n"); - try tree.dumpNode(fn_ptr, level + delta, mapper, config, w); + .call_expr => |call| { + try w.splatByteAll(' ', level + half); + try w.writeAll("callee:\n"); + try tree.dumpNode(call.callee, level + delta, config, w); - if (args.len > 0) { - try w.writeByteNTimes(' ', level + half); + if (call.args.len > 0) { + try w.splatByteAll(' ', level + half); try w.writeAll("args:\n"); - for (args) |arg| { - try tree.dumpNode(arg, level + delta, mapper, config, w); + for (call.args) |arg| { + try tree.dumpNode(arg, level + delta, config, w); } } }, - .builtin_call_expr => { - try w.writeByteNTimes(' ', level + half); + .builtin_call_expr => |call| { + try w.splatByteAll(' ', level + half); try w.writeAll("name: "); try config.setColor(w, NAME); - try w.print("{s}\n", .{tree.tokSlice(@intFromEnum(tree.data[data.range.start]))}); + try w.print("{s}\n", .{tree.tokSlice(call.builtin_tok)}); try config.setColor(w, .reset); - try w.writeByteNTimes(' ', level + half); - try w.writeAll("args:\n"); - for (tree.data[data.range.start + 1 .. data.range.end]) |arg| try tree.dumpNode(arg, level + delta, mapper, config, w); - }, - .builtin_call_expr_one => { - try w.writeByteNTimes(' ', level + half); - try w.writeAll("name: "); - try config.setColor(w, NAME); - try w.print("{s}\n", .{tree.tokSlice(data.decl.name)}); - try config.setColor(w, .reset); - if (data.decl.node != .none) { - try w.writeByteNTimes(' ', level + half); - try w.writeAll("arg:\n"); - try tree.dumpNode(data.decl.node, level + delta, mapper, config, w); - } - }, - .special_builtin_call_one => { - try w.writeByteNTimes(' ', level + half); - try w.writeAll("name: "); - try config.setColor(w, NAME); - try w.print("{s}\n", .{tree.tokSlice(data.decl.name)}); - try config.setColor(w, .reset); - if (data.decl.node != .none) { - try w.writeByteNTimes(' ', level + half); - try w.writeAll("arg:\n"); - try tree.dumpNode(data.decl.node, level + delta, mapper, config, w); + if (call.args.len > 0) { + try w.splatByteAll(' ', level + half); + try w.writeAll("args:\n"); + for (call.args) |arg| { + try tree.dumpNode(arg, level + delta, config, w); + } } }, - .comma_expr, .assign_expr, .mul_assign_expr, .div_assign_expr, @@ -1295,6 +3467,7 @@ fn dumpNode( .bit_and_assign_expr, .bit_xor_assign_expr, .bit_or_assign_expr, + .comma_expr, .bool_or_expr, .bool_and_expr, .bit_or_expr, @@ -1313,17 +3486,17 @@ fn dumpNode( .mul_expr, .div_expr, .mod_expr, - => { - try w.writeByteNTimes(' ', level + 1); + => |bin| { + try w.splatByteAll(' ', level + 1); try w.writeAll("lhs:\n"); - try tree.dumpNode(data.bin.lhs, level + delta, mapper, config, w); - try w.writeByteNTimes(' ', level + 1); + try tree.dumpNode(bin.lhs, level + delta, config, w); + + try w.splatByteAll(' ', level + 1); try w.writeAll("rhs:\n"); - try tree.dumpNode(data.bin.rhs, level + delta, mapper, config, w); + try tree.dumpNode(bin.rhs, level + delta, config, w); }, - .explicit_cast, .implicit_cast => try tree.dumpNode(data.cast.operand, level + delta, mapper, config, w), + .cast => |cast| try tree.dumpNode(cast.operand, level + delta, config, w), .addr_of_expr, - .computed_goto_stmt, .deref_expr, .plus_expr, .negate_expr, @@ -1336,23 +3509,25 @@ fn dumpNode( .post_inc_expr, .post_dec_expr, .paren_expr, - => { - try w.writeByteNTimes(' ', level + 1); + .stmt_expr, + .imaginary_literal, + => |un| { + try w.splatByteAll(' ', level + 1); try w.writeAll("operand:\n"); - try tree.dumpNode(data.un, level + delta, mapper, config, w); + try tree.dumpNode(un.operand, level + delta, config, w); }, - .decl_ref_expr => { - try w.writeByteNTimes(' ', level + 1); + .decl_ref_expr, .enumeration_ref => |dr| { + try w.splatByteAll(' ', level + 1); try w.writeAll("name: "); try config.setColor(w, NAME); - try w.print("{s}\n", .{tree.tokSlice(data.decl_ref)}); + try w.print("{s}\n", .{tree.tokSlice(dr.name_tok)}); try config.setColor(w, .reset); }, - .enumeration_ref => { - try w.writeByteNTimes(' ', level + 1); + .builtin_ref => |dr| { + try w.splatByteAll(' ', level + 1); try w.writeAll("name: "); try config.setColor(w, NAME); - try w.print("{s}\n", .{tree.tokSlice(data.decl_ref)}); + try w.print("{s}\n", .{tree.tokSlice(dr.name_tok)}); try config.setColor(w, .reset); }, .bool_literal, @@ -1362,67 +3537,71 @@ fn dumpNode( .float_literal, .string_literal_expr, => {}, - .member_access_expr, .member_access_ptr_expr => { - try w.writeByteNTimes(' ', level + 1); + .member_access_expr, .member_access_ptr_expr => |access| { + try w.splatByteAll(' ', level + 1); try w.writeAll("lhs:\n"); - try tree.dumpNode(data.member.lhs, level + delta, mapper, config, w); + try tree.dumpNode(access.base, level + delta, config, w); - var lhs_ty = tree.nodes.items(.ty)[@intFromEnum(data.member.lhs)]; - if (lhs_ty.isPtr()) lhs_ty = lhs_ty.elemType(); - lhs_ty = lhs_ty.canonicalize(.standard); + var base_qt = access.base.qt(tree); + if (base_qt.get(tree.comp, .pointer)) |some| base_qt = some.child; + const fields = (base_qt.getRecord(tree.comp) orelse return).fields; - try w.writeByteNTimes(' ', level + 1); + try w.splatByteAll(' ', level + 1); try w.writeAll("name: "); try config.setColor(w, NAME); - try w.print("{s}\n", .{mapper.lookup(lhs_ty.data.record.fields[data.member.index].name)}); + try w.print("{s}\n", .{fields[access.member_index].name.lookup(tree.comp)}); try config.setColor(w, .reset); }, - .array_access_expr => { - if (data.bin.lhs != .none) { - try w.writeByteNTimes(' ', level + 1); - try w.writeAll("lhs:\n"); - try tree.dumpNode(data.bin.lhs, level + delta, mapper, config, w); - } - try w.writeByteNTimes(' ', level + 1); + .array_access_expr => |access| { + try w.splatByteAll(' ', level + 1); + try w.writeAll("base:\n"); + try tree.dumpNode(access.base, level + delta, config, w); + + try w.splatByteAll(' ', level + 1); try w.writeAll("index:\n"); - try tree.dumpNode(data.bin.rhs, level + delta, mapper, config, w); + try tree.dumpNode(access.index, level + delta, config, w); }, - .sizeof_expr, .alignof_expr => { - if (data.un != .none) { - try w.writeByteNTimes(' ', level + 1); + .sizeof_expr, .alignof_expr => |type_info| { + if (type_info.expr) |some| { + try w.splatByteAll(' ', level + 1); try w.writeAll("expr:\n"); - try tree.dumpNode(data.un, level + delta, mapper, config, w); + try tree.dumpNode(some, level + delta, config, w); + } else { + try w.splatByteAll(' ', level + half); + try w.writeAll("operand type: "); + try config.setColor(w, TYPE); + try type_info.operand_qt.dump(tree.comp, w); + try w.writeByte('\n'); + try config.setColor(w, .reset); } }, - .generic_expr, .generic_expr_one => { - const child_nodes = tree.childNodes(node); - const controlling = child_nodes[0]; - const chosen = child_nodes[1]; - const rest = child_nodes[2..]; - - try w.writeByteNTimes(' ', level + 1); + .generic_expr => |generic| { + try w.splatByteAll(' ', level + 1); try w.writeAll("controlling:\n"); - try tree.dumpNode(controlling, level + delta, mapper, config, w); - try w.writeByteNTimes(' ', level + 1); + try tree.dumpNode(generic.controlling, level + delta, config, w); + try w.splatByteAll(' ', level + 1); try w.writeAll("chosen:\n"); - try tree.dumpNode(chosen, level + delta, mapper, config, w); + try tree.dumpNode(generic.chosen, level + delta, config, w); - if (rest.len > 0) { - try w.writeByteNTimes(' ', level + 1); + if (generic.rest.len > 0) { + try w.splatByteAll(' ', level + 1); try w.writeAll("rest:\n"); - for (rest) |expr| { - try tree.dumpNode(expr, level + delta, mapper, config, w); + for (generic.rest) |expr| { + try tree.dumpNode(expr, level + delta, config, w); } } }, - .generic_association_expr, .generic_default_expr, .stmt_expr, .imaginary_literal => { - try tree.dumpNode(data.un, level + delta, mapper, config, w); + .generic_association_expr => |assoc| { + try tree.dumpNode(assoc.expr, level + delta, config, w); + }, + .generic_default_expr => |default| { + try tree.dumpNode(default.expr, level + delta, config, w); }, - .array_filler_expr => { - try w.writeByteNTimes(' ', level + 1); + .array_filler_expr => |filler| { + try w.splatByteAll(' ', level + 1); try w.writeAll("count: "); try config.setColor(w, LITERAL); - try w.print("{d}\n", .{data.int}); + try w.print("{d}\n", .{filler.count}); try config.setColor(w, .reset); }, .struct_forward_decl, @@ -1430,6 +3609,7 @@ fn dumpNode( .enum_forward_decl, .default_init_expr, .cond_dummy_expr, + .compound_assign_dummy_expr, => {}, } } diff --git a/lib/compiler/aro/aro/Type.zig b/lib/compiler/aro/aro/Type.zig deleted file mode 100644 index 6bec686a2113..000000000000 --- a/lib/compiler/aro/aro/Type.zig +++ /dev/null @@ -1,2675 +0,0 @@ -const std = @import("std"); -const Tree = @import("Tree.zig"); -const TokenIndex = Tree.TokenIndex; -const NodeIndex = Tree.NodeIndex; -const Parser = @import("Parser.zig"); -const Compilation = @import("Compilation.zig"); -const Attribute = @import("Attribute.zig"); -const StringInterner = @import("StringInterner.zig"); -const StringId = StringInterner.StringId; -const target_util = @import("target.zig"); -const LangOpts = @import("LangOpts.zig"); - -pub const Qualifiers = packed struct { - @"const": bool = false, - atomic: bool = false, - @"volatile": bool = false, - restrict: bool = false, - - // for function parameters only, stored here since it fits in the padding - register: bool = false, - - pub fn any(quals: Qualifiers) bool { - return quals.@"const" or quals.restrict or quals.@"volatile" or quals.atomic; - } - - pub fn dump(quals: Qualifiers, w: anytype) !void { - if (quals.@"const") try w.writeAll("const "); - if (quals.atomic) try w.writeAll("_Atomic "); - if (quals.@"volatile") try w.writeAll("volatile "); - if (quals.restrict) try w.writeAll("restrict "); - if (quals.register) try w.writeAll("register "); - } - - /// Merge the const/volatile qualifiers, used by type resolution - /// of the conditional operator - pub fn mergeCV(a: Qualifiers, b: Qualifiers) Qualifiers { - return .{ - .@"const" = a.@"const" or b.@"const", - .@"volatile" = a.@"volatile" or b.@"volatile", - }; - } - - /// Merge all qualifiers, used by typeof() - fn mergeAll(a: Qualifiers, b: Qualifiers) Qualifiers { - return .{ - .@"const" = a.@"const" or b.@"const", - .atomic = a.atomic or b.atomic, - .@"volatile" = a.@"volatile" or b.@"volatile", - .restrict = a.restrict or b.restrict, - .register = a.register or b.register, - }; - } - - /// Checks if a has all the qualifiers of b - pub fn hasQuals(a: Qualifiers, b: Qualifiers) bool { - if (b.@"const" and !a.@"const") return false; - if (b.@"volatile" and !a.@"volatile") return false; - if (b.atomic and !a.atomic) return false; - return true; - } - - /// register is a storage class and not actually a qualifier - /// so it is not preserved by typeof() - pub fn inheritFromTypeof(quals: Qualifiers) Qualifiers { - var res = quals; - res.register = false; - return res; - } - - pub const Builder = struct { - @"const": ?TokenIndex = null, - atomic: ?TokenIndex = null, - @"volatile": ?TokenIndex = null, - restrict: ?TokenIndex = null, - - pub fn finish(b: Qualifiers.Builder, p: *Parser, ty: *Type) !void { - if (ty.specifier != .pointer and b.restrict != null) { - try p.errStr(.restrict_non_pointer, b.restrict.?, try p.typeStr(ty.*)); - } - if (b.atomic) |some| { - if (ty.isArray()) try p.errStr(.atomic_array, some, try p.typeStr(ty.*)); - if (ty.isFunc()) try p.errStr(.atomic_func, some, try p.typeStr(ty.*)); - if (ty.hasIncompleteSize()) try p.errStr(.atomic_incomplete, some, try p.typeStr(ty.*)); - } - - if (b.@"const" != null) ty.qual.@"const" = true; - if (b.atomic != null) ty.qual.atomic = true; - if (b.@"volatile" != null) ty.qual.@"volatile" = true; - if (b.restrict != null) ty.qual.restrict = true; - } - }; -}; - -// TODO improve memory usage -pub const Func = struct { - return_type: Type, - params: []Param, - - pub const Param = struct { - ty: Type, - name: StringId, - name_tok: TokenIndex, - }; - - fn eql(a: *const Func, b: *const Func, a_spec: Specifier, b_spec: Specifier, comp: *const Compilation) bool { - // return type cannot have qualifiers - if (!a.return_type.eql(b.return_type, comp, false)) return false; - if (a.params.len == 0 and b.params.len == 0) return true; - - if (a.params.len != b.params.len) { - if (a_spec == .old_style_func or b_spec == .old_style_func) { - const maybe_has_params = if (a_spec == .old_style_func) b else a; - for (maybe_has_params.params) |param| { - if (param.ty.undergoesDefaultArgPromotion(comp)) return false; - } - return true; - } - return false; - } - if ((a_spec == .func) != (b_spec == .func)) return false; - // TODO validate this - for (a.params, b.params) |param, b_qual| { - var a_unqual = param.ty; - a_unqual.qual.@"const" = false; - a_unqual.qual.@"volatile" = false; - var b_unqual = b_qual.ty; - b_unqual.qual.@"const" = false; - b_unqual.qual.@"volatile" = false; - if (!a_unqual.eql(b_unqual, comp, true)) return false; - } - return true; - } -}; - -pub const Array = struct { - len: u64, - elem: Type, -}; - -pub const Expr = struct { - node: NodeIndex, - ty: Type, -}; - -pub const Attributed = struct { - attributes: []Attribute, - base: Type, - - pub fn create(allocator: std.mem.Allocator, base_ty: Type, attributes: []const Attribute) !*Attributed { - const attributed_type = try allocator.create(Attributed); - errdefer allocator.destroy(attributed_type); - const duped = try allocator.dupe(Attribute, attributes); - - attributed_type.* = .{ - .attributes = duped, - .base = base_ty, - }; - return attributed_type; - } -}; - -// TODO improve memory usage -pub const Enum = struct { - fields: []Field, - tag_ty: Type, - name: StringId, - fixed: bool, - - pub const Field = struct { - ty: Type, - name: StringId, - name_tok: TokenIndex, - node: NodeIndex, - }; - - pub fn isIncomplete(e: Enum) bool { - return e.fields.len == std.math.maxInt(usize); - } - - pub fn create(allocator: std.mem.Allocator, name: StringId, fixed_ty: ?Type) !*Enum { - var e = try allocator.create(Enum); - e.name = name; - e.fields.len = std.math.maxInt(usize); - if (fixed_ty) |some| e.tag_ty = some; - e.fixed = fixed_ty != null; - return e; - } -}; - -pub const TypeLayout = struct { - /// The size of the type in bits. - /// - /// This is the value returned by `sizeof` in C - /// (but in bits instead of bytes). This is a multiple of `pointer_alignment_bits`. - size_bits: u64, - /// The alignment of the type, in bits, when used as a field in a record. - /// - /// This is usually the value returned by `_Alignof` in C, but there are some edge - /// cases in GCC where `_Alignof` returns a smaller value. - field_alignment_bits: u32, - /// The alignment, in bits, of valid pointers to this type. - /// `size_bits` is a multiple of this value. - pointer_alignment_bits: u32, - /// The required alignment of the type in bits. - /// - /// This value is only used by MSVC targets. It is 8 on all other - /// targets. On MSVC targets, this value restricts the effects of `#pragma pack` except - /// in some cases involving bit-fields. - required_alignment_bits: u32, -}; - -pub const FieldLayout = struct { - /// `offset_bits` and `size_bits` should both be INVALID if and only if the field - /// is an unnamed bitfield. There is no way to reference an unnamed bitfield in C, so - /// there should be no way to observe these values. If it is used, this value will - /// maximize the chance that a safety-checked overflow will occur. - const INVALID = std.math.maxInt(u64); - - /// The offset of the field, in bits, from the start of the struct. - offset_bits: u64 = INVALID, - /// The size, in bits, of the field. - /// - /// For bit-fields, this is the width of the field. - size_bits: u64 = INVALID, - - pub fn isUnnamed(self: FieldLayout) bool { - return self.offset_bits == INVALID and self.size_bits == INVALID; - } -}; - -// TODO improve memory usage -pub const Record = struct { - fields: []Field, - type_layout: TypeLayout, - /// If this is null, none of the fields have attributes - /// Otherwise, it's a pointer to N items (where N == number of fields) - /// and the item at index i is the attributes for the field at index i - field_attributes: ?[*][]const Attribute, - name: StringId, - - pub const Field = struct { - ty: Type, - name: StringId, - /// zero for anonymous fields - name_tok: TokenIndex = 0, - bit_width: ?u32 = null, - layout: FieldLayout = .{ - .offset_bits = 0, - .size_bits = 0, - }, - - pub fn isNamed(f: *const Field) bool { - return f.name_tok != 0; - } - - pub fn isAnonymousRecord(f: Field) bool { - return !f.isNamed() and f.ty.isRecord(); - } - - /// false for bitfields - pub fn isRegularField(f: *const Field) bool { - return f.bit_width == null; - } - - /// bit width as specified in the C source. Asserts that `f` is a bitfield. - pub fn specifiedBitWidth(f: *const Field) u32 { - return f.bit_width.?; - } - }; - - pub fn isIncomplete(r: Record) bool { - return r.fields.len == std.math.maxInt(usize); - } - - pub fn create(allocator: std.mem.Allocator, name: StringId) !*Record { - var r = try allocator.create(Record); - r.name = name; - r.fields.len = std.math.maxInt(usize); - r.field_attributes = null; - r.type_layout = .{ - .size_bits = 8, - .field_alignment_bits = 8, - .pointer_alignment_bits = 8, - .required_alignment_bits = 8, - }; - return r; - } - - pub fn hasFieldOfType(self: *const Record, ty: Type, comp: *const Compilation) bool { - if (self.isIncomplete()) return false; - for (self.fields) |f| { - if (ty.eql(f.ty, comp, false)) return true; - } - return false; - } - - pub fn hasField(self: *const Record, name: StringId) bool { - std.debug.assert(!self.isIncomplete()); - for (self.fields) |f| { - if (f.isAnonymousRecord() and f.ty.getRecord().?.hasField(name)) return true; - if (name == f.name) return true; - } - return false; - } -}; - -pub const Specifier = enum { - /// A NaN-like poison value - invalid, - - /// GNU auto type - /// This is a placeholder specifier - it must be replaced by the actual type specifier (determined by the initializer) - auto_type, - /// C23 auto, behaves like auto_type - c23_auto, - - void, - bool, - - // integers - char, - schar, - uchar, - short, - ushort, - int, - uint, - long, - ulong, - long_long, - ulong_long, - int128, - uint128, - complex_char, - complex_schar, - complex_uchar, - complex_short, - complex_ushort, - complex_int, - complex_uint, - complex_long, - complex_ulong, - complex_long_long, - complex_ulong_long, - complex_int128, - complex_uint128, - - // data.int - bit_int, - complex_bit_int, - - // floating point numbers - fp16, - float16, - float, - double, - long_double, - float128, - complex_float16, - complex_float, - complex_double, - complex_long_double, - complex_float128, - - // data.sub_type - pointer, - unspecified_variable_len_array, - // data.func - /// int foo(int bar, char baz) and int (void) - func, - /// int foo(int bar, char baz, ...) - var_args_func, - /// int foo(bar, baz) and int foo() - /// is also var args, but we can give warnings about incorrect amounts of parameters - old_style_func, - - // data.array - array, - static_array, - incomplete_array, - vector, - // data.expr - variable_len_array, - - // data.record - @"struct", - @"union", - - // data.enum - @"enum", - - /// typeof(type-name) - typeof_type, - - /// typeof(expression) - typeof_expr, - - /// data.attributed - attributed, - - /// C23 nullptr_t - nullptr_t, -}; - -const Type = @This(); - -/// All fields of Type except data may be mutated -data: union { - sub_type: *Type, - func: *Func, - array: *Array, - expr: *Expr, - @"enum": *Enum, - record: *Record, - attributed: *Attributed, - none: void, - int: struct { - bits: u16, - signedness: std.builtin.Signedness, - }, -} = .{ .none = {} }, -specifier: Specifier, -qual: Qualifiers = .{}, -decayed: bool = false, -/// typedef name, if any -name: StringId = .empty, - -pub const int = Type{ .specifier = .int }; -pub const invalid = Type{ .specifier = .invalid }; - -/// Determine if type matches the given specifier, recursing into typeof -/// types if necessary. -pub fn is(ty: Type, specifier: Specifier) bool { - std.debug.assert(specifier != .typeof_type and specifier != .typeof_expr); - return ty.get(specifier) != null; -} - -pub fn withAttributes(self: Type, allocator: std.mem.Allocator, attributes: []const Attribute) !Type { - if (attributes.len == 0) return self; - const attributed_type = try Type.Attributed.create(allocator, self, attributes); - return .{ .specifier = .attributed, .data = .{ .attributed = attributed_type }, .decayed = self.decayed }; -} - -pub fn isCallable(ty: Type) ?Type { - return switch (ty.specifier) { - .func, .var_args_func, .old_style_func => ty, - .pointer => if (ty.data.sub_type.isFunc()) ty.data.sub_type.* else null, - .typeof_type => ty.data.sub_type.isCallable(), - .typeof_expr => ty.data.expr.ty.isCallable(), - .attributed => ty.data.attributed.base.isCallable(), - else => null, - }; -} - -pub fn isFunc(ty: Type) bool { - return switch (ty.specifier) { - .func, .var_args_func, .old_style_func => true, - .typeof_type => ty.data.sub_type.isFunc(), - .typeof_expr => ty.data.expr.ty.isFunc(), - .attributed => ty.data.attributed.base.isFunc(), - else => false, - }; -} - -pub fn isArray(ty: Type) bool { - return switch (ty.specifier) { - .array, .static_array, .incomplete_array, .variable_len_array, .unspecified_variable_len_array => !ty.isDecayed(), - .typeof_type => !ty.isDecayed() and ty.data.sub_type.isArray(), - .typeof_expr => !ty.isDecayed() and ty.data.expr.ty.isArray(), - .attributed => !ty.isDecayed() and ty.data.attributed.base.isArray(), - else => false, - }; -} - -/// Must only be used to set the length of an incomplete array as determined by its initializer -pub fn setIncompleteArrayLen(ty: *Type, len: u64) void { - switch (ty.specifier) { - .incomplete_array => { - // Modifying .data is exceptionally allowed for .incomplete_array. - ty.data.array.len = len; - ty.specifier = .array; - }, - - .typeof_type => ty.data.sub_type.setIncompleteArrayLen(len), - .typeof_expr => ty.data.expr.ty.setIncompleteArrayLen(len), - .attributed => ty.data.attributed.base.setIncompleteArrayLen(len), - - else => unreachable, - } -} - -/// Whether the type is promoted if used as a variadic argument or as an argument to a function with no prototype -fn undergoesDefaultArgPromotion(ty: Type, comp: *const Compilation) bool { - return switch (ty.specifier) { - .bool => true, - .char, .uchar, .schar => true, - .short, .ushort => true, - .@"enum" => if (comp.langopts.emulate == .clang) ty.data.@"enum".isIncomplete() else false, - .float => true, - - .typeof_type => ty.data.sub_type.undergoesDefaultArgPromotion(comp), - .typeof_expr => ty.data.expr.ty.undergoesDefaultArgPromotion(comp), - .attributed => ty.data.attributed.base.undergoesDefaultArgPromotion(comp), - else => false, - }; -} - -pub fn isScalar(ty: Type) bool { - return ty.isInt() or ty.isScalarNonInt(); -} - -/// To avoid calling isInt() twice for allowable loop/if controlling expressions -pub fn isScalarNonInt(ty: Type) bool { - return ty.isFloat() or ty.isPtr() or ty.is(.nullptr_t); -} - -pub fn isDecayed(ty: Type) bool { - return ty.decayed; -} - -pub fn isPtr(ty: Type) bool { - return switch (ty.specifier) { - .pointer => true, - - .array, - .static_array, - .incomplete_array, - .variable_len_array, - .unspecified_variable_len_array, - => ty.isDecayed(), - .typeof_type => ty.isDecayed() or ty.data.sub_type.isPtr(), - .typeof_expr => ty.isDecayed() or ty.data.expr.ty.isPtr(), - .attributed => ty.isDecayed() or ty.data.attributed.base.isPtr(), - else => false, - }; -} - -pub fn isInt(ty: Type) bool { - return switch (ty.specifier) { - // zig fmt: off - .@"enum", .bool, .char, .schar, .uchar, .short, .ushort, .int, .uint, .long, .ulong, - .long_long, .ulong_long, .int128, .uint128, .complex_char, .complex_schar, .complex_uchar, - .complex_short, .complex_ushort, .complex_int, .complex_uint, .complex_long, .complex_ulong, - .complex_long_long, .complex_ulong_long, .complex_int128, .complex_uint128, - .bit_int, .complex_bit_int => true, - // zig fmt: on - .typeof_type => ty.data.sub_type.isInt(), - .typeof_expr => ty.data.expr.ty.isInt(), - .attributed => ty.data.attributed.base.isInt(), - else => false, - }; -} - -pub fn isFloat(ty: Type) bool { - return switch (ty.specifier) { - // zig fmt: off - .float, .double, .long_double, .complex_float, .complex_double, .complex_long_double, - .fp16, .float16, .float128, .complex_float128, .complex_float16 => true, - // zig fmt: on - .typeof_type => ty.data.sub_type.isFloat(), - .typeof_expr => ty.data.expr.ty.isFloat(), - .attributed => ty.data.attributed.base.isFloat(), - else => false, - }; -} - -pub fn isReal(ty: Type) bool { - return switch (ty.specifier) { - // zig fmt: off - .complex_float, .complex_double, .complex_long_double, - .complex_float128, .complex_char, .complex_schar, .complex_uchar, .complex_short, - .complex_ushort, .complex_int, .complex_uint, .complex_long, .complex_ulong, - .complex_long_long, .complex_ulong_long, .complex_int128, .complex_uint128, - .complex_bit_int, .complex_float16 => false, - // zig fmt: on - .typeof_type => ty.data.sub_type.isReal(), - .typeof_expr => ty.data.expr.ty.isReal(), - .attributed => ty.data.attributed.base.isReal(), - else => true, - }; -} - -pub fn isComplex(ty: Type) bool { - return switch (ty.specifier) { - // zig fmt: off - .complex_float, .complex_double, .complex_long_double, - .complex_float128, .complex_char, .complex_schar, .complex_uchar, .complex_short, - .complex_ushort, .complex_int, .complex_uint, .complex_long, .complex_ulong, - .complex_long_long, .complex_ulong_long, .complex_int128, .complex_uint128, - .complex_bit_int, .complex_float16 => true, - // zig fmt: on - .typeof_type => ty.data.sub_type.isComplex(), - .typeof_expr => ty.data.expr.ty.isComplex(), - .attributed => ty.data.attributed.base.isComplex(), - else => false, - }; -} - -pub fn isVoidStar(ty: Type) bool { - return switch (ty.specifier) { - .pointer => ty.data.sub_type.specifier == .void, - .typeof_type => ty.data.sub_type.isVoidStar(), - .typeof_expr => ty.data.expr.ty.isVoidStar(), - .attributed => ty.data.attributed.base.isVoidStar(), - else => false, - }; -} - -pub fn isTypeof(ty: Type) bool { - return switch (ty.specifier) { - .typeof_type, .typeof_expr => true, - else => false, - }; -} - -pub fn isConst(ty: Type) bool { - return switch (ty.specifier) { - .typeof_type => ty.qual.@"const" or ty.data.sub_type.isConst(), - .typeof_expr => ty.qual.@"const" or ty.data.expr.ty.isConst(), - .attributed => ty.data.attributed.base.isConst(), - else => ty.qual.@"const", - }; -} - -pub fn isUnsignedInt(ty: Type, comp: *const Compilation) bool { - return ty.signedness(comp) == .unsigned; -} - -pub fn signedness(ty: Type, comp: *const Compilation) std.builtin.Signedness { - return switch (ty.specifier) { - // zig fmt: off - .char, .complex_char => return comp.getCharSignedness(), - .uchar, .ushort, .uint, .ulong, .ulong_long, .uint128, .bool, .complex_uchar, .complex_ushort, - .complex_uint, .complex_ulong, .complex_ulong_long, .complex_uint128 => .unsigned, - // zig fmt: on - .bit_int, .complex_bit_int => ty.data.int.signedness, - .typeof_type => ty.data.sub_type.signedness(comp), - .typeof_expr => ty.data.expr.ty.signedness(comp), - .attributed => ty.data.attributed.base.signedness(comp), - else => .signed, - }; -} - -pub fn isEnumOrRecord(ty: Type) bool { - return switch (ty.specifier) { - .@"enum", .@"struct", .@"union" => true, - .typeof_type => ty.data.sub_type.isEnumOrRecord(), - .typeof_expr => ty.data.expr.ty.isEnumOrRecord(), - .attributed => ty.data.attributed.base.isEnumOrRecord(), - else => false, - }; -} - -pub fn isRecord(ty: Type) bool { - return switch (ty.specifier) { - .@"struct", .@"union" => true, - .typeof_type => ty.data.sub_type.isRecord(), - .typeof_expr => ty.data.expr.ty.isRecord(), - .attributed => ty.data.attributed.base.isRecord(), - else => false, - }; -} - -pub fn isAnonymousRecord(ty: Type, comp: *const Compilation) bool { - return switch (ty.specifier) { - // anonymous records can be recognized by their names which are in - // the format "(anonymous TAG at path:line:col)". - .@"struct", .@"union" => { - const mapper = comp.string_interner.getSlowTypeMapper(); - return mapper.lookup(ty.data.record.name)[0] == '('; - }, - .typeof_type => ty.data.sub_type.isAnonymousRecord(comp), - .typeof_expr => ty.data.expr.ty.isAnonymousRecord(comp), - .attributed => ty.data.attributed.base.isAnonymousRecord(comp), - else => false, - }; -} - -pub fn elemType(ty: Type) Type { - return switch (ty.specifier) { - .pointer, .unspecified_variable_len_array => ty.data.sub_type.*, - .array, .static_array, .incomplete_array, .vector => ty.data.array.elem, - .variable_len_array => ty.data.expr.ty, - .typeof_type, .typeof_expr => { - const unwrapped = ty.canonicalize(.preserve_quals); - var elem = unwrapped.elemType(); - elem.qual = elem.qual.mergeAll(unwrapped.qual); - return elem; - }, - .attributed => ty.data.attributed.base.elemType(), - .invalid => Type.invalid, - // zig fmt: off - .complex_float, .complex_double, .complex_long_double, - .complex_float128, .complex_char, .complex_schar, .complex_uchar, .complex_short, - .complex_ushort, .complex_int, .complex_uint, .complex_long, .complex_ulong, - .complex_long_long, .complex_ulong_long, .complex_int128, .complex_uint128, - .complex_bit_int, .complex_float16 => ty.makeReal(), - // zig fmt: on - else => unreachable, - }; -} - -pub fn returnType(ty: Type) Type { - return switch (ty.specifier) { - .func, .var_args_func, .old_style_func => ty.data.func.return_type, - .typeof_type => ty.data.sub_type.returnType(), - .typeof_expr => ty.data.expr.ty.returnType(), - .attributed => ty.data.attributed.base.returnType(), - .invalid => Type.invalid, - else => unreachable, - }; -} - -pub fn params(ty: Type) []Func.Param { - return switch (ty.specifier) { - .func, .var_args_func, .old_style_func => ty.data.func.params, - .typeof_type => ty.data.sub_type.params(), - .typeof_expr => ty.data.expr.ty.params(), - .attributed => ty.data.attributed.base.params(), - .invalid => &.{}, - else => unreachable, - }; -} - -/// Returns true if the return value or any param of `ty` is `.invalid` -/// Asserts that ty is a function type -pub fn isInvalidFunc(ty: Type) bool { - if (ty.returnType().is(.invalid)) return true; - for (ty.params()) |param| { - if (param.ty.is(.invalid)) return true; - } - return false; -} - -pub fn arrayLen(ty: Type) ?u64 { - return switch (ty.specifier) { - .array, .static_array => ty.data.array.len, - .typeof_type => ty.data.sub_type.arrayLen(), - .typeof_expr => ty.data.expr.ty.arrayLen(), - .attributed => ty.data.attributed.base.arrayLen(), - else => null, - }; -} - -/// Complex numbers are scalars but they can be initialized with a 2-element initList -pub fn expectedInitListSize(ty: Type) ?u64 { - return if (ty.isComplex()) 2 else ty.arrayLen(); -} - -pub fn anyQual(ty: Type) bool { - return switch (ty.specifier) { - .typeof_type => ty.qual.any() or ty.data.sub_type.anyQual(), - .typeof_expr => ty.qual.any() or ty.data.expr.ty.anyQual(), - else => ty.qual.any(), - }; -} - -pub fn getRecord(ty: Type) ?*const Type.Record { - return switch (ty.specifier) { - .attributed => ty.data.attributed.base.getRecord(), - .typeof_type => ty.data.sub_type.getRecord(), - .typeof_expr => ty.data.expr.ty.getRecord(), - .@"struct", .@"union" => ty.data.record, - else => null, - }; -} - -pub fn compareIntegerRanks(a: Type, b: Type, comp: *const Compilation) std.math.Order { - std.debug.assert(a.isInt() and b.isInt()); - if (a.eql(b, comp, false)) return .eq; - - const a_unsigned = a.isUnsignedInt(comp); - const b_unsigned = b.isUnsignedInt(comp); - - const a_rank = a.integerRank(comp); - const b_rank = b.integerRank(comp); - if (a_unsigned == b_unsigned) { - return std.math.order(a_rank, b_rank); - } - if (a_unsigned) { - if (a_rank >= b_rank) return .gt; - return .lt; - } - std.debug.assert(b_unsigned); - if (b_rank >= a_rank) return .lt; - return .gt; -} - -fn realIntegerConversion(a: Type, b: Type, comp: *const Compilation) Type { - std.debug.assert(a.isReal() and b.isReal()); - const type_order = a.compareIntegerRanks(b, comp); - const a_signed = !a.isUnsignedInt(comp); - const b_signed = !b.isUnsignedInt(comp); - if (a_signed == b_signed) { - // If both have the same sign, use higher-rank type. - return switch (type_order) { - .lt => b, - .eq, .gt => a, - }; - } else if (type_order != if (a_signed) std.math.Order.gt else std.math.Order.lt) { - // Only one is signed; and the unsigned type has rank >= the signed type - // Use the unsigned type - return if (b_signed) a else b; - } else if (a.bitSizeof(comp).? != b.bitSizeof(comp).?) { - // Signed type is higher rank and sizes are not equal - // Use the signed type - return if (a_signed) a else b; - } else { - // Signed type is higher rank but same size as unsigned type - // e.g. `long` and `unsigned` on x86-linux-gnu - // Use unsigned version of the signed type - return if (a_signed) a.makeIntegerUnsigned() else b.makeIntegerUnsigned(); - } -} - -pub fn makeIntegerUnsigned(ty: Type) Type { - // TODO discards attributed/typeof - var base_ty = ty.canonicalize(.standard); - switch (base_ty.specifier) { - // zig fmt: off - .uchar, .ushort, .uint, .ulong, .ulong_long, .uint128, - .complex_uchar, .complex_ushort, .complex_uint, .complex_ulong, .complex_ulong_long, .complex_uint128, - => return ty, - // zig fmt: on - - .char, .complex_char => { - base_ty.specifier = @enumFromInt(@intFromEnum(base_ty.specifier) + 2); - return base_ty; - }, - - // zig fmt: off - .schar, .short, .int, .long, .long_long, .int128, - .complex_schar, .complex_short, .complex_int, .complex_long, .complex_long_long, .complex_int128 => { - base_ty.specifier = @enumFromInt(@intFromEnum(base_ty.specifier) + 1); - return base_ty; - }, - // zig fmt: on - - .bit_int, .complex_bit_int => { - base_ty.data.int.signedness = .unsigned; - return base_ty; - }, - else => unreachable, - } -} - -/// Find the common type of a and b for binary operations -pub fn integerConversion(a: Type, b: Type, comp: *const Compilation) Type { - const a_real = a.isReal(); - const b_real = b.isReal(); - const target_ty = a.makeReal().realIntegerConversion(b.makeReal(), comp); - return if (a_real and b_real) target_ty else target_ty.makeComplex(); -} - -pub fn integerPromotion(ty: Type, comp: *Compilation) Type { - var specifier = ty.specifier; - switch (specifier) { - .@"enum" => { - if (ty.hasIncompleteSize()) return .{ .specifier = .int }; - if (ty.data.@"enum".fixed) return ty.data.@"enum".tag_ty.integerPromotion(comp); - - specifier = ty.data.@"enum".tag_ty.specifier; - }, - .bit_int, .complex_bit_int => return .{ .specifier = specifier, .data = ty.data }, - else => {}, - } - return switch (specifier) { - else => .{ - .specifier = switch (specifier) { - // zig fmt: off - .bool, .char, .schar, .uchar, .short => .int, - .ushort => if (ty.sizeof(comp).? == sizeof(.{ .specifier = .int }, comp)) Specifier.uint else .int, - .int, .uint, .long, .ulong, .long_long, .ulong_long, .int128, .uint128, .complex_char, - .complex_schar, .complex_uchar, .complex_short, .complex_ushort, .complex_int, - .complex_uint, .complex_long, .complex_ulong, .complex_long_long, .complex_ulong_long, - .complex_int128, .complex_uint128 => specifier, - // zig fmt: on - .typeof_type => return ty.data.sub_type.integerPromotion(comp), - .typeof_expr => return ty.data.expr.ty.integerPromotion(comp), - .attributed => return ty.data.attributed.base.integerPromotion(comp), - .invalid => .invalid, - else => unreachable, // _BitInt, or not an integer type - }, - }, - }; -} - -/// Promote a bitfield. If `int` can hold all the values of the underlying field, -/// promote to int. Otherwise, promote to unsigned int -/// Returns null if no promotion is necessary -pub fn bitfieldPromotion(ty: Type, comp: *Compilation, width: u32) ?Type { - const type_size_bits = ty.bitSizeof(comp).?; - - // Note: GCC and clang will promote `long: 3` to int even though the C standard does not allow this - if (width < type_size_bits) { - return int; - } - - if (width == type_size_bits) { - return if (ty.isUnsignedInt(comp)) .{ .specifier = .uint } else int; - } - - return null; -} - -pub fn hasIncompleteSize(ty: Type) bool { - if (ty.isDecayed()) return false; - return switch (ty.specifier) { - .void, .incomplete_array => true, - .@"enum" => ty.data.@"enum".isIncomplete() and !ty.data.@"enum".fixed, - .@"struct", .@"union" => ty.data.record.isIncomplete(), - .array, .static_array => ty.data.array.elem.hasIncompleteSize(), - .typeof_type => ty.data.sub_type.hasIncompleteSize(), - .typeof_expr, .variable_len_array => ty.data.expr.ty.hasIncompleteSize(), - .unspecified_variable_len_array => ty.data.sub_type.hasIncompleteSize(), - .attributed => ty.data.attributed.base.hasIncompleteSize(), - else => false, - }; -} - -pub fn hasUnboundVLA(ty: Type) bool { - var cur = ty; - while (true) { - switch (cur.specifier) { - .unspecified_variable_len_array => return true, - .array, - .static_array, - .incomplete_array, - .variable_len_array, - => cur = cur.elemType(), - .typeof_type => cur = cur.data.sub_type.*, - .typeof_expr => cur = cur.data.expr.ty, - .attributed => cur = cur.data.attributed.base, - else => return false, - } - } -} - -pub fn hasField(ty: Type, name: StringId) bool { - return ty.getRecord().?.hasField(name); -} - -const TypeSizeOrder = enum { - lt, - gt, - eq, - indeterminate, -}; - -pub fn sizeCompare(a: Type, b: Type, comp: *Compilation) TypeSizeOrder { - const a_size = a.sizeof(comp) orelse return .indeterminate; - const b_size = b.sizeof(comp) orelse return .indeterminate; - return switch (std.math.order(a_size, b_size)) { - .lt => .lt, - .gt => .gt, - .eq => .eq, - }; -} - -/// Size of type as reported by sizeof -pub fn sizeof(ty: Type, comp: *const Compilation) ?u64 { - if (ty.isPtr()) return comp.target.ptrBitWidth() / 8; - - return switch (ty.specifier) { - .auto_type, .c23_auto => unreachable, - .variable_len_array, .unspecified_variable_len_array => null, - .incomplete_array => return if (comp.langopts.emulate == .msvc) @as(?u64, 0) else null, - .func, .var_args_func, .old_style_func, .void, .bool => 1, - .char, .schar, .uchar => 1, - .short => comp.target.cTypeByteSize(.short), - .ushort => comp.target.cTypeByteSize(.ushort), - .int => comp.target.cTypeByteSize(.int), - .uint => comp.target.cTypeByteSize(.uint), - .long => comp.target.cTypeByteSize(.long), - .ulong => comp.target.cTypeByteSize(.ulong), - .long_long => comp.target.cTypeByteSize(.longlong), - .ulong_long => comp.target.cTypeByteSize(.ulonglong), - .long_double => comp.target.cTypeByteSize(.longdouble), - .int128, .uint128 => 16, - .fp16, .float16 => 2, - .float => comp.target.cTypeByteSize(.float), - .double => comp.target.cTypeByteSize(.double), - .float128 => 16, - .bit_int => { - return std.mem.alignForward(u64, (@as(u32, ty.data.int.bits) + 7) / 8, ty.alignof(comp)); - }, - // zig fmt: off - .complex_char, .complex_schar, .complex_uchar, .complex_short, .complex_ushort, .complex_int, - .complex_uint, .complex_long, .complex_ulong, .complex_long_long, .complex_ulong_long, - .complex_int128, .complex_uint128, .complex_float, .complex_double, - .complex_long_double, .complex_float128, .complex_bit_int, .complex_float16, - => return 2 * ty.makeReal().sizeof(comp).?, - // zig fmt: on - .pointer => unreachable, - .static_array, - .nullptr_t, - => comp.target.ptrBitWidth() / 8, - .array, .vector => { - const size = ty.data.array.elem.sizeof(comp) orelse return null; - const arr_size = size * ty.data.array.len; - if (comp.langopts.emulate == .msvc) { - // msvc ignores array type alignment. - // Since the size might not be a multiple of the field - // alignment, the address of the second element might not be properly aligned - // for the field alignment. A flexible array has size 0. See test case 0018. - return arr_size; - } else { - return std.mem.alignForward(u64, arr_size, ty.alignof(comp)); - } - }, - .@"struct", .@"union" => if (ty.data.record.isIncomplete()) null else @as(u64, ty.data.record.type_layout.size_bits / 8), - .@"enum" => if (ty.data.@"enum".isIncomplete() and !ty.data.@"enum".fixed) null else ty.data.@"enum".tag_ty.sizeof(comp), - .typeof_type => ty.data.sub_type.sizeof(comp), - .typeof_expr => ty.data.expr.ty.sizeof(comp), - .attributed => ty.data.attributed.base.sizeof(comp), - .invalid => return null, - }; -} - -pub fn bitSizeof(ty: Type, comp: *const Compilation) ?u64 { - return switch (ty.specifier) { - .bool => if (comp.langopts.emulate == .msvc) @as(u64, 8) else 1, - .typeof_type => ty.data.sub_type.bitSizeof(comp), - .typeof_expr => ty.data.expr.ty.bitSizeof(comp), - .attributed => ty.data.attributed.base.bitSizeof(comp), - .bit_int => return ty.data.int.bits, - .long_double => comp.target.cTypeBitSize(.longdouble), - else => 8 * (ty.sizeof(comp) orelse return null), - }; -} - -pub fn alignable(ty: Type) bool { - return (ty.isArray() or !ty.hasIncompleteSize() or ty.is(.void)) and !ty.is(.invalid); -} - -/// Get the alignment of a type -pub fn alignof(ty: Type, comp: *const Compilation) u29 { - // don't return the attribute for records - // layout has already accounted for requested alignment - if (ty.requestedAlignment(comp)) |requested| { - // gcc does not respect alignment on enums - if (ty.get(.@"enum")) |ty_enum| { - if (comp.langopts.emulate == .gcc) { - return ty_enum.alignof(comp); - } - } else if (ty.getRecord()) |rec| { - if (ty.hasIncompleteSize()) return 0; - const computed: u29 = @intCast(@divExact(rec.type_layout.field_alignment_bits, 8)); - return @max(requested, computed); - } else if (comp.langopts.emulate == .msvc) { - const type_align = ty.data.attributed.base.alignof(comp); - return @max(requested, type_align); - } - return requested; - } - - return switch (ty.specifier) { - .invalid => unreachable, - .auto_type, .c23_auto => unreachable, - - .variable_len_array, - .incomplete_array, - .unspecified_variable_len_array, - .array, - .vector, - => if (ty.isPtr()) switch (comp.target.cpu.arch) { - .avr => 1, - else => comp.target.ptrBitWidth() / 8, - } else ty.elemType().alignof(comp), - .func, .var_args_func, .old_style_func => target_util.defaultFunctionAlignment(comp.target), - .char, .schar, .uchar, .void, .bool => 1, - - // zig fmt: off - .complex_char, .complex_schar, .complex_uchar, .complex_short, .complex_ushort, .complex_int, - .complex_uint, .complex_long, .complex_ulong, .complex_long_long, .complex_ulong_long, - .complex_int128, .complex_uint128, .complex_float, .complex_double, - .complex_long_double, .complex_float128, .complex_bit_int, .complex_float16, - => return ty.makeReal().alignof(comp), - // zig fmt: on - - .short => comp.target.cTypeAlignment(.short), - .ushort => comp.target.cTypeAlignment(.ushort), - .int => comp.target.cTypeAlignment(.int), - .uint => comp.target.cTypeAlignment(.uint), - - .long => comp.target.cTypeAlignment(.long), - .ulong => comp.target.cTypeAlignment(.ulong), - .long_long => comp.target.cTypeAlignment(.longlong), - .ulong_long => comp.target.cTypeAlignment(.ulonglong), - - .bit_int => { - // https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2709.pdf - // _BitInt(N) types align with existing calling conventions. They have the same size and alignment as the - // smallest basic type that can contain them. Types that are larger than __int64_t are conceptually treated - // as struct of register size chunks. The number of chunks is the smallest number that can contain the type. - if (ty.data.int.bits > 64) return 8; - const basic_type = comp.intLeastN(ty.data.int.bits, ty.data.int.signedness); - return basic_type.alignof(comp); - }, - - .float => comp.target.cTypeAlignment(.float), - .double => comp.target.cTypeAlignment(.double), - .long_double => comp.target.cTypeAlignment(.longdouble), - - .int128, .uint128 => if (comp.target.cpu.arch == .s390x and comp.target.os.tag == .linux and comp.target.abi.isGnu()) 8 else 16, - .fp16, .float16 => 2, - - .float128 => 16, - .pointer, - .static_array, - .nullptr_t, - => switch (comp.target.cpu.arch) { - .avr => 1, - else => comp.target.ptrBitWidth() / 8, - }, - .@"struct", .@"union" => if (ty.data.record.isIncomplete()) 0 else @intCast(ty.data.record.type_layout.field_alignment_bits / 8), - .@"enum" => if (ty.data.@"enum".isIncomplete() and !ty.data.@"enum".fixed) 0 else ty.data.@"enum".tag_ty.alignof(comp), - .typeof_type => ty.data.sub_type.alignof(comp), - .typeof_expr => ty.data.expr.ty.alignof(comp), - .attributed => ty.data.attributed.base.alignof(comp), - }; -} - -// This enum should be kept public because it is used by the downstream zig translate-c -pub const QualHandling = enum { - standard, - preserve_quals, -}; - -/// Canonicalize a possibly-typeof() type. If the type is not a typeof() type, simply -/// return it. Otherwise, determine the actual qualified type. -/// The `qual_handling` parameter can be used to return the full set of qualifiers -/// added by typeof() operations, which is useful when determining the elemType of -/// arrays and pointers. -pub fn canonicalize(ty: Type, qual_handling: QualHandling) Type { - var cur = ty; - var qual = cur.qual; - while (true) { - switch (cur.specifier) { - .typeof_type => cur = cur.data.sub_type.*, - .typeof_expr => cur = cur.data.expr.ty, - .attributed => cur = cur.data.attributed.base, - else => break, - } - qual = qual.mergeAll(cur.qual); - } - if ((cur.isArray() or cur.isPtr()) and qual_handling == .standard) { - cur.qual = .{}; - } else { - cur.qual = qual; - } - cur.decayed = ty.decayed; - return cur; -} - -pub fn get(ty: *const Type, specifier: Specifier) ?*const Type { - std.debug.assert(specifier != .typeof_type and specifier != .typeof_expr); - return switch (ty.specifier) { - .typeof_type => ty.data.sub_type.get(specifier), - .typeof_expr => ty.data.expr.ty.get(specifier), - .attributed => ty.data.attributed.base.get(specifier), - else => if (ty.specifier == specifier) ty else null, - }; -} - -pub fn requestedAlignment(ty: Type, comp: *const Compilation) ?u29 { - return switch (ty.specifier) { - .typeof_type => ty.data.sub_type.requestedAlignment(comp), - .typeof_expr => ty.data.expr.ty.requestedAlignment(comp), - .attributed => annotationAlignment(comp, Attribute.Iterator.initType(ty)), - else => null, - }; -} - -pub fn enumIsPacked(ty: Type, comp: *const Compilation) bool { - std.debug.assert(ty.is(.@"enum")); - return comp.langopts.short_enums or target_util.packAllEnums(comp.target) or ty.hasAttribute(.@"packed"); -} - -pub fn getName(ty: Type) StringId { - return switch (ty.specifier) { - .typeof_type => if (ty.name == .empty) ty.data.sub_type.getName() else ty.name, - .typeof_expr => if (ty.name == .empty) ty.data.expr.ty.getName() else ty.name, - .attributed => if (ty.name == .empty) ty.data.attributed.base.getName() else ty.name, - else => ty.name, - }; -} - -pub fn annotationAlignment(comp: *const Compilation, attrs: Attribute.Iterator) ?u29 { - var it = attrs; - var max_requested: ?u29 = null; - var last_aligned_index: ?usize = null; - while (it.next()) |item| { - const attribute, const index = item; - if (attribute.tag != .aligned) continue; - if (last_aligned_index) |aligned_index| { - // once we recurse into a new type, after an `aligned` attribute was found, we're done - if (index <= aligned_index) break; - } - last_aligned_index = index; - const requested = if (attribute.args.aligned.alignment) |alignment| alignment.requested else target_util.defaultAlignment(comp.target); - if (max_requested == null or max_requested.? < requested) { - max_requested = requested; - } - } - return max_requested; -} - -pub fn eql(a_param: Type, b_param: Type, comp: *const Compilation, check_qualifiers: bool) bool { - const a = a_param.canonicalize(.standard); - const b = b_param.canonicalize(.standard); - - if (a.specifier == .invalid or b.specifier == .invalid) return false; - if (a.alignof(comp) != b.alignof(comp)) return false; - if (a.isPtr()) { - if (!b.isPtr()) return false; - } else if (a.isFunc()) { - if (!b.isFunc()) return false; - } else if (a.isArray()) { - if (!b.isArray()) return false; - } else if (a.specifier == .@"enum" and b.specifier != .@"enum") { - return a.data.@"enum".tag_ty.eql(b, comp, check_qualifiers); - } else if (b.specifier == .@"enum" and a.specifier != .@"enum") { - return a.eql(b.data.@"enum".tag_ty, comp, check_qualifiers); - } else if (a.specifier != b.specifier) return false; - - if (a.qual.atomic != b.qual.atomic) return false; - if (check_qualifiers) { - if (a.qual.@"const" != b.qual.@"const") return false; - if (a.qual.@"volatile" != b.qual.@"volatile") return false; - } - - if (a.isPtr()) { - return a_param.elemType().eql(b_param.elemType(), comp, check_qualifiers); - } - switch (a.specifier) { - .pointer => unreachable, - - .func, - .var_args_func, - .old_style_func, - => if (!a.data.func.eql(b.data.func, a.specifier, b.specifier, comp)) return false, - - .array, - .static_array, - .incomplete_array, - .vector, - => { - const a_len = a.arrayLen(); - const b_len = b.arrayLen(); - if (a_len == null or b_len == null) { - // At least one array is incomplete; only check child type for equality - } else if (a_len.? != b_len.?) { - return false; - } - if (!a.elemType().eql(b.elemType(), comp, false)) return false; - }, - .variable_len_array => { - if (!a.elemType().eql(b.elemType(), comp, check_qualifiers)) return false; - }, - .@"struct", .@"union" => if (a.data.record != b.data.record) return false, - .@"enum" => if (a.data.@"enum" != b.data.@"enum") return false, - .bit_int, .complex_bit_int => return a.data.int.bits == b.data.int.bits and a.data.int.signedness == b.data.int.signedness, - - else => {}, - } - return true; -} - -/// Decays an array to a pointer -pub fn decayArray(ty: *Type) void { - std.debug.assert(ty.isArray()); - ty.decayed = true; -} - -pub fn originalTypeOfDecayedArray(ty: Type) Type { - std.debug.assert(ty.isDecayed()); - var copy = ty; - copy.decayed = false; - return copy; -} - -/// Rank for floating point conversions, ignoring domain (complex vs real) -/// Asserts that ty is a floating point type -pub fn floatRank(ty: Type) usize { - const real = ty.makeReal(); - return switch (real.specifier) { - // TODO: bfloat16 => 0 - .float16 => 1, - .fp16 => 2, - .float => 3, - .double => 4, - .long_double => 5, - .float128 => 6, - // TODO: ibm128 => 7 - else => unreachable, - }; -} - -/// Rank for integer conversions, ignoring domain (complex vs real) -/// Asserts that ty is an integer type -pub fn integerRank(ty: Type, comp: *const Compilation) usize { - const real = ty.makeReal(); - return @intCast(switch (real.specifier) { - .bit_int => @as(u64, real.data.int.bits) << 3, - - .bool => 1 + (ty.bitSizeof(comp).? << 3), - .char, .schar, .uchar => 2 + (ty.bitSizeof(comp).? << 3), - .short, .ushort => 3 + (ty.bitSizeof(comp).? << 3), - .int, .uint => 4 + (ty.bitSizeof(comp).? << 3), - .long, .ulong => 5 + (ty.bitSizeof(comp).? << 3), - .long_long, .ulong_long => 6 + (ty.bitSizeof(comp).? << 3), - .int128, .uint128 => 7 + (ty.bitSizeof(comp).? << 3), - - .typeof_type => ty.data.sub_type.integerRank(comp), - .typeof_expr => ty.data.expr.ty.integerRank(comp), - .attributed => ty.data.attributed.base.integerRank(comp), - - .@"enum" => real.data.@"enum".tag_ty.integerRank(comp), - - else => unreachable, - }); -} - -/// Returns true if `a` and `b` are integer types that differ only in sign -pub fn sameRankDifferentSign(a: Type, b: Type, comp: *const Compilation) bool { - if (!a.isInt() or !b.isInt()) return false; - if (a.hasIncompleteSize() or b.hasIncompleteSize()) return false; - if (a.integerRank(comp) != b.integerRank(comp)) return false; - return a.isUnsignedInt(comp) != b.isUnsignedInt(comp); -} - -pub fn makeReal(ty: Type) Type { - // TODO discards attributed/typeof - var base_ty = ty.canonicalize(.standard); - switch (base_ty.specifier) { - .complex_float16, .complex_float, .complex_double, .complex_long_double, .complex_float128 => { - base_ty.specifier = @enumFromInt(@intFromEnum(base_ty.specifier) - 5); - return base_ty; - }, - .complex_char, .complex_schar, .complex_uchar, .complex_short, .complex_ushort, .complex_int, .complex_uint, .complex_long, .complex_ulong, .complex_long_long, .complex_ulong_long, .complex_int128, .complex_uint128 => { - base_ty.specifier = @enumFromInt(@intFromEnum(base_ty.specifier) - 13); - return base_ty; - }, - .complex_bit_int => { - base_ty.specifier = .bit_int; - return base_ty; - }, - else => return ty, - } -} - -pub fn makeComplex(ty: Type) Type { - // TODO discards attributed/typeof - var base_ty = ty.canonicalize(.standard); - switch (base_ty.specifier) { - .float, .double, .long_double, .float128 => { - base_ty.specifier = @enumFromInt(@intFromEnum(base_ty.specifier) + 5); - return base_ty; - }, - .char, .schar, .uchar, .short, .ushort, .int, .uint, .long, .ulong, .long_long, .ulong_long, .int128, .uint128 => { - base_ty.specifier = @enumFromInt(@intFromEnum(base_ty.specifier) + 13); - return base_ty; - }, - .bit_int => { - base_ty.specifier = .complex_bit_int; - return base_ty; - }, - else => return ty, - } -} - -/// Combines types recursively in the order they were parsed, uses `.void` specifier as a sentinel value. -pub fn combine(inner: *Type, outer: Type) Parser.Error!void { - switch (inner.specifier) { - .pointer => return inner.data.sub_type.combine(outer), - .unspecified_variable_len_array => { - std.debug.assert(!inner.isDecayed()); - try inner.data.sub_type.combine(outer); - }, - .variable_len_array => { - std.debug.assert(!inner.isDecayed()); - try inner.data.expr.ty.combine(outer); - }, - .array, .static_array, .incomplete_array => { - std.debug.assert(!inner.isDecayed()); - try inner.data.array.elem.combine(outer); - }, - .func, .var_args_func, .old_style_func => { - try inner.data.func.return_type.combine(outer); - }, - .typeof_type, - .typeof_expr, - => std.debug.assert(!inner.isDecayed()), - .void, .invalid => inner.* = outer, - else => unreachable, - } -} - -pub fn validateCombinedType(ty: Type, p: *Parser, source_tok: TokenIndex) Parser.Error!void { - switch (ty.specifier) { - .pointer => return ty.data.sub_type.validateCombinedType(p, source_tok), - .unspecified_variable_len_array, - .variable_len_array, - .array, - .static_array, - .incomplete_array, - => { - const elem_ty = ty.elemType(); - if (elem_ty.hasIncompleteSize()) { - try p.errStr(.array_incomplete_elem, source_tok, try p.typeStr(elem_ty)); - return error.ParsingFailed; - } - if (elem_ty.isFunc()) { - try p.errTok(.array_func_elem, source_tok); - return error.ParsingFailed; - } - if (elem_ty.specifier == .static_array and elem_ty.isArray()) { - try p.errTok(.static_non_outermost_array, source_tok); - } - if (elem_ty.anyQual() and elem_ty.isArray()) { - try p.errTok(.qualifier_non_outermost_array, source_tok); - } - }, - .func, .var_args_func, .old_style_func => { - const ret_ty = &ty.data.func.return_type; - if (ret_ty.isArray()) try p.errTok(.func_cannot_return_array, source_tok); - if (ret_ty.isFunc()) try p.errTok(.func_cannot_return_func, source_tok); - if (ret_ty.qual.@"const") { - try p.errStr(.qual_on_ret_type, source_tok, "const"); - ret_ty.qual.@"const" = false; - } - if (ret_ty.qual.@"volatile") { - try p.errStr(.qual_on_ret_type, source_tok, "volatile"); - ret_ty.qual.@"volatile" = false; - } - if (ret_ty.qual.atomic) { - try p.errStr(.qual_on_ret_type, source_tok, "atomic"); - ret_ty.qual.atomic = false; - } - if (ret_ty.is(.fp16) and !p.comp.hasHalfPrecisionFloatABI()) { - try p.errStr(.suggest_pointer_for_invalid_fp16, source_tok, "function return value"); - } - }, - .typeof_type => return ty.data.sub_type.validateCombinedType(p, source_tok), - .typeof_expr => return ty.data.expr.ty.validateCombinedType(p, source_tok), - .attributed => return ty.data.attributed.base.validateCombinedType(p, source_tok), - else => {}, - } -} - -/// An unfinished Type -pub const Builder = struct { - complex_tok: ?TokenIndex = null, - bit_int_tok: ?TokenIndex = null, - auto_type_tok: ?TokenIndex = null, - typedef: ?struct { - tok: TokenIndex, - ty: Type, - } = null, - specifier: Builder.Specifier = .none, - qual: Qualifiers.Builder = .{}, - typeof: ?Type = null, - /// When true an error is returned instead of adding a diagnostic message. - /// Used for trying to combine typedef types. - error_on_invalid: bool = false, - - pub const Specifier = union(enum) { - none, - void, - /// GNU __auto_type extension - auto_type, - /// C23 auto - c23_auto, - nullptr_t, - bool, - char, - schar, - uchar, - complex_char, - complex_schar, - complex_uchar, - - unsigned, - signed, - short, - sshort, - ushort, - short_int, - sshort_int, - ushort_int, - int, - sint, - uint, - long, - slong, - ulong, - long_int, - slong_int, - ulong_int, - long_long, - slong_long, - ulong_long, - long_long_int, - slong_long_int, - ulong_long_int, - int128, - sint128, - uint128, - complex_unsigned, - complex_signed, - complex_short, - complex_sshort, - complex_ushort, - complex_short_int, - complex_sshort_int, - complex_ushort_int, - complex_int, - complex_sint, - complex_uint, - complex_long, - complex_slong, - complex_ulong, - complex_long_int, - complex_slong_int, - complex_ulong_int, - complex_long_long, - complex_slong_long, - complex_ulong_long, - complex_long_long_int, - complex_slong_long_int, - complex_ulong_long_int, - complex_int128, - complex_sint128, - complex_uint128, - bit_int: u64, - sbit_int: u64, - ubit_int: u64, - complex_bit_int: u64, - complex_sbit_int: u64, - complex_ubit_int: u64, - - fp16, - float16, - float, - double, - long_double, - float128, - complex, - complex_float16, - complex_float, - complex_double, - complex_long_double, - complex_float128, - - pointer: *Type, - unspecified_variable_len_array: *Type, - decayed_unspecified_variable_len_array: *Type, - func: *Func, - var_args_func: *Func, - old_style_func: *Func, - array: *Array, - decayed_array: *Array, - static_array: *Array, - decayed_static_array: *Array, - incomplete_array: *Array, - decayed_incomplete_array: *Array, - vector: *Array, - variable_len_array: *Expr, - decayed_variable_len_array: *Expr, - @"struct": *Record, - @"union": *Record, - @"enum": *Enum, - typeof_type: *Type, - decayed_typeof_type: *Type, - typeof_expr: *Expr, - decayed_typeof_expr: *Expr, - - attributed: *Attributed, - decayed_attributed: *Attributed, - - pub fn str(spec: Builder.Specifier, langopts: LangOpts) ?[]const u8 { - return switch (spec) { - .none => unreachable, - .void => "void", - .auto_type => "__auto_type", - .c23_auto => "auto", - .nullptr_t => "nullptr_t", - .bool => if (langopts.standard.atLeast(.c23)) "bool" else "_Bool", - .char => "char", - .schar => "signed char", - .uchar => "unsigned char", - .unsigned => "unsigned", - .signed => "signed", - .short => "short", - .ushort => "unsigned short", - .sshort => "signed short", - .short_int => "short int", - .sshort_int => "signed short int", - .ushort_int => "unsigned short int", - .int => "int", - .sint => "signed int", - .uint => "unsigned int", - .long => "long", - .slong => "signed long", - .ulong => "unsigned long", - .long_int => "long int", - .slong_int => "signed long int", - .ulong_int => "unsigned long int", - .long_long => "long long", - .slong_long => "signed long long", - .ulong_long => "unsigned long long", - .long_long_int => "long long int", - .slong_long_int => "signed long long int", - .ulong_long_int => "unsigned long long int", - .int128 => "__int128", - .sint128 => "signed __int128", - .uint128 => "unsigned __int128", - .complex_char => "_Complex char", - .complex_schar => "_Complex signed char", - .complex_uchar => "_Complex unsigned char", - .complex_unsigned => "_Complex unsigned", - .complex_signed => "_Complex signed", - .complex_short => "_Complex short", - .complex_ushort => "_Complex unsigned short", - .complex_sshort => "_Complex signed short", - .complex_short_int => "_Complex short int", - .complex_sshort_int => "_Complex signed short int", - .complex_ushort_int => "_Complex unsigned short int", - .complex_int => "_Complex int", - .complex_sint => "_Complex signed int", - .complex_uint => "_Complex unsigned int", - .complex_long => "_Complex long", - .complex_slong => "_Complex signed long", - .complex_ulong => "_Complex unsigned long", - .complex_long_int => "_Complex long int", - .complex_slong_int => "_Complex signed long int", - .complex_ulong_int => "_Complex unsigned long int", - .complex_long_long => "_Complex long long", - .complex_slong_long => "_Complex signed long long", - .complex_ulong_long => "_Complex unsigned long long", - .complex_long_long_int => "_Complex long long int", - .complex_slong_long_int => "_Complex signed long long int", - .complex_ulong_long_int => "_Complex unsigned long long int", - .complex_int128 => "_Complex __int128", - .complex_sint128 => "_Complex signed __int128", - .complex_uint128 => "_Complex unsigned __int128", - - .fp16 => "__fp16", - .float16 => "_Float16", - .float => "float", - .double => "double", - .long_double => "long double", - .float128 => "__float128", - .complex => "_Complex", - .complex_float16 => "_Complex _Float16", - .complex_float => "_Complex float", - .complex_double => "_Complex double", - .complex_long_double => "_Complex long double", - .complex_float128 => "_Complex __float128", - - .attributed => |attributed| Builder.fromType(attributed.base).str(langopts), - - else => null, - }; - } - }; - - pub fn finish(b: Builder, p: *Parser) Parser.Error!Type { - var ty: Type = .{ .specifier = undefined }; - if (b.typedef) |typedef| { - ty = typedef.ty; - if (ty.isArray()) { - var elem = ty.elemType(); - try b.qual.finish(p, &elem); - // TODO this really should be easier - switch (ty.specifier) { - .array, .static_array, .incomplete_array => { - const old = ty.data.array; - ty.data.array = try p.arena.create(Array); - ty.data.array.* = .{ - .len = old.len, - .elem = elem, - }; - }, - .variable_len_array, .unspecified_variable_len_array => { - const old = ty.data.expr; - ty.data.expr = try p.arena.create(Expr); - ty.data.expr.* = .{ - .node = old.node, - .ty = elem, - }; - }, - .typeof_type => {}, // TODO handle - .typeof_expr => {}, // TODO handle - .attributed => {}, // TODO handle - else => unreachable, - } - - return ty; - } - try b.qual.finish(p, &ty); - return ty; - } - switch (b.specifier) { - .none => { - if (b.typeof) |typeof| { - ty = typeof; - } else { - ty.specifier = .int; - if (p.comp.langopts.standard.atLeast(.c23)) { - try p.err(.missing_type_specifier_c23); - } else { - try p.err(.missing_type_specifier); - } - } - }, - .void => ty.specifier = .void, - .auto_type => ty.specifier = .auto_type, - .c23_auto => ty.specifier = .c23_auto, - .nullptr_t => unreachable, // nullptr_t can only be accessed via typeof(nullptr) - .bool => ty.specifier = .bool, - .char => ty.specifier = .char, - .schar => ty.specifier = .schar, - .uchar => ty.specifier = .uchar, - .complex_char => ty.specifier = .complex_char, - .complex_schar => ty.specifier = .complex_schar, - .complex_uchar => ty.specifier = .complex_uchar, - - .unsigned => ty.specifier = .uint, - .signed => ty.specifier = .int, - .short_int, .sshort_int, .short, .sshort => ty.specifier = .short, - .ushort, .ushort_int => ty.specifier = .ushort, - .int, .sint => ty.specifier = .int, - .uint => ty.specifier = .uint, - .long, .slong, .long_int, .slong_int => ty.specifier = .long, - .ulong, .ulong_int => ty.specifier = .ulong, - .long_long, .slong_long, .long_long_int, .slong_long_int => ty.specifier = .long_long, - .ulong_long, .ulong_long_int => ty.specifier = .ulong_long, - .int128, .sint128 => ty.specifier = .int128, - .uint128 => ty.specifier = .uint128, - .complex_unsigned => ty.specifier = .complex_uint, - .complex_signed => ty.specifier = .complex_int, - .complex_short_int, .complex_sshort_int, .complex_short, .complex_sshort => ty.specifier = .complex_short, - .complex_ushort, .complex_ushort_int => ty.specifier = .complex_ushort, - .complex_int, .complex_sint => ty.specifier = .complex_int, - .complex_uint => ty.specifier = .complex_uint, - .complex_long, .complex_slong, .complex_long_int, .complex_slong_int => ty.specifier = .complex_long, - .complex_ulong, .complex_ulong_int => ty.specifier = .complex_ulong, - .complex_long_long, .complex_slong_long, .complex_long_long_int, .complex_slong_long_int => ty.specifier = .complex_long_long, - .complex_ulong_long, .complex_ulong_long_int => ty.specifier = .complex_ulong_long, - .complex_int128, .complex_sint128 => ty.specifier = .complex_int128, - .complex_uint128 => ty.specifier = .complex_uint128, - .bit_int, .sbit_int, .ubit_int, .complex_bit_int, .complex_ubit_int, .complex_sbit_int => |bits| { - const unsigned = b.specifier == .ubit_int or b.specifier == .complex_ubit_int; - const complex_str = if (b.complex_tok != null) "_Complex " else ""; - if (unsigned) { - if (bits < 1) { - try p.errStr(.unsigned_bit_int_too_small, b.bit_int_tok.?, complex_str); - return Type.invalid; - } - } else { - if (bits < 2) { - try p.errStr(.signed_bit_int_too_small, b.bit_int_tok.?, complex_str); - return Type.invalid; - } - } - if (bits > Compilation.bit_int_max_bits) { - try p.errStr(if (unsigned) .unsigned_bit_int_too_big else .signed_bit_int_too_big, b.bit_int_tok.?, complex_str); - return Type.invalid; - } - ty.specifier = if (b.complex_tok != null) .complex_bit_int else .bit_int; - ty.data = .{ .int = .{ - .signedness = if (unsigned) .unsigned else .signed, - .bits = @intCast(bits), - } }; - }, - - .fp16 => ty.specifier = .fp16, - .float16 => ty.specifier = .float16, - .float => ty.specifier = .float, - .double => ty.specifier = .double, - .long_double => ty.specifier = .long_double, - .float128 => ty.specifier = .float128, - .complex_float16 => ty.specifier = .complex_float16, - .complex_float => ty.specifier = .complex_float, - .complex_double => ty.specifier = .complex_double, - .complex_long_double => ty.specifier = .complex_long_double, - .complex_float128 => ty.specifier = .complex_float128, - .complex => { - try p.errTok(.plain_complex, p.tok_i - 1); - ty.specifier = .complex_double; - }, - - .pointer => |data| { - ty.specifier = .pointer; - ty.data = .{ .sub_type = data }; - }, - .unspecified_variable_len_array, .decayed_unspecified_variable_len_array => |data| { - ty.specifier = .unspecified_variable_len_array; - ty.data = .{ .sub_type = data }; - ty.decayed = b.specifier == .decayed_unspecified_variable_len_array; - }, - .func => |data| { - ty.specifier = .func; - ty.data = .{ .func = data }; - }, - .var_args_func => |data| { - ty.specifier = .var_args_func; - ty.data = .{ .func = data }; - }, - .old_style_func => |data| { - ty.specifier = .old_style_func; - ty.data = .{ .func = data }; - }, - .array, .decayed_array => |data| { - ty.specifier = .array; - ty.data = .{ .array = data }; - ty.decayed = b.specifier == .decayed_array; - }, - .static_array, .decayed_static_array => |data| { - ty.specifier = .static_array; - ty.data = .{ .array = data }; - ty.decayed = b.specifier == .decayed_static_array; - }, - .incomplete_array, .decayed_incomplete_array => |data| { - ty.specifier = .incomplete_array; - ty.data = .{ .array = data }; - ty.decayed = b.specifier == .decayed_incomplete_array; - }, - .vector => |data| { - ty.specifier = .vector; - ty.data = .{ .array = data }; - }, - .variable_len_array, .decayed_variable_len_array => |data| { - ty.specifier = .variable_len_array; - ty.data = .{ .expr = data }; - ty.decayed = b.specifier == .decayed_variable_len_array; - }, - .@"struct" => |data| { - ty.specifier = .@"struct"; - ty.data = .{ .record = data }; - }, - .@"union" => |data| { - ty.specifier = .@"union"; - ty.data = .{ .record = data }; - }, - .@"enum" => |data| { - ty.specifier = .@"enum"; - ty.data = .{ .@"enum" = data }; - }, - .typeof_type, .decayed_typeof_type => |data| { - ty.specifier = .typeof_type; - ty.data = .{ .sub_type = data }; - ty.decayed = b.specifier == .decayed_typeof_type; - }, - .typeof_expr, .decayed_typeof_expr => |data| { - ty.specifier = .typeof_expr; - ty.data = .{ .expr = data }; - ty.decayed = b.specifier == .decayed_typeof_expr; - }, - .attributed, .decayed_attributed => |data| { - ty.specifier = .attributed; - ty.data = .{ .attributed = data }; - ty.decayed = b.specifier == .decayed_attributed; - }, - } - if (!ty.isReal() and ty.isInt()) { - if (b.complex_tok) |tok| try p.errTok(.complex_int, tok); - } - try b.qual.finish(p, &ty); - return ty; - } - - fn cannotCombine(b: Builder, p: *Parser, source_tok: TokenIndex) !void { - if (b.error_on_invalid) return error.CannotCombine; - const ty_str = b.specifier.str(p.comp.langopts) orelse try p.typeStr(try b.finish(p)); - try p.errExtra(.cannot_combine_spec, source_tok, .{ .str = ty_str }); - if (b.typedef) |some| try p.errStr(.spec_from_typedef, some.tok, try p.typeStr(some.ty)); - } - - fn duplicateSpec(b: *Builder, p: *Parser, source_tok: TokenIndex, spec: []const u8) !void { - if (b.error_on_invalid) return error.CannotCombine; - if (p.comp.langopts.emulate != .clang) return b.cannotCombine(p, source_tok); - try p.errStr(.duplicate_decl_spec, p.tok_i, spec); - } - - pub fn combineFromTypeof(b: *Builder, p: *Parser, new: Type, source_tok: TokenIndex) Compilation.Error!void { - if (b.typeof != null) return p.errStr(.cannot_combine_spec, source_tok, "typeof"); - if (b.specifier != .none) return p.errStr(.invalid_typeof, source_tok, @tagName(b.specifier)); - const inner = switch (new.specifier) { - .typeof_type => new.data.sub_type.*, - .typeof_expr => new.data.expr.ty, - .nullptr_t => new, // typeof(nullptr) is special-cased to be an unwrapped typeof-expr - else => unreachable, - }; - - b.typeof = switch (inner.specifier) { - .attributed => inner.data.attributed.base, - else => new, - }; - } - - /// Try to combine type from typedef, returns true if successful. - pub fn combineTypedef(b: *Builder, p: *Parser, typedef_ty: Type, name_tok: TokenIndex) bool { - if (typedef_ty.is(.invalid)) return false; - b.error_on_invalid = true; - defer b.error_on_invalid = false; - - const new_spec = fromType(typedef_ty); - b.combineExtra(p, new_spec, 0) catch |err| switch (err) { - error.FatalError => unreachable, // we do not add any diagnostics - error.OutOfMemory => unreachable, // we do not add any diagnostics - error.ParsingFailed => unreachable, // we do not add any diagnostics - error.CannotCombine => return false, - }; - b.typedef = .{ .tok = name_tok, .ty = typedef_ty }; - return true; - } - - pub fn combine(b: *Builder, p: *Parser, new: Builder.Specifier, source_tok: TokenIndex) !void { - b.combineExtra(p, new, source_tok) catch |err| switch (err) { - error.CannotCombine => unreachable, - else => |e| return e, - }; - } - - fn combineExtra(b: *Builder, p: *Parser, new: Builder.Specifier, source_tok: TokenIndex) !void { - if (b.typeof != null) { - if (b.error_on_invalid) return error.CannotCombine; - try p.errStr(.invalid_typeof, source_tok, @tagName(new)); - } - - switch (new) { - .complex => b.complex_tok = source_tok, - .bit_int => b.bit_int_tok = source_tok, - .auto_type => b.auto_type_tok = source_tok, - else => {}, - } - - if (new == .int128 and !target_util.hasInt128(p.comp.target)) { - try p.errStr(.type_not_supported_on_target, source_tok, "__int128"); - } - - switch (new) { - else => switch (b.specifier) { - .none => b.specifier = new, - else => return b.cannotCombine(p, source_tok), - }, - .signed => b.specifier = switch (b.specifier) { - .none => .signed, - .char => .schar, - .short => .sshort, - .short_int => .sshort_int, - .int => .sint, - .long => .slong, - .long_int => .slong_int, - .long_long => .slong_long, - .long_long_int => .slong_long_int, - .int128 => .sint128, - .bit_int => |bits| .{ .sbit_int = bits }, - .complex => .complex_signed, - .complex_char => .complex_schar, - .complex_short => .complex_sshort, - .complex_short_int => .complex_sshort_int, - .complex_int => .complex_sint, - .complex_long => .complex_slong, - .complex_long_int => .complex_slong_int, - .complex_long_long => .complex_slong_long, - .complex_long_long_int => .complex_slong_long_int, - .complex_int128 => .complex_sint128, - .complex_bit_int => |bits| .{ .complex_sbit_int = bits }, - .signed, - .sshort, - .sshort_int, - .sint, - .slong, - .slong_int, - .slong_long, - .slong_long_int, - .sint128, - .sbit_int, - .complex_schar, - .complex_signed, - .complex_sshort, - .complex_sshort_int, - .complex_sint, - .complex_slong, - .complex_slong_int, - .complex_slong_long, - .complex_slong_long_int, - .complex_sint128, - .complex_sbit_int, - => return b.duplicateSpec(p, source_tok, "signed"), - else => return b.cannotCombine(p, source_tok), - }, - .unsigned => b.specifier = switch (b.specifier) { - .none => .unsigned, - .char => .uchar, - .short => .ushort, - .short_int => .ushort_int, - .int => .uint, - .long => .ulong, - .long_int => .ulong_int, - .long_long => .ulong_long, - .long_long_int => .ulong_long_int, - .int128 => .uint128, - .bit_int => |bits| .{ .ubit_int = bits }, - .complex => .complex_unsigned, - .complex_char => .complex_uchar, - .complex_short => .complex_ushort, - .complex_short_int => .complex_ushort_int, - .complex_int => .complex_uint, - .complex_long => .complex_ulong, - .complex_long_int => .complex_ulong_int, - .complex_long_long => .complex_ulong_long, - .complex_long_long_int => .complex_ulong_long_int, - .complex_int128 => .complex_uint128, - .complex_bit_int => |bits| .{ .complex_ubit_int = bits }, - .unsigned, - .ushort, - .ushort_int, - .uint, - .ulong, - .ulong_int, - .ulong_long, - .ulong_long_int, - .uint128, - .ubit_int, - .complex_uchar, - .complex_unsigned, - .complex_ushort, - .complex_ushort_int, - .complex_uint, - .complex_ulong, - .complex_ulong_int, - .complex_ulong_long, - .complex_ulong_long_int, - .complex_uint128, - .complex_ubit_int, - => return b.duplicateSpec(p, source_tok, "unsigned"), - else => return b.cannotCombine(p, source_tok), - }, - .char => b.specifier = switch (b.specifier) { - .none => .char, - .unsigned => .uchar, - .signed => .schar, - .complex => .complex_char, - .complex_signed => .complex_schar, - .complex_unsigned => .complex_uchar, - else => return b.cannotCombine(p, source_tok), - }, - .short => b.specifier = switch (b.specifier) { - .none => .short, - .unsigned => .ushort, - .signed => .sshort, - .int => .short_int, - .sint => .sshort_int, - .uint => .ushort_int, - .complex => .complex_short, - .complex_signed => .complex_sshort, - .complex_unsigned => .complex_ushort, - else => return b.cannotCombine(p, source_tok), - }, - .int => b.specifier = switch (b.specifier) { - .none => .int, - .signed => .sint, - .unsigned => .uint, - .short => .short_int, - .sshort => .sshort_int, - .ushort => .ushort_int, - .long => .long_int, - .slong => .slong_int, - .ulong => .ulong_int, - .long_long => .long_long_int, - .slong_long => .slong_long_int, - .ulong_long => .ulong_long_int, - .complex => .complex_int, - .complex_signed => .complex_sint, - .complex_unsigned => .complex_uint, - .complex_short => .complex_short_int, - .complex_sshort => .complex_sshort_int, - .complex_ushort => .complex_ushort_int, - .complex_long => .complex_long_int, - .complex_slong => .complex_slong_int, - .complex_ulong => .complex_ulong_int, - .complex_long_long => .complex_long_long_int, - .complex_slong_long => .complex_slong_long_int, - .complex_ulong_long => .complex_ulong_long_int, - else => return b.cannotCombine(p, source_tok), - }, - .long => b.specifier = switch (b.specifier) { - .none => .long, - .double => .long_double, - .long => .long_long, - .unsigned => .ulong, - .signed => .long, - .int => .long_int, - .sint => .slong_int, - .ulong => .ulong_long, - .complex => .complex_long, - .complex_signed => .complex_slong, - .complex_unsigned => .complex_ulong, - .complex_long => .complex_long_long, - .complex_slong => .complex_slong_long, - .complex_ulong => .complex_ulong_long, - .complex_double => .complex_long_double, - else => return b.cannotCombine(p, source_tok), - }, - .int128 => b.specifier = switch (b.specifier) { - .none => .int128, - .unsigned => .uint128, - .signed => .sint128, - .complex => .complex_int128, - .complex_signed => .complex_sint128, - .complex_unsigned => .complex_uint128, - else => return b.cannotCombine(p, source_tok), - }, - .bit_int => b.specifier = switch (b.specifier) { - .none => .{ .bit_int = new.bit_int }, - .unsigned => .{ .ubit_int = new.bit_int }, - .signed => .{ .sbit_int = new.bit_int }, - .complex => .{ .complex_bit_int = new.bit_int }, - .complex_signed => .{ .complex_sbit_int = new.bit_int }, - .complex_unsigned => .{ .complex_ubit_int = new.bit_int }, - else => return b.cannotCombine(p, source_tok), - }, - .auto_type => b.specifier = switch (b.specifier) { - .none => .auto_type, - else => return b.cannotCombine(p, source_tok), - }, - .c23_auto => b.specifier = switch (b.specifier) { - .none => .c23_auto, - else => return b.cannotCombine(p, source_tok), - }, - .fp16 => b.specifier = switch (b.specifier) { - .none => .fp16, - else => return b.cannotCombine(p, source_tok), - }, - .float16 => b.specifier = switch (b.specifier) { - .none => .float16, - .complex => .complex_float16, - else => return b.cannotCombine(p, source_tok), - }, - .float => b.specifier = switch (b.specifier) { - .none => .float, - .complex => .complex_float, - else => return b.cannotCombine(p, source_tok), - }, - .double => b.specifier = switch (b.specifier) { - .none => .double, - .long => .long_double, - .complex_long => .complex_long_double, - .complex => .complex_double, - else => return b.cannotCombine(p, source_tok), - }, - .float128 => b.specifier = switch (b.specifier) { - .none => .float128, - .complex => .complex_float128, - else => return b.cannotCombine(p, source_tok), - }, - .complex => b.specifier = switch (b.specifier) { - .none => .complex, - .float16 => .complex_float16, - .float => .complex_float, - .double => .complex_double, - .long_double => .complex_long_double, - .float128 => .complex_float128, - .char => .complex_char, - .schar => .complex_schar, - .uchar => .complex_uchar, - .unsigned => .complex_unsigned, - .signed => .complex_signed, - .short => .complex_short, - .sshort => .complex_sshort, - .ushort => .complex_ushort, - .short_int => .complex_short_int, - .sshort_int => .complex_sshort_int, - .ushort_int => .complex_ushort_int, - .int => .complex_int, - .sint => .complex_sint, - .uint => .complex_uint, - .long => .complex_long, - .slong => .complex_slong, - .ulong => .complex_ulong, - .long_int => .complex_long_int, - .slong_int => .complex_slong_int, - .ulong_int => .complex_ulong_int, - .long_long => .complex_long_long, - .slong_long => .complex_slong_long, - .ulong_long => .complex_ulong_long, - .long_long_int => .complex_long_long_int, - .slong_long_int => .complex_slong_long_int, - .ulong_long_int => .complex_ulong_long_int, - .int128 => .complex_int128, - .sint128 => .complex_sint128, - .uint128 => .complex_uint128, - .bit_int => |bits| .{ .complex_bit_int = bits }, - .sbit_int => |bits| .{ .complex_sbit_int = bits }, - .ubit_int => |bits| .{ .complex_ubit_int = bits }, - .complex, - .complex_float, - .complex_double, - .complex_long_double, - .complex_float128, - .complex_char, - .complex_schar, - .complex_uchar, - .complex_unsigned, - .complex_signed, - .complex_short, - .complex_sshort, - .complex_ushort, - .complex_short_int, - .complex_sshort_int, - .complex_ushort_int, - .complex_int, - .complex_sint, - .complex_uint, - .complex_long, - .complex_slong, - .complex_ulong, - .complex_long_int, - .complex_slong_int, - .complex_ulong_int, - .complex_long_long, - .complex_slong_long, - .complex_ulong_long, - .complex_long_long_int, - .complex_slong_long_int, - .complex_ulong_long_int, - .complex_int128, - .complex_sint128, - .complex_uint128, - .complex_bit_int, - .complex_sbit_int, - .complex_ubit_int, - => return b.duplicateSpec(p, source_tok, "_Complex"), - else => return b.cannotCombine(p, source_tok), - }, - } - } - - pub fn fromType(ty: Type) Builder.Specifier { - return switch (ty.specifier) { - .void => .void, - .auto_type => .auto_type, - .c23_auto => .c23_auto, - .nullptr_t => .nullptr_t, - .bool => .bool, - .char => .char, - .schar => .schar, - .uchar => .uchar, - .short => .short, - .ushort => .ushort, - .int => .int, - .uint => .uint, - .long => .long, - .ulong => .ulong, - .long_long => .long_long, - .ulong_long => .ulong_long, - .int128 => .int128, - .uint128 => .uint128, - .bit_int => if (ty.data.int.signedness == .unsigned) { - return .{ .ubit_int = ty.data.int.bits }; - } else { - return .{ .bit_int = ty.data.int.bits }; - }, - .complex_char => .complex_char, - .complex_schar => .complex_schar, - .complex_uchar => .complex_uchar, - .complex_short => .complex_short, - .complex_ushort => .complex_ushort, - .complex_int => .complex_int, - .complex_uint => .complex_uint, - .complex_long => .complex_long, - .complex_ulong => .complex_ulong, - .complex_long_long => .complex_long_long, - .complex_ulong_long => .complex_ulong_long, - .complex_int128 => .complex_int128, - .complex_uint128 => .complex_uint128, - .complex_bit_int => if (ty.data.int.signedness == .unsigned) { - return .{ .complex_ubit_int = ty.data.int.bits }; - } else { - return .{ .complex_bit_int = ty.data.int.bits }; - }, - .fp16 => .fp16, - .float16 => .float16, - .float => .float, - .double => .double, - .float128 => .float128, - .long_double => .long_double, - .complex_float16 => .complex_float16, - .complex_float => .complex_float, - .complex_double => .complex_double, - .complex_long_double => .complex_long_double, - .complex_float128 => .complex_float128, - - .pointer => .{ .pointer = ty.data.sub_type }, - .unspecified_variable_len_array => if (ty.isDecayed()) - .{ .decayed_unspecified_variable_len_array = ty.data.sub_type } - else - .{ .unspecified_variable_len_array = ty.data.sub_type }, - .func => .{ .func = ty.data.func }, - .var_args_func => .{ .var_args_func = ty.data.func }, - .old_style_func => .{ .old_style_func = ty.data.func }, - .array => if (ty.isDecayed()) - .{ .decayed_array = ty.data.array } - else - .{ .array = ty.data.array }, - .static_array => if (ty.isDecayed()) - .{ .decayed_static_array = ty.data.array } - else - .{ .static_array = ty.data.array }, - .incomplete_array => if (ty.isDecayed()) - .{ .decayed_incomplete_array = ty.data.array } - else - .{ .incomplete_array = ty.data.array }, - .vector => .{ .vector = ty.data.array }, - .variable_len_array => if (ty.isDecayed()) - .{ .decayed_variable_len_array = ty.data.expr } - else - .{ .variable_len_array = ty.data.expr }, - .@"struct" => .{ .@"struct" = ty.data.record }, - .@"union" => .{ .@"union" = ty.data.record }, - .@"enum" => .{ .@"enum" = ty.data.@"enum" }, - - .typeof_type => if (ty.isDecayed()) - .{ .decayed_typeof_type = ty.data.sub_type } - else - .{ .typeof_type = ty.data.sub_type }, - .typeof_expr => if (ty.isDecayed()) - .{ .decayed_typeof_expr = ty.data.expr } - else - .{ .typeof_expr = ty.data.expr }, - - .attributed => if (ty.isDecayed()) - .{ .decayed_attributed = ty.data.attributed } - else - .{ .attributed = ty.data.attributed }, - else => unreachable, - }; - } -}; - -/// Use with caution -pub fn base(ty: *Type) *Type { - return switch (ty.specifier) { - .typeof_type => ty.data.sub_type.base(), - .typeof_expr => ty.data.expr.ty.base(), - .attributed => ty.data.attributed.base.base(), - else => ty, - }; -} - -pub fn getAttribute(ty: Type, comptime tag: Attribute.Tag) ?Attribute.ArgumentsForTag(tag) { - if (tag == .aligned) @compileError("use requestedAlignment"); - var it = Attribute.Iterator.initType(ty); - while (it.next()) |item| { - const attribute, _ = item; - if (attribute.tag == tag) return @field(attribute.args, @tagName(tag)); - } - return null; -} - -pub fn hasAttribute(ty: Type, tag: Attribute.Tag) bool { - var it = Attribute.Iterator.initType(ty); - while (it.next()) |item| { - const attr, _ = item; - if (attr.tag == tag) return true; - } - return false; -} - -/// printf format modifier -pub fn formatModifier(ty: Type) []const u8 { - return switch (ty.specifier) { - .schar, .uchar => "hh", - .short, .ushort => "h", - .int, .uint => "", - .long, .ulong => "l", - .long_long, .ulong_long => "ll", - else => unreachable, - }; -} - -/// Suffix for integer values of this type -pub fn intValueSuffix(ty: Type, comp: *const Compilation) []const u8 { - return switch (ty.specifier) { - .schar, .short, .int => "", - .long => "L", - .long_long => "LL", - .uchar, .char => { - if (ty.specifier == .char and comp.getCharSignedness() == .signed) return ""; - // Only 8-bit char supported currently; - // TODO: handle platforms with 16-bit int + 16-bit char - std.debug.assert(ty.sizeof(comp).? == 1); - return ""; - }, - .ushort => { - if (ty.sizeof(comp).? < int.sizeof(comp).?) { - return ""; - } - return "U"; - }, - .uint => "U", - .ulong => "UL", - .ulong_long => "ULL", - else => unreachable, // not integer - }; -} - -/// Print type in C style -pub fn print(ty: Type, mapper: StringInterner.TypeMapper, langopts: LangOpts, w: anytype) @TypeOf(w).Error!void { - _ = try ty.printPrologue(mapper, langopts, w); - try ty.printEpilogue(mapper, langopts, w); -} - -pub fn printNamed(ty: Type, name: []const u8, mapper: StringInterner.TypeMapper, langopts: LangOpts, w: anytype) @TypeOf(w).Error!void { - const simple = try ty.printPrologue(mapper, langopts, w); - if (simple) try w.writeByte(' '); - try w.writeAll(name); - try ty.printEpilogue(mapper, langopts, w); -} - -const StringGetter = fn (TokenIndex) []const u8; - -/// return true if `ty` is simple -fn printPrologue(ty: Type, mapper: StringInterner.TypeMapper, langopts: LangOpts, w: anytype) @TypeOf(w).Error!bool { - if (ty.qual.atomic) { - var non_atomic_ty = ty; - non_atomic_ty.qual.atomic = false; - try w.writeAll("_Atomic("); - try non_atomic_ty.print(mapper, langopts, w); - try w.writeAll(")"); - return true; - } - if (ty.isPtr()) { - const elem_ty = ty.elemType(); - const simple = try elem_ty.printPrologue(mapper, langopts, w); - if (simple) try w.writeByte(' '); - if (elem_ty.isFunc() or elem_ty.isArray()) try w.writeByte('('); - try w.writeByte('*'); - try ty.qual.dump(w); - return false; - } - switch (ty.specifier) { - .pointer => unreachable, - .func, .var_args_func, .old_style_func => { - const ret_ty = ty.data.func.return_type; - const simple = try ret_ty.printPrologue(mapper, langopts, w); - if (simple) try w.writeByte(' '); - return false; - }, - .array, .static_array, .incomplete_array, .unspecified_variable_len_array, .variable_len_array => { - const elem_ty = ty.elemType(); - const simple = try elem_ty.printPrologue(mapper, langopts, w); - if (simple) try w.writeByte(' '); - return false; - }, - .typeof_type, .typeof_expr => { - const actual = ty.canonicalize(.standard); - return actual.printPrologue(mapper, langopts, w); - }, - .attributed => { - const actual = ty.canonicalize(.standard); - return actual.printPrologue(mapper, langopts, w); - }, - else => {}, - } - try ty.qual.dump(w); - - switch (ty.specifier) { - .@"enum" => if (ty.data.@"enum".fixed) { - try w.print("enum {s}: ", .{mapper.lookup(ty.data.@"enum".name)}); - try ty.data.@"enum".tag_ty.dump(mapper, langopts, w); - } else { - try w.print("enum {s}", .{mapper.lookup(ty.data.@"enum".name)}); - }, - .@"struct" => try w.print("struct {s}", .{mapper.lookup(ty.data.record.name)}), - .@"union" => try w.print("union {s}", .{mapper.lookup(ty.data.record.name)}), - .vector => { - const len = ty.data.array.len; - const elem_ty = ty.data.array.elem; - try w.print("__attribute__((__vector_size__({d} * sizeof(", .{len}); - _ = try elem_ty.printPrologue(mapper, langopts, w); - try w.writeAll(")))) "); - _ = try elem_ty.printPrologue(mapper, langopts, w); - try w.print(" (vector of {d} '", .{len}); - _ = try elem_ty.printPrologue(mapper, langopts, w); - try w.writeAll("' values)"); - }, - .bit_int => try w.print("{s} _BitInt({d})", .{ @tagName(ty.data.int.signedness), ty.data.int.bits }), - .complex_bit_int => try w.print("_Complex {s} _BitInt({d})", .{ @tagName(ty.data.int.signedness), ty.data.int.bits }), - else => try w.writeAll(Builder.fromType(ty).str(langopts).?), - } - return true; -} - -fn printEpilogue(ty: Type, mapper: StringInterner.TypeMapper, langopts: LangOpts, w: anytype) @TypeOf(w).Error!void { - if (ty.qual.atomic) return; - if (ty.isPtr()) { - const elem_ty = ty.elemType(); - if (elem_ty.isFunc() or elem_ty.isArray()) try w.writeByte(')'); - try elem_ty.printEpilogue(mapper, langopts, w); - return; - } - switch (ty.specifier) { - .pointer => unreachable, // handled above - .func, .var_args_func, .old_style_func => { - try w.writeByte('('); - for (ty.data.func.params, 0..) |param, i| { - if (i != 0) try w.writeAll(", "); - _ = try param.ty.printPrologue(mapper, langopts, w); - try param.ty.printEpilogue(mapper, langopts, w); - } - if (ty.specifier != .func) { - if (ty.data.func.params.len != 0) try w.writeAll(", "); - try w.writeAll("..."); - } else if (ty.data.func.params.len == 0) { - try w.writeAll("void"); - } - try w.writeByte(')'); - try ty.data.func.return_type.printEpilogue(mapper, langopts, w); - }, - .array, .static_array => { - try w.writeByte('['); - if (ty.specifier == .static_array) try w.writeAll("static "); - try ty.qual.dump(w); - try w.print("{d}]", .{ty.data.array.len}); - try ty.data.array.elem.printEpilogue(mapper, langopts, w); - }, - .incomplete_array => { - try w.writeByte('['); - try ty.qual.dump(w); - try w.writeByte(']'); - try ty.data.array.elem.printEpilogue(mapper, langopts, w); - }, - .unspecified_variable_len_array => { - try w.writeByte('['); - try ty.qual.dump(w); - try w.writeAll("*]"); - try ty.data.sub_type.printEpilogue(mapper, langopts, w); - }, - .variable_len_array => { - try w.writeByte('['); - try ty.qual.dump(w); - try w.writeAll("]"); - try ty.data.expr.ty.printEpilogue(mapper, langopts, w); - }, - .typeof_type, .typeof_expr => { - const actual = ty.canonicalize(.standard); - try actual.printEpilogue(mapper, langopts, w); - }, - .attributed => { - const actual = ty.canonicalize(.standard); - try actual.printEpilogue(mapper, langopts, w); - }, - else => {}, - } -} - -/// Useful for debugging, too noisy to be enabled by default. -const dump_detailed_containers = false; - -// Print as Zig types since those are actually readable -pub fn dump(ty: Type, mapper: StringInterner.TypeMapper, langopts: LangOpts, w: anytype) @TypeOf(w).Error!void { - try ty.qual.dump(w); - switch (ty.specifier) { - .invalid => try w.writeAll("invalid"), - .pointer => { - try w.writeAll("*"); - try ty.data.sub_type.dump(mapper, langopts, w); - }, - .func, .var_args_func, .old_style_func => { - if (ty.specifier == .old_style_func) - try w.writeAll("kr (") - else - try w.writeAll("fn ("); - for (ty.data.func.params, 0..) |param, i| { - if (i != 0) try w.writeAll(", "); - if (param.name != .empty) try w.print("{s}: ", .{mapper.lookup(param.name)}); - try param.ty.dump(mapper, langopts, w); - } - if (ty.specifier != .func) { - if (ty.data.func.params.len != 0) try w.writeAll(", "); - try w.writeAll("..."); - } - try w.writeAll(") "); - try ty.data.func.return_type.dump(mapper, langopts, w); - }, - .array, .static_array => { - if (ty.isDecayed()) try w.writeAll("*d"); - try w.writeByte('['); - if (ty.specifier == .static_array) try w.writeAll("static "); - try w.print("{d}]", .{ty.data.array.len}); - try ty.data.array.elem.dump(mapper, langopts, w); - }, - .vector => { - try w.print("vector({d}, ", .{ty.data.array.len}); - try ty.data.array.elem.dump(mapper, langopts, w); - try w.writeAll(")"); - }, - .incomplete_array => { - if (ty.isDecayed()) try w.writeAll("*d"); - try w.writeAll("[]"); - try ty.data.array.elem.dump(mapper, langopts, w); - }, - .@"enum" => { - const enum_ty = ty.data.@"enum"; - if (enum_ty.isIncomplete() and !enum_ty.fixed) { - try w.print("enum {s}", .{mapper.lookup(enum_ty.name)}); - } else { - try w.print("enum {s}: ", .{mapper.lookup(enum_ty.name)}); - try enum_ty.tag_ty.dump(mapper, langopts, w); - } - if (dump_detailed_containers) try dumpEnum(enum_ty, mapper, w); - }, - .@"struct" => { - try w.print("struct {s}", .{mapper.lookup(ty.data.record.name)}); - if (dump_detailed_containers) try dumpRecord(ty.data.record, mapper, langopts, w); - }, - .@"union" => { - try w.print("union {s}", .{mapper.lookup(ty.data.record.name)}); - if (dump_detailed_containers) try dumpRecord(ty.data.record, mapper, langopts, w); - }, - .unspecified_variable_len_array => { - if (ty.isDecayed()) try w.writeAll("*d"); - try w.writeAll("[*]"); - try ty.data.sub_type.dump(mapper, langopts, w); - }, - .variable_len_array => { - if (ty.isDecayed()) try w.writeAll("*d"); - try w.writeAll("[]"); - try ty.data.expr.ty.dump(mapper, langopts, w); - }, - .typeof_type => { - try w.writeAll("typeof("); - try ty.data.sub_type.dump(mapper, langopts, w); - try w.writeAll(")"); - }, - .typeof_expr => { - try w.writeAll("typeof(: "); - try ty.data.expr.ty.dump(mapper, langopts, w); - try w.writeAll(")"); - }, - .attributed => { - if (ty.isDecayed()) try w.writeAll("*d:"); - try w.writeAll("attributed("); - try ty.data.attributed.base.canonicalize(.standard).dump(mapper, langopts, w); - try w.writeAll(")"); - }, - .bit_int => try w.print("{s} _BitInt({d})", .{ @tagName(ty.data.int.signedness), ty.data.int.bits }), - .complex_bit_int => try w.print("_Complex {s} _BitInt({d})", .{ @tagName(ty.data.int.signedness), ty.data.int.bits }), - else => try w.writeAll(Builder.fromType(ty).str(langopts).?), - } -} - -fn dumpEnum(@"enum": *Enum, mapper: StringInterner.TypeMapper, w: anytype) @TypeOf(w).Error!void { - try w.writeAll(" {"); - for (@"enum".fields) |field| { - try w.print(" {s} = {d},", .{ mapper.lookup(field.name), field.value }); - } - try w.writeAll(" }"); -} - -fn dumpRecord(record: *Record, mapper: StringInterner.TypeMapper, langopts: LangOpts, w: anytype) @TypeOf(w).Error!void { - try w.writeAll(" {"); - for (record.fields) |field| { - try w.writeByte(' '); - try field.ty.dump(mapper, langopts, w); - try w.print(" {s}: {d};", .{ mapper.lookup(field.name), field.bit_width }); - } - try w.writeAll(" }"); -} diff --git a/lib/compiler/aro/aro/TypeStore.zig b/lib/compiler/aro/aro/TypeStore.zig new file mode 100644 index 000000000000..8d18603fbd26 --- /dev/null +++ b/lib/compiler/aro/aro/TypeStore.zig @@ -0,0 +1,3008 @@ +pub const std = @import("std"); + +const Attribute = @import("Attribute.zig"); +const Compilation = @import("Compilation.zig"); +const LangOpts = @import("LangOpts.zig"); +const record_layout = @import("record_layout.zig"); +const Parser = @import("Parser.zig"); +const StringInterner = @import("StringInterner.zig"); +const StringId = StringInterner.StringId; +const target_util = @import("target.zig"); +const Tree = @import("Tree.zig"); +const Node = Tree.Node; +const TokenIndex = Tree.TokenIndex; + +const Repr = struct { + tag: Tag, + /// If a Type has a child type it is stored in data[0]. + data: [2]u32, + + pub const Tag = enum(u8) { + complex, + bit_int, + atomic, + func, + func_variadic, + func_old_style, + func_zero, + func_variadic_zero, + func_old_style_zero, + func_one, + func_variadic_one, + func_old_style_one, + pointer, + pointer_decayed, + array_incomplete, + array_fixed, + array_static, + array_variable, + array_unspecified_variable, + vector, + @"struct", + struct_incomplete, + @"union", + union_incomplete, + @"enum", + enum_fixed, + enum_incomplete, + enum_incomplete_fixed, + typeof, + typeof_expr, + typedef, + attributed, + attributed_one, + }; +}; + +const Index = enum(u29) { + /// A NaN-like poison value + /// Can only be nested in function types. + invalid = std.math.maxInt(u29) - 0, + /// GNU auto type + /// This is a placeholder specifier - it must be replaced by the actual type specifier (determined by the initializer) + /// Must *NOT* be nested. + auto_type = std.math.maxInt(u29) - 1, + /// C23 auto, behaves like auto_type + /// Must *NOT* be nested. + c23_auto = std.math.maxInt(u29) - 2, + void = std.math.maxInt(u29) - 3, + bool = std.math.maxInt(u29) - 4, + nullptr_t = std.math.maxInt(u29) - 5, + int_char = std.math.maxInt(u29) - 6, + int_schar = std.math.maxInt(u29) - 7, + int_uchar = std.math.maxInt(u29) - 8, + int_short = std.math.maxInt(u29) - 9, + int_ushort = std.math.maxInt(u29) - 10, + int_int = std.math.maxInt(u29) - 11, + int_uint = std.math.maxInt(u29) - 12, + int_long = std.math.maxInt(u29) - 13, + int_ulong = std.math.maxInt(u29) - 14, + int_long_long = std.math.maxInt(u29) - 15, + int_ulong_long = std.math.maxInt(u29) - 16, + int_int128 = std.math.maxInt(u29) - 17, + int_uint128 = std.math.maxInt(u29) - 18, + float_fp16 = std.math.maxInt(u29) - 19, + float_float16 = std.math.maxInt(u29) - 20, + float_float = std.math.maxInt(u29) - 21, + float_double = std.math.maxInt(u29) - 22, + float_long_double = std.math.maxInt(u29) - 23, + float_float128 = std.math.maxInt(u29) - 24, + void_pointer = std.math.maxInt(u29) - 25, + char_pointer = std.math.maxInt(u29) - 26, + int_pointer = std.math.maxInt(u29) - 27, + /// Special type used when combining declarators. + declarator_combine = std.math.maxInt(u29) - 28, + _, +}; + +const TypeStore = @This(); + +pub const QualType = packed struct(u32) { + @"const": bool = false, + @"volatile": bool = false, + restrict: bool = false, + + _index: Index, + + pub const invalid: QualType = .{ ._index = .invalid }; + pub const auto_type: QualType = .{ ._index = .auto_type }; + pub const c23_auto: QualType = .{ ._index = .c23_auto }; + pub const @"void": QualType = .{ ._index = .void }; + pub const @"bool": QualType = .{ ._index = .bool }; + pub const nullptr_t: QualType = .{ ._index = .nullptr_t }; + pub const char: QualType = .{ ._index = .int_char }; + pub const schar: QualType = .{ ._index = .int_schar }; + pub const uchar: QualType = .{ ._index = .int_uchar }; + pub const short: QualType = .{ ._index = .int_short }; + pub const ushort: QualType = .{ ._index = .int_ushort }; + pub const int: QualType = .{ ._index = .int_int }; + pub const uint: QualType = .{ ._index = .int_uint }; + pub const long: QualType = .{ ._index = .int_long }; + pub const ulong: QualType = .{ ._index = .int_ulong }; + pub const long_long: QualType = .{ ._index = .int_long_long }; + pub const ulong_long: QualType = .{ ._index = .int_ulong_long }; + pub const int128: QualType = .{ ._index = .int_int128 }; + pub const uint128: QualType = .{ ._index = .int_uint128 }; + pub const fp16: QualType = .{ ._index = .float_fp16 }; + pub const float16: QualType = .{ ._index = .float_float16 }; + pub const float: QualType = .{ ._index = .float_float }; + pub const double: QualType = .{ ._index = .float_double }; + pub const long_double: QualType = .{ ._index = .float_long_double }; + pub const float128: QualType = .{ ._index = .float_float128 }; + pub const void_pointer: QualType = .{ ._index = .void_pointer }; + pub const char_pointer: QualType = .{ ._index = .char_pointer }; + pub const int_pointer: QualType = .{ ._index = .int_pointer }; + + pub fn isInvalid(qt: QualType) bool { + return qt._index == .invalid; + } + + pub fn isAutoType(qt: QualType) bool { + return qt._index == .auto_type; + } + + pub fn isC23Auto(qt: QualType) bool { + return qt._index == .c23_auto; + } + + pub fn isQualified(qt: QualType) bool { + return qt.@"const" or qt.@"volatile" or qt.restrict; + } + + pub fn unqualified(qt: QualType) QualType { + return .{ ._index = qt._index }; + } + + pub fn withQualifiers(target: QualType, quals_from: QualType) QualType { + return .{ + ._index = target._index, + .@"const" = quals_from.@"const", + .@"volatile" = quals_from.@"volatile", + .restrict = quals_from.restrict, + }; + } + + pub fn @"type"(qt: QualType, comp: *const Compilation) Type { + switch (qt._index) { + .invalid => unreachable, + .auto_type => unreachable, + .c23_auto => unreachable, + .declarator_combine => unreachable, + .void => return .void, + .bool => return .bool, + .nullptr_t => return .nullptr_t, + .int_char => return .{ .int = .char }, + .int_schar => return .{ .int = .schar }, + .int_uchar => return .{ .int = .uchar }, + .int_short => return .{ .int = .short }, + .int_ushort => return .{ .int = .ushort }, + .int_int => return .{ .int = .int }, + .int_uint => return .{ .int = .uint }, + .int_long => return .{ .int = .long }, + .int_ulong => return .{ .int = .ulong }, + .int_long_long => return .{ .int = .long_long }, + .int_ulong_long => return .{ .int = .ulong_long }, + .int_int128 => return .{ .int = .int128 }, + .int_uint128 => return .{ .int = .uint128 }, + .float_fp16 => return .{ .float = .fp16 }, + .float_float16 => return .{ .float = .float16 }, + .float_float => return .{ .float = .float }, + .float_double => return .{ .float = .double }, + .float_long_double => return .{ .float = .long_double }, + .float_float128 => return .{ .float = .float128 }, + .void_pointer => return .{ .pointer = .{ .child = .void, .decayed = null } }, + .char_pointer => return .{ .pointer = .{ .child = .char, .decayed = null } }, + .int_pointer => return .{ .pointer = .{ .child = .int, .decayed = null } }, + + else => {}, + } + + const repr = comp.type_store.types.get(@intFromEnum(qt._index)); + return switch (repr.tag) { + .complex => .{ .complex = @bitCast(repr.data[0]) }, + .atomic => .{ .atomic = @bitCast(repr.data[0]) }, + .bit_int => .{ .bit_int = .{ + .bits = @intCast(repr.data[0]), + .signedness = @enumFromInt(repr.data[1]), + } }, + .func_zero => .{ .func = .{ + .return_type = @bitCast(repr.data[0]), + .kind = .normal, + .params = &.{}, + } }, + .func_variadic_zero => .{ .func = .{ + .return_type = @bitCast(repr.data[0]), + .kind = .variadic, + .params = &.{}, + } }, + .func_old_style_zero => .{ .func = .{ + .return_type = @bitCast(repr.data[0]), + .kind = .old_style, + .params = &.{}, + } }, + .func_one, + .func_variadic_one, + .func_old_style_one, + .func, + .func_variadic, + .func_old_style, + => { + const param_size = 4; + comptime std.debug.assert(@sizeOf(Type.Func.Param) == @sizeOf(u32) * param_size); + + const extra = comp.type_store.extra.items; + const params_len = switch (repr.tag) { + .func_one, .func_variadic_one, .func_old_style_one => 1, + .func, .func_variadic, .func_old_style => extra[repr.data[1]], + else => unreachable, + }; + const extra_params = extra[repr.data[1] + @intFromBool(params_len > 1) ..][0 .. params_len * param_size]; + + return .{ .func = .{ + .return_type = @bitCast(repr.data[0]), + .kind = switch (repr.tag) { + .func_one, .func => .normal, + .func_variadic_one, .func_variadic => .variadic, + .func_old_style_one, .func_old_style => .old_style, + else => unreachable, + }, + .params = std.mem.bytesAsSlice(Type.Func.Param, std.mem.sliceAsBytes(extra_params)), + } }; + }, + .pointer => .{ .pointer = .{ + .child = @bitCast(repr.data[0]), + .decayed = null, + } }, + .pointer_decayed => .{ .pointer = .{ + .child = @bitCast(repr.data[0]), + .decayed = @bitCast(repr.data[1]), + } }, + .array_incomplete => .{ .array = .{ + .elem = @bitCast(repr.data[0]), + .len = .incomplete, + } }, + .array_fixed => .{ .array = .{ + .elem = @bitCast(repr.data[0]), + .len = .{ .fixed = @bitCast(comp.type_store.extra.items[repr.data[1]..][0..2].*) }, + } }, + .array_static => .{ .array = .{ + .elem = @bitCast(repr.data[0]), + .len = .{ .static = @bitCast(comp.type_store.extra.items[repr.data[1]..][0..2].*) }, + } }, + .array_variable => .{ .array = .{ + .elem = @bitCast(repr.data[0]), + .len = .{ .variable = @enumFromInt(repr.data[1]) }, + } }, + .array_unspecified_variable => .{ .array = .{ + .elem = @bitCast(repr.data[0]), + .len = .unspecified_variable, + } }, + .vector => .{ .vector = .{ + .elem = @bitCast(repr.data[0]), + .len = repr.data[1], + } }, + .@"struct", .@"union" => { + const layout_size = 5; + comptime std.debug.assert(@sizeOf(Type.Record.Layout) == @sizeOf(u32) * layout_size); + const field_size = 10; + comptime std.debug.assert(@sizeOf(Type.Record.Field) == @sizeOf(u32) * field_size); + + const extra = comp.type_store.extra.items; + const layout = @as(*Type.Record.Layout, @ptrCast(extra[repr.data[1] + 1 ..][0..layout_size])).*; + const fields_len = extra[repr.data[1] + layout_size + 1]; + const extra_fields = extra[repr.data[1] + layout_size + 2 ..][0 .. fields_len * field_size]; + + const record: Type.Record = .{ + .name = @enumFromInt(repr.data[0]), + .decl_node = @enumFromInt(extra[repr.data[1]]), + .layout = layout, + .fields = std.mem.bytesAsSlice(Type.Record.Field, std.mem.sliceAsBytes(extra_fields)), + }; + return switch (repr.tag) { + .@"struct" => .{ .@"struct" = record }, + .@"union" => .{ .@"union" = record }, + else => unreachable, + }; + }, + .struct_incomplete => .{ .@"struct" = .{ + .name = @enumFromInt(repr.data[0]), + .decl_node = @enumFromInt(repr.data[1]), + .layout = null, + .fields = &.{}, + } }, + .union_incomplete => .{ .@"union" = .{ + .name = @enumFromInt(repr.data[0]), + .decl_node = @enumFromInt(repr.data[1]), + .layout = null, + .fields = &.{}, + } }, + .@"enum", .enum_fixed => { + const extra = comp.type_store.extra.items; + const field_size = 3; + comptime std.debug.assert(@sizeOf(Type.Enum.Field) == @sizeOf(u32) * field_size); + + const fields_len = extra[repr.data[1] + 2]; + const extra_fields = extra[repr.data[1] + 3 ..][0 .. fields_len * field_size]; + + return .{ .@"enum" = .{ + .name = @enumFromInt(extra[repr.data[1]]), + .decl_node = @enumFromInt(extra[repr.data[1] + 1]), + .tag = @bitCast(repr.data[0]), + .incomplete = false, + .fixed = repr.tag == .enum_fixed, + .fields = std.mem.bytesAsSlice(Type.Enum.Field, std.mem.sliceAsBytes(extra_fields)), + } }; + }, + .enum_incomplete => .{ + .@"enum" = .{ + .tag = null, + .name = @enumFromInt(repr.data[0]), + .decl_node = @enumFromInt(repr.data[1]), + .incomplete = true, + .fixed = false, + .fields = &.{}, + }, + }, + .enum_incomplete_fixed => .{ + .@"enum" = .{ + .tag = @bitCast(repr.data[0]), + .name = @enumFromInt(comp.type_store.extra.items[repr.data[1]]), + .decl_node = @enumFromInt(comp.type_store.extra.items[repr.data[1] + 1]), + .incomplete = true, + .fixed = true, + .fields = &.{}, + }, + }, + .typeof => .{ .typeof = .{ + .base = @bitCast(repr.data[0]), + .expr = null, + } }, + .typeof_expr => .{ .typeof = .{ + .base = @bitCast(repr.data[0]), + .expr = @enumFromInt(repr.data[1]), + } }, + .typedef => .{ .typedef = .{ + .base = @bitCast(repr.data[0]), + .name = @enumFromInt(comp.type_store.extra.items[repr.data[1]]), + .decl_node = @enumFromInt(comp.type_store.extra.items[repr.data[1] + 1]), + } }, + .attributed => { + const extra = comp.type_store.extra.items; + return .{ .attributed = .{ + .base = @bitCast(repr.data[0]), + .attributes = comp.type_store.attributes.items[extra[repr.data[1]]..][0..extra[repr.data[1] + 1]], + } }; + }, + .attributed_one => .{ .attributed = .{ + .base = @bitCast(repr.data[0]), + .attributes = comp.type_store.attributes.items[repr.data[1]..][0..1], + } }, + }; + } + + pub fn base(qt: QualType, comp: *const Compilation) struct { type: Type, qt: QualType } { + var cur = qt; + while (true) switch (cur.type(comp)) { + .typeof => |typeof| cur = typeof.base, + .typedef => |typedef| cur = typedef.base, + .attributed => |attributed| cur = attributed.base, + else => |ty| return .{ .type = ty, .qt = cur }, + }; + } + + pub fn getRecord(qt: QualType, comp: *const Compilation) ?Type.Record { + return switch (qt.base(comp).type) { + .@"struct", .@"union" => |record| record, + else => null, + }; + } + + pub fn get(qt: QualType, comp: *const Compilation, comptime tag: std.meta.Tag(Type)) ?@FieldType(Type, @tagName(tag)) { + comptime std.debug.assert(tag != .typeof and tag != .attributed and tag != .typedef); + switch (qt._index) { + .invalid, .auto_type, .c23_auto => return null, + else => {}, + } + + const base_type = qt.base(comp).type; + if (base_type == tag) return @field(base_type, @tagName(tag)); + return null; + } + + pub fn is(qt: QualType, comp: *const Compilation, comptime tag: std.meta.Tag(Type)) bool { + return qt.get(comp, tag) != null; + } + + pub fn childType(qt: QualType, comp: *const Compilation) QualType { + if (qt.isInvalid()) return .invalid; + return switch (qt.base(comp).type) { + .complex => |complex| complex, + .pointer => |pointer| pointer.child, + .array => |array| array.elem, + .vector => |vector| vector.elem, + else => unreachable, + }; + } + + pub fn arrayLen(qt: QualType, comp: *Compilation) ?u64 { + const array_type = switch (qt.base(comp).type) { + .array => |array| array, + .pointer => |pointer| blk: { + const decayed = pointer.decayed orelse return null; + break :blk decayed.get(comp, .array) orelse return null; + }, + else => return null, + }; + switch (array_type.len) { + .fixed, .static => |len| return len, + else => return null, + } + } + + pub const TypeSizeOrder = enum { lt, gt, eq, indeterminate }; + + pub fn sizeCompare(a: QualType, b: QualType, comp: *const Compilation) TypeSizeOrder { + const a_size = a.sizeofOrNull(comp) orelse return .indeterminate; + const b_size = b.sizeofOrNull(comp) orelse return .indeterminate; + return switch (std.math.order(a_size, b_size)) { + .lt => .lt, + .gt => .gt, + .eq => .eq, + }; + } + + /// Size of a type as reported by the sizeof operator. + pub fn sizeof(qt: QualType, comp: *const Compilation) u64 { + return qt.sizeofOrNull(comp).?; + } + + /// Size of a type as reported by the sizeof operator. + /// Returns null for incomplete types. + pub fn sizeofOrNull(qt: QualType, comp: *const Compilation) ?u64 { + if (qt.isInvalid()) return null; + return loop: switch (qt.base(comp).type) { + .void => 1, + .bool => 1, + .func => 1, + .nullptr_t, .pointer => comp.target.ptrBitWidth() / 8, + .int => |int_ty| int_ty.bits(comp) / 8, + .float => |float_ty| float_ty.bits(comp) / 8, + .complex => |complex| complex.sizeofOrNull(comp), + .bit_int => |bit_int| { + return std.mem.alignForward(u64, (@as(u32, bit_int.bits) + 7) / 8, qt.alignof(comp)); + }, + .atomic => |atomic| atomic.sizeofOrNull(comp), + .vector => |vector| { + const elem_size = vector.elem.sizeofOrNull(comp) orelse return null; + return elem_size * vector.len; + }, + .array => |array| { + const len = switch (array.len) { + .variable, .unspecified_variable => return null, + .incomplete => { + return if (comp.langopts.emulate == .msvc) 0 else null; + }, + .fixed, .static => |len| len, + }; + const elem_size = array.elem.sizeofOrNull(comp) orelse return null; + const arr_size = elem_size * len; + if (comp.langopts.emulate == .msvc) { + // msvc ignores array type alignment. + // Since the size might not be a multiple of the field + // alignment, the address of the second element might not be properly aligned + // for the field alignment. A flexible array has size 0. See test case 0018. + return arr_size; + } else { + return std.mem.alignForward(u64, arr_size, qt.alignof(comp)); + } + }, + .@"struct", .@"union" => |record| { + const layout = record.layout orelse return null; + return layout.size_bits / 8; + }, + .@"enum" => |enum_ty| { + const tag = enum_ty.tag orelse return null; + continue :loop tag.base(comp).type; + }, + .typeof => unreachable, + .typedef => unreachable, + .attributed => unreachable, + }; + } + + /// Size of type in bits as it would have in a bitfield. + pub fn bitSizeof(qt: QualType, comp: *const Compilation) u64 { + return qt.bitSizeofOrNull(comp).?; + } + + /// Size of type in bits as it would have in a bitfield. + /// Returns null for incomplete types. + pub fn bitSizeofOrNull(qt: QualType, comp: *const Compilation) ?u64 { + if (qt.isInvalid()) return null; + return loop: switch (qt.base(comp).type) { + .bool => if (comp.langopts.emulate == .msvc) 8 else 1, + .bit_int => |bit_int| bit_int.bits, + .float => |float_ty| float_ty.bits(comp), + .int => |int_ty| int_ty.bits(comp), + .nullptr_t, .pointer => comp.target.ptrBitWidth(), + .atomic => |atomic| continue :loop atomic.base(comp).type, + .complex => |complex| { + const child_size = complex.bitSizeofOrNull(comp) orelse return null; + return child_size * 2; + }, + else => 8 * (qt.sizeofOrNull(comp) orelse return null), + }; + } + + pub fn hasIncompleteSize(qt: QualType, comp: *const Compilation) bool { + if (qt.isInvalid()) return false; + return switch (qt.base(comp).type) { + .void => true, + .array => |array| array.len == .incomplete, + .@"enum" => |enum_ty| enum_ty.incomplete and !enum_ty.fixed, + .@"struct", .@"union" => |record| record.layout == null, + else => false, + }; + } + + pub fn signedness(qt: QualType, comp: *const Compilation) std.builtin.Signedness { + return loop: switch (qt.base(comp).type) { + .complex => |complex| continue :loop complex.base(comp).type, + .atomic => |atomic| continue :loop atomic.base(comp).type, + .bool => .unsigned, + .bit_int => |bit_int| bit_int.signedness, + .int => |int_ty| switch (int_ty) { + .char => comp.getCharSignedness(), + .schar, .short, .int, .long, .long_long, .int128 => .signed, + .uchar, .ushort, .uint, .ulong, .ulong_long, .uint128 => .unsigned, + }, + // Pointer values are signed. + .pointer, .nullptr_t => .signed, + .@"enum" => .signed, + else => unreachable, + }; + } + + /// Size of a type as reported by the alignof operator. + pub fn alignof(qt: QualType, comp: *const Compilation) u32 { + if (qt.requestedAlignment(comp)) |requested| request: { + if (qt.is(comp, .@"enum")) { + if (comp.langopts.emulate == .gcc) { + // gcc does not respect alignment on enums + break :request; + } + } else if (qt.getRecord(comp)) |record_ty| { + const layout = record_ty.layout orelse return 0; + + // don't return the attribute for records + // layout has already accounted for requested alignment + const computed = @divExact(layout.field_alignment_bits, 8); + return @max(requested, computed); + } else if (comp.langopts.emulate == .msvc) { + const type_align = qt.base(comp).qt.alignof(comp); + return @max(requested, type_align); + } + return requested; + } + + return loop: switch (qt.base(comp).type) { + .void => 1, + .bool => 1, + .int => |int_ty| switch (int_ty) { + .char, + .schar, + .uchar, + => 1, + .short => comp.target.cTypeAlignment(.short), + .ushort => comp.target.cTypeAlignment(.ushort), + .int => comp.target.cTypeAlignment(.int), + .uint => comp.target.cTypeAlignment(.uint), + + .long => comp.target.cTypeAlignment(.long), + .ulong => comp.target.cTypeAlignment(.ulong), + .long_long => comp.target.cTypeAlignment(.longlong), + .ulong_long => comp.target.cTypeAlignment(.ulonglong), + .int128, .uint128 => if (comp.target.cpu.arch == .s390x and comp.target.os.tag == .linux and comp.target.abi.isGnu()) 8 else 16, + }, + .float => |float_ty| switch (float_ty) { + .float => comp.target.cTypeAlignment(.float), + .double => comp.target.cTypeAlignment(.double), + .long_double => comp.target.cTypeAlignment(.longdouble), + .fp16, .float16 => 2, + .float128 => 16, + }, + .bit_int => |bit_int| { + // https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2709.pdf + // _BitInt(N) types align with existing calling conventions. They have the same size and alignment as the + // smallest basic type that can contain them. Types that are larger than __int64_t are conceptually treated + // as struct of register size chunks. The number of chunks is the smallest number that can contain the type. + if (bit_int.bits > 64) return 8; + const basic_type = comp.intLeastN(bit_int.bits, bit_int.signedness); + return basic_type.alignof(comp); + }, + .atomic => |atomic| continue :loop atomic.base(comp).type, + .complex => |complex| continue :loop complex.base(comp).type, + + .pointer, .nullptr_t => switch (comp.target.cpu.arch) { + .avr => 1, + else => comp.target.ptrBitWidth() / 8, + }, + + .func => target_util.defaultFunctionAlignment(comp.target), + + .array => |array| continue :loop array.elem.base(comp).type, + .vector => |vector| continue :loop vector.elem.base(comp).type, + + .@"struct", .@"union" => |record| { + const layout = record.layout orelse return 0; + return layout.field_alignment_bits / 8; + }, + .@"enum" => |enum_ty| { + const tag = enum_ty.tag orelse return 0; + continue :loop tag.base(comp).type; + }, + .typeof => unreachable, + .typedef => unreachable, + .attributed => unreachable, + }; + } + + /// Suffix for integer values of this type + pub fn intValueSuffix(qt: QualType, comp: *const Compilation) []const u8 { + return switch (qt.get(comp, .int).?) { + .short, .int => "", + .long => "L", + .long_long => "LL", + .schar, .uchar, .char => { + // Only 8-bit char supported currently; + // TODO: handle platforms with 16-bit int + 16-bit char + std.debug.assert(qt.sizeof(comp) == 1); + return ""; + }, + .ushort => { + if (qt.sizeof(comp) < int.sizeof(comp)) { + return ""; + } + return "U"; + }, + .uint => "U", + .ulong => "UL", + .ulong_long => "ULL", + else => unreachable, // TODO + }; + } + + /// printf format modifier + pub fn formatModifier(qt: QualType, comp: *const Compilation) []const u8 { + return switch (qt.get(comp, .int).?) { + .schar, .uchar => "hh", + .short, .ushort => "h", + .int, .uint => "", + .long, .ulong => "l", + .long_long, .ulong_long => "ll", + else => unreachable, // TODO + }; + } + + /// Make real int type unsigned. + /// Discards attributes. + pub fn makeIntUnsigned(qt: QualType, comp: *Compilation) !QualType { + switch (qt.base(comp).type) { + .int => |kind| switch (kind) { + .char => return .uchar, + .schar => return .uchar, + .uchar => return .uchar, + .short => return .ushort, + .ushort => return .ushort, + .int => return .uint, + .uint => return .uint, + .long => return .ulong, + .ulong => return .ulong, + .long_long => return .ulong_long, + .ulong_long => return .ulong_long, + .int128 => return .uint128, + .uint128 => return .uint128, + }, + .bit_int => |bit_int| { + return try comp.type_store.put(comp.gpa, .{ .bit_int = .{ + .signedness = .unsigned, + .bits = bit_int.bits, + } }); + }, + else => unreachable, + } + } + + pub fn toReal(qt: QualType, comp: *const Compilation) QualType { + return switch (qt.base(comp).type) { + .complex => |complex| complex, + else => qt, + }; + } + + pub fn toComplex(qt: QualType, comp: *Compilation) !QualType { + if (std.debug.runtime_safety) { + switch (qt.base(comp).type) { + .complex => unreachable, + .float => |float_ty| if (float_ty == .fp16) unreachable, + .int, .bit_int => {}, + else => unreachable, + } + } + return comp.type_store.put(comp.gpa, .{ .complex = qt }); + } + + pub fn decay(qt: QualType, comp: *Compilation) !QualType { + if (qt.isInvalid()) return .invalid; + switch (qt.base(comp).type) { + .array => |array_ty| { + // Copy const and volatile to the element + var elem_qt = array_ty.elem; + elem_qt.@"const" = qt.@"const" or elem_qt.@"const"; + elem_qt.@"volatile" = qt.@"volatile" or elem_qt.@"volatile"; + + var pointer_qt = try comp.type_store.put(comp.gpa, .{ .pointer = .{ + .child = elem_qt, + .decayed = qt, + } }); + + // .. and restrict to the pointer. + pointer_qt.restrict = qt.restrict or array_ty.elem.restrict; + return pointer_qt; + }, + .func => |func_ty| { + if (func_ty.return_type.isInvalid()) { + return .invalid; + } + for (func_ty.params) |param| { + if (param.qt.isInvalid()) { + return .invalid; + } + } + + return comp.type_store.put(comp.gpa, .{ .pointer = .{ + .child = qt, + .decayed = null, + } }); + }, + else => return qt, + } + } + + /// Rank for floating point conversions, ignoring domain (complex vs real) + /// Asserts that ty is a floating point type + pub fn floatRank(qt: QualType, comp: *const Compilation) usize { + return loop: switch (qt.base(comp).type) { + .float => |float_ty| switch (float_ty) { + // TODO: bfloat16 => 0 + .float16 => 1, + .fp16 => 2, + .float => 3, + .double => 4, + .long_double => 5, + .float128 => 6, + // TODO: ibm128 => 7 + }, + .complex => |complex| continue :loop complex.base(comp).type, + .atomic => |atomic| continue :loop atomic.base(comp).type, + else => unreachable, + }; + } + + /// Rank for integer conversions, ignoring domain (complex vs real) + /// Asserts that ty is an integer type + pub fn intRank(qt: QualType, comp: *const Compilation) usize { + return loop: switch (qt.base(comp).type) { + .bit_int => |bit_int| @as(usize, bit_int.bits) * 8, + .bool => 1 + @as(usize, @intCast((QualType.bool.bitSizeof(comp) * 8))), + .int => |int_ty| switch (int_ty) { + .char, .schar, .uchar => 2 + (int_ty.bits(comp) * 8), + .short, .ushort => 3 + (int_ty.bits(comp) * 8), + .int, .uint => 4 + (int_ty.bits(comp) * 8), + .long, .ulong => 5 + (int_ty.bits(comp) * 8), + .long_long, .ulong_long => 6 + (int_ty.bits(comp) * 8), + .int128, .uint128 => 7 + (int_ty.bits(comp) * 8), + }, + .complex => |complex| continue :loop complex.base(comp).type, + .atomic => |atomic| continue :loop atomic.base(comp).type, + .@"enum" => |enum_ty| continue :loop enum_ty.tag.?.base(comp).type, + else => unreachable, + }; + } + + pub fn intRankOrder(a: QualType, b: QualType, comp: *const Compilation) std.math.Order { + std.debug.assert(a.isInt(comp) and b.isInt(comp)); + + const a_unsigned = a.signedness(comp) == .unsigned; + const b_unsigned = b.signedness(comp) == .unsigned; + + const a_rank = a.intRank(comp); + const b_rank = b.intRank(comp); + if (a_unsigned == b_unsigned) { + return std.math.order(a_rank, b_rank); + } + if (a_unsigned) { + if (a_rank >= b_rank) return .gt; + return .lt; + } + std.debug.assert(b_unsigned); + if (b_rank >= a_rank) return .lt; + return .gt; + } + + /// Returns true if `a` and `b` are integer types that differ only in sign + pub fn sameRankDifferentSign(a: QualType, b: QualType, comp: *const Compilation) bool { + if (!a.isInt(comp) or !b.isInt(comp)) return false; + if (a.hasIncompleteSize(comp) or b.hasIncompleteSize(comp)) return false; + if (a.intRank(comp) != b.intRank(comp)) return false; + return a.signedness(comp) != b.signedness(comp); + } + + pub fn promoteInt(qt: QualType, comp: *const Compilation) QualType { + return loop: switch (qt.base(comp).type) { + .bool => return .int, + .@"enum" => |enum_ty| if (enum_ty.tag) |tag| { + continue :loop tag.base(comp).type; + } else return .int, + .bit_int => return qt, + .complex => return qt, // Assume complex integer type + .int => |int_ty| switch (int_ty) { + .char, .schar, .uchar, .short => .int, + .ushort => if (Type.Int.uchar.bits(comp) == Type.Int.int.bits(comp)) .uint else .int, + else => return qt, + }, + .atomic => |atomic| continue :loop atomic.base(comp).type, + else => unreachable, // Not an integer type + }; + } + + /// Promote a bitfield. If `int` can hold all the values of the underlying field, + /// promote to int. Otherwise, promote to unsigned int + /// Returns null if no promotion is necessary + pub fn promoteBitfield(qt: QualType, comp: *const Compilation, width: u32) ?QualType { + const type_size_bits = qt.bitSizeof(comp); + + // Note: GCC and clang will promote `long: 3` to int even though the C standard does not allow this + if (width < type_size_bits) { + return .int; + } + + if (width == type_size_bits) { + return if (qt.signedness(comp) == .unsigned) .uint else .int; + } + + return null; + } + + pub const ScalarKind = enum { + @"enum", + bool, + int, + float, + pointer, + nullptr_t, + void_pointer, + complex_int, + complex_float, + none, + + pub fn isInt(sk: ScalarKind) bool { + return switch (sk) { + .bool, .@"enum", .int, .complex_int => true, + else => false, + }; + } + + pub fn isFloat(sk: ScalarKind) bool { + return switch (sk) { + .float, .complex_float => true, + else => false, + }; + } + + pub fn isReal(sk: ScalarKind) bool { + return switch (sk) { + .complex_int, .complex_float => false, + else => true, + }; + } + + pub fn isPointer(sk: ScalarKind) bool { + return switch (sk) { + .pointer, .void_pointer => true, + else => false, + }; + } + + /// Equivalent to isInt() or isFloat() + pub fn isArithmetic(sk: ScalarKind) bool { + return switch (sk) { + .bool, .@"enum", .int, .complex_int, .float, .complex_float => true, + else => false, + }; + } + }; + + pub fn scalarKind(qt: QualType, comp: *const Compilation) ScalarKind { + loop: switch (qt.base(comp).type) { + .bool => return .bool, + .int, .bit_int => return .int, + .float => return .float, + .nullptr_t => return .nullptr_t, + .pointer => |pointer| switch (pointer.child.base(comp).type) { + .void => return .void_pointer, + else => return .pointer, + }, + .@"enum" => return .@"enum", + .complex => |complex| switch (complex.base(comp).type) { + .int, .bit_int => return .complex_int, + .float => return .complex_float, + else => unreachable, + }, + .atomic => |atomic| continue :loop atomic.base(comp).type, + else => return .none, + } + } + + // Prefer calling scalarKind directly if checking multiple kinds. + pub fn isInt(qt: QualType, comp: *const Compilation) bool { + return qt.scalarKind(comp).isInt(); + } + + pub fn isRealInt(qt: QualType, comp: *const Compilation) bool { + const sk = qt.scalarKind(comp); + return sk.isInt() and sk.isReal(); + } + + // Prefer calling scalarKind directly if checking multiple kinds. + pub fn isFloat(qt: QualType, comp: *const Compilation) bool { + return qt.scalarKind(comp).isFloat(); + } + + // Prefer calling scalarKind directly if checking multiple kinds. + pub fn isPointer(qt: QualType, comp: *const Compilation) bool { + return qt.scalarKind(comp).isPointer(); + } + + pub fn eqlQualified(a_qt: QualType, b_qt: QualType, comp: *const Compilation) bool { + if (a_qt.@"const" != b_qt.@"const") return false; + if (a_qt.@"volatile" != b_qt.@"volatile") return false; + if (a_qt.restrict != b_qt.restrict) return false; + + return a_qt.eql(b_qt, comp); + } + + pub fn eql(a_qt: QualType, b_qt: QualType, comp: *const Compilation) bool { + if (a_qt.isInvalid() or b_qt.isInvalid()) return false; + if (a_qt._index == b_qt._index) return true; + + const a_type_qt = a_qt.base(comp); + const a_type = a_type_qt.type; + const b_type_qt = b_qt.base(comp); + const b_type = b_type_qt.type; + + // Alignment check also guards against comparing incomplete enums to ints. + if (a_type_qt.qt.alignof(comp) != b_type_qt.qt.alignof(comp)) return false; + if (a_type == .@"enum" and b_type != .@"enum") { + return a_type.@"enum".tag.?.eql(b_qt, comp); + } else if (a_type != .@"enum" and b_type == .@"enum") { + return b_type.@"enum".tag.?.eql(a_qt, comp); + } + + if (std.meta.activeTag(a_type) != b_type) return false; + switch (a_type) { + .void => return true, + .bool => return true, + .nullptr_t => return true, + .int => |a_int| return a_int == b_type.int, + .float => |a_float| return a_float == b_type.float, + .complex => |a_complex| { + const b_complex = b_type.complex; + // Complex child type cannot be qualified. + return a_complex.eql(b_complex, comp); + }, + .bit_int => |a_bit_int| { + const b_bit_int = b_type.bit_int; + if (a_bit_int.bits != b_bit_int.bits) return false; + if (a_bit_int.signedness != b_bit_int.signedness) return false; + return true; + }, + .atomic => |a_atomic| { + const b_atomic = b_type.atomic; + // Atomic child type cannot be qualified. + return a_atomic.eql(b_atomic, comp); + }, + .func => |a_func| { + const b_func = b_type.func; + + // Function return type cannot be qualified. + if (!a_func.return_type.eql(b_func.return_type, comp)) return false; + + if (a_func.params.len == 0 and b_func.params.len == 0) { + return (a_func.kind == .variadic) == (b_func.kind == .variadic); + } + + if (a_func.params.len != b_func.params.len) { + if (a_func.kind == .old_style and b_func.kind == .old_style) return true; + if (a_func.kind == .old_style or b_func.kind == .old_style) { + const maybe_has_params = if (a_func.kind == .old_style) b_func else a_func; + + // Check if any args undergo default argument promotion. + for (maybe_has_params.params) |param| { + switch (param.qt.base(comp).type) { + .bool => return false, + .int => |int_ty| switch (int_ty) { + .char, .uchar, .schar => return false, + else => {}, + }, + .float => |float_ty| if (float_ty != .double) return false, + .@"enum" => |enum_ty| { + if (comp.langopts.emulate == .clang and enum_ty.incomplete) return false; + }, + else => {}, + } + } + return true; + } + return false; + } + + if ((a_func.kind == .normal) != (b_func.kind == .normal)) return false; + + for (a_func.params, b_func.params) |a_param, b_param| { + // Function parameters cannot be qualified. + if (!a_param.qt.eql(b_param.qt, comp)) return false; + } + return true; + }, + .pointer => |a_pointer| { + const b_pointer = b_type.pointer; + return a_pointer.child.eqlQualified(b_pointer.child, comp); + }, + .array => |a_array| { + const b_array = b_type.array; + const a_len = switch (a_array.len) { + .fixed, .static => |len| len, + else => null, + }; + const b_len = switch (b_array.len) { + .fixed, .static => |len| len, + else => null, + }; + if (a_len != null and b_len != null) { + return a_len.? == b_len.?; + } + + // Array element qualifiers are ignored. + return a_array.elem.eql(b_array.elem, comp); + }, + .vector => |a_vector| { + const b_vector = b_type.vector; + if (a_vector.len != b_vector.len) return false; + + // Vector elemnent qualifiers are checked. + return a_vector.elem.eqlQualified(b_vector.elem, comp); + }, + .@"struct", .@"union", .@"enum" => return a_type_qt.qt._index == b_type_qt.qt._index, + + .typeof => unreachable, // Never returned from base() + .typedef => unreachable, // Never returned from base() + .attributed => unreachable, // Never returned from base() + } + } + + pub fn getAttribute(qt: QualType, comp: *const Compilation, comptime tag: Attribute.Tag) ?Attribute.ArgumentsForTag(tag) { + if (tag == .aligned) @compileError("use requestedAlignment"); + var it = Attribute.Iterator.initType(qt, comp); + while (it.next()) |item| { + const attribute, _ = item; + if (attribute.tag == tag) return @field(attribute.args, @tagName(tag)); + } + return null; + } + + pub fn hasAttribute(qt: QualType, comp: *const Compilation, tag: Attribute.Tag) bool { + var it = Attribute.Iterator.initType(qt, comp); + while (it.next()) |item| { + const attr, _ = item; + if (attr.tag == tag) return true; + } + return false; + } + + pub fn alignable(qt: QualType, comp: *const Compilation) bool { + if (qt.isInvalid()) return true; // Avoid redundant error. + const base_type = qt.base(comp); + return switch (base_type.type) { + .array, .void => false, + else => !base_type.qt.hasIncompleteSize(comp), + }; + } + + pub fn requestedAlignment(qt: QualType, comp: *const Compilation) ?u32 { + return annotationAlignment(comp, Attribute.Iterator.initType(qt, comp)); + } + + pub fn annotationAlignment(comp: *const Compilation, attrs: Attribute.Iterator) ?u32 { + var it = attrs; + var max_requested: ?u32 = null; + var last_aligned_index: ?usize = null; + while (it.next()) |item| { + const attribute, const index = item; + if (attribute.tag != .aligned) continue; + if (last_aligned_index) |aligned_index| { + // once we recurse into a new type, after an `aligned` attribute was found, we're done + if (index <= aligned_index) break; + } + last_aligned_index = index; + const requested = if (attribute.args.aligned.alignment) |alignment| alignment.requested else target_util.defaultAlignment(comp.target); + if (max_requested == null or max_requested.? < requested) { + max_requested = requested; + } + } + return max_requested; + } + + pub fn enumIsPacked(qt: QualType, comp: *const Compilation) bool { + std.debug.assert(qt.is(comp, .@"enum")); + return comp.langopts.short_enums or target_util.packAllEnums(comp.target) or qt.hasAttribute(comp, .@"packed"); + } + + pub fn shouldDesugar(qt: QualType, comp: *const Compilation) bool { + loop: switch (qt.type(comp)) { + .attributed => |attributed| continue :loop attributed.base.type(comp), + .pointer => |pointer| continue :loop pointer.child.type(comp), + .func => |func| { + for (func.params) |param| { + if (param.qt.shouldDesugar(comp)) return true; + } + continue :loop func.return_type.type(comp); + }, + .typeof => return true, + .typedef => |typedef| return !typedef.base.is(comp, .nullptr_t), + else => return false, + } + } + + pub fn print(qt: QualType, comp: *const Compilation, w: *std.Io.Writer) std.Io.Writer.Error!void { + if (qt.isC23Auto()) { + try w.writeAll("auto"); + return; + } + _ = try qt.printPrologue(comp, false, w); + try qt.printEpilogue(comp, false, w); + } + + pub fn printNamed(qt: QualType, name: []const u8, comp: *const Compilation, w: *std.Io.Writer) std.Io.Writer.Error!void { + if (qt.isC23Auto()) { + try w.print("auto {s}", .{name}); + return; + } + const simple = try qt.printPrologue(comp, false, w); + if (simple) try w.writeByte(' '); + try w.writeAll(name); + try qt.printEpilogue(comp, false, w); + } + + pub fn printDesugared(qt: QualType, comp: *const Compilation, w: *std.Io.Writer) std.Io.Writer.Error!void { + _ = try qt.printPrologue(comp, true, w); + try qt.printEpilogue(comp, true, w); + } + + fn printPrologue(qt: QualType, comp: *const Compilation, desugar: bool, w: *std.Io.Writer) std.Io.Writer.Error!bool { + loop: switch (qt.type(comp)) { + .pointer => |pointer| { + const simple = try pointer.child.printPrologue(comp, desugar, w); + if (simple) try w.writeByte(' '); + switch (pointer.child.base(comp).type) { + .func, .array => try w.writeByte('('), + else => {}, + } + try w.writeByte('*'); + if (qt.@"const") try w.writeAll("const"); + if (qt.@"volatile") { + if (qt.@"const") try w.writeByte(' '); + try w.writeAll("volatile"); + } + if (qt.restrict) { + if (qt.@"const" or qt.@"volatile") try w.writeByte(' '); + try w.writeAll("restrict"); + } + return false; + }, + .func => |func| { + const simple = try func.return_type.printPrologue(comp, desugar, w); + if (simple) try w.writeByte(' '); + return false; + }, + .array => |array| { + if (qt.@"const") { + try w.writeAll("const "); + } + if (qt.@"volatile") { + try w.writeAll("volatile"); + } + + const simple = try array.elem.printPrologue(comp, desugar, w); + if (simple) try w.writeByte(' '); + return false; + }, + .typeof => |typeof| if (desugar) { + continue :loop typeof.base.type(comp); + } else { + try w.writeAll("typeof("); + try typeof.base.print(comp, w); + try w.writeAll(")"); + return true; + }, + .typedef => |typedef| if (desugar) { + continue :loop typedef.base.type(comp); + } else { + try w.writeAll(typedef.name.lookup(comp)); + return true; + }, + .attributed => |attributed| continue :loop attributed.base.type(comp), + else => {}, + } + if (qt.@"const") try w.writeAll("const "); + if (qt.@"volatile") try w.writeAll("volatile "); + + switch (qt.base(comp).type) { + .pointer => unreachable, + .func => unreachable, + .array => unreachable, + .typeof => unreachable, + .typedef => unreachable, + .attributed => unreachable, + + .void => try w.writeAll("void"), + .bool => try w.writeAll(if (comp.langopts.standard.atLeast(.c23)) "bool" else "_Bool"), + .nullptr_t => try w.writeAll("nullptr_t"), + .int => |int_ty| switch (int_ty) { + .char => try w.writeAll("char"), + .schar => try w.writeAll("signed char"), + .uchar => try w.writeAll("unsigned char"), + .short => try w.writeAll("short"), + .ushort => try w.writeAll("unsigned short"), + .int => try w.writeAll("int"), + .uint => try w.writeAll("unsigned int"), + .long => try w.writeAll("long"), + .ulong => try w.writeAll("unsigned long"), + .long_long => try w.writeAll("long long"), + .ulong_long => try w.writeAll("unsigned long long"), + .int128 => try w.writeAll("__int128"), + .uint128 => try w.writeAll("unsigned __int128"), + }, + .bit_int => |bit_int| try w.print("{s} _BitInt({d})", .{ @tagName(bit_int.signedness), bit_int.bits }), + .float => |float_ty| switch (float_ty) { + .fp16 => try w.writeAll("__fp16"), + .float16 => try w.writeAll("_Float16"), + .float => try w.writeAll("float"), + .double => try w.writeAll("double"), + .long_double => try w.writeAll("long double"), + .float128 => try w.writeAll("__float128"), + }, + .complex => |complex| { + try w.writeAll("_Complex "); + _ = try complex.printPrologue(comp, desugar, w); + }, + .atomic => |atomic| { + try w.writeAll("_Atomic("); + _ = try atomic.printPrologue(comp, desugar, w); + try atomic.printEpilogue(comp, desugar, w); + try w.writeAll(")"); + }, + + .vector => |vector| { + try w.print("__attribute__((__vector_size__({d} * sizeof(", .{vector.len}); + _ = try vector.elem.printPrologue(comp, desugar, w); + try w.writeAll(")))) "); + _ = try vector.elem.printPrologue(comp, desugar, w); + }, + + .@"struct" => |struct_ty| try w.print("struct {s}", .{struct_ty.name.lookup(comp)}), + .@"union" => |union_ty| try w.print("union {s}", .{union_ty.name.lookup(comp)}), + .@"enum" => |enum_ty| if (enum_ty.fixed) { + try w.print("enum {s}: ", .{enum_ty.name.lookup(comp)}); + _ = try enum_ty.tag.?.printPrologue(comp, desugar, w); + } else { + try w.print("enum {s}", .{enum_ty.name.lookup(comp)}); + }, + } + return true; + } + + fn printEpilogue(qt: QualType, comp: *const Compilation, desugar: bool, w: *std.Io.Writer) std.Io.Writer.Error!void { + loop: switch (qt.type(comp)) { + .pointer => |pointer| { + switch (pointer.child.base(comp).type) { + .func, .array => try w.writeByte(')'), + else => {}, + } + continue :loop pointer.child.type(comp); + }, + .func => |func| { + try w.writeByte('('); + for (func.params, 0..) |param, i| { + if (i != 0) try w.writeAll(", "); + _ = try param.qt.printPrologue(comp, desugar, w); + try param.qt.printEpilogue(comp, desugar, w); + } + if (func.kind != .normal) { + if (func.params.len != 0) try w.writeAll(", "); + try w.writeAll("..."); + } else if (func.params.len == 0 and !comp.langopts.standard.atLeast(.c23)) { + try w.writeAll("void"); + } + try w.writeByte(')'); + continue :loop func.return_type.type(comp); + }, + .array => |array| { + try w.writeByte('['); + switch (array.len) { + .fixed, .static => |len| try w.print("{d}", .{len}), + .incomplete => {}, + .unspecified_variable => try w.writeByte('*'), + .variable => try w.writeAll(""), + } + + const static = array.len == .static; + if (static) try w.writeAll("static"); + if (qt.restrict) { + if (static or qt.@"const" or qt.@"volatile") try w.writeByte(' '); + try w.writeAll("restrict"); + } + try w.writeByte(']'); + + continue :loop array.elem.type(comp); + }, + .attributed => |attributed| continue :loop attributed.base.type(comp), + else => {}, + } + } + + pub fn dump(qt: QualType, comp: *const Compilation, w: *std.Io.Writer) std.Io.Writer.Error!void { + if (qt.@"const") try w.writeAll("const "); + if (qt.@"volatile") try w.writeAll("volatile "); + if (qt.restrict) try w.writeAll("restrict "); + if (qt.isInvalid()) return w.writeAll("invalid"); + switch (qt.type(comp)) { + .pointer => |pointer| { + if (pointer.decayed) |decayed| { + try w.writeAll("decayed *"); + try decayed.dump(comp, w); + } else { + try w.writeAll("*"); + try pointer.child.dump(comp, w); + } + }, + .func => |func| { + if (func.kind == .old_style) + try w.writeAll("kr (") + else + try w.writeAll("fn ("); + + for (func.params, 0..) |param, i| { + if (i != 0) try w.writeAll(", "); + if (param.name != .empty) try w.print("{s}: ", .{param.name.lookup(comp)}); + try param.qt.dump(comp, w); + } + if (func.kind != .normal) { + if (func.params.len != 0) try w.writeAll(", "); + try w.writeAll("..."); + } + try w.writeAll(") "); + try func.return_type.dump(comp, w); + }, + .array => |array| { + switch (array.len) { + .fixed => |len| try w.print("[{d}]", .{len}), + .static => |len| try w.print("[static {d}]", .{len}), + .incomplete => try w.writeAll("[]"), + .unspecified_variable => try w.writeAll("[*]"), + .variable => try w.writeAll("[]"), + } + try array.elem.dump(comp, w); + }, + .vector => |vector| { + try w.print("vector({d}, ", .{vector.len}); + try vector.elem.dump(comp, w); + try w.writeAll(")"); + }, + .typeof => |typeof| { + try w.writeAll("typeof("); + if (typeof.expr != null) try w.writeAll(": "); + try typeof.base.dump(comp, w); + try w.writeAll(")"); + }, + .attributed => |attributed| { + try w.writeAll("attributed("); + try attributed.base.dump(comp, w); + try w.writeAll(")"); + }, + .typedef => |typedef| { + try w.writeAll(typedef.name.lookup(comp)); + try w.writeAll(": "); + try typedef.base.dump(comp, w); + }, + .@"enum" => |enum_ty| { + try w.print("enum {s}: ", .{enum_ty.name.lookup(comp)}); + if (enum_ty.tag) |some| { + try some.dump(comp, w); + } else { + try w.writeAll(""); + } + }, + else => try qt.unqualified().print(comp, w), + } + } +}; + +pub const Type = union(enum) { + void, + bool, + /// C23 nullptr_t + nullptr_t, + + int: Int, + float: Float, + complex: QualType, + bit_int: BitInt, + atomic: QualType, + + func: Func, + pointer: Pointer, + array: Array, + vector: Vector, + + @"struct": Record, + @"union": Record, + @"enum": Enum, + + typeof: TypeOf, + typedef: TypeDef, + attributed: Attributed, + + pub const Int = enum { + char, + schar, + uchar, + short, + ushort, + int, + uint, + long, + ulong, + long_long, + ulong_long, + int128, + uint128, + + pub fn bits(int: Int, comp: *const Compilation) u16 { + return switch (int) { + .char => comp.target.cTypeBitSize(.char), + .schar => comp.target.cTypeBitSize(.char), + .uchar => comp.target.cTypeBitSize(.char), + .short => comp.target.cTypeBitSize(.short), + .ushort => comp.target.cTypeBitSize(.ushort), + .int => comp.target.cTypeBitSize(.int), + .uint => comp.target.cTypeBitSize(.uint), + .long => comp.target.cTypeBitSize(.long), + .ulong => comp.target.cTypeBitSize(.ulong), + .long_long => comp.target.cTypeBitSize(.longlong), + .ulong_long => comp.target.cTypeBitSize(.ulonglong), + .int128 => 128, + .uint128 => 128, + }; + } + }; + + pub const Float = enum { + fp16, + float16, + float, + double, + long_double, + float128, + + pub fn bits(float: Float, comp: *const Compilation) u16 { + return switch (float) { + .fp16 => 16, + .float16 => 16, + .float => comp.target.cTypeBitSize(.float), + .double => comp.target.cTypeBitSize(.double), + .long_double => comp.target.cTypeBitSize(.longdouble), + .float128 => 128, + }; + } + }; + + pub const BitInt = struct { + /// Must be >= 1 if unsigned and >= 2 if signed + bits: u16, + signedness: std.builtin.Signedness, + }; + + pub const Func = struct { + return_type: QualType, + kind: enum { + /// int foo(int bar, char baz) and int (void) + normal, + /// int foo(int bar, char baz, ...) + variadic, + /// int foo(bar, baz) and int foo() + /// is also var args, but we can give warnings about incorrect amounts of parameters + old_style, + }, + params: []const Param, + + pub const Param = extern struct { + qt: QualType, + name: StringId, + name_tok: TokenIndex, + node: Node.OptIndex, + }; + }; + + pub const Pointer = struct { + child: QualType, + decayed: ?QualType, + }; + + pub const Array = struct { + elem: QualType, + len: union(enum) { + incomplete, + fixed: u64, + static: u64, + variable: Node.Index, + unspecified_variable, + }, + }; + + pub const Vector = struct { + elem: QualType, + len: u32, + }; + + pub const Record = struct { + name: StringId, + decl_node: Node.Index, + layout: ?Layout = null, + fields: []const Field, + + pub const Field = extern struct { + qt: QualType, + name: StringId, + /// zero for anonymous fields + name_tok: TokenIndex = 0, + bit_width: enum(u32) { + null = std.math.maxInt(u32), + _, + + pub fn unpack(width: @This()) ?u32 { + if (width == .null) return null; + return @intFromEnum(width); + } + } = .null, + layout: Field.Layout = .{ + .offset_bits = 0, + .size_bits = 0, + }, + _attr_index: u32 = 0, + _attr_len: u32 = 0, + + pub fn attributes(field: Field, comp: *const Compilation) []const Attribute { + return comp.type_store.attributes.items[field._attr_index..][0..field._attr_len]; + } + + pub const Layout = extern struct { + /// `offset_bits` and `size_bits` should both be INVALID if and only if the field + /// is an unnamed bitfield. There is no way to reference an unnamed bitfield in C, so + /// there should be no way to observe these values. If it is used, this value will + /// maximize the chance that a safety-checked overflow will occur. + const INVALID = std.math.maxInt(u64); + + /// The offset of the field, in bits, from the start of the struct. + offset_bits: u64 align(4) = INVALID, + /// The size, in bits, of the field. + /// + /// For bit-fields, this is the width of the field. + size_bits: u64 align(4) = INVALID, + }; + }; + + pub const Layout = extern struct { + /// The size of the type in bits. + /// + /// This is the value returned by `sizeof` in C + /// (but in bits instead of bytes). This is a multiple of `pointer_alignment_bits`. + size_bits: u64 align(4), + /// The alignment of the type, in bits, when used as a field in a record. + /// + /// This is usually the value returned by `_Alignof` in C, but there are some edge + /// cases in GCC where `_Alignof` returns a smaller value. + field_alignment_bits: u32, + /// The alignment, in bits, of valid pointers to this type. + /// `size_bits` is a multiple of this value. + pointer_alignment_bits: u32, + /// The required alignment of the type in bits. + /// + /// This value is only used by MSVC targets. It is 8 on all other + /// targets. On MSVC targets, this value restricts the effects of `#pragma pack` except + /// in some cases involving bit-fields. + required_alignment_bits: u32, + }; + + pub fn isAnonymous(record: Record, comp: *const Compilation) bool { + // anonymous records can be recognized by their names which are in + // the format "(anonymous TAG at path:line:col)". + return record.name.lookup(comp)[0] == '('; + } + + pub fn hasField(record: Record, comp: *const Compilation, name: StringId) bool { + std.debug.assert(record.layout != null); + std.debug.assert(name != .empty); + for (record.fields) |field| { + if (name == field.name) return true; + if (field.name_tok == 0) if (field.qt.getRecord(comp)) |field_record_ty| { + if (field_record_ty.hasField(comp, name)) return true; + }; + } + return false; + } + }; + + pub const Enum = struct { + /// Null if the enum is incomplete and not fixed. + tag: ?QualType, + fixed: bool, + incomplete: bool, + name: StringId, + decl_node: Node.Index, + fields: []const Field, + + pub const Field = extern struct { + qt: QualType, + name: StringId, + name_tok: TokenIndex, + }; + + pub fn isAnonymous(@"enum": Enum, comp: *const Compilation) bool { + // anonymous enums can be recognized by their names which are in + // the format "(anonymous TAG at path:line:col)". + return @"enum".name.lookup(comp)[0] == '('; + } + }; + + pub const TypeOf = struct { + base: QualType, + expr: ?Node.Index, + }; + + pub const TypeDef = struct { + base: QualType, + name: StringId, + decl_node: Node.Index, + }; + + pub const Attributed = struct { + base: QualType, + attributes: []const Attribute, + }; +}; + +types: std.MultiArrayList(Repr) = .empty, +extra: std.ArrayList(u32) = .empty, +attributes: std.ArrayList(Attribute) = .empty, +anon_name_arena: std.heap.ArenaAllocator.State = .{}, + +wchar: QualType = .invalid, +uint_least16_t: QualType = .invalid, +uint_least32_t: QualType = .invalid, +ptrdiff: QualType = .invalid, +size: QualType = .invalid, +va_list: QualType = .invalid, +pid_t: QualType = .invalid, +ns_constant_string: QualType = .invalid, +file: QualType = .invalid, +jmp_buf: QualType = .invalid, +sigjmp_buf: QualType = .invalid, +ucontext_t: QualType = .invalid, +intmax: QualType = .invalid, +intptr: QualType = .invalid, +int16: QualType = .invalid, +int64: QualType = .invalid, + +pub fn deinit(ts: *TypeStore, gpa: std.mem.Allocator) void { + ts.types.deinit(gpa); + ts.extra.deinit(gpa); + ts.attributes.deinit(gpa); + ts.anon_name_arena.promote(gpa).deinit(); + ts.* = undefined; +} + +pub fn put(ts: *TypeStore, gpa: std.mem.Allocator, ty: Type) !QualType { + return .{ ._index = try ts.putExtra(gpa, ty) }; +} + +pub fn putExtra(ts: *TypeStore, gpa: std.mem.Allocator, ty: Type) !Index { + switch (ty) { + .void => return .void, + .bool => return .bool, + .nullptr_t => return .nullptr_t, + .int => |int| switch (int) { + .char => return .int_char, + .schar => return .int_schar, + .uchar => return .int_uchar, + .short => return .int_short, + .ushort => return .int_ushort, + .int => return .int_int, + .uint => return .int_uint, + .long => return .int_long, + .ulong => return .int_ulong, + .long_long => return .int_long_long, + .ulong_long => return .int_ulong_long, + .int128 => return .int_int128, + .uint128 => return .int_uint128, + }, + .float => |float| switch (float) { + .fp16 => return .float_fp16, + .float16 => return .float_float16, + .float => return .float_float, + .double => return .float_double, + .long_double => return .float_long_double, + .float128 => return .float_float128, + }, + else => {}, + } + const index = try ts.types.addOne(gpa); + try ts.set(gpa, ty, index); + return @enumFromInt(index); +} + +pub fn set(ts: *TypeStore, gpa: std.mem.Allocator, ty: Type, index: usize) !void { + var repr: Repr = undefined; + switch (ty) { + .void => unreachable, + .bool => unreachable, + .nullptr_t => unreachable, + .int => unreachable, + .float => unreachable, + .complex => |complex| { + repr.tag = .complex; + repr.data[0] = @bitCast(complex); + }, + .bit_int => |bit_int| { + repr.tag = .bit_int; + repr.data[0] = bit_int.bits; + repr.data[1] = @intFromEnum(bit_int.signedness); + }, + .atomic => |atomic| { + repr.tag = .atomic; + std.debug.assert(!atomic.@"const" and !atomic.@"volatile"); + repr.data[0] = @bitCast(atomic); + }, + .func => |func| { + repr.data[0] = @bitCast(func.return_type); + + const extra_index: u32 = @intCast(ts.extra.items.len); + repr.data[1] = extra_index; + if (func.params.len > 1) { + try ts.extra.append(gpa, @intCast(func.params.len)); + } + + const param_size = 4; + comptime std.debug.assert(@sizeOf(Type.Func.Param) == @sizeOf(u32) * param_size); + + try ts.extra.ensureUnusedCapacity(gpa, func.params.len * param_size); + for (func.params) |*param| { + const casted: *const [param_size]u32 = @ptrCast(param); + ts.extra.appendSliceAssumeCapacity(casted); + } + + repr.tag = switch (func.kind) { + .normal => switch (func.params.len) { + 0 => .func_zero, + 1 => .func_one, + else => .func, + }, + .variadic => switch (func.params.len) { + 0 => .func_variadic_zero, + 1 => .func_variadic_one, + else => .func_variadic, + }, + .old_style => switch (func.params.len) { + 0 => .func_old_style_zero, + 1 => .func_old_style_one, + else => .func_old_style, + }, + }; + }, + .pointer => |pointer| { + repr.data[0] = @bitCast(pointer.child); + if (pointer.decayed) |array| { + repr.tag = .pointer_decayed; + repr.data[1] = @bitCast(array); + } else { + repr.tag = .pointer; + } + }, + .array => |array| { + repr.data[0] = @bitCast(array.elem); + + const extra_index: u32 = @intCast(ts.extra.items.len); + switch (array.len) { + .incomplete => { + repr.tag = .array_incomplete; + }, + .fixed => |len| { + repr.tag = .array_fixed; + repr.data[1] = extra_index; + try ts.extra.appendSlice(gpa, &@as([2]u32, @bitCast(len))); + }, + .static => |len| { + repr.tag = .array_static; + repr.data[1] = extra_index; + try ts.extra.appendSlice(gpa, &@as([2]u32, @bitCast(len))); + }, + .variable => |expr| { + repr.tag = .array_variable; + repr.data[1] = @intFromEnum(expr); + }, + .unspecified_variable => { + repr.tag = .array_unspecified_variable; + }, + } + }, + .vector => |vector| { + repr.tag = .vector; + repr.data[0] = @bitCast(vector.elem); + repr.data[1] = vector.len; + }, + .@"struct", .@"union" => |record| record: { + repr.data[0] = @intFromEnum(record.name); + const layout = record.layout orelse { + std.debug.assert(record.fields.len == 0); + repr.tag = switch (ty) { + .@"struct" => .struct_incomplete, + .@"union" => .union_incomplete, + else => unreachable, + }; + repr.data[1] = @intFromEnum(record.decl_node); + break :record; + }; + repr.tag = switch (ty) { + .@"struct" => .@"struct", + .@"union" => .@"union", + else => unreachable, + }; + + const extra_index: u32 = @intCast(ts.extra.items.len); + repr.data[1] = extra_index; + + const layout_size = 5; + comptime std.debug.assert(@sizeOf(Type.Record.Layout) == @sizeOf(u32) * layout_size); + const field_size = 10; + comptime std.debug.assert(@sizeOf(Type.Record.Field) == @sizeOf(u32) * field_size); + try ts.extra.ensureUnusedCapacity(gpa, record.fields.len * field_size + layout_size + 2); + + ts.extra.appendAssumeCapacity(@intFromEnum(record.decl_node)); + const casted_layout: *const [layout_size]u32 = @ptrCast(&layout); + ts.extra.appendSliceAssumeCapacity(casted_layout); + ts.extra.appendAssumeCapacity(@intCast(record.fields.len)); + + for (record.fields) |*field| { + const casted: *const [field_size]u32 = @ptrCast(field); + ts.extra.appendSliceAssumeCapacity(casted); + } + }, + .@"enum" => |@"enum"| @"enum": { + if (@"enum".incomplete) { + std.debug.assert(@"enum".fields.len == 0); + if (@"enum".fixed) { + repr.tag = .enum_incomplete_fixed; + repr.data[0] = @bitCast(@"enum".tag.?); + repr.data[1] = @intCast(ts.extra.items.len); + try ts.extra.appendSlice(gpa, &.{ + @intFromEnum(@"enum".name), + @intFromEnum(@"enum".decl_node), + }); + } else { + repr.tag = .enum_incomplete; + repr.data[0] = @intFromEnum(@"enum".name); + repr.data[1] = @intFromEnum(@"enum".decl_node); + } + break :@"enum"; + } + repr.tag = if (@"enum".fixed) .enum_fixed else .@"enum"; + repr.data[0] = @bitCast(@"enum".tag.?); + + const extra_index: u32 = @intCast(ts.extra.items.len); + repr.data[1] = extra_index; + + const field_size = 3; + comptime std.debug.assert(@sizeOf(Type.Enum.Field) == @sizeOf(u32) * field_size); + try ts.extra.ensureUnusedCapacity(gpa, @"enum".fields.len * field_size + 3); + + ts.extra.appendAssumeCapacity(@intFromEnum(@"enum".name)); + ts.extra.appendAssumeCapacity(@intFromEnum(@"enum".decl_node)); + ts.extra.appendAssumeCapacity(@intCast(@"enum".fields.len)); + + for (@"enum".fields) |*field| { + const casted: *const [field_size]u32 = @ptrCast(field); + ts.extra.appendSliceAssumeCapacity(casted); + } + }, + .typeof => |typeof| { + repr.data[0] = @bitCast(typeof.base); + if (typeof.expr) |some| { + repr.tag = .typeof_expr; + repr.data[1] = @intFromEnum(some); + } else { + repr.tag = .typeof; + } + }, + .typedef => |typedef| { + repr.tag = .typedef; + repr.data[0] = @bitCast(typedef.base); + repr.data[1] = @intCast(ts.extra.items.len); + try ts.extra.appendSlice(gpa, &.{ + @intFromEnum(typedef.name), + @intFromEnum(typedef.decl_node), + }); + }, + .attributed => |attributed| { + repr.data[0] = @bitCast(attributed.base); + + const attr_index: u32 = @intCast(ts.attributes.items.len); + const attr_count: u32 = @intCast(attributed.attributes.len); + try ts.attributes.appendSlice(gpa, attributed.attributes); + if (attr_count > 1) { + repr.tag = .attributed; + const extra_index: u32 = @intCast(ts.extra.items.len); + repr.data[1] = extra_index; + try ts.extra.appendSlice(gpa, &.{ attr_index, attr_count }); + } else { + repr.tag = .attributed_one; + repr.data[1] = attr_index; + } + }, + } + ts.types.set(index, repr); +} + +pub fn initNamedTypes(ts: *TypeStore, comp: *Compilation) !void { + const os = comp.target.os.tag; + ts.wchar = switch (comp.target.cpu.arch) { + .xcore => .uchar, + .ve, .msp430 => .uint, + .arm, .armeb, .thumb, .thumbeb => if (os != .windows and os != .netbsd and os != .openbsd) .uint else .int, + .aarch64, .aarch64_be => if (!os.isDarwin() and os != .netbsd) .uint else .int, + .x86_64, .x86 => if (os == .windows) .ushort else .int, + else => .int, + }; + + const ptr_width = comp.target.ptrBitWidth(); + ts.ptrdiff = if (os == .windows and ptr_width == 64) + .long_long + else switch (ptr_width) { + 16 => .int, + 32 => .int, + 64 => .long, + else => unreachable, + }; + + ts.size = if (os == .windows and ptr_width == 64) + .ulong_long + else switch (ptr_width) { + 16 => .uint, + 32 => .uint, + 64 => .ulong, + else => unreachable, + }; + + ts.pid_t = switch (os) { + .haiku => .long, + // Todo: pid_t is required to "a signed integer type"; are there any systems + // on which it is `short int`? + else => .int, + }; + + ts.intmax = target_util.intMaxType(comp.target); + ts.intptr = target_util.intPtrType(comp.target); + ts.int16 = target_util.int16Type(comp.target); + ts.int64 = target_util.int64Type(comp.target); + ts.uint_least16_t = comp.intLeastN(16, .unsigned); + ts.uint_least32_t = comp.intLeastN(32, .unsigned); + + ts.ns_constant_string = try ts.generateNsConstantStringType(comp); + ts.va_list = try ts.generateVaListType(comp); +} + +fn generateNsConstantStringType(ts: *TypeStore, comp: *Compilation) !QualType { + const const_int_ptr: QualType = .{ .@"const" = true, ._index = .int_pointer }; + const const_char_ptr: QualType = .{ .@"const" = true, ._index = .char_pointer }; + + var record: Type.Record = .{ + .name = try comp.internString("__NSConstantString_tag"), + .layout = null, + .decl_node = undefined, // TODO + .fields = &.{}, + }; + const qt = try ts.put(comp.gpa, .{ .@"struct" = record }); + + var fields: [4]Type.Record.Field = .{ + .{ .name = try comp.internString("isa"), .qt = const_int_ptr }, + .{ .name = try comp.internString("flags"), .qt = .int }, + .{ .name = try comp.internString("str"), .qt = const_char_ptr }, + .{ .name = try comp.internString("length"), .qt = .long }, + }; + record.fields = &fields; + record.layout = record_layout.compute(&fields, qt, comp, null) catch unreachable; + try ts.set(comp.gpa, .{ .@"struct" = record }, @intFromEnum(qt._index)); + + return qt; +} + +fn generateVaListType(ts: *TypeStore, comp: *Compilation) !QualType { + const Kind = enum { aarch64_va_list, x86_64_va_list }; + const kind: Kind = switch (comp.target.cpu.arch) { + .aarch64, .aarch64_be => switch (comp.target.os.tag) { + .windows => return .char_pointer, + .ios, .macos, .tvos, .watchos => return .char_pointer, + else => .aarch64_va_list, + }, + .arm, .armeb, .thumb, .thumbeb => switch (comp.target.os.tag) { + .ios, .macos, .tvos, .watchos, .visionos => return .char_pointer, + else => return .void_pointer, + }, + .sparc, .wasm32, .wasm64, .bpfel, .bpfeb, .riscv32, .riscv64, .avr, .spirv32, .spirv64 => return .void_pointer, + .powerpc => switch (comp.target.os.tag) { + .ios, .macos, .tvos, .watchos, .aix => return .char_pointer, + else => return .void, // unknown + }, + .x86, .msp430 => return .char_pointer, + .x86_64 => switch (comp.target.os.tag) { + .windows => return .char_pointer, + else => .x86_64_va_list, + }, + else => return .void, // unknown + }; + + const struct_qt = switch (kind) { + .aarch64_va_list => blk: { + var record: Type.Record = .{ + .name = try comp.internString("__va_list_tag"), + .decl_node = undefined, // TODO + .layout = null, + .fields = &.{}, + }; + const qt = try ts.put(comp.gpa, .{ .@"struct" = record }); + + var fields: [5]Type.Record.Field = .{ + .{ .name = try comp.internString("__stack"), .qt = .void_pointer }, + .{ .name = try comp.internString("__gr_top"), .qt = .void_pointer }, + .{ .name = try comp.internString("__vr_top"), .qt = .void_pointer }, + .{ .name = try comp.internString("__gr_offs"), .qt = .int }, + .{ .name = try comp.internString("__vr_offs"), .qt = .int }, + }; + record.fields = &fields; + record.layout = record_layout.compute(&fields, qt, comp, null) catch unreachable; + try ts.set(comp.gpa, .{ .@"struct" = record }, @intFromEnum(qt._index)); + + break :blk qt; + }, + .x86_64_va_list => blk: { + var record: Type.Record = .{ + .name = try comp.internString("__va_list_tag"), + .decl_node = undefined, // TODO + .layout = null, + .fields = &.{}, + }; + const qt = try ts.put(comp.gpa, .{ .@"struct" = record }); + + var fields: [4]Type.Record.Field = .{ + .{ .name = try comp.internString("gp_offset"), .qt = .uint }, + .{ .name = try comp.internString("fp_offset"), .qt = .uint }, + .{ .name = try comp.internString("overflow_arg_area"), .qt = .void_pointer }, + .{ .name = try comp.internString("reg_save_area"), .qt = .void_pointer }, + }; + record.fields = &fields; + record.layout = record_layout.compute(&fields, qt, comp, null) catch unreachable; + try ts.set(comp.gpa, .{ .@"struct" = record }, @intFromEnum(qt._index)); + + break :blk qt; + }, + }; + + return ts.put(comp.gpa, .{ .array = .{ + .elem = struct_qt, + .len = .{ .fixed = 1 }, + } }); +} + +/// An unfinished Type +pub const Builder = struct { + parser: *Parser, + + @"const": ?TokenIndex = null, + /// _Atomic + atomic: ?TokenIndex = null, + @"volatile": ?TokenIndex = null, + restrict: ?TokenIndex = null, + unaligned: ?TokenIndex = null, + nullability: union(enum) { + none, + nonnull: TokenIndex, + nullable: TokenIndex, + nullable_result: TokenIndex, + null_unspecified: TokenIndex, + } = .none, + + complex_tok: ?TokenIndex = null, + bit_int_tok: ?TokenIndex = null, + typedef: bool = false, + typeof: bool = false, + /// _Atomic(type) + atomic_type: ?TokenIndex = null, + + type: Specifier = .none, + /// When true an error is returned instead of adding a diagnostic message. + /// Used for trying to combine typedef types. + error_on_invalid: bool = false, + + pub const Specifier = union(enum) { + none, + void, + /// GNU __auto_type extension + auto_type, + /// C23 auto + c23_auto, + nullptr_t, + bool, + char, + schar, + uchar, + complex_char, + complex_schar, + complex_uchar, + + unsigned, + signed, + short, + sshort, + ushort, + short_int, + sshort_int, + ushort_int, + int, + sint, + uint, + long, + slong, + ulong, + long_int, + slong_int, + ulong_int, + long_long, + slong_long, + ulong_long, + long_long_int, + slong_long_int, + ulong_long_int, + int128, + sint128, + uint128, + complex_unsigned, + complex_signed, + complex_short, + complex_sshort, + complex_ushort, + complex_short_int, + complex_sshort_int, + complex_ushort_int, + complex_int, + complex_sint, + complex_uint, + complex_long, + complex_slong, + complex_ulong, + complex_long_int, + complex_slong_int, + complex_ulong_int, + complex_long_long, + complex_slong_long, + complex_ulong_long, + complex_long_long_int, + complex_slong_long_int, + complex_ulong_long_int, + complex_int128, + complex_sint128, + complex_uint128, + bit_int: u64, + sbit_int: u64, + ubit_int: u64, + complex_bit_int: u64, + complex_sbit_int: u64, + complex_ubit_int: u64, + + fp16, + float16, + float, + double, + long_double, + float128, + complex, + complex_float16, + complex_float, + complex_double, + complex_long_double, + complex_float128, + + // Any not simply constructed from specifier keywords. + other: QualType, + + pub fn str(spec: Builder.Specifier, langopts: LangOpts) ?[]const u8 { + return switch (spec) { + .none => unreachable, + .void => "void", + .auto_type => "__auto_type", + .c23_auto => "auto", + .nullptr_t => "nullptr_t", + .bool => if (langopts.standard.atLeast(.c23)) "bool" else "_Bool", + .char => "char", + .schar => "signed char", + .uchar => "unsigned char", + .unsigned => "unsigned", + .signed => "signed", + .short => "short", + .ushort => "unsigned short", + .sshort => "signed short", + .short_int => "short int", + .sshort_int => "signed short int", + .ushort_int => "unsigned short int", + .int => "int", + .sint => "signed int", + .uint => "unsigned int", + .long => "long", + .slong => "signed long", + .ulong => "unsigned long", + .long_int => "long int", + .slong_int => "signed long int", + .ulong_int => "unsigned long int", + .long_long => "long long", + .slong_long => "signed long long", + .ulong_long => "unsigned long long", + .long_long_int => "long long int", + .slong_long_int => "signed long long int", + .ulong_long_int => "unsigned long long int", + .int128 => "__int128", + .sint128 => "signed __int128", + .uint128 => "unsigned __int128", + .complex_char => "_Complex char", + .complex_schar => "_Complex signed char", + .complex_uchar => "_Complex unsigned char", + .complex_unsigned => "_Complex unsigned", + .complex_signed => "_Complex signed", + .complex_short => "_Complex short", + .complex_ushort => "_Complex unsigned short", + .complex_sshort => "_Complex signed short", + .complex_short_int => "_Complex short int", + .complex_sshort_int => "_Complex signed short int", + .complex_ushort_int => "_Complex unsigned short int", + .complex_int => "_Complex int", + .complex_sint => "_Complex signed int", + .complex_uint => "_Complex unsigned int", + .complex_long => "_Complex long", + .complex_slong => "_Complex signed long", + .complex_ulong => "_Complex unsigned long", + .complex_long_int => "_Complex long int", + .complex_slong_int => "_Complex signed long int", + .complex_ulong_int => "_Complex unsigned long int", + .complex_long_long => "_Complex long long", + .complex_slong_long => "_Complex signed long long", + .complex_ulong_long => "_Complex unsigned long long", + .complex_long_long_int => "_Complex long long int", + .complex_slong_long_int => "_Complex signed long long int", + .complex_ulong_long_int => "_Complex unsigned long long int", + .complex_int128 => "_Complex __int128", + .complex_sint128 => "_Complex signed __int128", + .complex_uint128 => "_Complex unsigned __int128", + + .fp16 => "__fp16", + .float16 => "_Float16", + .float => "float", + .double => "double", + .long_double => "long double", + .float128 => "__float128", + .complex => "_Complex", + .complex_float16 => "_Complex _Float16", + .complex_float => "_Complex float", + .complex_double => "_Complex double", + .complex_long_double => "_Complex long double", + .complex_float128 => "_Complex __float128", + + else => null, + }; + } + }; + + pub fn finish(b: Builder) Parser.Error!QualType { + const qt: QualType = switch (b.type) { + .none => blk: { + if (b.parser.comp.langopts.standard.atLeast(.c23)) { + try b.parser.err(b.parser.tok_i, .missing_type_specifier_c23, .{}); + } else { + try b.parser.err(b.parser.tok_i, .missing_type_specifier, .{}); + } + break :blk .int; + }, + .void => .void, + .auto_type => .auto_type, + .c23_auto => .c23_auto, + .nullptr_t => unreachable, // nullptr_t can only be accessed via typeof(nullptr) + .bool => .bool, + .char => .char, + .schar => .schar, + .uchar => .uchar, + + .unsigned => .uint, + .signed => .int, + .short_int, .sshort_int, .short, .sshort => .short, + .ushort, .ushort_int => .ushort, + .int, .sint => .int, + .uint => .uint, + .long, .slong, .long_int, .slong_int => .long, + .ulong, .ulong_int => .ulong, + .long_long, .slong_long, .long_long_int, .slong_long_int => .long_long, + .ulong_long, .ulong_long_int => .ulong_long, + .int128, .sint128 => .int128, + .uint128 => .uint128, + + .complex_char, + .complex_schar, + .complex_uchar, + .complex_unsigned, + .complex_signed, + .complex_short_int, + .complex_sshort_int, + .complex_short, + .complex_sshort, + .complex_ushort, + .complex_ushort_int, + .complex_int, + .complex_sint, + .complex_uint, + .complex_long, + .complex_slong, + .complex_long_int, + .complex_slong_int, + .complex_ulong, + .complex_ulong_int, + .complex_long_long, + .complex_slong_long, + .complex_long_long_int, + .complex_slong_long_int, + .complex_ulong_long, + .complex_ulong_long_int, + .complex_int128, + .complex_sint128, + .complex_uint128, + => blk: { + const base_qt: QualType = switch (b.type) { + .complex_char => .char, + .complex_schar => .schar, + .complex_uchar => .uchar, + .complex_unsigned => .uint, + .complex_signed => .int, + .complex_short_int, .complex_sshort_int, .complex_short, .complex_sshort => .short, + .complex_ushort, .complex_ushort_int => .ushort, + .complex_int, .complex_sint => .int, + .complex_uint => .uint, + .complex_long, .complex_slong, .complex_long_int, .complex_slong_int => .long, + .complex_ulong, .complex_ulong_int => .ulong, + .complex_long_long, .complex_slong_long, .complex_long_long_int, .complex_slong_long_int => .long_long, + .complex_ulong_long, .complex_ulong_long_int => .ulong_long, + .complex_int128, .complex_sint128 => .int128, + .complex_uint128 => .uint128, + else => unreachable, + }; + if (b.complex_tok) |tok| try b.parser.err(tok, .complex_int, .{}); + break :blk try base_qt.toComplex(b.parser.comp); + }, + + .bit_int, .sbit_int, .ubit_int, .complex_bit_int, .complex_ubit_int, .complex_sbit_int => |bits| blk: { + const unsigned = b.type == .ubit_int or b.type == .complex_ubit_int; + const complex = b.type == .complex_bit_int or b.type == .complex_ubit_int or b.type == .complex_sbit_int; + const complex_str = if (complex) "_Complex " else ""; + + if (unsigned) { + if (bits < 1) { + try b.parser.err(b.bit_int_tok.?, .unsigned_bit_int_too_small, .{complex_str}); + return .invalid; + } + } else { + if (bits < 2) { + try b.parser.err(b.bit_int_tok.?, .signed_bit_int_too_small, .{complex_str}); + return .invalid; + } + } + if (bits > Compilation.bit_int_max_bits) { + try b.parser.err(b.bit_int_tok.?, if (unsigned) .unsigned_bit_int_too_big else .signed_bit_int_too_big, .{complex_str}); + return .invalid; + } + if (b.complex_tok) |tok| try b.parser.err(tok, .complex_int, .{}); + + const qt = try b.parser.comp.type_store.put(b.parser.comp.gpa, .{ .bit_int = .{ + .signedness = if (unsigned) .unsigned else .signed, + .bits = @intCast(bits), + } }); + break :blk if (complex) try qt.toComplex(b.parser.comp) else qt; + }, + + .fp16 => .fp16, + .float16 => .float16, + .float => .float, + .double => .double, + .long_double => .long_double, + .float128 => .float128, + + .complex_float16, + .complex_float, + .complex_double, + .complex_long_double, + .complex_float128, + .complex, + => blk: { + const base_qt: QualType = switch (b.type) { + .complex_float16 => .float16, + .complex_float => .float, + .complex_double => .double, + .complex_long_double => .long_double, + .complex_float128 => .float128, + .complex => .double, + else => unreachable, + }; + if (b.type == .complex) try b.parser.err(b.parser.tok_i - 1, .plain_complex, .{}); + break :blk try base_qt.toComplex(b.parser.comp); + }, + + .other => |qt| qt, + }; + return b.finishQuals(qt); + } + + pub fn finishQuals(b: Builder, qt: QualType) !QualType { + if (qt.isInvalid()) return .invalid; + const gpa = b.parser.comp.gpa; + var result_qt = qt; + if (b.atomic_type orelse b.atomic) |atomic_tok| { + if (result_qt.isAutoType()) return b.parser.todo("_Atomic __auto_type"); + if (result_qt.isC23Auto()) { + try b.parser.err(atomic_tok, .atomic_auto, .{}); + return .invalid; + } + if (result_qt.hasIncompleteSize(b.parser.comp)) { + try b.parser.err(atomic_tok, .atomic_incomplete, .{qt}); + return .invalid; + } + switch (result_qt.base(b.parser.comp).type) { + .array => { + try b.parser.err(atomic_tok, .atomic_array, .{qt}); + return .invalid; + }, + .func => { + try b.parser.err(atomic_tok, .atomic_func, .{qt}); + return .invalid; + }, + .atomic => { + try b.parser.err(atomic_tok, .atomic_atomic, .{qt}); + return .invalid; + }, + .complex => { + try b.parser.err(atomic_tok, .atomic_complex, .{qt}); + return .invalid; + }, + else => { + result_qt = try b.parser.comp.type_store.put(gpa, .{ .atomic = result_qt }); + }, + } + } + + // We can't use `qt.isPointer()` because `qt` might contain a `.declarator_combine`. + const is_pointer = qt.isAutoType() or qt.isC23Auto() or qt.base(b.parser.comp).type == .pointer; + + if (b.unaligned != null and !is_pointer) { + result_qt = (try b.parser.comp.type_store.put(gpa, .{ .attributed = .{ + .base = result_qt, + .attributes = &.{.{ .tag = .unaligned, .args = .{ .unaligned = .{} }, .syntax = .keyword }}, + } })).withQualifiers(result_qt); + } + switch (b.nullability) { + .none => {}, + .nonnull, + .nullable, + .nullable_result, + .null_unspecified, + => |tok| if (!is_pointer) { + // TODO this should be checked later so that auto types can be properly validated. + try b.parser.err(tok, .invalid_nullability, .{qt}); + }, + } + + if (b.@"const" != null) result_qt.@"const" = true; + if (b.@"volatile" != null) result_qt.@"volatile" = true; + + if (b.restrict) |restrict_tok| { + if (result_qt.isAutoType()) return b.parser.todo("restrict __auto_type"); + if (result_qt.isC23Auto()) { + try b.parser.err(restrict_tok, .restrict_non_pointer, .{qt}); + return result_qt; + } + switch (qt.base(b.parser.comp).type) { + .array, .pointer => result_qt.restrict = true, + else => { + try b.parser.err(restrict_tok, .restrict_non_pointer, .{qt}); + }, + } + } + return result_qt; + } + + fn cannotCombine(b: Builder, source_tok: TokenIndex) !void { + if (b.type.str(b.parser.comp.langopts)) |some| { + return b.parser.err(source_tok, .cannot_combine_spec, .{some}); + } + try b.parser.err(source_tok, .cannot_combine_spec_qt, .{try b.finish()}); + } + + fn duplicateSpec(b: *Builder, source_tok: TokenIndex, spec: []const u8) !void { + if (b.parser.comp.langopts.emulate != .clang) return b.cannotCombine(source_tok); + try b.parser.err(b.parser.tok_i, .duplicate_decl_spec, .{spec}); + } + + pub fn combineFromTypeof(b: *Builder, new: QualType, source_tok: TokenIndex) Compilation.Error!void { + if (b.atomic_type != null) return b.parser.err(source_tok, .cannot_combine_spec, .{"_Atomic"}); + if (b.typedef) return b.parser.err(source_tok, .cannot_combine_spec, .{"type-name"}); + if (b.typeof) return b.parser.err(source_tok, .cannot_combine_spec, .{"typeof"}); + if (b.type != .none) return b.parser.err(source_tok, .cannot_combine_with_typeof, .{@tagName(b.type)}); + b.typeof = true; + b.type = .{ .other = new }; + } + + pub fn combineAtomic(b: *Builder, base_qt: QualType, source_tok: TokenIndex) !void { + if (b.atomic_type != null) return b.parser.err(source_tok, .cannot_combine_spec, .{"_Atomic"}); + if (b.typedef) return b.parser.err(source_tok, .cannot_combine_spec, .{"type-name"}); + if (b.typeof) return b.parser.err(source_tok, .cannot_combine_spec, .{"typeof"}); + + const new_spec = TypeStore.Builder.fromType(b.parser.comp, base_qt); + try b.combine(new_spec, source_tok); + + b.atomic_type = source_tok; + } + + /// Try to combine type from typedef, returns true if successful. + pub fn combineTypedef(b: *Builder, typedef_qt: QualType) bool { + if (b.type != .none) return false; + + b.typedef = true; + b.type = .{ .other = typedef_qt }; + return true; + } + + pub fn combine(b: *Builder, new: Builder.Specifier, source_tok: TokenIndex) !void { + if (b.typeof) { + return b.parser.err(source_tok, .cannot_combine_with_typeof, .{@tagName(new)}); + } + if (b.atomic_type != null) { + return b.parser.err(source_tok, .cannot_combine_spec, .{"_Atomic"}); + } + if (b.typedef) { + return b.parser.err(source_tok, .cannot_combine_spec, .{"type-name"}); + } + if (b.type == .other and b.type.other.isInvalid()) return; + + switch (new) { + .complex => b.complex_tok = source_tok, + .bit_int => b.bit_int_tok = source_tok, + else => {}, + } + + if (new == .int128 and !target_util.hasInt128(b.parser.comp.target)) { + try b.parser.err(source_tok, .type_not_supported_on_target, .{"__int128"}); + } + + b.type = switch (new) { + else => switch (b.type) { + .none => new, + else => return b.cannotCombine(source_tok), + }, + .signed => switch (b.type) { + .none => .signed, + .char => .schar, + .short => .sshort, + .short_int => .sshort_int, + .int => .sint, + .long => .slong, + .long_int => .slong_int, + .long_long => .slong_long, + .long_long_int => .slong_long_int, + .int128 => .sint128, + .bit_int => |bits| .{ .sbit_int = bits }, + .complex => .complex_signed, + .complex_char => .complex_schar, + .complex_short => .complex_sshort, + .complex_short_int => .complex_sshort_int, + .complex_int => .complex_sint, + .complex_long => .complex_slong, + .complex_long_int => .complex_slong_int, + .complex_long_long => .complex_slong_long, + .complex_long_long_int => .complex_slong_long_int, + .complex_int128 => .sint128, + .complex_bit_int => |bits| .{ .complex_sbit_int = bits }, + .signed, + .sshort, + .sshort_int, + .sint, + .slong, + .slong_int, + .slong_long, + .slong_long_int, + .sint128, + .sbit_int, + .complex_schar, + .complex_signed, + .complex_sshort, + .complex_sshort_int, + .complex_sint, + .complex_slong, + .complex_slong_int, + .complex_slong_long, + .complex_slong_long_int, + .complex_sint128, + .complex_sbit_int, + => return b.duplicateSpec(source_tok, "signed"), + else => return b.cannotCombine(source_tok), + }, + .unsigned => switch (b.type) { + .none => .unsigned, + .char => .uchar, + .short => .ushort, + .short_int => .ushort_int, + .int => .uint, + .long => .ulong, + .long_int => .ulong_int, + .long_long => .ulong_long, + .long_long_int => .ulong_long_int, + .int128 => .uint128, + .bit_int => |bits| .{ .ubit_int = bits }, + .complex => .complex_unsigned, + .complex_char => .complex_uchar, + .complex_short => .complex_ushort, + .complex_short_int => .complex_ushort_int, + .complex_int => .complex_uint, + .complex_long => .complex_ulong, + .complex_long_int => .complex_ulong_int, + .complex_long_long => .complex_ulong_long, + .complex_long_long_int => .complex_ulong_long_int, + .complex_int128 => .complex_uint128, + .complex_bit_int => |bits| .{ .complex_ubit_int = bits }, + .unsigned, + .ushort, + .ushort_int, + .uint, + .ulong, + .ulong_int, + .ulong_long, + .ulong_long_int, + .uint128, + .ubit_int, + .complex_uchar, + .complex_unsigned, + .complex_ushort, + .complex_ushort_int, + .complex_uint, + .complex_ulong, + .complex_ulong_int, + .complex_ulong_long, + .complex_ulong_long_int, + .complex_uint128, + .complex_ubit_int, + => return b.duplicateSpec(source_tok, "unsigned"), + else => return b.cannotCombine(source_tok), + }, + .char => switch (b.type) { + .none => .char, + .unsigned => .uchar, + .signed => .schar, + .complex => .complex_char, + .complex_signed => .schar, + .complex_unsigned => .uchar, + else => return b.cannotCombine(source_tok), + }, + .short => switch (b.type) { + .none => .short, + .unsigned => .ushort, + .signed => .sshort, + .int => .short_int, + .sint => .sshort_int, + .uint => .ushort_int, + .complex => .complex_short, + .complex_signed => .sshort, + .complex_unsigned => .ushort, + else => return b.cannotCombine(source_tok), + }, + .int => switch (b.type) { + .none => .int, + .signed => .sint, + .unsigned => .uint, + .short => .short_int, + .sshort => .sshort_int, + .ushort => .ushort_int, + .long => .long_int, + .slong => .slong_int, + .ulong => .ulong_int, + .long_long => .long_long_int, + .slong_long => .slong_long_int, + .ulong_long => .ulong_long_int, + .complex => .complex_int, + .complex_signed => .complex_sint, + .complex_unsigned => .complex_uint, + .complex_short => .complex_short_int, + .complex_sshort => .complex_sshort_int, + .complex_ushort => .complex_ushort_int, + .complex_long => .complex_long_int, + .complex_slong => .complex_slong_int, + .complex_ulong => .complex_ulong_int, + .complex_long_long => .complex_long_long_int, + .complex_slong_long => .complex_slong_long_int, + .complex_ulong_long => .complex_ulong_long_int, + else => return b.cannotCombine(source_tok), + }, + .long => switch (b.type) { + .none => .long, + .double => .long_double, + .unsigned => .ulong, + .signed => .slong, + .int => .long_int, + .uint => .ulong_int, + .sint => .slong_int, + .long => .long_long, + .slong => .slong_long, + .ulong => .ulong_long, + .complex => .complex_long, + .complex_signed => .complex_slong, + .complex_unsigned => .complex_ulong, + .complex_long => .complex_long_long, + .complex_slong => .complex_slong_long, + .complex_ulong => .complex_ulong_long, + .complex_double => .complex_long_double, + else => return b.cannotCombine(source_tok), + }, + .long_long => switch (b.type) { + .none => .long_long, + .unsigned => .ulong_long, + .signed => .slong_long, + .int => .long_long_int, + .sint => .slong_long_int, + .long => .long_long, + .slong => .slong_long, + .ulong => .ulong_long, + .complex => .complex_long, + .complex_signed => .complex_slong_long, + .complex_unsigned => .complex_ulong_long, + .complex_long => .complex_long_long, + .complex_slong => .complex_slong_long, + .complex_ulong => .complex_ulong_long, + .long_long, + .ulong_long, + .ulong_long_int, + .complex_long_long, + .complex_ulong_long, + .complex_ulong_long_int, + => return b.duplicateSpec(source_tok, "long"), + else => return b.cannotCombine(source_tok), + }, + .int128 => switch (b.type) { + .none => .int128, + .unsigned => .uint128, + .signed => .sint128, + .complex => .complex_int128, + .complex_signed => .complex_sint128, + .complex_unsigned => .complex_uint128, + else => return b.cannotCombine(source_tok), + }, + .bit_int => switch (b.type) { + .none => .{ .bit_int = new.bit_int }, + .unsigned => .{ .ubit_int = new.bit_int }, + .signed => .{ .sbit_int = new.bit_int }, + .complex => .{ .complex_bit_int = new.bit_int }, + .complex_signed => .{ .complex_sbit_int = new.bit_int }, + .complex_unsigned => .{ .complex_ubit_int = new.bit_int }, + else => return b.cannotCombine(source_tok), + }, + .auto_type => switch (b.type) { + .none => .auto_type, + else => return b.cannotCombine(source_tok), + }, + .c23_auto => switch (b.type) { + .none => .c23_auto, + else => return b.cannotCombine(source_tok), + }, + .fp16 => switch (b.type) { + .none => .fp16, + else => return b.cannotCombine(source_tok), + }, + .float16 => switch (b.type) { + .none => .float16, + .complex => .complex_float16, + else => return b.cannotCombine(source_tok), + }, + .float => switch (b.type) { + .none => .float, + .complex => .complex_float, + else => return b.cannotCombine(source_tok), + }, + .double => switch (b.type) { + .none => .double, + .long => .long_double, + .complex_long => .complex_long_double, + .complex => .complex_double, + else => return b.cannotCombine(source_tok), + }, + .float128 => switch (b.type) { + .none => .float128, + .complex => .complex_float128, + else => return b.cannotCombine(source_tok), + }, + .complex => switch (b.type) { + .none => .complex, + .float16 => .complex_float16, + .float => .complex_float, + .double => .complex_double, + .long_double => .complex_long_double, + .float128 => .complex_float128, + .char => .complex_char, + .schar => .complex_schar, + .uchar => .complex_uchar, + .unsigned => .complex_unsigned, + .signed => .complex_signed, + .short => .complex_short, + .sshort => .complex_sshort, + .ushort => .complex_ushort, + .short_int => .complex_short_int, + .sshort_int => .complex_sshort_int, + .ushort_int => .complex_ushort_int, + .int => .complex_int, + .sint => .complex_sint, + .uint => .complex_uint, + .long => .complex_long, + .slong => .complex_slong, + .ulong => .complex_ulong, + .long_int => .complex_long_int, + .slong_int => .complex_slong_int, + .ulong_int => .complex_ulong_int, + .long_long => .complex_long_long, + .slong_long => .complex_slong_long, + .ulong_long => .complex_ulong_long, + .long_long_int => .complex_long_long_int, + .slong_long_int => .complex_slong_long_int, + .ulong_long_int => .complex_ulong_long_int, + .int128 => .complex_int128, + .sint128 => .complex_sint128, + .uint128 => .complex_uint128, + .bit_int => |bits| .{ .complex_bit_int = bits }, + .sbit_int => |bits| .{ .complex_sbit_int = bits }, + .ubit_int => |bits| .{ .complex_ubit_int = bits }, + .complex, + .complex_float, + .complex_double, + .complex_long_double, + .complex_float128, + .complex_char, + .complex_schar, + .complex_uchar, + .complex_unsigned, + .complex_signed, + .complex_short, + .complex_sshort, + .complex_ushort, + .complex_short_int, + .complex_sshort_int, + .complex_ushort_int, + .complex_int, + .complex_sint, + .complex_uint, + .complex_long, + .complex_slong, + .complex_ulong, + .complex_long_int, + .complex_slong_int, + .complex_ulong_int, + .complex_long_long, + .complex_slong_long, + .complex_ulong_long, + .complex_long_long_int, + .complex_slong_long_int, + .complex_ulong_long_int, + .complex_int128, + .complex_sint128, + .complex_uint128, + .complex_bit_int, + .complex_sbit_int, + .complex_ubit_int, + => return b.duplicateSpec(source_tok, "_Complex"), + else => return b.cannotCombine(source_tok), + }, + }; + } + + pub fn fromType(comp: *const Compilation, qt: QualType) Builder.Specifier { + return switch (qt.base(comp).type) { + .void => .void, + .nullptr_t => .nullptr_t, + .bool => .bool, + .int => |int| switch (int) { + .char => .char, + .schar => .schar, + .uchar => .uchar, + .short => .short, + .ushort => .ushort, + .int => .int, + .uint => .uint, + .long => .long, + .ulong => .ulong, + .long_long => .long_long, + .ulong_long => .ulong_long, + .int128 => .int128, + .uint128 => .uint128, + }, + .bit_int => |bit_int| if (bit_int.signedness == .unsigned) { + return .{ .ubit_int = bit_int.bits }; + } else { + return .{ .bit_int = bit_int.bits }; + }, + .float => |float| switch (float) { + .fp16 => .fp16, + .float16 => .float16, + .float => .float, + .double => .double, + .long_double => .long_double, + .float128 => .float128, + }, + .complex => |complex| switch (complex.base(comp).type) { + .int => |int| switch (int) { + .char => .complex_char, + .schar => .complex_schar, + .uchar => .complex_uchar, + .short => .complex_short, + .ushort => .complex_ushort, + .int => .complex_int, + .uint => .complex_uint, + .long => .complex_long, + .ulong => .complex_ulong, + .long_long => .complex_long_long, + .ulong_long => .complex_ulong_long, + .int128 => .complex_int128, + .uint128 => .complex_uint128, + }, + .bit_int => |bit_int| if (bit_int.signedness == .unsigned) { + return .{ .complex_ubit_int = bit_int.bits }; + } else { + return .{ .complex_bit_int = bit_int.bits }; + }, + .float => |float| switch (float) { + .fp16 => unreachable, + .float16 => .complex_float16, + .float => .complex_float, + .double => .complex_double, + .long_double => .complex_long_double, + .float128 => .complex_float128, + }, + else => unreachable, + }, + else => .{ .other = qt }, + }; + } +}; diff --git a/lib/compiler/aro/aro/Value.zig b/lib/compiler/aro/aro/Value.zig index 183c55797607..16a692e56495 100644 --- a/lib/compiler/aro/aro/Value.zig +++ b/lib/compiler/aro/aro/Value.zig @@ -2,13 +2,14 @@ const std = @import("std"); const assert = std.debug.assert; const BigIntConst = std.math.big.int.Const; const BigIntMutable = std.math.big.int.Mutable; -const backend = @import("../backend.zig"); -const Interner = backend.Interner; + +const Interner = @import("../backend.zig").Interner; const BigIntSpace = Interner.Tag.Int.BigIntSpace; + +const annex_g = @import("annex_g.zig"); const Compilation = @import("Compilation.zig"); -const Type = @import("Type.zig"); const target_util = @import("target.zig"); -const annex_g = @import("annex_g.zig"); +const QualType = @import("TypeStore.zig").QualType; const Value = @This(); @@ -32,11 +33,19 @@ pub fn int(i: anytype, comp: *Compilation) !Value { } } +pub fn pointer(r: Interner.Key.Pointer, comp: *Compilation) !Value { + return intern(comp, .{ .pointer = r }); +} + pub fn ref(v: Value) Interner.Ref { std.debug.assert(v.opt_ref != .none); return @enumFromInt(@intFromEnum(v.opt_ref)); } +pub fn fromRef(r: Interner.Ref) Value { + return .{ .opt_ref = @enumFromInt(@intFromEnum(r)) }; +} + pub fn is(v: Value, tag: std.meta.Tag(Interner.Key), comp: *const Compilation) bool { if (v.opt_ref == .none) return false; return comp.interner.get(v.ref()) == tag; @@ -67,7 +76,11 @@ test "minUnsignedBits" { } }; - var comp = Compilation.init(std.testing.allocator, std.fs.cwd()); + var arena_state: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena_state.deinit(); + const arena = arena_state.allocator(); + + var comp = Compilation.init(std.testing.allocator, arena, undefined, std.fs.cwd()); defer comp.deinit(); const target_query = try std.Target.Query.parse(.{ .arch_os_abi = "x86_64-linux-gnu" }); comp.target = try std.zig.system.resolveTargetQuery(target_query); @@ -102,7 +115,11 @@ test "minSignedBits" { } }; - var comp = Compilation.init(std.testing.allocator, std.fs.cwd()); + var arena_state: std.heap.ArenaAllocator = .init(std.testing.allocator); + defer arena_state.deinit(); + const arena = arena_state.allocator(); + + var comp = Compilation.init(std.testing.allocator, arena, undefined, std.fs.cwd()); defer comp.deinit(); const target_query = try std.Target.Query.parse(.{ .arch_os_abi = "x86_64-linux-gnu" }); comp.target = try std.zig.system.resolveTargetQuery(target_query); @@ -132,24 +149,27 @@ pub const FloatToIntChangeKind = enum { /// Converts the stored value from a float to an integer. /// `.none` value remains unchanged. -pub fn floatToInt(v: *Value, dest_ty: Type, comp: *Compilation) !FloatToIntChangeKind { +pub fn floatToInt(v: *Value, dest_ty: QualType, comp: *Compilation) !FloatToIntChangeKind { if (v.opt_ref == .none) return .none; const float_val = v.toFloat(f128, comp); const was_zero = float_val == 0; - if (dest_ty.is(.bool)) { + if (dest_ty.is(comp, .bool)) { const was_one = float_val == 1.0; v.* = fromBool(!was_zero); if (was_zero or was_one) return .none; return .value_changed; - } else if (dest_ty.isUnsignedInt(comp) and float_val < 0) { + } else if (dest_ty.signedness(comp) == .unsigned and float_val < 0) { v.* = zero; return .out_of_range; + } else if (!std.math.isFinite(float_val)) { + v.* = .{}; + return .overflow; } const signedness = dest_ty.signedness(comp); - const bits: usize = @intCast(dest_ty.bitSizeof(comp).?); + const bits: usize = @intCast(dest_ty.bitSizeof(comp)); var big_int: std.math.big.int.Mutable = .{ .limbs = try comp.gpa.alloc(std.math.big.Limb, @max( @@ -159,6 +179,7 @@ pub fn floatToInt(v: *Value, dest_ty: Type, comp: *Compilation) !FloatToIntChang .len = undefined, .positive = undefined, }; + defer comp.gpa.free(big_int.limbs); const had_fraction = switch (big_int.setFloat(float_val, .trunc)) { .inexact => true, .exact => false, @@ -176,11 +197,11 @@ pub fn floatToInt(v: *Value, dest_ty: Type, comp: *Compilation) !FloatToIntChang /// Converts the stored value from an integer to a float. /// `.none` value remains unchanged. -pub fn intToFloat(v: *Value, dest_ty: Type, comp: *Compilation) !void { +pub fn intToFloat(v: *Value, dest_ty: QualType, comp: *Compilation) !void { if (v.opt_ref == .none) return; - if (dest_ty.isComplex()) { - const bits = dest_ty.bitSizeof(comp).?; + if (dest_ty.is(comp, .complex)) { + const bits = dest_ty.bitSizeof(comp); const cf: Interner.Key.Complex = switch (bits) { 32 => .{ .cf16 = .{ v.toFloat(f16, comp), 0 } }, 64 => .{ .cf32 = .{ v.toFloat(f32, comp), 0 } }, @@ -192,7 +213,7 @@ pub fn intToFloat(v: *Value, dest_ty: Type, comp: *Compilation) !void { v.* = try intern(comp, .{ .complex = cf }); return; } - const bits = dest_ty.bitSizeof(comp).?; + const bits = dest_ty.bitSizeof(comp); return switch (comp.interner.get(v.ref()).int) { inline .u64, .i64 => |data| { const f: Interner.Key.Float = switch (bits) { @@ -231,14 +252,16 @@ pub const IntCastChangeKind = enum { /// Truncates or extends bits based on type. /// `.none` value remains unchanged. -pub fn intCast(v: *Value, dest_ty: Type, comp: *Compilation) !IntCastChangeKind { +pub fn intCast(v: *Value, dest_ty: QualType, comp: *Compilation) !IntCastChangeKind { if (v.opt_ref == .none) return .none; + const key = comp.interner.get(v.ref()); + if (key == .pointer or key == .bytes) return .none; - const dest_bits: usize = @intCast(dest_ty.bitSizeof(comp).?); + const dest_bits: usize = @intCast(dest_ty.bitSizeof(comp)); const dest_signed = dest_ty.signedness(comp) == .signed; var space: BigIntSpace = undefined; - const big = v.toBigInt(&space, comp); + const big = key.toBigInt(&space); const value_bits = big.bitCountTwosComp(); // if big is negative, then is signed. @@ -268,10 +291,10 @@ pub fn intCast(v: *Value, dest_ty: Type, comp: *Compilation) !IntCastChangeKind /// Converts the stored value to a float of the specified type /// `.none` value remains unchanged. -pub fn floatCast(v: *Value, dest_ty: Type, comp: *Compilation) !void { +pub fn floatCast(v: *Value, dest_ty: QualType, comp: *Compilation) !void { if (v.opt_ref == .none) return; - const bits = dest_ty.bitSizeof(comp).?; - if (dest_ty.isComplex()) { + const bits = dest_ty.bitSizeof(comp); + if (dest_ty.is(comp, .complex)) { const cf: Interner.Key.Complex = switch (bits) { 32 => .{ .cf16 = .{ v.toFloat(f16, comp), v.imag(f16, comp) } }, 64 => .{ .cf32 = .{ v.toFloat(f32, comp), v.imag(f32, comp) } }, @@ -369,11 +392,8 @@ fn bigIntToFloat(limbs: []const std.math.big.Limb, positive: bool) f128 { } } -pub fn toBigInt(val: Value, space: *BigIntSpace, comp: *const Compilation) BigIntConst { - return switch (comp.interner.get(val.ref()).int) { - inline .u64, .i64 => |x| BigIntMutable.init(&space.limbs, x).toConst(), - .big_int => |b| b, - }; +fn toBigInt(val: Value, space: *BigIntSpace, comp: *const Compilation) BigIntConst { + return comp.interner.get(val.ref()).toBigInt(space); } pub fn isZero(v: Value, comp: *const Compilation) bool { @@ -397,6 +417,7 @@ pub fn isZero(v: Value, comp: *const Compilation) bool { inline else => |data| return data[0] == 0.0 and data[1] == 0.0, }, .bytes => return false, + .pointer => return false, else => unreachable, } } @@ -460,12 +481,19 @@ pub fn toBool(v: Value, comp: *const Compilation) bool { pub fn toInt(v: Value, comptime T: type, comp: *const Compilation) ?T { if (v.opt_ref == .none) return null; - if (comp.interner.get(v.ref()) != .int) return null; + const key = comp.interner.get(v.ref()); + if (key != .int) return null; var space: BigIntSpace = undefined; - const big_int = v.toBigInt(&space, comp); + const big_int = key.toBigInt(&space); return big_int.toInt(T) catch null; } +pub fn toBytes(v: Value, comp: *const Compilation) []const u8 { + assert(v.opt_ref != .none); + const key = comp.interner.get(v.ref()); + return key.bytes; +} + const ComplexOp = enum { add, sub, @@ -491,10 +519,11 @@ fn complexAddSub(lhs: Value, rhs: Value, comptime T: type, op: ComplexOp, comp: }; } -pub fn add(res: *Value, lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !bool { - const bits: usize = @intCast(ty.bitSizeof(comp).?); - if (ty.isFloat()) { - if (ty.isComplex()) { +pub fn add(res: *Value, lhs: Value, rhs: Value, qt: QualType, comp: *Compilation) !bool { + const bits: usize = @intCast(qt.bitSizeof(comp)); + const scalar_kind = qt.scalarKind(comp); + if (scalar_kind.isFloat()) { + if (scalar_kind == .complex_float) { res.* = switch (bits) { 32 => try complexAddSub(lhs, rhs, f16, .add, comp), 64 => try complexAddSub(lhs, rhs, f32, .add, comp), @@ -515,29 +544,60 @@ pub fn add(res: *Value, lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !b }; res.* = try intern(comp, .{ .float = f }); return false; - } else { - var lhs_space: BigIntSpace = undefined; - var rhs_space: BigIntSpace = undefined; - const lhs_bigint = lhs.toBigInt(&lhs_space, comp); - const rhs_bigint = rhs.toBigInt(&rhs_space, comp); + } + const lhs_key = comp.interner.get(lhs.ref()); + const rhs_key = comp.interner.get(rhs.ref()); + if (lhs_key == .bytes or rhs_key == .bytes) { + res.* = .{}; + return false; + } + if (lhs_key == .pointer or rhs_key == .pointer) { + const rel, const index = if (lhs_key == .pointer) + .{ lhs_key.pointer, rhs } + else + .{ rhs_key.pointer, lhs }; + + const elem_size = try int(qt.childType(comp).sizeofOrNull(comp) orelse 1, comp); + var total_offset: Value = undefined; + const mul_overflow = try total_offset.mul(elem_size, index, comp.type_store.ptrdiff, comp); + const old_offset = fromRef(rel.offset); + const add_overflow = try total_offset.add(total_offset, old_offset, comp.type_store.ptrdiff, comp); + _ = try total_offset.intCast(comp.type_store.ptrdiff, comp); + res.* = try pointer(.{ .node = rel.node, .offset = total_offset.ref() }, comp); + return mul_overflow or add_overflow; + } - const limbs = try comp.gpa.alloc( - std.math.big.Limb, - std.math.big.int.calcTwosCompLimbCount(bits), - ); - defer comp.gpa.free(limbs); - var result_bigint = BigIntMutable{ .limbs = limbs, .positive = undefined, .len = undefined }; + var lhs_space: BigIntSpace = undefined; + var rhs_space: BigIntSpace = undefined; + const lhs_bigint = lhs_key.toBigInt(&lhs_space); + const rhs_bigint = rhs_key.toBigInt(&rhs_space); - const overflowed = result_bigint.addWrap(lhs_bigint, rhs_bigint, ty.signedness(comp), bits); - res.* = try intern(comp, .{ .int = .{ .big_int = result_bigint.toConst() } }); - return overflowed; - } + const limbs = try comp.gpa.alloc( + std.math.big.Limb, + std.math.big.int.calcTwosCompLimbCount(bits), + ); + defer comp.gpa.free(limbs); + var result_bigint = BigIntMutable{ .limbs = limbs, .positive = undefined, .len = undefined }; + + const overflowed = result_bigint.addWrap(lhs_bigint, rhs_bigint, qt.signedness(comp), bits); + res.* = try intern(comp, .{ .int = .{ .big_int = result_bigint.toConst() } }); + return overflowed; +} + +pub fn negate(res: *Value, val: Value, qt: QualType, comp: *Compilation) !bool { + return res.sub(zero, val, qt, undefined, comp); +} + +pub fn decrement(res: *Value, val: Value, qt: QualType, comp: *Compilation) !bool { + return res.sub(val, one, qt, undefined, comp); } -pub fn sub(res: *Value, lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !bool { - const bits: usize = @intCast(ty.bitSizeof(comp).?); - if (ty.isFloat()) { - if (ty.isComplex()) { +/// elem_size is only used when subtracting two pointers, so we can scale the result by the size of the element type +pub fn sub(res: *Value, lhs: Value, rhs: Value, qt: QualType, elem_size: u64, comp: *Compilation) !bool { + const bits: usize = @intCast(qt.bitSizeof(comp)); + const scalar_kind = qt.scalarKind(comp); + if (scalar_kind.isFloat()) { + if (scalar_kind == .complex_float) { res.* = switch (bits) { 32 => try complexAddSub(lhs, rhs, f16, .sub, comp), 64 => try complexAddSub(lhs, rhs, f32, .sub, comp), @@ -558,29 +618,61 @@ pub fn sub(res: *Value, lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !b }; res.* = try intern(comp, .{ .float = f }); return false; - } else { - var lhs_space: BigIntSpace = undefined; - var rhs_space: BigIntSpace = undefined; - const lhs_bigint = lhs.toBigInt(&lhs_space, comp); - const rhs_bigint = rhs.toBigInt(&rhs_space, comp); - - const limbs = try comp.gpa.alloc( - std.math.big.Limb, - std.math.big.int.calcTwosCompLimbCount(bits), - ); - defer comp.gpa.free(limbs); - var result_bigint = BigIntMutable{ .limbs = limbs, .positive = undefined, .len = undefined }; - - const overflowed = result_bigint.subWrap(lhs_bigint, rhs_bigint, ty.signedness(comp), bits); - res.* = try intern(comp, .{ .int = .{ .big_int = result_bigint.toConst() } }); + } + const lhs_key = comp.interner.get(lhs.ref()); + const rhs_key = comp.interner.get(rhs.ref()); + if (lhs_key == .bytes or rhs_key == .bytes) { + res.* = .{}; + return false; + } + if (lhs_key == .pointer and rhs_key == .pointer) { + const lhs_pointer = lhs_key.pointer; + const rhs_pointer = rhs_key.pointer; + if (lhs_pointer.node != rhs_pointer.node) { + res.* = .{}; + return false; + } + const lhs_offset = fromRef(lhs_pointer.offset); + const rhs_offset = fromRef(rhs_pointer.offset); + const overflowed = try res.sub(lhs_offset, rhs_offset, comp.type_store.ptrdiff, undefined, comp); + const rhs_size = try int(elem_size, comp); + _ = try res.div(res.*, rhs_size, comp.type_store.ptrdiff, comp); return overflowed; + } else if (lhs_key == .pointer) { + const rel = lhs_key.pointer; + + const lhs_size = try int(elem_size, comp); + var total_offset: Value = undefined; + const mul_overflow = try total_offset.mul(lhs_size, rhs, comp.type_store.ptrdiff, comp); + const old_offset = fromRef(rel.offset); + const add_overflow = try total_offset.sub(old_offset, total_offset, comp.type_store.ptrdiff, undefined, comp); + _ = try total_offset.intCast(comp.type_store.ptrdiff, comp); + res.* = try pointer(.{ .node = rel.node, .offset = total_offset.ref() }, comp); + return mul_overflow or add_overflow; } + + var lhs_space: BigIntSpace = undefined; + var rhs_space: BigIntSpace = undefined; + const lhs_bigint = lhs_key.toBigInt(&lhs_space); + const rhs_bigint = rhs_key.toBigInt(&rhs_space); + + const limbs = try comp.gpa.alloc( + std.math.big.Limb, + std.math.big.int.calcTwosCompLimbCount(bits), + ); + defer comp.gpa.free(limbs); + var result_bigint = BigIntMutable{ .limbs = limbs, .positive = undefined, .len = undefined }; + + const overflowed = result_bigint.subWrap(lhs_bigint, rhs_bigint, qt.signedness(comp), bits); + res.* = try intern(comp, .{ .int = .{ .big_int = result_bigint.toConst() } }); + return overflowed; } -pub fn mul(res: *Value, lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !bool { - const bits: usize = @intCast(ty.bitSizeof(comp).?); - if (ty.isFloat()) { - if (ty.isComplex()) { +pub fn mul(res: *Value, lhs: Value, rhs: Value, qt: QualType, comp: *Compilation) !bool { + const bits: usize = @intCast(qt.bitSizeof(comp)); + const scalar_kind = qt.scalarKind(comp); + if (scalar_kind.isFloat()) { + if (scalar_kind == .complex_float) { const cf: Interner.Key.Complex = switch (bits) { 32 => .{ .cf16 = annex_g.complexFloatMul(f16, lhs.toFloat(f16, comp), lhs.imag(f16, comp), rhs.toFloat(f16, comp), rhs.imag(f16, comp)) }, 64 => .{ .cf32 = annex_g.complexFloatMul(f32, lhs.toFloat(f32, comp), lhs.imag(f32, comp), rhs.toFloat(f32, comp), rhs.imag(f32, comp)) }, @@ -623,7 +715,7 @@ pub fn mul(res: *Value, lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !b result_bigint.mul(lhs_bigint, rhs_bigint, limbs_buffer, comp.gpa); - const signedness = ty.signedness(comp); + const signedness = qt.signedness(comp); const overflowed = !result_bigint.toConst().fitsInTwosComp(signedness, bits); if (overflowed) { result_bigint.truncate(result_bigint.toConst(), signedness, bits); @@ -634,10 +726,11 @@ pub fn mul(res: *Value, lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !b } /// caller guarantees rhs != 0 -pub fn div(res: *Value, lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !bool { - const bits: usize = @intCast(ty.bitSizeof(comp).?); - if (ty.isFloat()) { - if (ty.isComplex()) { +pub fn div(res: *Value, lhs: Value, rhs: Value, qt: QualType, comp: *Compilation) !bool { + const bits: usize = @intCast(qt.bitSizeof(comp)); + const scalar_kind = qt.scalarKind(comp); + if (scalar_kind.isFloat()) { + if (scalar_kind == .complex_float) { const cf: Interner.Key.Complex = switch (bits) { 32 => .{ .cf16 = annex_g.complexFloatDiv(f16, lhs.toFloat(f16, comp), lhs.imag(f16, comp), rhs.toFloat(f16, comp), rhs.imag(f16, comp)) }, 64 => .{ .cf32 = annex_g.complexFloatDiv(f32, lhs.toFloat(f32, comp), lhs.imag(f32, comp), rhs.toFloat(f32, comp), rhs.imag(f32, comp)) }, @@ -688,22 +781,21 @@ pub fn div(res: *Value, lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !b result_q.divTrunc(&result_r, lhs_bigint, rhs_bigint, limbs_buffer); res.* = try intern(comp, .{ .int = .{ .big_int = result_q.toConst() } }); - return !result_q.toConst().fitsInTwosComp(ty.signedness(comp), bits); + return !result_q.toConst().fitsInTwosComp(qt.signedness(comp), bits); } } /// caller guarantees rhs != 0 /// caller guarantees lhs != std.math.minInt(T) OR rhs != -1 -pub fn rem(lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !Value { +pub fn rem(lhs: Value, rhs: Value, qt: QualType, comp: *Compilation) !Value { var lhs_space: BigIntSpace = undefined; var rhs_space: BigIntSpace = undefined; const lhs_bigint = lhs.toBigInt(&lhs_space, comp); const rhs_bigint = rhs.toBigInt(&rhs_space, comp); - const signedness = ty.signedness(comp); - if (signedness == .signed) { + if (qt.signedness(comp) == .signed) { var spaces: [2]BigIntSpace = undefined; - const min_val = try Value.minInt(ty, comp); + const min_val = try Value.minInt(qt, comp); const negative = BigIntMutable.init(&spaces[0].limbs, -1).toConst(); const big_one = BigIntMutable.init(&spaces[1].limbs, 1).toConst(); if (lhs.compare(.eq, min_val, comp) and rhs_bigint.eql(negative)) { @@ -711,9 +803,9 @@ pub fn rem(lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !Value { } else if (rhs_bigint.order(big_one).compare(.lt)) { // lhs - @divTrunc(lhs, rhs) * rhs var tmp: Value = undefined; - _ = try tmp.div(lhs, rhs, ty, comp); - _ = try tmp.mul(tmp, rhs, ty, comp); - _ = try tmp.sub(lhs, tmp, ty, comp); + _ = try tmp.div(lhs, rhs, qt, comp); + _ = try tmp.mul(tmp, rhs, qt, comp); + _ = try tmp.sub(lhs, tmp, qt, undefined, comp); return tmp; } } @@ -800,8 +892,8 @@ pub fn bitAnd(lhs: Value, rhs: Value, comp: *Compilation) !Value { return intern(comp, .{ .int = .{ .big_int = result_bigint.toConst() } }); } -pub fn bitNot(val: Value, ty: Type, comp: *Compilation) !Value { - const bits: usize = @intCast(ty.bitSizeof(comp).?); +pub fn bitNot(val: Value, qt: QualType, comp: *Compilation) !Value { + const bits: usize = @intCast(qt.bitSizeof(comp)); var val_space: Value.BigIntSpace = undefined; const val_bigint = val.toBigInt(&val_space, comp); @@ -812,21 +904,21 @@ pub fn bitNot(val: Value, ty: Type, comp: *Compilation) !Value { defer comp.gpa.free(limbs); var result_bigint = BigIntMutable{ .limbs = limbs, .positive = undefined, .len = undefined }; - result_bigint.bitNotWrap(val_bigint, ty.signedness(comp), bits); + result_bigint.bitNotWrap(val_bigint, qt.signedness(comp), bits); return intern(comp, .{ .int = .{ .big_int = result_bigint.toConst() } }); } -pub fn shl(res: *Value, lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !bool { +pub fn shl(res: *Value, lhs: Value, rhs: Value, qt: QualType, comp: *Compilation) !bool { var lhs_space: Value.BigIntSpace = undefined; const lhs_bigint = lhs.toBigInt(&lhs_space, comp); const shift = rhs.toInt(usize, comp) orelse std.math.maxInt(usize); - const bits: usize = @intCast(ty.bitSizeof(comp).?); + const bits: usize = @intCast(qt.bitSizeof(comp)); if (shift > bits) { if (lhs_bigint.positive) { - res.* = try Value.maxInt(ty, comp); + res.* = try Value.maxInt(qt, comp); } else { - res.* = try Value.minInt(ty, comp); + res.* = try Value.minInt(qt, comp); } return true; } @@ -839,7 +931,7 @@ pub fn shl(res: *Value, lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !b var result_bigint = BigIntMutable{ .limbs = limbs, .positive = undefined, .len = undefined }; result_bigint.shiftLeft(lhs_bigint, shift); - const signedness = ty.signedness(comp); + const signedness = qt.signedness(comp); const overflowed = !result_bigint.toConst().fitsInTwosComp(signedness, bits); if (overflowed) { result_bigint.truncate(result_bigint.toConst(), signedness, bits); @@ -848,7 +940,7 @@ pub fn shl(res: *Value, lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !b return overflowed; } -pub fn shr(lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !Value { +pub fn shr(lhs: Value, rhs: Value, qt: QualType, comp: *Compilation) !Value { var lhs_space: Value.BigIntSpace = undefined; const lhs_bigint = lhs.toBigInt(&lhs_space, comp); const shift = rhs.toInt(usize, comp) orelse return zero; @@ -864,7 +956,7 @@ pub fn shr(lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !Value { } } - const bits: usize = @intCast(ty.bitSizeof(comp).?); + const bits: usize = @intCast(qt.bitSizeof(comp)); const limbs = try comp.gpa.alloc( std.math.big.Limb, std.math.big.int.calcTwosCompLimbCount(bits), @@ -876,8 +968,8 @@ pub fn shr(lhs: Value, rhs: Value, ty: Type, comp: *Compilation) !Value { return intern(comp, .{ .int = .{ .big_int = result_bigint.toConst() } }); } -pub fn complexConj(val: Value, ty: Type, comp: *Compilation) !Value { - const bits = ty.bitSizeof(comp).?; +pub fn complexConj(val: Value, qt: QualType, comp: *Compilation) !Value { + const bits = qt.bitSizeof(comp); const cf: Interner.Key.Complex = switch (bits) { 32 => .{ .cf16 = .{ val.toFloat(f16, comp), -val.imag(f16, comp) } }, 64 => .{ .cf32 = .{ val.toFloat(f32, comp), -val.imag(f32, comp) } }, @@ -889,12 +981,17 @@ pub fn complexConj(val: Value, ty: Type, comp: *Compilation) !Value { return intern(comp, .{ .complex = cf }); } -pub fn compare(lhs: Value, op: std.math.CompareOperator, rhs: Value, comp: *const Compilation) bool { +fn shallowCompare(lhs: Value, op: std.math.CompareOperator, rhs: Value) ?bool { if (op == .eq) { return lhs.opt_ref == rhs.opt_ref; } else if (lhs.opt_ref == rhs.opt_ref) { return std.math.Order.eq.compare(op); } + return null; +} + +pub fn compare(lhs: Value, op: std.math.CompareOperator, rhs: Value, comp: *const Compilation) bool { + if (lhs.shallowCompare(op, rhs)) |val| return val; const lhs_key = comp.interner.get(lhs.ref()); const rhs_key = comp.interner.get(rhs.ref()); @@ -917,10 +1014,33 @@ pub fn compare(lhs: Value, op: std.math.CompareOperator, rhs: Value, comp: *cons return lhs_bigint.order(rhs_bigint).compare(op); } -fn twosCompIntLimit(limit: std.math.big.int.TwosCompIntLimit, ty: Type, comp: *Compilation) !Value { - const signedness = ty.signedness(comp); +/// Returns null for values that cannot be compared at compile time (e.g. `&x < &y`) for globals `x` and `y`. +pub fn comparePointers(lhs: Value, op: std.math.CompareOperator, rhs: Value, comp: *const Compilation) ?bool { + if (lhs.shallowCompare(op, rhs)) |val| return val; + + const lhs_key = comp.interner.get(lhs.ref()); + const rhs_key = comp.interner.get(rhs.ref()); + + if (lhs_key == .pointer and rhs_key == .pointer) { + const lhs_pointer = lhs_key.pointer; + const rhs_pointer = rhs_key.pointer; + switch (op) { + .eq => if (lhs_pointer.node != rhs_pointer.node) return false, + .neq => if (lhs_pointer.node != rhs_pointer.node) return true, + else => if (lhs_pointer.node != rhs_pointer.node) return null, + } + + const lhs_offset = fromRef(lhs_pointer.offset); + const rhs_offset = fromRef(rhs_pointer.offset); + return lhs_offset.compare(op, rhs_offset, comp); + } + return null; +} + +fn twosCompIntLimit(limit: std.math.big.int.TwosCompIntLimit, qt: QualType, comp: *Compilation) !Value { + const signedness = qt.signedness(comp); if (limit == .min and signedness == .unsigned) return Value.zero; - const mag_bits: usize = @intCast(ty.bitSizeof(comp).?); + const mag_bits: usize = @intCast(qt.bitSizeof(comp)); switch (mag_bits) { inline 8, 16, 32, 64 => |bits| { if (limit == .min) return Value.int(@as(i64, std.math.minInt(std.meta.Int(.signed, bits))), comp); @@ -945,44 +1065,63 @@ fn twosCompIntLimit(limit: std.math.big.int.TwosCompIntLimit, ty: Type, comp: *C return Value.intern(comp, .{ .int = .{ .big_int = result_bigint.toConst() } }); } -pub fn minInt(ty: Type, comp: *Compilation) !Value { - return twosCompIntLimit(.min, ty, comp); +pub fn minInt(qt: QualType, comp: *Compilation) !Value { + return twosCompIntLimit(.min, qt, comp); +} + +pub fn maxInt(qt: QualType, comp: *Compilation) !Value { + return twosCompIntLimit(.max, qt, comp); } -pub fn maxInt(ty: Type, comp: *Compilation) !Value { - return twosCompIntLimit(.max, ty, comp); +const NestedPrint = union(enum) { + pointer: struct { + node: u32, + offset: Value, + }, +}; + +pub fn printPointer(offset: Value, base: []const u8, comp: *const Compilation, w: *std.Io.Writer) std.Io.Writer.Error!void { + try w.writeByte('&'); + try w.writeAll(base); + if (!offset.isZero(comp)) { + const maybe_nested = try offset.print(comp.type_store.ptrdiff, comp, w); + std.debug.assert(maybe_nested == null); + } } -pub fn print(v: Value, ty: Type, comp: *const Compilation, w: anytype) @TypeOf(w).Error!void { - if (ty.is(.bool)) { - return w.writeAll(if (v.isZero(comp)) "false" else "true"); +pub fn print(v: Value, qt: QualType, comp: *const Compilation, w: *std.Io.Writer) std.Io.Writer.Error!?NestedPrint { + if (qt.is(comp, .bool)) { + try w.writeAll(if (v.isZero(comp)) "false" else "true"); + return null; } const key = comp.interner.get(v.ref()); switch (key) { - .null => return w.writeAll("nullptr_t"), + .null => try w.writeAll("nullptr_t"), .int => |repr| switch (repr) { - inline .u64, .i64, .big_int => |x| return w.print("{d}", .{x}), + inline else => |x| try w.print("{d}", .{x}), }, .float => |repr| switch (repr) { - .f16 => |x| return w.print("{d}", .{@round(@as(f64, @floatCast(x)) * 1000) / 1000}), - .f32 => |x| return w.print("{d}", .{@round(@as(f64, @floatCast(x)) * 1000000) / 1000000}), - inline else => |x| return w.print("{d}", .{@as(f64, @floatCast(x))}), + .f16 => |x| try w.print("{d}", .{@round(@as(f64, @floatCast(x)) * 1000) / 1000}), + .f32 => |x| try w.print("{d}", .{@round(@as(f64, @floatCast(x)) * 1000000) / 1000000}), + inline else => |x| try w.print("{d}", .{@as(f64, @floatCast(x))}), }, - .bytes => |b| return printString(b, ty, comp, w), + .bytes => |b| try printString(b, qt, comp, w), .complex => |repr| switch (repr) { - .cf32 => |components| return w.print("{d} + {d}i", .{ @round(@as(f64, @floatCast(components[0])) * 1000000) / 1000000, @round(@as(f64, @floatCast(components[1])) * 1000000) / 1000000 }), - inline else => |components| return w.print("{d} + {d}i", .{ @as(f64, @floatCast(components[0])), @as(f64, @floatCast(components[1])) }), + .cf32 => |components| try w.print("{d} + {d}i", .{ @round(@as(f64, @floatCast(components[0])) * 1000000) / 1000000, @round(@as(f64, @floatCast(components[1])) * 1000000) / 1000000 }), + inline else => |components| try w.print("{d} + {d}i", .{ @as(f64, @floatCast(components[0])), @as(f64, @floatCast(components[1])) }), }, + .pointer => |ptr| return .{ .pointer = .{ .node = ptr.node, .offset = fromRef(ptr.offset) } }, else => unreachable, // not a value } + return null; } -pub fn printString(bytes: []const u8, ty: Type, comp: *const Compilation, w: anytype) @TypeOf(w).Error!void { - const size: Compilation.CharUnitSize = @enumFromInt(ty.elemType().sizeof(comp).?); +pub fn printString(bytes: []const u8, qt: QualType, comp: *const Compilation, w: *std.Io.Writer) std.Io.Writer.Error!void { + const size: Compilation.CharUnitSize = @enumFromInt(qt.childType(comp).sizeof(comp)); const without_null = bytes[0 .. bytes.len - @intFromEnum(size)]; try w.writeByte('"'); switch (size) { - .@"1" => try w.print("{f}", .{std.zig.fmtString(without_null)}), + .@"1" => try std.zig.stringEscape(without_null, w), .@"2" => { var items: [2]u16 = undefined; var i: usize = 0; diff --git a/lib/compiler/aro/aro/char_info.zig b/lib/compiler/aro/aro/char_info.zig index c2134efa987a..a4d5857c80e3 100644 --- a/lib/compiler/aro/aro/char_info.zig +++ b/lib/compiler/aro/aro/char_info.zig @@ -442,48 +442,48 @@ pub fn isInvisible(codepoint: u21) bool { } /// Checks for identifier characters which resemble non-identifier characters -pub fn homoglyph(codepoint: u21) ?u21 { +pub fn homoglyph(codepoint: u21) ?[]const u8 { assert(codepoint > 0x7F); return switch (codepoint) { - 0x01c3 => '!', // LATIN LETTER RETROFLEX CLICK - 0x037e => ';', // GREEK QUESTION MARK - 0x2212 => '-', // MINUS SIGN - 0x2215 => '/', // DIVISION SLASH - 0x2216 => '\\', // SET MINUS - 0x2217 => '*', // ASTERISK OPERATOR - 0x2223 => '|', // DIVIDES - 0x2227 => '^', // LOGICAL AND - 0x2236 => ':', // RATIO - 0x223c => '~', // TILDE OPERATOR - 0xa789 => ':', // MODIFIER LETTER COLON - 0xff01 => '!', // FULLWIDTH EXCLAMATION MARK - 0xff03 => '#', // FULLWIDTH NUMBER SIGN - 0xff04 => '$', // FULLWIDTH DOLLAR SIGN - 0xff05 => '%', // FULLWIDTH PERCENT SIGN - 0xff06 => '&', // FULLWIDTH AMPERSAND - 0xff08 => '(', // FULLWIDTH LEFT PARENTHESIS - 0xff09 => ')', // FULLWIDTH RIGHT PARENTHESIS - 0xff0a => '*', // FULLWIDTH ASTERISK - 0xff0b => '+', // FULLWIDTH ASTERISK - 0xff0c => ',', // FULLWIDTH COMMA - 0xff0d => '-', // FULLWIDTH HYPHEN-MINUS - 0xff0e => '.', // FULLWIDTH FULL STOP - 0xff0f => '/', // FULLWIDTH SOLIDUS - 0xff1a => ':', // FULLWIDTH COLON - 0xff1b => ';', // FULLWIDTH SEMICOLON - 0xff1c => '<', // FULLWIDTH LESS-THAN SIGN - 0xff1d => '=', // FULLWIDTH EQUALS SIGN - 0xff1e => '>', // FULLWIDTH GREATER-THAN SIGN - 0xff1f => '?', // FULLWIDTH QUESTION MARK - 0xff20 => '@', // FULLWIDTH COMMERCIAL AT - 0xff3b => '[', // FULLWIDTH LEFT SQUARE BRACKET - 0xff3c => '\\', // FULLWIDTH REVERSE SOLIDUS - 0xff3d => ']', // FULLWIDTH RIGHT SQUARE BRACKET - 0xff3e => '^', // FULLWIDTH CIRCUMFLEX ACCENT - 0xff5b => '{', // FULLWIDTH LEFT CURLY BRACKET - 0xff5c => '|', // FULLWIDTH VERTICAL LINE - 0xff5d => '}', // FULLWIDTH RIGHT CURLY BRACKET - 0xff5e => '~', // FULLWIDTH TILDE + 0x01c3 => "!", // LATIN LETTER RETROFLEX CLICK + 0x037e => ";", // GREEK QUESTION MARK + 0x2212 => "-", // MINUS SIGN + 0x2215 => "/", // DIVISION SLASH + 0x2216 => "\\", // SET MINUS + 0x2217 => "*", // ASTERISK OPERATOR + 0x2223 => "|", // DIVIDES + 0x2227 => "^", // LOGICAL AND + 0x2236 => ":", // RATIO + 0x223c => "~", // TILDE OPERATOR + 0xa789 => ":", // MODIFIER LETTER COLON + 0xff01 => "!", // FULLWIDTH EXCLAMATION MARK + 0xff03 => "#", // FULLWIDTH NUMBER SIGN + 0xff04 => "$", // FULLWIDTH DOLLAR SIGN + 0xff05 => "%", // FULLWIDTH PERCENT SIGN + 0xff06 => "&", // FULLWIDTH AMPERSAND + 0xff08 => "(", // FULLWIDTH LEFT PARENTHESIS + 0xff09 => ")", // FULLWIDTH RIGHT PARENTHESIS + 0xff0a => "*", // FULLWIDTH ASTERISK + 0xff0b => "+", // FULLWIDTH ASTERISK + 0xff0c => ",", // FULLWIDTH COMMA + 0xff0d => "-", // FULLWIDTH HYPHEN-MINUS + 0xff0e => ".", // FULLWIDTH FULL STOP + 0xff0f => "/", // FULLWIDTH SOLIDUS + 0xff1a => ":", // FULLWIDTH COLON + 0xff1b => ";", // FULLWIDTH SEMICOLON + 0xff1c => "<", // FULLWIDTH LESS-THAN SIGN + 0xff1d => "=", // FULLWIDTH EQUALS SIGN + 0xff1e => ">", // FULLWIDTH GREATER-THAN SIGN + 0xff1f => "?", // FULLWIDTH QUESTION MARK + 0xff20 => "@", // FULLWIDTH COMMERCIAL AT + 0xff3b => "[", // FULLWIDTH LEFT SQUARE BRACKET + 0xff3c => "\\", // FULLWIDTH REVERSE SOLIDUS + 0xff3d => "]", // FULLWIDTH RIGHT SQUARE BRACKET + 0xff3e => "^", // FULLWIDTH CIRCUMFLEX ACCENT + 0xff5b => "{", // FULLWIDTH LEFT CURLY BRACKET + 0xff5c => "|", // FULLWIDTH VERTICAL LINE + 0xff5d => "}", // FULLWIDTH RIGHT CURLY BRACKET + 0xff5e => "~", // FULLWIDTH TILDE else => null, }; } diff --git a/lib/compiler/aro/aro/features.zig b/lib/compiler/aro/aro/features.zig index fdc49b722bea..94d02ca603ac 100644 --- a/lib/compiler/aro/aro/features.zig +++ b/lib/compiler/aro/aro/features.zig @@ -57,13 +57,13 @@ pub fn hasExtension(comp: *Compilation, ext: []const u8) bool { // C11 features .c_alignas = true, .c_alignof = true, - .c_atomic = false, // TODO + .c_atomic = true, .c_generic_selections = true, .c_static_assert = true, .c_thread_local = target_util.isTlsSupported(comp.target), // misc .overloadable_unmarked = false, // TODO - .statement_attributes_with_gnu_syntax = false, // TODO + .statement_attributes_with_gnu_syntax = true, .gnu_asm = true, .gnu_asm_goto_with_outputs = true, .matrix_types = false, // TODO diff --git a/lib/compiler/aro/aro/pragmas/gcc.zig b/lib/compiler/aro/aro/pragmas/gcc.zig index ce67698b88ba..bb1c0ffaf847 100644 --- a/lib/compiler/aro/aro/pragmas/gcc.zig +++ b/lib/compiler/aro/aro/pragmas/gcc.zig @@ -1,10 +1,11 @@ const std = @import("std"); const mem = std.mem; + const Compilation = @import("../Compilation.zig"); -const Pragma = @import("../Pragma.zig"); const Diagnostics = @import("../Diagnostics.zig"); -const Preprocessor = @import("../Preprocessor.zig"); const Parser = @import("../Parser.zig"); +const Pragma = @import("../Pragma.zig"); +const Preprocessor = @import("../Preprocessor.zig"); const TokenIndex = @import("../Tree.zig").TokenIndex; const GCC = @This(); @@ -18,8 +19,8 @@ pragma: Pragma = .{ .parserHandler = parserHandler, .preserveTokens = preserveTokens, }, -original_options: Diagnostics.Options = .{}, -options_stack: std.ArrayListUnmanaged(Diagnostics.Options) = .empty, +original_state: Diagnostics.State = .{}, +state_stack: std.ArrayList(Diagnostics.State) = .empty, const Directive = enum { warning, @@ -38,19 +39,19 @@ const Directive = enum { fn beforePreprocess(pragma: *Pragma, comp: *Compilation) void { var self: *GCC = @fieldParentPtr("pragma", pragma); - self.original_options = comp.diagnostics.options; + self.original_state = comp.diagnostics.state; } fn beforeParse(pragma: *Pragma, comp: *Compilation) void { var self: *GCC = @fieldParentPtr("pragma", pragma); - comp.diagnostics.options = self.original_options; - self.options_stack.items.len = 0; + comp.diagnostics.state = self.original_state; + self.state_stack.items.len = 0; } fn afterParse(pragma: *Pragma, comp: *Compilation) void { var self: *GCC = @fieldParentPtr("pragma", pragma); - comp.diagnostics.options = self.original_options; - self.options_stack.items.len = 0; + comp.diagnostics.state = self.original_state; + self.state_stack.items.len = 0; } pub fn init(allocator: mem.Allocator) !*Pragma { @@ -61,7 +62,7 @@ pub fn init(allocator: mem.Allocator) !*Pragma { fn deinit(pragma: *Pragma, comp: *Compilation) void { var self: *GCC = @fieldParentPtr("pragma", pragma); - self.options_stack.deinit(comp.gpa); + self.state_stack.deinit(comp.gpa); comp.gpa.destroy(self); } @@ -76,23 +77,14 @@ fn diagnosticHandler(self: *GCC, pp: *Preprocessor, start_idx: TokenIndex) Pragm .ignored, .warning, .@"error", .fatal => { const str = Pragma.pasteTokens(pp, start_idx + 1) catch |err| switch (err) { error.ExpectedStringLiteral => { - return pp.comp.addDiagnostic(.{ - .tag = .pragma_requires_string_literal, - .loc = diagnostic_tok.loc, - .extra = .{ .str = "GCC diagnostic" }, - }, pp.expansionSlice(start_idx)); + return Pragma.err(pp, start_idx, .pragma_requires_string_literal, .{"GCC diagnostic"}); }, else => |e| return e, }; if (!mem.startsWith(u8, str, "-W")) { - const next = pp.tokens.get(start_idx + 1); - return pp.comp.addDiagnostic(.{ - .tag = .malformed_warning_check, - .loc = next.loc, - .extra = .{ .str = "GCC diagnostic" }, - }, pp.expansionSlice(start_idx + 1)); + return Pragma.err(pp, start_idx + 1, .malformed_warning_check, .{"GCC diagnostic"}); } - const new_kind: Diagnostics.Kind = switch (diagnostic) { + const new_kind: Diagnostics.Message.Kind = switch (diagnostic) { .ignored => .off, .warning => .warning, .@"error" => .@"error", @@ -100,10 +92,10 @@ fn diagnosticHandler(self: *GCC, pp: *Preprocessor, start_idx: TokenIndex) Pragm else => unreachable, }; - try pp.comp.diagnostics.set(str[2..], new_kind); + try pp.diagnostics.set(str[2..], new_kind); }, - .push => try self.options_stack.append(pp.comp.gpa, pp.comp.diagnostics.options), - .pop => pp.comp.diagnostics.options = self.options_stack.pop() orelse self.original_options, + .push => try self.state_stack.append(pp.comp.gpa, pp.diagnostics.state), + .pop => pp.diagnostics.state = self.state_stack.pop() orelse self.original_state, } } @@ -112,38 +104,24 @@ fn preprocessorHandler(pragma: *Pragma, pp: *Preprocessor, start_idx: TokenIndex const directive_tok = pp.tokens.get(start_idx + 1); if (directive_tok.id == .nl) return; - const gcc_pragma = std.meta.stringToEnum(Directive, pp.expandedSlice(directive_tok)) orelse - return pp.comp.addDiagnostic(.{ - .tag = .unknown_gcc_pragma, - .loc = directive_tok.loc, - }, pp.expansionSlice(start_idx + 1)); + const gcc_pragma = std.meta.stringToEnum(Directive, pp.expandedSlice(directive_tok)) orelse { + return Pragma.err(pp, start_idx + 1, .unknown_gcc_pragma, .{}); + }; switch (gcc_pragma) { .warning, .@"error" => { const text = Pragma.pasteTokens(pp, start_idx + 2) catch |err| switch (err) { error.ExpectedStringLiteral => { - return pp.comp.addDiagnostic(.{ - .tag = .pragma_requires_string_literal, - .loc = directive_tok.loc, - .extra = .{ .str = @tagName(gcc_pragma) }, - }, pp.expansionSlice(start_idx + 1)); + return Pragma.err(pp, start_idx + 1, .pragma_requires_string_literal, .{@tagName(gcc_pragma)}); }, else => |e| return e, }; - const extra = Diagnostics.Message.Extra{ .str = try pp.comp.diagnostics.arena.allocator().dupe(u8, text) }; - const diagnostic_tag: Diagnostics.Tag = if (gcc_pragma == .warning) .pragma_warning_message else .pragma_error_message; - return pp.comp.addDiagnostic( - .{ .tag = diagnostic_tag, .loc = directive_tok.loc, .extra = extra }, - pp.expansionSlice(start_idx + 1), - ); + + return Pragma.err(pp, start_idx + 1, if (gcc_pragma == .warning) .pragma_warning_message else .pragma_error_message, .{text}); }, .diagnostic => return self.diagnosticHandler(pp, start_idx + 2) catch |err| switch (err) { error.UnknownPragma => { - const tok = pp.tokens.get(start_idx + 2); - return pp.comp.addDiagnostic(.{ - .tag = .unknown_gcc_pragma_directive, - .loc = tok.loc, - }, pp.expansionSlice(start_idx + 2)); + return Pragma.err(pp, start_idx + 2, .unknown_gcc_pragma_directive, .{}); }, else => |e| return e, }, @@ -154,19 +132,13 @@ fn preprocessorHandler(pragma: *Pragma, pp: *Preprocessor, start_idx: TokenIndex if (tok.id == .nl) break; if (!tok.id.isMacroIdentifier()) { - return pp.comp.addDiagnostic(.{ - .tag = .pragma_poison_identifier, - .loc = tok.loc, - }, pp.expansionSlice(start_idx + i)); + return Pragma.err(pp, start_idx + i, .pragma_poison_identifier, .{}); } const str = pp.expandedSlice(tok); if (pp.defines.get(str) != null) { - try pp.comp.addDiagnostic(.{ - .tag = .pragma_poison_macro, - .loc = tok.loc, - }, pp.expansionSlice(start_idx + i)); + try Pragma.err(pp, start_idx + i, .pragma_poison_macro, .{}); } - try pp.poisoned_identifiers.put(str, {}); + try pp.poisoned_identifiers.put(pp.comp.gpa, str, {}); } return; }, diff --git a/lib/compiler/aro/aro/pragmas/message.zig b/lib/compiler/aro/aro/pragmas/message.zig index a364c6d8c12a..11f5af5a9aae 100644 --- a/lib/compiler/aro/aro/pragmas/message.zig +++ b/lib/compiler/aro/aro/pragmas/message.zig @@ -1,12 +1,13 @@ const std = @import("std"); const mem = std.mem; + const Compilation = @import("../Compilation.zig"); -const Pragma = @import("../Pragma.zig"); const Diagnostics = @import("../Diagnostics.zig"); -const Preprocessor = @import("../Preprocessor.zig"); const Parser = @import("../Parser.zig"); -const TokenIndex = @import("../Tree.zig").TokenIndex; +const Pragma = @import("../Pragma.zig"); +const Preprocessor = @import("../Preprocessor.zig"); const Source = @import("../Source.zig"); +const TokenIndex = @import("../Tree.zig").TokenIndex; const Message = @This(); @@ -27,24 +28,32 @@ fn deinit(pragma: *Pragma, comp: *Compilation) void { } fn preprocessorHandler(_: *Pragma, pp: *Preprocessor, start_idx: TokenIndex) Pragma.Error!void { - const message_tok = pp.tokens.get(start_idx); - const message_expansion_locs = pp.expansionSlice(start_idx); - const str = Pragma.pasteTokens(pp, start_idx + 1) catch |err| switch (err) { error.ExpectedStringLiteral => { - return pp.comp.addDiagnostic(.{ - .tag = .pragma_requires_string_literal, - .loc = message_tok.loc, - .extra = .{ .str = "message" }, - }, message_expansion_locs); + return Pragma.err(pp, start_idx, .pragma_requires_string_literal, .{"message"}); }, else => |e| return e, }; + const message_tok = pp.tokens.get(start_idx); + const message_expansion_locs = pp.expansionSlice(start_idx); const loc = if (message_expansion_locs.len != 0) message_expansion_locs[message_expansion_locs.len - 1] else message_tok.loc; - const extra = Diagnostics.Message.Extra{ .str = try pp.comp.diagnostics.arena.allocator().dupe(u8, str) }; - return pp.comp.addDiagnostic(.{ .tag = .pragma_message, .loc = loc, .extra = extra }, &.{}); + + const diagnostic: Pragma.Diagnostic = .pragma_message; + + var sf = std.heap.stackFallback(1024, pp.comp.gpa); + var allocating: std.Io.Writer.Allocating = .init(sf.get()); + defer allocating.deinit(); + + Diagnostics.formatArgs(&allocating.writer, diagnostic.fmt, .{str}) catch return error.OutOfMemory; + + try pp.diagnostics.add(.{ + .text = allocating.written(), + .kind = diagnostic.kind, + .opt = diagnostic.opt, + .location = loc.expand(pp.comp), + }); } diff --git a/lib/compiler/aro/aro/pragmas/once.zig b/lib/compiler/aro/aro/pragmas/once.zig index 21d6c9854efc..e021a1bc7684 100644 --- a/lib/compiler/aro/aro/pragmas/once.zig +++ b/lib/compiler/aro/aro/pragmas/once.zig @@ -1,12 +1,13 @@ const std = @import("std"); const mem = std.mem; + const Compilation = @import("../Compilation.zig"); -const Pragma = @import("../Pragma.zig"); const Diagnostics = @import("../Diagnostics.zig"); -const Preprocessor = @import("../Preprocessor.zig"); const Parser = @import("../Parser.zig"); -const TokenIndex = @import("../Tree.zig").TokenIndex; +const Pragma = @import("../Pragma.zig"); +const Preprocessor = @import("../Preprocessor.zig"); const Source = @import("../Source.zig"); +const TokenIndex = @import("../Tree.zig").TokenIndex; const Once = @This(); @@ -14,15 +15,14 @@ pragma: Pragma = .{ .afterParse = afterParse, .deinit = deinit, .preprocessorHandler = preprocessorHandler, + .preserveTokens = preserveTokens, }, -pragma_once: std.AutoHashMap(Source.Id, void), +pragma_once: std.AutoHashMapUnmanaged(Source.Id, void) = .empty, preprocess_count: u32 = 0, pub fn init(allocator: mem.Allocator) !*Pragma { var once = try allocator.create(Once); - once.* = .{ - .pragma_once = std.AutoHashMap(Source.Id, void).init(allocator), - }; + once.* = .{}; return &once.pragma; } @@ -33,8 +33,9 @@ fn afterParse(pragma: *Pragma, _: *Compilation) void { fn deinit(pragma: *Pragma, comp: *Compilation) void { var self: *Once = @fieldParentPtr("pragma", pragma); - self.pragma_once.deinit(); + self.pragma_once.deinit(comp.gpa); comp.gpa.destroy(self); + pragma.* = undefined; } fn preprocessorHandler(pragma: *Pragma, pp: *Preprocessor, start_idx: TokenIndex) Pragma.Error!void { @@ -42,15 +43,22 @@ fn preprocessorHandler(pragma: *Pragma, pp: *Preprocessor, start_idx: TokenIndex const name_tok = pp.tokens.get(start_idx); const next = pp.tokens.get(start_idx + 1); if (next.id != .nl) { - try pp.comp.addDiagnostic(.{ - .tag = .extra_tokens_directive_end, - .loc = name_tok.loc, - }, pp.expansionSlice(start_idx + 1)); + const diagnostic: Preprocessor.Diagnostic = .extra_tokens_directive_end; + return pp.diagnostics.addWithLocation(pp.comp, .{ + .text = diagnostic.fmt, + .kind = diagnostic.kind, + .opt = diagnostic.opt, + .location = name_tok.loc.expand(pp.comp), + }, pp.expansionSlice(start_idx + 1), true); } const seen = self.preprocess_count == pp.preprocess_count; - const prev = try self.pragma_once.fetchPut(name_tok.loc.id, {}); + const prev = try self.pragma_once.fetchPut(pp.comp.gpa, name_tok.loc.id, {}); if (prev != null and !seen) { return error.StopPreprocessing; } self.preprocess_count = pp.preprocess_count; } + +fn preserveTokens(_: *Pragma, _: *Preprocessor, _: TokenIndex) bool { + return false; +} diff --git a/lib/compiler/aro/aro/pragmas/pack.zig b/lib/compiler/aro/aro/pragmas/pack.zig index baa44509168b..4b527ca92e17 100644 --- a/lib/compiler/aro/aro/pragmas/pack.zig +++ b/lib/compiler/aro/aro/pragmas/pack.zig @@ -1,10 +1,11 @@ const std = @import("std"); const mem = std.mem; + const Compilation = @import("../Compilation.zig"); -const Pragma = @import("../Pragma.zig"); const Diagnostics = @import("../Diagnostics.zig"); -const Preprocessor = @import("../Preprocessor.zig"); const Parser = @import("../Parser.zig"); +const Pragma = @import("../Pragma.zig"); +const Preprocessor = @import("../Preprocessor.zig"); const Tree = @import("../Tree.zig"); const TokenIndex = Tree.TokenIndex; @@ -13,9 +14,8 @@ const Pack = @This(); pragma: Pragma = .{ .deinit = deinit, .parserHandler = parserHandler, - .preserveTokens = preserveTokens, }, -stack: std.ArrayListUnmanaged(struct { label: []const u8, val: u8 }) = .empty, +stack: std.ArrayList(struct { label: []const u8, val: u8 }) = .empty, pub fn init(allocator: mem.Allocator) !*Pragma { var pack = try allocator.create(Pack); @@ -34,10 +34,7 @@ fn parserHandler(pragma: *Pragma, p: *Parser, start_idx: TokenIndex) Compilation var idx = start_idx + 1; const l_paren = p.pp.tokens.get(idx); if (l_paren.id != .l_paren) { - return p.comp.addDiagnostic(.{ - .tag = .pragma_pack_lparen, - .loc = l_paren.loc, - }, p.pp.expansionSlice(idx)); + return Pragma.err(p.pp, idx, .pragma_pack_lparen, .{}); } idx += 1; @@ -54,11 +51,11 @@ fn parserHandler(pragma: *Pragma, p: *Parser, start_idx: TokenIndex) Compilation pop, }; const action = std.meta.stringToEnum(Action, p.tokSlice(arg)) orelse { - return p.errTok(.pragma_pack_unknown_action, arg); + return Pragma.err(p.pp, arg, .pragma_pack_unknown_action, .{}); }; switch (action) { .show => { - try p.errExtra(.pragma_pack_show, arg, .{ .unsigned = p.pragma_pack orelse 8 }); + return Pragma.err(p.pp, arg, .pragma_pack_show, .{p.pragma_pack orelse 8}); }, .push, .pop => { var new_val: ?u8 = null; @@ -75,21 +72,23 @@ fn parserHandler(pragma: *Pragma, p: *Parser, start_idx: TokenIndex) Compilation idx += 1; const int = idx; idx += 1; - if (tok_ids[int] != .pp_num) return p.errTok(.pragma_pack_int_ident, int); + if (tok_ids[int] != .pp_num) { + return Pragma.err(p.pp, int, .pragma_pack_int_ident, .{}); + } new_val = (try packInt(p, int)) orelse return; } }, - else => return p.errTok(.pragma_pack_int_ident, next), + else => return Pragma.err(p.pp, next, .pragma_pack_int_ident, .{}), } } if (action == .push) { - try pack.stack.append(p.gpa, .{ .label = label orelse "", .val = p.pragma_pack orelse 8 }); + try pack.stack.append(p.comp.gpa, .{ .label = label orelse "", .val = p.pragma_pack orelse 8 }); } else { pack.pop(p, label); if (new_val != null) { - try p.errTok(.pragma_pack_undefined_pop, arg); + try Pragma.err(p.pp, arg, .pragma_pack_undefined_pop, .{}); } else if (pack.stack.items.len == 0) { - try p.errTok(.pragma_pack_empty_stack, arg); + try Pragma.err(p.pp, arg, .pragma_pack_empty_stack, .{}); } } if (new_val) |some| { @@ -115,14 +114,14 @@ fn parserHandler(pragma: *Pragma, p: *Parser, start_idx: TokenIndex) Compilation } if (tok_ids[idx] != .r_paren) { - return p.errTok(.pragma_pack_rparen, idx); + return Pragma.err(p.pp, idx, .pragma_pack_rparen, .{}); } } fn packInt(p: *Parser, tok_i: TokenIndex) Compilation.Error!?u8 { const res = p.parseNumberToken(tok_i) catch |err| switch (err) { error.ParsingFailed => { - try p.errTok(.pragma_pack_int, tok_i); + try Pragma.err(p.pp, tok_i, .pragma_pack_int, .{}); return null; }, else => |e| return e, @@ -131,7 +130,7 @@ fn packInt(p: *Parser, tok_i: TokenIndex) Compilation.Error!?u8 { switch (int) { 1, 2, 4, 8, 16 => return @intCast(int), else => { - try p.errTok(.pragma_pack_int, tok_i); + try Pragma.err(p.pp, tok_i, .pragma_pack_int, .{}); return null; }, } @@ -156,9 +155,3 @@ fn pop(pack: *Pack, p: *Parser, maybe_label: ?[]const u8) void { p.pragma_pack = prev.val; } } - -fn preserveTokens(_: *Pragma, pp: *Preprocessor, start_idx: TokenIndex) bool { - _ = pp; - _ = start_idx; - return true; -} diff --git a/lib/compiler/aro/aro/record_layout.zig b/lib/compiler/aro/aro/record_layout.zig index da0517d9fc5b..19fdce6b2713 100644 --- a/lib/compiler/aro/aro/record_layout.zig +++ b/lib/compiler/aro/aro/record_layout.zig @@ -2,15 +2,18 @@ //! Licensed under MIT license: https://github.com/mahkoh/repr-c/tree/master/repc/facade const std = @import("std"); -const Type = @import("Type.zig"); + const Attribute = @import("Attribute.zig"); const Compilation = @import("Compilation.zig"); const Parser = @import("Parser.zig"); +const target_util = @import("target.zig"); +const TypeStore = @import("TypeStore.zig"); +const QualType = TypeStore.QualType; +const Type = TypeStore.Type; const Record = Type.Record; const Field = Record.Field; -const TypeLayout = Type.TypeLayout; -const FieldLayout = Type.FieldLayout; -const target_util = @import("target.zig"); +const RecordLayout = Type.Record.Layout; +const FieldLayout = Type.Record.Field.Layout; const BITS_PER_BYTE = 8; @@ -42,36 +45,33 @@ const SysVContext = struct { comp: *const Compilation, - fn init(ty: Type, comp: *const Compilation, pragma_pack: ?u8) SysVContext { + fn init(qt: QualType, comp: *const Compilation, pragma_pack: ?u8) SysVContext { const pack_value: ?u64 = if (pragma_pack) |pak| @as(u64, pak) * BITS_PER_BYTE else null; - const req_align = @as(u32, (ty.requestedAlignment(comp) orelse 1)) * BITS_PER_BYTE; + const req_align = @as(u32, (qt.requestedAlignment(comp) orelse 1)) * BITS_PER_BYTE; return SysVContext{ - .attr_packed = ty.hasAttribute(.@"packed"), + .attr_packed = qt.hasAttribute(comp, .@"packed"), .max_field_align_bits = pack_value, .aligned_bits = req_align, - .is_union = ty.is(.@"union"), + .is_union = qt.is(comp, .@"union"), .size_bits = 0, .comp = comp, .ongoing_bitfield = null, }; } - fn layoutFields(self: *SysVContext, rec: *const Record) !void { - for (rec.fields, 0..) |*fld, fld_indx| { - if (fld.ty.specifier == .invalid) continue; - const type_layout = computeLayout(fld.ty, self.comp); + fn layoutFields(self: *SysVContext, fields: []Type.Record.Field) !void { + for (fields) |*field| { + if (field.qt.isInvalid()) continue; + const type_layout = computeLayout(field.qt, self.comp); - var field_attrs: ?[]const Attribute = null; - if (rec.field_attributes) |attrs| { - field_attrs = attrs[fld_indx]; - } + const attributes = field.attributes(self.comp); if (self.comp.target.isMinGW()) { - fld.layout = try self.layoutMinGWField(fld, field_attrs, type_layout); + field.layout = try self.layoutMinGWField(field, attributes, type_layout); } else { - if (fld.isRegularField()) { - fld.layout = try self.layoutRegularField(field_attrs, type_layout); + if (field.bit_width.unpack()) |bit_width| { + field.layout = try self.layoutBitField(attributes, type_layout, field.name_tok != 0, bit_width); } else { - fld.layout = try self.layoutBitField(field_attrs, type_layout, fld.isNamed(), fld.specifiedBitWidth()); + field.layout = try self.layoutRegularField(attributes, type_layout); } } } @@ -83,7 +83,7 @@ const SysVContext = struct { /// - the field is a bit-field and the previous field was a non-zero-sized bit-field with the same type size /// - the field is a zero-sized bit-field and the previous field was not a non-zero-sized bit-field /// See test case 0068. - fn ignoreTypeAlignment(is_attr_packed: bool, bit_width: ?u32, ongoing_bitfield: ?OngoingBitfield, fld_layout: TypeLayout) bool { + fn ignoreTypeAlignment(is_attr_packed: bool, bit_width: ?u32, ongoing_bitfield: ?OngoingBitfield, fld_layout: RecordLayout) bool { if (is_attr_packed) return true; if (bit_width) |width| { if (ongoing_bitfield) |ongoing| { @@ -98,12 +98,12 @@ const SysVContext = struct { fn layoutMinGWField( self: *SysVContext, field: *const Field, - field_attrs: ?[]const Attribute, - field_layout: TypeLayout, + field_attrs: []const Attribute, + field_layout: RecordLayout, ) !FieldLayout { - const annotation_alignment_bits = BITS_PER_BYTE * @as(u32, (Type.annotationAlignment(self.comp, Attribute.Iterator.initSlice(field_attrs)) orelse 1)); + const annotation_alignment_bits = BITS_PER_BYTE * (QualType.annotationAlignment(self.comp, Attribute.Iterator.initSlice(field_attrs)) orelse 1); const is_attr_packed = self.attr_packed or isPacked(field_attrs); - const ignore_type_alignment = ignoreTypeAlignment(is_attr_packed, field.bit_width, self.ongoing_bitfield, field_layout); + const ignore_type_alignment = ignoreTypeAlignment(is_attr_packed, field.bit_width.unpack(), self.ongoing_bitfield, field_layout); var field_alignment_bits: u64 = field_layout.field_alignment_bits; if (ignore_type_alignment) { @@ -120,16 +120,16 @@ const SysVContext = struct { // - the field is a non-zero-width bit-field and not packed. // See test case 0069. const update_record_alignment = - field.isRegularField() or - (field.specifiedBitWidth() == 0 and self.ongoing_bitfield != null) or - (field.specifiedBitWidth() != 0 and !is_attr_packed); + field.bit_width == .null or + (field.bit_width.unpack().? == 0 and self.ongoing_bitfield != null) or + (field.bit_width.unpack().? != 0 and !is_attr_packed); // If a field affects the alignment of a record, the alignment is calculated in the // usual way except that __attribute__((packed)) is ignored on a zero-width bit-field. // See test case 0068. if (update_record_alignment) { var ty_alignment_bits = field_layout.field_alignment_bits; - if (is_attr_packed and (field.isRegularField() or field.specifiedBitWidth() != 0)) { + if (is_attr_packed and (field.bit_width == .null or field.bit_width.unpack().? != 0)) { ty_alignment_bits = BITS_PER_BYTE; } ty_alignment_bits = @max(ty_alignment_bits, annotation_alignment_bits); @@ -145,10 +145,10 @@ const SysVContext = struct { // @attr_packed _ { size: 64, alignment: 64 }long long:0, // { offset: 8, size: 8 }d { size: 8, alignment: 8 }char, // } - if (field.isRegularField()) { - return self.layoutRegularFieldMinGW(field_layout.size_bits, field_alignment_bits); + if (field.bit_width.unpack()) |bit_width| { + return self.layoutBitFieldMinGW(field_layout.size_bits, field_alignment_bits, field.name_tok != 0, bit_width); } else { - return self.layoutBitFieldMinGW(field_layout.size_bits, field_alignment_bits, field.isNamed(), field.specifiedBitWidth()); + return self.layoutRegularFieldMinGW(field_layout.size_bits, field_alignment_bits); } } @@ -227,8 +227,8 @@ const SysVContext = struct { fn layoutRegularField( self: *SysVContext, - fld_attrs: ?[]const Attribute, - fld_layout: TypeLayout, + fld_attrs: []const Attribute, + fld_layout: RecordLayout, ) !FieldLayout { var fld_align_bits = fld_layout.field_alignment_bits; @@ -240,7 +240,7 @@ const SysVContext = struct { // The field alignment can be increased by __attribute__((aligned)) annotations on the // field. See test case 0085. - if (Type.annotationAlignment(self.comp, Attribute.Iterator.initSlice(fld_attrs))) |anno| { + if (QualType.annotationAlignment(self.comp, Attribute.Iterator.initSlice(fld_attrs))) |anno| { fld_align_bits = @max(fld_align_bits, @as(u32, anno) * BITS_PER_BYTE); } @@ -268,8 +268,8 @@ const SysVContext = struct { fn layoutBitField( self: *SysVContext, - fld_attrs: ?[]const Attribute, - fld_layout: TypeLayout, + fld_attrs: []const Attribute, + fld_layout: RecordLayout, is_named: bool, bit_width: u64, ) !FieldLayout { @@ -302,7 +302,7 @@ const SysVContext = struct { const attr_packed = self.attr_packed or isPacked(fld_attrs); const has_packing_annotation = attr_packed or self.max_field_align_bits != null; - const annotation_alignment = if (Type.annotationAlignment(self.comp, Attribute.Iterator.initSlice(fld_attrs))) |anno| @as(u32, anno) * BITS_PER_BYTE else 1; + const annotation_alignment = if (QualType.annotationAlignment(self.comp, Attribute.Iterator.initSlice(fld_attrs))) |anno| @as(u32, anno) * BITS_PER_BYTE else 1; const first_unused_bit: u64 = if (self.is_union) 0 else self.size_bits; var field_align_bits: u64 = 1; @@ -403,9 +403,9 @@ const MsvcContext = struct { is_union: bool, comp: *const Compilation, - fn init(ty: Type, comp: *const Compilation, pragma_pack: ?u8) MsvcContext { + fn init(qt: QualType, comp: *const Compilation, pragma_pack: ?u8) MsvcContext { var pack_value: ?u32 = null; - if (ty.hasAttribute(.@"packed")) { + if (qt.hasAttribute(comp, .@"packed")) { // __attribute__((packed)) behaves like #pragma pack(1) in clang. See test case 0056. pack_value = BITS_PER_BYTE; } @@ -420,8 +420,8 @@ const MsvcContext = struct { // The required alignment can be increased by adding a __declspec(align) // annotation. See test case 0023. - const must_align = @as(u32, (ty.requestedAlignment(comp) orelse 1)) * BITS_PER_BYTE; - return MsvcContext{ + const must_align = @as(u32, (qt.requestedAlignment(comp) orelse 1)) * BITS_PER_BYTE; + return .{ .req_align_bits = must_align, .pointer_align_bits = must_align, .field_align_bits = must_align, @@ -429,26 +429,26 @@ const MsvcContext = struct { .max_field_align_bits = pack_value, .ongoing_bitfield = null, .contains_non_bitfield = false, - .is_union = ty.is(.@"union"), + .is_union = qt.is(comp, .@"union"), .comp = comp, }; } - fn layoutField(self: *MsvcContext, fld: *const Field, fld_attrs: ?[]const Attribute) !FieldLayout { - const type_layout = computeLayout(fld.ty, self.comp); + fn layoutField(self: *MsvcContext, fld: *const Field, fld_attrs: []const Attribute) !FieldLayout { + const type_layout = computeLayout(fld.qt, self.comp); // The required alignment of the field is the maximum of the required alignment of the // underlying type and the __declspec(align) annotation on the field itself. // See test case 0028. var req_align = type_layout.required_alignment_bits; - if (Type.annotationAlignment(self.comp, Attribute.Iterator.initSlice(fld_attrs))) |anno| { + if (QualType.annotationAlignment(self.comp, Attribute.Iterator.initSlice(fld_attrs))) |anno| { req_align = @max(@as(u32, anno) * BITS_PER_BYTE, req_align); } // The required alignment of a record is the maximum of the required alignments of its // fields except that the required alignment of bitfields is ignored. // See test case 0029. - if (fld.isRegularField()) { + if (fld.bit_width == .null) { self.req_align_bits = @max(self.req_align_bits, req_align); } @@ -459,7 +459,7 @@ const MsvcContext = struct { fld_align_bits = @min(fld_align_bits, max_align); } // check the requested alignment of the field type. - if (fld.ty.requestedAlignment(self.comp)) |type_req_align| { + if (fld.qt.requestedAlignment(self.comp)) |type_req_align| { fld_align_bits = @max(fld_align_bits, type_req_align * 8); } @@ -471,10 +471,10 @@ const MsvcContext = struct { // __attribute__((packed)) on a field is a clang extension. It behaves as if #pragma // pack(1) had been applied only to this field. See test case 0057. fld_align_bits = @max(fld_align_bits, req_align); - if (fld.isRegularField()) { - return self.layoutRegularField(type_layout.size_bits, fld_align_bits); + if (fld.bit_width.unpack()) |bit_width| { + return self.layoutBitField(type_layout.size_bits, fld_align_bits, bit_width); } else { - return self.layoutBitField(type_layout.size_bits, fld_align_bits, fld.specifiedBitWidth()); + return self.layoutRegularField(type_layout.size_bits, fld_align_bits); } } @@ -567,16 +567,16 @@ const MsvcContext = struct { } }; -pub fn compute(rec: *Type.Record, ty: Type, comp: *const Compilation, pragma_pack: ?u8) Error!void { +pub fn compute(fields: []Type.Record.Field, qt: QualType, comp: *const Compilation, pragma_pack: ?u8) Error!Type.Record.Layout { switch (comp.langopts.emulate) { .gcc, .clang => { - var context = SysVContext.init(ty, comp, pragma_pack); + var context = SysVContext.init(qt, comp, pragma_pack); - try context.layoutFields(rec); + try context.layoutFields(fields); context.size_bits = try alignForward(context.size_bits, context.aligned_bits); - rec.type_layout = .{ + return .{ .size_bits = context.size_bits, .field_alignment_bits = context.aligned_bits, .pointer_alignment_bits = context.aligned_bits, @@ -584,15 +584,10 @@ pub fn compute(rec: *Type.Record, ty: Type, comp: *const Compilation, pragma_pac }; }, .msvc => { - var context = MsvcContext.init(ty, comp, pragma_pack); - for (rec.fields, 0..) |*fld, fld_indx| { - if (fld.ty.specifier == .invalid) continue; - var field_attrs: ?[]const Attribute = null; - if (rec.field_attributes) |attrs| { - field_attrs = attrs[fld_indx]; - } - - fld.layout = try context.layoutField(fld, field_attrs); + var context = MsvcContext.init(qt, comp, pragma_pack); + for (fields) |*field| { + if (field.qt.isInvalid()) continue; + field.layout = try context.layoutField(field, field.attributes(comp)); } if (context.size_bits == 0) { // As an extension, MSVC allows records that only contain zero-sized bitfields and empty @@ -601,7 +596,7 @@ pub fn compute(rec: *Type.Record, ty: Type, comp: *const Compilation, pragma_pac context.handleZeroSizedRecord(); } context.size_bits = try alignForward(context.size_bits, context.pointer_align_bits); - rec.type_layout = .{ + return .{ .size_bits = context.size_bits, .field_alignment_bits = context.field_align_bits, .pointer_alignment_bits = context.pointer_align_bits, @@ -611,23 +606,26 @@ pub fn compute(rec: *Type.Record, ty: Type, comp: *const Compilation, pragma_pac } } -fn computeLayout(ty: Type, comp: *const Compilation) TypeLayout { - if (ty.getRecord()) |rec| { - const requested = BITS_PER_BYTE * (ty.requestedAlignment(comp) orelse 0); - return .{ - .size_bits = rec.type_layout.size_bits, - .pointer_alignment_bits = @max(requested, rec.type_layout.pointer_alignment_bits), - .field_alignment_bits = @max(requested, rec.type_layout.field_alignment_bits), - .required_alignment_bits = rec.type_layout.required_alignment_bits, - }; - } else { - const type_align = ty.alignof(comp) * BITS_PER_BYTE; - return .{ - .size_bits = ty.bitSizeof(comp) orelse 0, - .pointer_alignment_bits = type_align, - .field_alignment_bits = type_align, - .required_alignment_bits = BITS_PER_BYTE, - }; +fn computeLayout(qt: QualType, comp: *const Compilation) RecordLayout { + switch (qt.base(comp).type) { + .@"struct", .@"union" => |record| { + const requested = BITS_PER_BYTE * (qt.requestedAlignment(comp) orelse 0); + return .{ + .size_bits = record.layout.?.size_bits, + .pointer_alignment_bits = @max(requested, record.layout.?.pointer_alignment_bits), + .field_alignment_bits = @max(requested, record.layout.?.field_alignment_bits), + .required_alignment_bits = record.layout.?.required_alignment_bits, + }; + }, + else => { + const type_align = qt.alignof(comp) * BITS_PER_BYTE; + return .{ + .size_bits = qt.bitSizeofOrNull(comp) orelse 0, + .pointer_alignment_bits = type_align, + .field_alignment_bits = type_align, + .required_alignment_bits = BITS_PER_BYTE, + }; + }, } } diff --git a/lib/compiler/aro/aro/target.zig b/lib/compiler/aro/aro/target.zig index 457b93e0cf4f..0aec09151b86 100644 --- a/lib/compiler/aro/aro/target.zig +++ b/lib/compiler/aro/aro/target.zig @@ -1,15 +1,18 @@ const std = @import("std"); + +const backend = @import("../backend.zig"); + const LangOpts = @import("LangOpts.zig"); -const Type = @import("Type.zig"); const TargetSet = @import("Builtins/Properties.zig").TargetSet; +const QualType = @import("TypeStore.zig").QualType; /// intmax_t for this target -pub fn intMaxType(target: std.Target) Type { +pub fn intMaxType(target: std.Target) QualType { switch (target.cpu.arch) { .aarch64, .aarch64_be, .sparc64, - => if (target.os.tag != .openbsd) return .{ .specifier = .long }, + => if (target.os.tag != .openbsd) return .long, .bpfel, .bpfeb, @@ -18,28 +21,28 @@ pub fn intMaxType(target: std.Target) Type { .powerpc64, .powerpc64le, .ve, - => return .{ .specifier = .long }, + => return .long, .x86_64 => switch (target.os.tag) { .windows, .openbsd => {}, else => switch (target.abi) { .gnux32, .muslx32 => {}, - else => return .{ .specifier = .long }, + else => return .long, }, }, else => {}, } - return .{ .specifier = .long_long }; + return .long_long; } /// intptr_t for this target -pub fn intPtrType(target: std.Target) Type { - if (target.os.tag == .haiku) return .{ .specifier = .long }; +pub fn intPtrType(target: std.Target) QualType { + if (target.os.tag == .haiku) return .long; switch (target.cpu.arch) { .aarch64, .aarch64_be => switch (target.os.tag) { - .windows => return .{ .specifier = .long_long }, + .windows => return .long_long, else => {}, }, @@ -53,28 +56,28 @@ pub fn intPtrType(target: std.Target) Type { .spirv32, .arc, .avr, - => return .{ .specifier = .int }, + => return .int, .sparc => switch (target.os.tag) { .netbsd, .openbsd => {}, - else => return .{ .specifier = .int }, + else => return .int, }, .powerpc, .powerpcle => switch (target.os.tag) { - .linux, .freebsd, .netbsd => return .{ .specifier = .int }, + .linux, .freebsd, .netbsd => return .int, else => {}, }, // 32-bit x86 Darwin, OpenBSD, and RTEMS use long (the default); others use int .x86 => switch (target.os.tag) { .openbsd, .rtems => {}, - else => if (!target.os.tag.isDarwin()) return .{ .specifier = .int }, + else => if (!target.os.tag.isDarwin()) return .int, }, .x86_64 => switch (target.os.tag) { - .windows => return .{ .specifier = .long_long }, + .windows => return .long_long, else => switch (target.abi) { - .gnux32, .muslx32 => return .{ .specifier = .int }, + .gnux32, .muslx32 => return .int, else => {}, }, }, @@ -82,29 +85,29 @@ pub fn intPtrType(target: std.Target) Type { else => {}, } - return .{ .specifier = .long }; + return .long; } /// int16_t for this target -pub fn int16Type(target: std.Target) Type { +pub fn int16Type(target: std.Target) QualType { return switch (target.cpu.arch) { - .avr => .{ .specifier = .int }, - else => .{ .specifier = .short }, + .avr => .int, + else => .short, }; } /// sig_atomic_t for this target -pub fn sigAtomicType(target: std.Target) Type { - if (target.cpu.arch.isWasm()) return .{ .specifier = .long }; +pub fn sigAtomicType(target: std.Target) QualType { + if (target.cpu.arch.isWasm()) return .long; return switch (target.cpu.arch) { - .avr => .{ .specifier = .schar }, - .msp430 => .{ .specifier = .long }, - else => .{ .specifier = .int }, + .avr => .schar, + .msp430 => .long, + else => .int, }; } /// int64_t for this target -pub fn int64Type(target: std.Target) Type { +pub fn int64Type(target: std.Target) QualType { switch (target.cpu.arch) { .loongarch64, .ve, @@ -113,20 +116,20 @@ pub fn int64Type(target: std.Target) Type { .powerpc64le, .bpfel, .bpfeb, - => return .{ .specifier = .long }, + => return .long, .sparc64 => return intMaxType(target), .x86, .x86_64 => if (!target.os.tag.isDarwin()) return intMaxType(target), - .aarch64, .aarch64_be => if (!target.os.tag.isDarwin() and target.os.tag != .openbsd and target.os.tag != .windows) return .{ .specifier = .long }, + .aarch64, .aarch64_be => if (!target.os.tag.isDarwin() and target.os.tag != .openbsd and target.os.tag != .windows) return .long, else => {}, } - return .{ .specifier = .long_long }; + return .long_long; } -pub fn float80Type(target: std.Target) ?Type { +pub fn float80Type(target: std.Target) ?QualType { switch (target.cpu.arch) { - .x86, .x86_64 => return .{ .specifier = .long_double }, + .x86, .x86_64 => return .long_double, else => {}, } return null; @@ -162,7 +165,7 @@ pub fn ignoreNonZeroSizedBitfieldTypeAlignment(target: std.Target) bool { switch (target.cpu.arch) { .avr => return true, .arm => { - if (target.cpu.has(.arm, .has_v7)) { + if (std.Target.arm.featureSetHas(target.cpu.features, .has_v7)) { switch (target.os.tag) { .ios => return true, else => return false, @@ -185,7 +188,7 @@ pub fn minZeroWidthBitfieldAlignment(target: std.Target) ?u29 { switch (target.cpu.arch) { .avr => return 8, .arm => { - if (target.cpu.has(.arm, .has_v7)) { + if (std.Target.arm.featureSetHas(target.cpu.features, .has_v7)) { switch (target.os.tag) { .ios => return 32, else => return null, @@ -203,7 +206,7 @@ pub fn unnamedFieldAffectsAlignment(target: std.Target) bool { return true; }, .armeb => { - if (target.cpu.has(.arm, .has_v7)) { + if (std.Target.arm.featureSetHas(target.cpu.features, .has_v7)) { if (std.Target.Abi.default(target.cpu.arch, target.os.tag) == .eabi) return true; } }, @@ -230,7 +233,7 @@ pub fn defaultAlignment(target: std.Target) u29 { switch (target.cpu.arch) { .avr => return 1, .arm => if (target.abi.isAndroid() or target.os.tag == .ios) return 16 else return 8, - .sparc => if (target.cpu.has(.sparc, .v9)) return 16 else return 8, + .sparc => if (std.Target.sparc.featureSetHas(target.cpu.features, .v9)) return 16 else return 8, .mips, .mipsel => switch (target.abi) { .none, .gnuabi64 => return 16, else => return 8, @@ -242,7 +245,8 @@ pub fn defaultAlignment(target: std.Target) u29 { pub fn systemCompiler(target: std.Target) LangOpts.Compiler { // Android is linux but not gcc, so these checks go first // the rest for documentation as fn returns .clang - if (target.abi.isAndroid() or + if (target.os.tag.isDarwin() or + target.abi.isAndroid() or target.os.tag.isBSD() or target.os.tag == .fuchsia or target.os.tag == .solaris or @@ -268,7 +272,7 @@ pub fn systemCompiler(target: std.Target) LangOpts.Compiler { pub fn hasFloat128(target: std.Target) bool { if (target.cpu.arch.isWasm()) return true; if (target.os.tag.isDarwin()) return false; - if (target.cpu.arch.isPowerPC()) return target.cpu.has(.powerpc, .float128); + if (target.cpu.arch.isPowerPC()) return std.Target.powerpc.featureSetHas(target.cpu.features, .float128); return switch (target.os.tag) { .dragonfly, .haiku, @@ -334,7 +338,7 @@ pub const FPSemantics = enum { .spirv32, .spirv64, => return .IEEEHalf, - .x86, .x86_64 => if (target.cpu.has(.x86, .sse2)) return .IEEEHalf, + .x86, .x86_64 => if (std.Target.x86.featureSetHas(target.cpu.features, .sse2)) return .IEEEHalf, else => {}, } return null; @@ -369,6 +373,10 @@ pub fn isCygwinMinGW(target: std.Target) bool { return target.os.tag == .windows and (target.abi == .gnu or target.abi == .cygnus); } +pub fn isPS(target: std.Target) bool { + return (target.os.tag == .ps4 or target.os.tag == .ps5) and target.cpu.arch == .x86_64; +} + pub fn builtinEnabled(target: std.Target, enabled_for: TargetSet) bool { var it = enabled_for.iterator(); while (it.next()) |val| { @@ -399,7 +407,7 @@ pub fn defaultFpEvalMethod(target: std.Target) LangOpts.FPEvalMethod { return .double; } } - if (target.cpu.has(.x86, .sse)) { + if (std.Target.x86.featureSetHas(target.cpu.features, .sse)) { return .source; } return .extended; @@ -489,6 +497,8 @@ pub fn get32BitArchVariant(target: std.Target) ?std.Target { .spirv32, .loongarch32, .xtensa, + .propeller, + .or1k, => {}, // Already 32 bit .aarch64 => copy.cpu.arch = .arm, @@ -521,6 +531,8 @@ pub fn get64BitArchVariant(target: std.Target) ?std.Target { .msp430, .xcore, .xtensa, + .propeller, + .or1k, => return null, .aarch64, @@ -567,8 +579,7 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 { // 64 bytes is assumed to be large enough to hold any target triple; increase if necessary std.debug.assert(buf.len >= 64); - var stream = std.io.fixedBufferStream(buf); - const writer = stream.writer(); + var writer: std.Io.Writer = .fixed(buf); const llvm_arch = switch (target.cpu.arch) { .arm => "arm", @@ -609,11 +620,14 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 { .nvptx64 => "nvptx64", .spirv32 => "spirv32", .spirv64 => "spirv64", - .kalimba => "kalimba", .lanai => "lanai", .wasm32 => "wasm32", .wasm64 => "wasm64", .ve => "ve", + // Note: propeller1, kalimba and or1k are not supported in LLVM; this is the Zig arch name + .kalimba => "kalimba", + .propeller => "propeller", + .or1k => "or1k", }; writer.writeAll(llvm_arch) catch unreachable; writer.writeByte('-') catch unreachable; @@ -705,67 +719,265 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 { .ohoseabi => "ohoseabi", }; writer.writeAll(llvm_abi) catch unreachable; - return stream.getWritten(); + return writer.buffered(); } -test "alignment functions - smoke test" { - var target: std.Target = undefined; - const x86 = std.Target.Cpu.Arch.x86_64; - target.os = std.Target.Os.Tag.defaultVersionRange(.linux, x86, .none); - target.cpu = std.Target.Cpu.baseline(x86, target.os); - target.abi = std.Target.Abi.default(x86, target.os.tag); - - try std.testing.expect(isTlsSupported(target)); - try std.testing.expect(!ignoreNonZeroSizedBitfieldTypeAlignment(target)); - try std.testing.expect(minZeroWidthBitfieldAlignment(target) == null); - try std.testing.expect(!unnamedFieldAffectsAlignment(target)); - try std.testing.expect(defaultAlignment(target) == 16); - try std.testing.expect(!packAllEnums(target)); - try std.testing.expect(systemCompiler(target) == .gcc); - - const arm = std.Target.Cpu.Arch.arm; - target.os = std.Target.Os.Tag.defaultVersionRange(.ios, arm, .none); - target.cpu = std.Target.Cpu.baseline(arm, target.os); - target.abi = std.Target.Abi.default(arm, target.os.tag); - - try std.testing.expect(!isTlsSupported(target)); - try std.testing.expect(ignoreNonZeroSizedBitfieldTypeAlignment(target)); - try std.testing.expectEqual(@as(?u29, 32), minZeroWidthBitfieldAlignment(target)); - try std.testing.expect(unnamedFieldAffectsAlignment(target)); - try std.testing.expect(defaultAlignment(target) == 16); - try std.testing.expect(!packAllEnums(target)); - try std.testing.expect(systemCompiler(target) == .clang); +pub const DefaultPIStatus = enum { yes, no, depends_on_linker }; + +pub fn isPIEDefault(target: std.Target) DefaultPIStatus { + return switch (target.os.tag) { + .aix, + .haiku, + + .macos, + .ios, + .tvos, + .watchos, + .visionos, + .driverkit, + + .dragonfly, + .netbsd, + .freebsd, + .solaris, + + .cuda, + .amdhsa, + .amdpal, + .mesa3d, + + .ps4, + .ps5, + + .hurd, + .zos, + => .no, + + .openbsd, + .fuchsia, + => .yes, + + .linux => { + if (target.abi == .ohos) + return .yes; + + switch (target.cpu.arch) { + .ve => return .no, + else => return if (target.os.tag == .linux or target.abi.isAndroid() or target.abi.isMusl()) .yes else .no, + } + }, + + .windows => { + if (target.isMinGW()) + return .no; + + if (target.abi == .itanium) + return if (target.cpu.arch == .x86_64) .yes else .no; + + if (target.abi == .msvc or target.abi == .none) + return .depends_on_linker; + + return .no; + }, + + else => { + switch (target.cpu.arch) { + .hexagon => { + // CLANG_DEFAULT_PIE_ON_LINUX + return if (target.os.tag == .linux or target.abi.isAndroid() or target.abi.isMusl()) .yes else .no; + }, + + else => return .no, + } + }, + }; } -test "target size/align tests" { - var comp: @import("Compilation.zig") = undefined; +pub fn isPICdefault(target: std.Target) DefaultPIStatus { + return switch (target.os.tag) { + .aix, + .haiku, + + .macos, + .ios, + .tvos, + .watchos, + .visionos, + .driverkit, + + .amdhsa, + .amdpal, + .mesa3d, + + .ps4, + .ps5, + => .yes, + + .fuchsia, + .cuda, + .zos, + => .no, + + .dragonfly, + .openbsd, + .netbsd, + .freebsd, + .solaris, + .hurd, + => { + return switch (target.cpu.arch) { + .mips64, .mips64el => .yes, + else => .no, + }; + }, + + .linux => { + if (target.abi == .ohos) + return .no; - const x86 = std.Target.Cpu.Arch.x86; - comp.target.cpu.arch = x86; - comp.target.cpu.model = &std.Target.x86.cpu.i586; - comp.target.os = std.Target.Os.Tag.defaultVersionRange(.linux, x86, .none); - comp.target.abi = std.Target.Abi.gnu; + return switch (target.cpu.arch) { + .mips64, .mips64el => .yes, + else => .no, + }; + }, - const tt: Type = .{ - .specifier = .long_long, + .windows => { + if (target.isMinGW()) + return if (target.cpu.arch == .x86_64 or target.cpu.arch == .aarch64) .yes else .no; + + if (target.abi == .itanium) + return if (target.cpu.arch == .x86_64) .yes else .no; + + if (target.abi == .msvc or target.abi == .none) + return .depends_on_linker; + + if (target.ofmt == .macho) + return .yes; + + return switch (target.cpu.arch) { + .x86_64, .mips64, .mips64el => .yes, + else => .no, + }; + }, + + else => { + if (target.ofmt == .macho) + return .yes; + + return switch (target.cpu.arch) { + .mips64, .mips64el => .yes, + else => .no, + }; + }, }; +} - try std.testing.expectEqual(@as(u64, 8), tt.sizeof(&comp).?); - try std.testing.expectEqual(@as(u64, 4), tt.alignof(&comp)); +pub fn isPICDefaultForced(target: std.Target) DefaultPIStatus { + return switch (target.os.tag) { + .aix, .amdhsa, .amdpal, .mesa3d => .yes, + + .haiku, + .dragonfly, + .openbsd, + .netbsd, + .freebsd, + .solaris, + .cuda, + .ps4, + .ps5, + .hurd, + .linux, + .fuchsia, + .zos, + => .no, + + .windows => { + if (target.isMinGW()) + return .yes; - const arm = std.Target.Cpu.Arch.arm; - comp.target.cpu = std.Target.Cpu.Model.toCpu(&std.Target.arm.cpu.cortex_r4, arm); - comp.target.os = std.Target.Os.Tag.defaultVersionRange(.ios, arm, .none); - comp.target.abi = std.Target.Abi.none; + if (target.abi == .itanium) + return if (target.cpu.arch == .x86_64) .yes else .no; - const ct: Type = .{ - .specifier = .char, + // if (bfd) return target.cpu.arch == .x86_64 else target.cpu.arch == .x86_64 or target.cpu.arch == .aarch64; + if (target.abi == .msvc or target.abi == .none) + return .depends_on_linker; + + if (target.ofmt == .macho) + return if (target.cpu.arch == .aarch64 or target.cpu.arch == .x86_64) .yes else .no; + + return if (target.cpu.arch == .x86_64) .yes else .no; + }, + + .macos, + .ios, + .tvos, + .watchos, + .visionos, + .driverkit, + => if (target.cpu.arch == .x86_64 or target.cpu.arch == .aarch64) .yes else .no, + + else => { + return switch (target.cpu.arch) { + .hexagon, + .lanai, + .avr, + .riscv32, + .riscv64, + .csky, + .xcore, + .wasm32, + .wasm64, + .ve, + .spirv32, + .spirv64, + => .no, + + .msp430 => .yes, + + else => { + if (target.ofmt == .macho) + return if (target.cpu.arch == .aarch64 or target.cpu.arch == .x86_64) .yes else .no; + return .no; + }, + }; + }, }; +} - try std.testing.expectEqual(true, comp.target.cpu.has(.arm, .has_v7)); - try std.testing.expectEqual(@as(u64, 1), ct.sizeof(&comp).?); - try std.testing.expectEqual(@as(u64, 1), ct.alignof(&comp)); - try std.testing.expectEqual(true, ignoreNonZeroSizedBitfieldTypeAlignment(comp.target)); +test "alignment functions - smoke test" { + const linux: std.Target.Os = .{ .tag = .linux, .version_range = .{ .none = {} } }; + const x86_64_target: std.Target = .{ + .abi = std.Target.Abi.default(.x86_64, linux.tag), + .cpu = std.Target.Cpu.Model.generic(.x86_64).toCpu(.x86_64), + .os = linux, + .ofmt = .elf, + }; + + try std.testing.expect(isTlsSupported(x86_64_target)); + try std.testing.expect(!ignoreNonZeroSizedBitfieldTypeAlignment(x86_64_target)); + try std.testing.expect(minZeroWidthBitfieldAlignment(x86_64_target) == null); + try std.testing.expect(!unnamedFieldAffectsAlignment(x86_64_target)); + try std.testing.expect(defaultAlignment(x86_64_target) == 16); + try std.testing.expect(!packAllEnums(x86_64_target)); + try std.testing.expect(systemCompiler(x86_64_target) == .gcc); +} + +test "target size/align tests" { + var comp: @import("Compilation.zig") = undefined; + + const linux: std.Target.Os = .{ .tag = .linux, .version_range = .{ .none = {} } }; + const x86_target: std.Target = .{ + .abi = std.Target.Abi.default(.x86, linux.tag), + .cpu = std.Target.Cpu.Model.generic(.x86).toCpu(.x86), + .os = linux, + .ofmt = .elf, + }; + comp.target = x86_target; + + const tt: QualType = .long_long; + + try std.testing.expectEqual(@as(u64, 8), tt.sizeof(&comp)); + try std.testing.expectEqual(@as(u64, 4), tt.alignof(&comp)); } /// The canonical integer representation of nullptr_t. diff --git a/lib/compiler/aro/aro/text_literal.zig b/lib/compiler/aro/aro/text_literal.zig index 7bc8fd95cb2c..cb4ccdf12b1a 100644 --- a/lib/compiler/aro/aro/text_literal.zig +++ b/lib/compiler/aro/aro/text_literal.zig @@ -1,11 +1,13 @@ //! Parsing and classification of string and character literals const std = @import("std"); +const mem = std.mem; + const Compilation = @import("Compilation.zig"); -const Type = @import("Type.zig"); const Diagnostics = @import("Diagnostics.zig"); const Tokenizer = @import("Tokenizer.zig"); -const mem = std.mem; +const QualType = @import("TypeStore.zig").QualType; +const Source = @import("Source.zig"); pub const Item = union(enum) { /// decoded hex or character escape @@ -18,11 +20,6 @@ pub const Item = union(enum) { utf8_text: std.unicode.Utf8View, }; -const CharDiagnostic = struct { - tag: Diagnostics.Tag, - extra: Diagnostics.Message.Extra, -}; - pub const Kind = enum { char, wide, @@ -91,13 +88,13 @@ pub const Kind = enum { } /// The C type of a character literal of this kind - pub fn charLiteralType(kind: Kind, comp: *const Compilation) Type { + pub fn charLiteralType(kind: Kind, comp: *const Compilation) QualType { return switch (kind) { - .char => Type.int, - .wide => comp.types.wchar, - .utf_8 => .{ .specifier = .uchar }, - .utf_16 => comp.types.uint_least16_t, - .utf_32 => comp.types.uint_least32_t, + .char => .int, + .wide => comp.type_store.wchar, + .utf_8 => .uchar, + .utf_16 => comp.type_store.uint_least16_t, + .utf_32 => comp.type_store.uint_least32_t, .unterminated => unreachable, }; } @@ -120,7 +117,7 @@ pub const Kind = enum { pub fn charUnitSize(kind: Kind, comp: *const Compilation) Compilation.CharUnitSize { return switch (kind) { .char => .@"1", - .wide => switch (comp.types.wchar.sizeof(comp).?) { + .wide => switch (comp.type_store.wchar.sizeof(comp)) { 2 => .@"2", 4 => .@"4", else => unreachable, @@ -140,37 +137,55 @@ pub const Kind = enum { } /// The C type of an element of a string literal of this kind - pub fn elementType(kind: Kind, comp: *const Compilation) Type { + pub fn elementType(kind: Kind, comp: *const Compilation) QualType { return switch (kind) { .unterminated => unreachable, - .char => .{ .specifier = .char }, - .utf_8 => if (comp.langopts.hasChar8_T()) .{ .specifier = .uchar } else .{ .specifier = .char }, + .char => .char, + .utf_8 => if (comp.langopts.hasChar8_T()) .uchar else .char, else => kind.charLiteralType(comp), }; } }; +pub const Ascii = struct { + val: u7, + + pub fn init(val: anytype) Ascii { + return .{ .val = @intCast(val) }; + } + + pub fn format(ctx: Ascii, w: *std.Io.Writer, fmt_str: []const u8) !usize { + const template = "{c}"; + const i = std.mem.indexOf(u8, fmt_str, template).?; + try w.writeAll(fmt_str[0..i]); + + if (std.ascii.isPrint(ctx.val)) { + try w.writeByte(ctx.val); + } else { + try w.print("x{x:0>2}", .{ctx.val}); + } + return i + template.len; + } +}; + pub const Parser = struct { + comp: *const Compilation, literal: []const u8, i: usize = 0, kind: Kind, max_codepoint: u21, + loc: Source.Location, + /// Offset added to `loc.byte_offset` when emitting an error. + offset: u32 = 0, + expansion_locs: []const Source.Location, /// We only want to issue a max of 1 error per char literal errored: bool = false, - errors_buffer: [4]CharDiagnostic, - errors_len: usize, - comp: *const Compilation, - - pub fn init(literal: []const u8, kind: Kind, max_codepoint: u21, comp: *const Compilation) Parser { - return .{ - .literal = literal, - .comp = comp, - .kind = kind, - .max_codepoint = max_codepoint, - .errors_buffer = undefined, - .errors_len = 0, - }; - } + /// Makes incorrect encoding always an error. + /// Used when concatenating string literals. + incorrect_encoding_is_error: bool = false, + /// If this is false, do not issue any diagnostics for incorrect character encoding + /// Incorrect encoding is allowed if we are unescaping an identifier in the preprocessor + diagnose_incorrect_encoding: bool = true, fn prefixLen(self: *const Parser) usize { return switch (self.kind) { @@ -181,65 +196,204 @@ pub const Parser = struct { }; } - pub fn errors(p: *Parser) []CharDiagnostic { - return p.errors_buffer[0..p.errors_len]; + const Diagnostic = struct { + fmt: []const u8, + kind: Diagnostics.Message.Kind, + opt: ?Diagnostics.Option = null, + extension: bool = false, + + pub const illegal_char_encoding_error: Diagnostic = .{ + .fmt = "illegal character encoding in character literal", + .kind = .@"error", + }; + + pub const illegal_char_encoding_warning: Diagnostic = .{ + .fmt = "illegal character encoding in character literal", + .kind = .warning, + .opt = .@"invalid-source-encoding", + }; + + pub const missing_hex_escape: Diagnostic = .{ + .fmt = "\\{c} used with no following hex digits", + .kind = .@"error", + }; + + pub const escape_sequence_overflow: Diagnostic = .{ + .fmt = "escape sequence out of range", + .kind = .@"error", + }; + + pub const incomplete_universal_character: Diagnostic = .{ + .fmt = "incomplete universal character name", + .kind = .@"error", + }; + + pub const invalid_universal_character: Diagnostic = .{ + .fmt = "invalid universal character", + .kind = .@"error", + }; + + pub const char_too_large: Diagnostic = .{ + .fmt = "character too large for enclosing character literal type", + .kind = .@"error", + }; + + pub const ucn_basic_char_error: Diagnostic = .{ + .fmt = "character '{c}' cannot be specified by a universal character name", + .kind = .@"error", + }; + + pub const ucn_basic_char_warning: Diagnostic = .{ + .fmt = "specifying character '{c}' with a universal character name is incompatible with C standards before C23", + .kind = .off, + .opt = .@"pre-c23-compat", + }; + + pub const ucn_control_char_error: Diagnostic = .{ + .fmt = "universal character name refers to a control character", + .kind = .@"error", + }; + + pub const ucn_control_char_warning: Diagnostic = .{ + .fmt = "universal character name referring to a control character is incompatible with C standards before C23", + .kind = .off, + .opt = .@"pre-c23-compat", + }; + + pub const c89_ucn_in_literal: Diagnostic = .{ + .fmt = "universal character names are only valid in C99 or later", + .kind = .warning, + .opt = .unicode, + }; + + const non_standard_escape_char: Diagnostic = .{ + .fmt = "use of non-standard escape character '\\{c}'", + .kind = .off, + .extension = true, + }; + + pub const unknown_escape_sequence: Diagnostic = .{ + .fmt = "unknown escape sequence '\\{c}'", + .kind = .warning, + .opt = .@"unknown-escape-sequence", + }; + + pub const four_char_char_literal: Diagnostic = .{ + .fmt = "multi-character character constant", + .opt = .@"four-char-constants", + .kind = .off, + }; + + pub const multichar_literal_warning: Diagnostic = .{ + .fmt = "multi-character character constant", + .kind = .warning, + .opt = .multichar, + }; + + pub const invalid_multichar_literal: Diagnostic = .{ + .fmt = "{s} character literals may not contain multiple characters", + .kind = .@"error", + }; + + pub const char_lit_too_wide: Diagnostic = .{ + .fmt = "character constant too long for its type", + .kind = .warning, + }; + + // pub const wide_multichar_literal: Diagnostic = .{ + // .fmt = "extraneous characters in character constant ignored", + // .kind = .warning, + // }; + }; + + pub fn err(p: *Parser, diagnostic: Diagnostic, args: anytype) !void { + defer p.offset = 0; + if (p.errored) return; + defer p.errored = true; + try p.warn(diagnostic, args); } - pub fn err(self: *Parser, tag: Diagnostics.Tag, extra: Diagnostics.Message.Extra) void { - if (self.errored) return; - self.errored = true; - const diagnostic: CharDiagnostic = .{ .tag = tag, .extra = extra }; - if (self.errors_len == self.errors_buffer.len) { - self.errors_buffer[self.errors_buffer.len - 1] = diagnostic; - } else { - self.errors_buffer[self.errors_len] = diagnostic; - self.errors_len += 1; - } + pub fn warn(p: *Parser, diagnostic: Diagnostic, args: anytype) Compilation.Error!void { + defer p.offset = 0; + if (p.errored) return; + if (p.comp.diagnostics.effectiveKind(diagnostic) == .off) return; + + var sf = std.heap.stackFallback(1024, p.comp.gpa); + var allocating: std.Io.Writer.Allocating = .init(sf.get()); + defer allocating.deinit(); + + formatArgs(&allocating.writer, diagnostic.fmt, args) catch return error.OutOfMemory; + + var offset_location = p.loc; + offset_location.byte_offset += p.offset; + try p.comp.diagnostics.addWithLocation(p.comp, .{ + .kind = diagnostic.kind, + .text = allocating.written(), + .opt = diagnostic.opt, + .extension = diagnostic.extension, + .location = offset_location.expand(p.comp), + }, p.expansion_locs, true); } - pub fn warn(self: *Parser, tag: Diagnostics.Tag, extra: Diagnostics.Message.Extra) void { - if (self.errored) return; - if (self.errors_len < self.errors_buffer.len) { - self.errors_buffer[self.errors_len] = .{ .tag = tag, .extra = extra }; - self.errors_len += 1; + fn formatArgs(w: *std.Io.Writer, fmt: []const u8, args: anytype) !void { + var i: usize = 0; + inline for (std.meta.fields(@TypeOf(args))) |arg_info| { + const arg = @field(args, arg_info.name); + i += switch (@TypeOf(arg)) { + []const u8 => try Diagnostics.formatString(w, fmt[i..], arg), + Ascii => try arg.format(w, fmt[i..]), + else => switch (@typeInfo(@TypeOf(arg))) { + .int, .comptime_int => try Diagnostics.formatInt(w, fmt[i..], arg), + .pointer => try Diagnostics.formatString(w, fmt[i..], arg), + else => unreachable, + }, + }; } + try w.writeAll(fmt[i..]); } - pub fn next(self: *Parser) ?Item { - if (self.i >= self.literal.len) return null; + pub fn next(p: *Parser) !?Item { + if (p.i >= p.literal.len) return null; - const start = self.i; - if (self.literal[start] != '\\') { - self.i = mem.indexOfScalarPos(u8, self.literal, start + 1, '\\') orelse self.literal.len; - const unescaped_slice = self.literal[start..self.i]; + const start = p.i; + if (p.literal[start] != '\\') { + p.i = mem.indexOfScalarPos(u8, p.literal, start + 1, '\\') orelse p.literal.len; + const unescaped_slice = p.literal[start..p.i]; const view = std.unicode.Utf8View.init(unescaped_slice) catch { - if (self.kind != .char) { - self.err(.illegal_char_encoding_error, .{ .none = {} }); + if (!p.diagnose_incorrect_encoding) { + return .{ .improperly_encoded = p.literal[start..p.i] }; + } + if (p.incorrect_encoding_is_error) { + try p.warn(.illegal_char_encoding_error, .{}); + return .{ .improperly_encoded = p.literal[start..p.i] }; + } + if (p.kind != .char) { + try p.err(.illegal_char_encoding_error, .{}); return null; } - self.warn(.illegal_char_encoding_warning, .{ .none = {} }); - return .{ .improperly_encoded = self.literal[start..self.i] }; + try p.warn(.illegal_char_encoding_warning, .{}); + return .{ .improperly_encoded = p.literal[start..p.i] }; }; return .{ .utf8_text = view }; } - switch (self.literal[start + 1]) { - 'u', 'U' => return self.parseUnicodeEscape(), - else => return self.parseEscapedChar(), + switch (p.literal[start + 1]) { + 'u', 'U' => return try p.parseUnicodeEscape(), + else => return try p.parseEscapedChar(), } } - fn parseUnicodeEscape(self: *Parser) ?Item { - const start = self.i; + fn parseUnicodeEscape(p: *Parser) !?Item { + const start = p.i; - std.debug.assert(self.literal[self.i] == '\\'); + std.debug.assert(p.literal[p.i] == '\\'); - const kind = self.literal[self.i + 1]; + const kind = p.literal[p.i + 1]; std.debug.assert(kind == 'u' or kind == 'U'); - self.i += 2; - if (self.i >= self.literal.len or !std.ascii.isHex(self.literal[self.i])) { - self.err(.missing_hex_escape, .{ .ascii = @intCast(kind) }); + p.i += 2; + if (p.i >= p.literal.len or !std.ascii.isHex(p.literal[p.i])) { + try p.err(.missing_hex_escape, .{Ascii.init(kind)}); return null; } const expected_len: usize = if (kind == 'u') 4 else 8; @@ -247,66 +401,66 @@ pub const Parser = struct { var count: usize = 0; var val: u32 = 0; - for (self.literal[self.i..], 0..) |c, i| { + for (p.literal[p.i..], 0..) |c, i| { if (i == expected_len) break; - const char = std.fmt.charToDigit(c, 16) catch { - break; - }; + const char = std.fmt.charToDigit(c, 16) catch break; val, const overflow = @shlWithOverflow(val, 4); overflowed = overflowed or overflow != 0; val |= char; count += 1; } - self.i += expected_len; + p.i += expected_len; if (overflowed) { - self.err(.escape_sequence_overflow, .{ .offset = start + self.prefixLen() }); + p.offset += @intCast(start + p.prefixLen()); + try p.err(.escape_sequence_overflow, .{}); return null; } if (count != expected_len) { - self.err(.incomplete_universal_character, .{ .none = {} }); + try p.err(.incomplete_universal_character, .{}); return null; } if (val > std.math.maxInt(u21) or !std.unicode.utf8ValidCodepoint(@intCast(val))) { - self.err(.invalid_universal_character, .{ .offset = start + self.prefixLen() }); + p.offset += @intCast(start + p.prefixLen()); + try p.err(.invalid_universal_character, .{}); return null; } - if (val > self.max_codepoint) { - self.err(.char_too_large, .{ .none = {} }); + if (val > p.max_codepoint) { + try p.err(.char_too_large, .{}); return null; } if (val < 0xA0 and (val != '$' and val != '@' and val != '`')) { - const is_error = !self.comp.langopts.standard.atLeast(.c23); + const is_error = !p.comp.langopts.standard.atLeast(.c23); if (val >= 0x20 and val <= 0x7F) { if (is_error) { - self.err(.ucn_basic_char_error, .{ .ascii = @intCast(val) }); - } else { - self.warn(.ucn_basic_char_warning, .{ .ascii = @intCast(val) }); + try p.err(.ucn_basic_char_error, .{Ascii.init(val)}); + } else if (!p.comp.langopts.standard.atLeast(.c23)) { + try p.warn(.ucn_basic_char_warning, .{Ascii.init(val)}); } } else { if (is_error) { - self.err(.ucn_control_char_error, .{ .none = {} }); - } else { - self.warn(.ucn_control_char_warning, .{ .none = {} }); + try p.err(.ucn_control_char_error, .{}); + } else if (!p.comp.langopts.standard.atLeast(.c23)) { + try p.warn(.ucn_control_char_warning, .{}); } } } - self.warn(.c89_ucn_in_literal, .{ .none = {} }); + if (!p.comp.langopts.standard.atLeast(.c99)) try p.warn(.c89_ucn_in_literal, .{}); return .{ .codepoint = @intCast(val) }; } - fn parseEscapedChar(self: *Parser) Item { - self.i += 1; - const c = self.literal[self.i]; + fn parseEscapedChar(p: *Parser) !Item { + p.i += 1; + const c = p.literal[p.i]; defer if (c != 'x' and (c < '0' or c > '7')) { - self.i += 1; + p.i += 1; }; switch (c) { @@ -319,36 +473,40 @@ pub const Parser = struct { 'a' => return .{ .value = 0x07 }, 'b' => return .{ .value = 0x08 }, 'e', 'E' => { - self.warn(.non_standard_escape_char, .{ .invalid_escape = .{ .char = c, .offset = @intCast(self.i) } }); + p.offset += @intCast(p.i); + try p.warn(.non_standard_escape_char, .{Ascii.init(c)}); return .{ .value = 0x1B }; }, '(', '{', '[', '%' => { - self.warn(.non_standard_escape_char, .{ .invalid_escape = .{ .char = c, .offset = @intCast(self.i) } }); + p.offset += @intCast(p.i); + try p.warn(.non_standard_escape_char, .{Ascii.init(c)}); return .{ .value = c }; }, 'f' => return .{ .value = 0x0C }, 'v' => return .{ .value = 0x0B }, - 'x' => return .{ .value = self.parseNumberEscape(.hex) }, - '0'...'7' => return .{ .value = self.parseNumberEscape(.octal) }, + 'x' => return .{ .value = try p.parseNumberEscape(.hex) }, + '0'...'7' => return .{ .value = try p.parseNumberEscape(.octal) }, 'u', 'U' => unreachable, // handled by parseUnicodeEscape else => { - self.warn(.unknown_escape_sequence, .{ .invalid_escape = .{ .char = c, .offset = @intCast(self.i) } }); + p.offset += @intCast(p.i); + try p.warn(.unknown_escape_sequence, .{Ascii.init(c)}); return .{ .value = c }; }, } } - fn parseNumberEscape(self: *Parser, base: EscapeBase) u32 { + fn parseNumberEscape(p: *Parser, base: EscapeBase) !u32 { var val: u32 = 0; var count: usize = 0; var overflowed = false; - const start = self.i; - defer self.i += count; + const start = p.i; + defer p.i += count; + const slice = switch (base) { - .octal => self.literal[self.i..@min(self.literal.len, self.i + 3)], // max 3 chars + .octal => p.literal[p.i..@min(p.literal.len, p.i + 3)], // max 3 chars .hex => blk: { - self.i += 1; - break :blk self.literal[self.i..]; // skip over 'x'; could have an arbitrary number of chars + p.i += 1; + break :blk p.literal[p.i..]; // skip over 'x'; could have an arbitrary number of chars }, }; for (slice) |c| { @@ -358,13 +516,14 @@ pub const Parser = struct { val += char; count += 1; } - if (overflowed or val > self.kind.maxInt(self.comp)) { - self.err(.escape_sequence_overflow, .{ .offset = start + self.prefixLen() }); + if (overflowed or val > p.kind.maxInt(p.comp)) { + p.offset += @intCast(start + p.prefixLen()); + try p.err(.escape_sequence_overflow, .{}); return 0; } if (count == 0) { std.debug.assert(base == .hex); - self.err(.missing_hex_escape, .{ .ascii = 'x' }); + try p.err(.missing_hex_escape, .{Ascii.init('x')}); } return val; } diff --git a/lib/compiler/aro/aro/toolchains/Linux.zig b/lib/compiler/aro/aro/toolchains/Linux.zig deleted file mode 100644 index fe6272b6b4fb..000000000000 --- a/lib/compiler/aro/aro/toolchains/Linux.zig +++ /dev/null @@ -1,517 +0,0 @@ -const std = @import("std"); -const mem = std.mem; -const Compilation = @import("../Compilation.zig"); -const GCCDetector = @import("../Driver/GCCDetector.zig"); -const Toolchain = @import("../Toolchain.zig"); -const Driver = @import("../Driver.zig"); -const Distro = @import("../Driver/Distro.zig"); -const target_util = @import("../target.zig"); -const system_defaults = @import("system_defaults"); - -const Linux = @This(); - -distro: Distro.Tag = .unknown, -extra_opts: std.ArrayListUnmanaged([]const u8) = .empty, -gcc_detector: GCCDetector = .{}, - -pub fn discover(self: *Linux, tc: *Toolchain) !void { - self.distro = Distro.detect(tc.getTarget(), tc.filesystem); - try self.gcc_detector.discover(tc); - tc.selected_multilib = self.gcc_detector.selected; - - try self.gcc_detector.appendToolPath(tc); - try self.buildExtraOpts(tc); - try self.findPaths(tc); -} - -fn buildExtraOpts(self: *Linux, tc: *const Toolchain) !void { - const gpa = tc.driver.comp.gpa; - const target = tc.getTarget(); - const is_android = target.abi.isAndroid(); - if (self.distro.isAlpine() or is_android) { - try self.extra_opts.ensureUnusedCapacity(gpa, 2); - self.extra_opts.appendAssumeCapacity("-z"); - self.extra_opts.appendAssumeCapacity("now"); - } - - if (self.distro.isOpenSUSE() or self.distro.isUbuntu() or self.distro.isAlpine() or is_android) { - try self.extra_opts.ensureUnusedCapacity(gpa, 2); - self.extra_opts.appendAssumeCapacity("-z"); - self.extra_opts.appendAssumeCapacity("relro"); - } - - if ((target.cpu.arch.isArm() and !target.cpu.arch.isThumb()) or target.cpu.arch.isAARCH64() or is_android) { - try self.extra_opts.ensureUnusedCapacity(gpa, 2); - self.extra_opts.appendAssumeCapacity("-z"); - self.extra_opts.appendAssumeCapacity("max-page-size=4096"); - } - - if (target.cpu.arch == .arm or target.cpu.arch == .thumb) { - try self.extra_opts.append(gpa, "-X"); - } - - if (!target.cpu.arch.isMIPS() and target.cpu.arch != .hexagon) { - const hash_style = if (is_android) .both else self.distro.getHashStyle(); - try self.extra_opts.append(gpa, switch (hash_style) { - inline else => |tag| "--hash-style=" ++ @tagName(tag), - }); - } - - if (system_defaults.enable_linker_build_id) { - try self.extra_opts.append(gpa, "--build-id"); - } -} - -fn addMultiLibPaths(self: *Linux, tc: *Toolchain, sysroot: []const u8, os_lib_dir: []const u8) !void { - if (!self.gcc_detector.is_valid) return; - const gcc_triple = self.gcc_detector.gcc_triple; - const lib_path = self.gcc_detector.parent_lib_path; - - // Add lib/gcc/$triple/$version, with an optional /multilib suffix. - try tc.addPathIfExists(&.{ self.gcc_detector.install_path, tc.selected_multilib.gcc_suffix }, .file); - - // Add lib/gcc/$triple/$libdir - // For GCC built with --enable-version-specific-runtime-libs. - try tc.addPathIfExists(&.{ self.gcc_detector.install_path, "..", os_lib_dir }, .file); - - try tc.addPathIfExists(&.{ lib_path, "..", gcc_triple, "lib", "..", os_lib_dir, tc.selected_multilib.os_suffix }, .file); - - // If the GCC installation we found is inside of the sysroot, we want to - // prefer libraries installed in the parent prefix of the GCC installation. - // It is important to *not* use these paths when the GCC installation is - // outside of the system root as that can pick up unintended libraries. - // This usually happens when there is an external cross compiler on the - // host system, and a more minimal sysroot available that is the target of - // the cross. Note that GCC does include some of these directories in some - // configurations but this seems somewhere between questionable and simply - // a bug. - if (mem.startsWith(u8, lib_path, sysroot)) { - try tc.addPathIfExists(&.{ lib_path, "..", os_lib_dir }, .file); - } -} - -fn addMultiArchPaths(self: *Linux, tc: *Toolchain) !void { - if (!self.gcc_detector.is_valid) return; - const lib_path = self.gcc_detector.parent_lib_path; - const gcc_triple = self.gcc_detector.gcc_triple; - const multilib = self.gcc_detector.selected; - try tc.addPathIfExists(&.{ lib_path, "..", gcc_triple, "lib", multilib.os_suffix }, .file); -} - -/// TODO: Very incomplete -fn findPaths(self: *Linux, tc: *Toolchain) !void { - const target = tc.getTarget(); - const sysroot = tc.getSysroot(); - - var output: [64]u8 = undefined; - - const os_lib_dir = getOSLibDir(target); - const multiarch_triple = getMultiarchTriple(target) orelse target_util.toLLVMTriple(target, &output); - - try self.addMultiLibPaths(tc, sysroot, os_lib_dir); - - try tc.addPathIfExists(&.{ sysroot, "/lib", multiarch_triple }, .file); - try tc.addPathIfExists(&.{ sysroot, "/lib", "..", os_lib_dir }, .file); - - if (target.abi.isAndroid()) { - // TODO - } - try tc.addPathIfExists(&.{ sysroot, "/usr", "lib", multiarch_triple }, .file); - try tc.addPathIfExists(&.{ sysroot, "/usr", "lib", "..", os_lib_dir }, .file); - - try self.addMultiArchPaths(tc); - - try tc.addPathIfExists(&.{ sysroot, "/lib" }, .file); - try tc.addPathIfExists(&.{ sysroot, "/usr", "lib" }, .file); -} - -pub fn deinit(self: *Linux, allocator: std.mem.Allocator) void { - self.extra_opts.deinit(allocator); -} - -fn isPIEDefault(self: *const Linux) bool { - _ = self; - return false; -} - -fn getPIE(self: *const Linux, d: *const Driver) bool { - if (d.shared or d.static or d.relocatable or d.static_pie) { - return false; - } - return d.pie orelse self.isPIEDefault(); -} - -fn getStaticPIE(self: *const Linux, d: *Driver) !bool { - _ = self; - if (d.static_pie and d.pie != null) { - try d.err("cannot specify 'nopie' along with 'static-pie'"); - } - return d.static_pie; -} - -fn getStatic(self: *const Linux, d: *const Driver) bool { - _ = self; - return d.static and !d.static_pie; -} - -pub fn getDefaultLinker(self: *const Linux, target: std.Target) []const u8 { - _ = self; - if (target.abi.isAndroid()) { - return "ld.lld"; - } - return "ld"; -} - -pub fn buildLinkerArgs(self: *const Linux, tc: *const Toolchain, argv: *std.array_list.Managed([]const u8)) Compilation.Error!void { - const d = tc.driver; - const target = tc.getTarget(); - - const is_pie = self.getPIE(d); - const is_static_pie = try self.getStaticPIE(d); - const is_static = self.getStatic(d); - const is_android = target.abi.isAndroid(); - const is_ve = target.cpu.arch == .ve; - const has_crt_begin_end_files = target.abi != .none; // TODO: clang checks for MIPS vendor - - if (is_pie) { - try argv.append("-pie"); - } - if (is_static_pie) { - try argv.appendSlice(&.{ "-static", "-pie", "--no-dynamic-linker", "-z", "text" }); - } - - if (d.rdynamic) { - try argv.append("-export-dynamic"); - } - - if (d.strip) { - try argv.append("-s"); - } - - try argv.appendSlice(self.extra_opts.items); - try argv.append("--eh-frame-hdr"); - - // Todo: Driver should parse `-EL`/`-EB` for arm to set endianness for arm targets - if (target_util.ldEmulationOption(d.comp.target, null)) |emulation| { - try argv.appendSlice(&.{ "-m", emulation }); - } else { - try d.err("Unknown target triple"); - return; - } - if (d.comp.target.cpu.arch.isRISCV()) { - try argv.append("-X"); - } - if (d.shared) { - try argv.append("-shared"); - } - if (is_static) { - try argv.append("-static"); - } else { - if (d.rdynamic) { - try argv.append("-export-dynamic"); - } - if (!d.shared and !is_static_pie and !d.relocatable) { - const dynamic_linker = d.comp.target.standardDynamicLinkerPath(); - // todo: check for --dyld-prefix - if (dynamic_linker.get()) |path| { - try argv.appendSlice(&.{ "-dynamic-linker", try tc.arena.dupe(u8, path) }); - } else { - try d.err("Could not find dynamic linker path"); - } - } - } - - try argv.appendSlice(&.{ "-o", d.output_name orelse "a.out" }); - - if (!d.nostdlib and !d.nostartfiles and !d.relocatable) { - if (!is_android) { - if (!d.shared) { - const crt1 = if (is_pie) - "Scrt1.o" - else if (is_static_pie) - "rcrt1.o" - else - "crt1.o"; - try argv.append(try tc.getFilePath(crt1)); - } - try argv.append(try tc.getFilePath("crti.o")); - } - if (is_ve) { - try argv.appendSlice(&.{ "-z", "max-page-size=0x4000000" }); - } - - if (has_crt_begin_end_files) { - var path: []const u8 = ""; - if (tc.getRuntimeLibKind() == .compiler_rt and !is_android) { - const crt_begin = try tc.getCompilerRt("crtbegin", .object); - if (tc.filesystem.exists(crt_begin)) { - path = crt_begin; - } - } - if (path.len == 0) { - const crt_begin = if (tc.driver.shared) - if (is_android) "crtbegin_so.o" else "crtbeginS.o" - else if (is_static) - if (is_android) "crtbegin_static.o" else "crtbeginT.o" - else if (is_pie or is_static_pie) - if (is_android) "crtbegin_dynamic.o" else "crtbeginS.o" - else if (is_android) "crtbegin_dynamic.o" else "crtbegin.o"; - path = try tc.getFilePath(crt_begin); - } - try argv.append(path); - } - } - - // TODO add -L opts - // TODO add -u opts - - try tc.addFilePathLibArgs(argv); - - // TODO handle LTO - - try argv.appendSlice(d.link_objects.items); - - if (!d.nostdlib and !d.relocatable) { - if (!d.nodefaultlibs) { - if (is_static or is_static_pie) { - try argv.append("--start-group"); - } - try tc.addRuntimeLibs(argv); - - // TODO: add pthread if needed - if (!d.nolibc) { - try argv.append("-lc"); - } - if (is_static or is_static_pie) { - try argv.append("--end-group"); - } else { - try tc.addRuntimeLibs(argv); - } - } - if (!d.nostartfiles) { - if (has_crt_begin_end_files) { - var path: []const u8 = ""; - if (tc.getRuntimeLibKind() == .compiler_rt and !is_android) { - const crt_end = try tc.getCompilerRt("crtend", .object); - if (tc.filesystem.exists(crt_end)) { - path = crt_end; - } - } - if (path.len == 0) { - const crt_end = if (d.shared) - if (is_android) "crtend_so.o" else "crtendS.o" - else if (is_pie or is_static_pie) - if (is_android) "crtend_android.o" else "crtendS.o" - else if (is_android) "crtend_android.o" else "crtend.o"; - path = try tc.getFilePath(crt_end); - } - try argv.append(path); - } - if (!is_android) { - try argv.append(try tc.getFilePath("crtn.o")); - } - } - } - - // TODO add -T args -} - -fn getMultiarchTriple(target: std.Target) ?[]const u8 { - const is_android = target.abi.isAndroid(); - const is_mips_r6 = target.cpu.has(.mips, .mips32r6); - return switch (target.cpu.arch) { - .arm, .thumb => if (is_android) "arm-linux-androideabi" else if (target.abi == .gnueabihf) "arm-linux-gnueabihf" else "arm-linux-gnueabi", - .armeb, .thumbeb => if (target.abi == .gnueabihf) "armeb-linux-gnueabihf" else "armeb-linux-gnueabi", - .aarch64 => if (is_android) "aarch64-linux-android" else "aarch64-linux-gnu", - .aarch64_be => "aarch64_be-linux-gnu", - .x86 => if (is_android) "i686-linux-android" else "i386-linux-gnu", - .x86_64 => if (is_android) "x86_64-linux-android" else if (target.abi == .gnux32) "x86_64-linux-gnux32" else "x86_64-linux-gnu", - .m68k => "m68k-linux-gnu", - .mips => if (is_mips_r6) "mipsisa32r6-linux-gnu" else "mips-linux-gnu", - .mipsel => if (is_android) "mipsel-linux-android" else if (is_mips_r6) "mipsisa32r6el-linux-gnu" else "mipsel-linux-gnu", - .powerpcle => "powerpcle-linux-gnu", - .powerpc64 => "powerpc64-linux-gnu", - .powerpc64le => "powerpc64le-linux-gnu", - .riscv64 => "riscv64-linux-gnu", - .sparc => "sparc-linux-gnu", - .sparc64 => "sparc64-linux-gnu", - .s390x => "s390x-linux-gnu", - - // TODO: expand this - else => null, - }; -} - -fn getOSLibDir(target: std.Target) []const u8 { - switch (target.cpu.arch) { - .x86, - .powerpc, - .powerpcle, - .sparc, - => return "lib32", - else => {}, - } - if (target.cpu.arch == .x86_64 and (target.abi == .gnux32 or target.abi == .muslx32)) { - return "libx32"; - } - if (target.cpu.arch == .riscv32) { - return "lib32"; - } - if (target.ptrBitWidth() == 32) { - return "lib"; - } - return "lib64"; -} - -pub fn defineSystemIncludes(self: *const Linux, tc: *const Toolchain) !void { - if (tc.driver.nostdinc) return; - - const comp = tc.driver.comp; - const target = tc.getTarget(); - - // musl prefers /usr/include before builtin includes, so musl targets will add builtins - // at the end of this function (unless disabled with nostdlibinc) - if (!tc.driver.nobuiltininc and (!target.abi.isMusl() or tc.driver.nostdlibinc)) { - try comp.addBuiltinIncludeDir(tc.driver.aro_name); - } - - if (tc.driver.nostdlibinc) return; - - const sysroot = tc.getSysroot(); - const local_include = try std.fmt.allocPrint(comp.gpa, "{s}{s}", .{ sysroot, "/usr/local/include" }); - defer comp.gpa.free(local_include); - try comp.addSystemIncludeDir(local_include); - - if (self.gcc_detector.is_valid) { - const gcc_include_path = try std.fs.path.join(comp.gpa, &.{ self.gcc_detector.parent_lib_path, "..", self.gcc_detector.gcc_triple, "include" }); - defer comp.gpa.free(gcc_include_path); - try comp.addSystemIncludeDir(gcc_include_path); - } - - if (getMultiarchTriple(target)) |triple| { - const joined = try std.fs.path.join(comp.gpa, &.{ sysroot, "usr", "include", triple }); - defer comp.gpa.free(joined); - if (tc.filesystem.exists(joined)) { - try comp.addSystemIncludeDir(joined); - } - } - - if (target.os.tag == .rtems) return; - - try comp.addSystemIncludeDir("/include"); - try comp.addSystemIncludeDir("/usr/include"); - - std.debug.assert(!tc.driver.nostdlibinc); - if (!tc.driver.nobuiltininc and target.abi.isMusl()) { - try comp.addBuiltinIncludeDir(tc.driver.aro_name); - } -} - -test Linux { - if (@import("builtin").os.tag == .windows) return error.SkipZigTest; - - var arena_instance = std.heap.ArenaAllocator.init(std.testing.allocator); - defer arena_instance.deinit(); - const arena = arena_instance.allocator(); - - var comp = Compilation.init(std.testing.allocator, std.fs.cwd()); - defer comp.deinit(); - comp.environment = .{ - .path = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", - }; - defer comp.environment = .{}; - - const raw_triple = "x86_64-linux-gnu"; - const target_query = try std.Target.Query.parse(.{ .arch_os_abi = raw_triple }); - comp.target = try std.zig.system.resolveTargetQuery(target_query); - comp.langopts.setEmulatedCompiler(.gcc); - - var driver: Driver = .{ .comp = &comp }; - defer driver.deinit(); - driver.raw_target_triple = raw_triple; - - const link_obj = try driver.comp.gpa.dupe(u8, "/tmp/foo.o"); - try driver.link_objects.append(driver.comp.gpa, link_obj); - driver.temp_file_count += 1; - - var toolchain: Toolchain = .{ .driver = &driver, .arena = arena, .filesystem = .{ .fake = &.{ - .{ .path = "/tmp" }, - .{ .path = "/usr" }, - .{ .path = "/usr/lib64" }, - .{ .path = "/usr/bin" }, - .{ .path = "/usr/bin/ld", .executable = true }, - .{ .path = "/lib" }, - .{ .path = "/lib/x86_64-linux-gnu" }, - .{ .path = "/lib/x86_64-linux-gnu/crt1.o" }, - .{ .path = "/lib/x86_64-linux-gnu/crti.o" }, - .{ .path = "/lib/x86_64-linux-gnu/crtn.o" }, - .{ .path = "/lib64" }, - .{ .path = "/usr/lib" }, - .{ .path = "/usr/lib/gcc" }, - .{ .path = "/usr/lib/gcc/x86_64-linux-gnu" }, - .{ .path = "/usr/lib/gcc/x86_64-linux-gnu/9" }, - .{ .path = "/usr/lib/gcc/x86_64-linux-gnu/9/crtbegin.o" }, - .{ .path = "/usr/lib/gcc/x86_64-linux-gnu/9/crtend.o" }, - .{ .path = "/usr/lib/x86_64-linux-gnu" }, - .{ .path = "/etc/lsb-release", .contents = - \\DISTRIB_ID=Ubuntu - \\DISTRIB_RELEASE=20.04 - \\DISTRIB_CODENAME=focal - \\DISTRIB_DESCRIPTION="Ubuntu 20.04.6 LTS" - \\ - }, - } } }; - defer toolchain.deinit(); - - try toolchain.discover(); - - var argv = std.array_list.Managed([]const u8).init(driver.comp.gpa); - defer argv.deinit(); - - var linker_path_buf: [std.fs.max_path_bytes]u8 = undefined; - const linker_path = try toolchain.getLinkerPath(&linker_path_buf); - try argv.append(linker_path); - - try toolchain.buildLinkerArgs(&argv); - - const expected = [_][]const u8{ - "/usr/bin/ld", - "-z", - "relro", - "--hash-style=gnu", - "--eh-frame-hdr", - "-m", - "elf_x86_64", - "-dynamic-linker", - "/lib64/ld-linux-x86-64.so.2", - "-o", - "a.out", - "/lib/x86_64-linux-gnu/crt1.o", - "/lib/x86_64-linux-gnu/crti.o", - "/usr/lib/gcc/x86_64-linux-gnu/9/crtbegin.o", - "-L/usr/lib/gcc/x86_64-linux-gnu/9", - "-L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib64", - "-L/lib/x86_64-linux-gnu", - "-L/lib/../lib64", - "-L/usr/lib/x86_64-linux-gnu", - "-L/usr/lib/../lib64", - "-L/lib", - "-L/usr/lib", - link_obj, - "-lgcc", - "--as-needed", - "-lgcc_s", - "--no-as-needed", - "-lc", - "-lgcc", - "--as-needed", - "-lgcc_s", - "--no-as-needed", - "/usr/lib/gcc/x86_64-linux-gnu/9/crtend.o", - "/lib/x86_64-linux-gnu/crtn.o", - }; - try std.testing.expectEqual(expected.len, argv.items.len); - for (expected, argv.items) |expected_item, actual_item| { - try std.testing.expectEqualStrings(expected_item, actual_item); - } -} diff --git a/lib/compiler/aro/assembly_backend.zig b/lib/compiler/aro/assembly_backend.zig new file mode 100644 index 000000000000..1818b6ba9b4e --- /dev/null +++ b/lib/compiler/aro/assembly_backend.zig @@ -0,0 +1,12 @@ +const std = @import("std"); + +const aro = @import("aro"); + +pub const x86_64 = @import("assembly_backend/x86_64.zig"); + +pub fn genAsm(target: std.Target, tree: *const aro.Tree) aro.Compilation.Error!aro.Assembly { + return switch (target.cpu.arch) { + .x86_64 => x86_64.genAsm(tree), + else => std.debug.panic("genAsm not implemented: {s}", .{@tagName(target.cpu.arch)}), + }; +} diff --git a/lib/compiler/aro/assembly_backend/x86_64.zig b/lib/compiler/aro/assembly_backend/x86_64.zig new file mode 100644 index 000000000000..455d21aa82bd --- /dev/null +++ b/lib/compiler/aro/assembly_backend/x86_64.zig @@ -0,0 +1,255 @@ +const std = @import("std"); +const Allocator = std.mem.Allocator; +const assert = std.debug.assert; + +const aro = @import("aro"); +const Assembly = aro.Assembly; +const Compilation = aro.Compilation; +const Node = Tree.Node; +const Source = aro.Source; +const Tree = aro.Tree; +const QualType = aro.QualType; +const Value = aro.Value; + +const AsmCodeGen = @This(); +const Error = aro.Compilation.Error; + +tree: *const Tree, +comp: *Compilation, +text: *std.Io.Writer, +data: *std.Io.Writer, + +const StorageUnit = enum(u8) { + byte = 8, + short = 16, + long = 32, + quad = 64, + + fn trunc(self: StorageUnit, val: u64) u64 { + return switch (self) { + .byte => @as(u8, @truncate(val)), + .short => @as(u16, @truncate(val)), + .long => @as(u32, @truncate(val)), + .quad => val, + }; + } +}; + +fn serializeInt(value: u64, storage_unit: StorageUnit, w: *std.Io.Writer) !void { + try w.print(" .{s} 0x{x}\n", .{ @tagName(storage_unit), storage_unit.trunc(value) }); +} + +fn serializeFloat(comptime T: type, value: T, w: *std.Io.Writer) !void { + switch (T) { + f128 => { + const bytes = std.mem.asBytes(&value); + const first = std.mem.bytesToValue(u64, bytes[0..8]); + try serializeInt(first, .quad, w); + const second = std.mem.bytesToValue(u64, bytes[8..16]); + return serializeInt(second, .quad, w); + }, + f80 => { + const bytes = std.mem.asBytes(&value); + const first = std.mem.bytesToValue(u64, bytes[0..8]); + try serializeInt(first, .quad, w); + const second = std.mem.bytesToValue(u16, bytes[8..10]); + try serializeInt(second, .short, w); + return w.writeAll(" .zero 6\n"); + }, + else => { + const size = @bitSizeOf(T); + const storage_unit = std.meta.intToEnum(StorageUnit, size) catch unreachable; + const IntTy = @Type(.{ .int = .{ .signedness = .unsigned, .bits = size } }); + const int_val: IntTy = @bitCast(value); + return serializeInt(int_val, storage_unit, w); + }, + } +} + +pub fn todo(c: *AsmCodeGen, msg: []const u8, tok: Tree.TokenIndex) Error { + const loc: Source.Location = c.tree.tokens.items(.loc)[tok]; + + var sf = std.heap.stackFallback(1024, c.comp.gpa); + const allocator = sf.get(); + var buf: std.ArrayList(u8) = .empty; + defer buf.deinit(allocator); + + try buf.print(allocator, "TODO: {s}", .{msg}); + try c.comp.diagnostics.add(.{ + .text = buf.items, + .kind = .@"error", + .location = loc.expand(c.comp), + }); + return error.FatalError; +} + +fn emitAggregate(c: *AsmCodeGen, qt: QualType, node: Node.Index) !void { + _ = qt; + return c.todo("Codegen aggregates", node.tok(c.tree)); +} + +fn emitSingleValue(c: *AsmCodeGen, qt: QualType, node: Node.Index) !void { + const value = c.tree.value_map.get(node) orelse return; + const bit_size = qt.bitSizeof(c.comp); + const scalar_kind = qt.scalarKind(c.comp); + if (!scalar_kind.isReal()) { + return c.todo("Codegen _Complex values", node.tok(c.tree)); + } else if (scalar_kind.isInt()) { + const storage_unit = std.meta.intToEnum(StorageUnit, bit_size) catch return c.todo("Codegen _BitInt values", node.tok(c.tree)); + try c.data.print(" .{s} ", .{@tagName(storage_unit)}); + _ = try value.print(qt, c.comp, c.data); + try c.data.writeByte('\n'); + } else if (scalar_kind.isFloat()) { + switch (bit_size) { + 16 => return serializeFloat(f16, value.toFloat(f16, c.comp), c.data), + 32 => return serializeFloat(f32, value.toFloat(f32, c.comp), c.data), + 64 => return serializeFloat(f64, value.toFloat(f64, c.comp), c.data), + 80 => return serializeFloat(f80, value.toFloat(f80, c.comp), c.data), + 128 => return serializeFloat(f128, value.toFloat(f128, c.comp), c.data), + else => unreachable, + } + } else if (scalar_kind.isPointer()) { + return c.todo("Codegen pointer", node.tok(c.tree)); + } else if (qt.is(c.comp, .array)) { + // Todo: + // Handle truncated initializers e.g. char x[3] = "hello"; + // Zero out remaining bytes if initializer is shorter than storage capacity + // Handle non-char strings + const bytes = value.toBytes(c.comp); + const directive = if (bytes.len > bit_size / 8) "ascii" else "string"; + try c.data.print(" .{s} ", .{directive}); + try Value.printString(bytes, qt, c.comp, c.data); + + try c.data.writeByte('\n'); + } else unreachable; +} + +fn emitValue(c: *AsmCodeGen, qt: QualType, node: Node.Index) !void { + switch (node.get(c.tree)) { + .array_init_expr, + .struct_init_expr, + .union_init_expr, + => return c.todo("Codegen multiple inits", node.tok(c.tree)), + else => return c.emitSingleValue(qt, node), + } +} + +pub fn genAsm(tree: *const Tree) Error!Assembly { + var data: std.Io.Writer.Allocating = .init(tree.comp.gpa); + defer data.deinit(); + + var text: std.Io.Writer.Allocating = .init(tree.comp.gpa); + defer text.deinit(); + + var codegen: AsmCodeGen = .{ + .tree = tree, + .comp = tree.comp, + .text = &text.writer, + .data = &data.writer, + }; + + codegen.genDecls() catch |err| switch (err) { + error.WriteFailed => return error.OutOfMemory, + error.OutOfMemory => return error.OutOfMemory, + error.FatalError => return error.FatalError, + }; + + const text_slice = try text.toOwnedSlice(); + errdefer tree.comp.gpa.free(text_slice); + const data_slice = try data.toOwnedSlice(); + return .{ + .text = text_slice, + .data = data_slice, + }; +} + +fn genDecls(c: *AsmCodeGen) !void { + if (c.tree.comp.code_gen_options.debug != .strip) { + const sources = c.tree.comp.sources.values(); + for (sources) |source| { + try c.data.print(" .file {d} \"{s}\"\n", .{ @intFromEnum(source.id) - 1, source.path }); + } + } + + for (c.tree.root_decls.items) |decl| { + switch (decl.get(c.tree)) { + .static_assert, + .typedef, + .struct_decl, + .union_decl, + .enum_decl, + => {}, + + .function => |function| { + if (function.body == null) continue; + try c.genFn(function); + }, + + .variable => |variable| try c.genVar(variable), + + else => unreachable, + } + } + try c.text.writeAll(" .section .note.GNU-stack,\"\",@progbits\n"); +} + +fn genFn(c: *AsmCodeGen, function: Node.Function) !void { + return c.todo("Codegen functions", function.name_tok); +} + +fn genVar(c: *AsmCodeGen, variable: Node.Variable) !void { + const comp = c.comp; + const qt = variable.qt; + + const is_tentative = variable.initializer == null; + const size = qt.sizeofOrNull(comp) orelse blk: { + // tentative array definition assumed to have one element + std.debug.assert(is_tentative and qt.is(c.comp, .array)); + break :blk qt.childType(c.comp).sizeof(comp); + }; + + const name = c.tree.tokSlice(variable.name_tok); + const nat_align = qt.alignof(comp); + const alignment = if (qt.is(c.comp, .array) and size >= 16) @max(16, nat_align) else nat_align; + + if (variable.storage_class == .static) { + try c.data.print(" .local \"{s}\"\n", .{name}); + } else { + try c.data.print(" .globl \"{s}\"\n", .{name}); + } + + if (is_tentative and comp.code_gen_options.common) { + try c.data.print(" .comm \"{s}\", {d}, {d}\n", .{ name, size, alignment }); + return; + } + if (variable.initializer) |init| { + if (variable.thread_local and comp.code_gen_options.data_sections) { + try c.data.print(" .section .tdata.\"{s}\",\"awT\",@progbits\n", .{name}); + } else if (variable.thread_local) { + try c.data.writeAll(" .section .tdata,\"awT\",@progbits\n"); + } else if (comp.code_gen_options.data_sections) { + try c.data.print(" .section .data.\"{s}\",\"aw\",@progbits\n", .{name}); + } else { + try c.data.writeAll(" .data\n"); + } + + try c.data.print(" .type \"{s}\", @object\n", .{name}); + try c.data.print(" .size \"{s}\", {d}\n", .{ name, size }); + try c.data.print(" .align {d}\n", .{alignment}); + try c.data.print("\"{s}\":\n", .{name}); + try c.emitValue(qt, init); + return; + } + if (variable.thread_local and comp.code_gen_options.data_sections) { + try c.data.print(" .section .tbss.\"{s}\",\"awT\",@nobits\n", .{name}); + } else if (variable.thread_local) { + try c.data.writeAll(" .section .tbss,\"awT\",@nobits\n"); + } else if (comp.code_gen_options.data_sections) { + try c.data.print(" .section .bss.\"{s}\",\"aw\",@nobits\n", .{name}); + } else { + try c.data.writeAll(" .bss\n"); + } + try c.data.print(" .align {d}\n", .{alignment}); + try c.data.print("\"{s}\":\n", .{name}); + try c.data.print(" .zero {d}\n", .{size}); +} diff --git a/lib/compiler/aro/backend.zig b/lib/compiler/aro/backend.zig index 04c31c1e7d5d..9d2ef1fae43f 100644 --- a/lib/compiler/aro/backend.zig +++ b/lib/compiler/aro/backend.zig @@ -1,12 +1,23 @@ +pub const Assembly = @import("backend/Assembly.zig"); +pub const CodeGenOptions = @import("backend/CodeGenOptions.zig"); pub const Interner = @import("backend/Interner.zig"); pub const Ir = @import("backend/Ir.zig"); pub const Object = @import("backend/Object.zig"); pub const CallingConvention = enum { - C, + c, stdcall, thiscall, vectorcall, + fastcall, + regcall, + riscv_vector, + aarch64_sve_pcs, + aarch64_vector_pcs, + arm_aapcs, + arm_aapcs_vfp, + x86_64_sysv, + x86_64_win, }; pub const version_str = "aro-zig"; diff --git a/lib/compiler/aro/backend/Assembly.zig b/lib/compiler/aro/backend/Assembly.zig new file mode 100644 index 000000000000..ec9d671034bd --- /dev/null +++ b/lib/compiler/aro/backend/Assembly.zig @@ -0,0 +1,20 @@ +const std = @import("std"); +const Allocator = std.mem.Allocator; + +data: []const u8, +text: []const u8, + +const Assembly = @This(); + +pub fn deinit(self: *const Assembly, gpa: Allocator) void { + gpa.free(self.data); + gpa.free(self.text); +} + +pub fn writeToFile(self: Assembly, file: std.fs.File) !void { + var vec: [2]std.posix.iovec_const = .{ + .{ .base = self.data.ptr, .len = self.data.len }, + .{ .base = self.text.ptr, .len = self.text.len }, + }; + return file.writevAll(&vec); +} diff --git a/lib/compiler/aro/backend/CodeGenOptions.zig b/lib/compiler/aro/backend/CodeGenOptions.zig new file mode 100644 index 000000000000..986e9534837d --- /dev/null +++ b/lib/compiler/aro/backend/CodeGenOptions.zig @@ -0,0 +1,94 @@ +const std = @import("std"); + +/// place uninitialized global variables in a common block +common: bool, +/// Place each function into its own section in the output file if the target supports arbitrary sections +func_sections: bool, +/// Place each data item into its own section in the output file if the target supports arbitrary sections +data_sections: bool, +pic_level: PicLevel, +/// Generate position-independent code that can only be linked into executables +is_pie: bool, +optimization_level: OptimizationLevel, +/// Generate debug information +debug: DebugFormat, +dwarf_version: DwarfVersion, + +pub const DebugFormat = union(enum) { + strip, + dwarf: std.dwarf.Format, + code_view, +}; + +pub const DwarfVersion = enum(u3) { + @"0" = 0, + @"2" = 2, + @"3" = 3, + @"4" = 4, + @"5" = 5, +}; + +pub const PicLevel = enum(u8) { + /// Do not generate position-independent code + none = 0, + /// Generate position-independent code (PIC) suitable for use in a shared library, if supported for the target machine. + one = 1, + /// If supported for the target machine, emit position-independent code, suitable for dynamic linking and avoiding + /// any limit on the size of the global offset table. + two = 2, +}; + +pub const OptimizationLevel = enum { + @"0", + @"1", + @"2", + @"3", + /// Optimize for size + s, + /// Disregard strict standards compliance + fast, + /// Optimize debugging experience + g, + /// Optimize aggressively for size rather than speed + z, + + const level_map = std.StaticStringMap(OptimizationLevel).initComptime(.{ + .{ "0", .@"0" }, + .{ "1", .@"1" }, + .{ "2", .@"2" }, + .{ "3", .@"3" }, + .{ "s", .s }, + .{ "fast", .fast }, + .{ "g", .g }, + .{ "z", .z }, + }); + + pub fn fromString(str: []const u8) ?OptimizationLevel { + return level_map.get(str); + } + + pub fn isSizeOptimized(self: OptimizationLevel) bool { + return switch (self) { + .s, .z => true, + .@"0", .@"1", .@"2", .@"3", .fast, .g => false, + }; + } + + pub fn hasAnyOptimizations(self: OptimizationLevel) bool { + return switch (self) { + .@"0" => false, + .@"1", .@"2", .@"3", .s, .fast, .g, .z => true, + }; + } +}; + +pub const default: @This() = .{ + .common = false, + .func_sections = false, + .data_sections = false, + .pic_level = .none, + .is_pie = false, + .optimization_level = .@"0", + .debug = .strip, + .dwarf_version = .@"0", +}; diff --git a/lib/compiler/aro/backend/Interner.zig b/lib/compiler/aro/backend/Interner.zig index 0a910cc93c04..683b18d7f5c6 100644 --- a/lib/compiler/aro/backend/Interner.zig +++ b/lib/compiler/aro/backend/Interner.zig @@ -12,10 +12,10 @@ map: std.AutoArrayHashMapUnmanaged(void, void) = .empty, items: std.MultiArrayList(struct { tag: Tag, data: u32, -}) = .{}, -extra: std.ArrayListUnmanaged(u32) = .empty, -limbs: std.ArrayListUnmanaged(Limb) = .empty, -strings: std.ArrayListUnmanaged(u8) = .empty, +}) = .empty, +extra: std.ArrayList(u32) = .empty, +limbs: std.ArrayList(Limb) = .empty, +strings: std.ArrayList(u8) = .empty, const KeyAdapter = struct { interner: *const Interner, @@ -65,6 +65,7 @@ pub const Key = union(enum) { float: Float, complex: Complex, bytes: []const u8, + pointer: Pointer, pub const Float = union(enum) { f16: f16, @@ -80,6 +81,12 @@ pub const Key = union(enum) { cf80: [2]f80, cf128: [2]f128, }; + pub const Pointer = struct { + /// NodeIndex of decl or compound literal whose address we are offsetting from + node: u32, + /// Offset in bytes + offset: Ref, + }; pub fn hash(key: Key) u32 { var hasher = Hash.init(0); @@ -199,6 +206,10 @@ pub const Key = union(enum) { } return null; } + + pub fn toBigInt(key: Key, space: *Tag.Int.BigIntSpace) BigIntConst { + return key.int.toBigInt(space); + } }; pub const Ref = enum(u32) { @@ -303,6 +314,8 @@ pub const Tag = enum(u8) { bytes, /// `data` is `Record` record_ty, + /// `data` is Pointer + pointer, pub const Array = struct { len0: u32, @@ -322,6 +335,11 @@ pub const Tag = enum(u8) { child: Ref, }; + pub const Pointer = struct { + node: u32, + offset: Ref, + }; + pub const Int = struct { limbs_index: u32, limbs_len: u32, @@ -606,6 +624,15 @@ pub fn put(i: *Interner, gpa: Allocator, key: Key) !Ref { }), }); }, + .pointer => |info| { + i.items.appendAssumeCapacity(.{ + .tag = .pointer, + .data = try i.addExtra(gpa, Tag.Pointer{ + .node = info.node, + .offset = info.offset, + }), + }); + }, .int => |repr| int: { var space: Tag.Int.BigIntSpace = undefined; const big = repr.toBigInt(&space); @@ -792,6 +819,13 @@ pub fn get(i: *const Interner, ref: Ref) Key { .child = vector_ty.child, } }; }, + .pointer => { + const pointer = i.extraData(Tag.Pointer, data); + return .{ .pointer = .{ + .node = pointer.node, + .offset = pointer.offset, + } }; + }, .u32 => .{ .int = .{ .u64 = data } }, .i32 => .{ .int = .{ .i64 = @as(i32, @bitCast(data)) } }, .int_positive, .int_negative => { diff --git a/lib/compiler/aro/backend/Ir.zig b/lib/compiler/aro/backend/Ir.zig index e90bf56cbd20..a041618b14ea 100644 --- a/lib/compiler/aro/backend/Ir.zig +++ b/lib/compiler/aro/backend/Ir.zig @@ -11,7 +11,7 @@ decls: std.StringArrayHashMapUnmanaged(Decl), pub const Decl = struct { instructions: std.MultiArrayList(Inst), - body: std.ArrayListUnmanaged(Ref), + body: std.ArrayList(Ref), arena: std.heap.ArenaAllocator.State, pub fn deinit(decl: *Decl, gpa: Allocator) void { @@ -27,8 +27,8 @@ pub const Builder = struct { interner: *Interner, decls: std.StringArrayHashMapUnmanaged(Decl) = .empty, - instructions: std.MultiArrayList(Ir.Inst) = .{}, - body: std.ArrayListUnmanaged(Ref) = .empty, + instructions: std.MultiArrayList(Ir.Inst) = .empty, + body: std.ArrayList(Ref) = .empty, alloc_count: u32 = 0, arg_count: u32 = 0, current_label: Ref = undefined, @@ -374,29 +374,30 @@ pub fn deinit(ir: *Ir, gpa: std.mem.Allocator) void { ir.* = undefined; } -const TYPE = std.io.tty.Color.bright_magenta; -const INST = std.io.tty.Color.bright_cyan; -const REF = std.io.tty.Color.bright_blue; -const LITERAL = std.io.tty.Color.bright_green; -const ATTRIBUTE = std.io.tty.Color.bright_yellow; +const TYPE = std.Io.tty.Color.bright_magenta; +const INST = std.Io.tty.Color.bright_cyan; +const REF = std.Io.tty.Color.bright_blue; +const LITERAL = std.Io.tty.Color.bright_green; +const ATTRIBUTE = std.Io.tty.Color.bright_yellow; -const RefMap = std.AutoArrayHashMap(Ref, void); +const RefMap = std.AutoArrayHashMapUnmanaged(Ref, void); -pub fn dump(ir: *const Ir, gpa: Allocator, config: std.io.tty.Config, w: anytype) !void { +pub fn dump(ir: *const Ir, gpa: Allocator, config: std.Io.tty.Config, w: *std.Io.Writer) !void { for (ir.decls.keys(), ir.decls.values()) |name, *decl| { try ir.dumpDecl(decl, gpa, name, config, w); } + try w.flush(); } -fn dumpDecl(ir: *const Ir, decl: *const Decl, gpa: Allocator, name: []const u8, config: std.io.tty.Config, w: anytype) !void { +fn dumpDecl(ir: *const Ir, decl: *const Decl, gpa: Allocator, name: []const u8, config: std.Io.tty.Config, w: *std.Io.Writer) !void { const tags = decl.instructions.items(.tag); const data = decl.instructions.items(.data); - var ref_map = RefMap.init(gpa); - defer ref_map.deinit(); + var ref_map: RefMap = .empty; + defer ref_map.deinit(gpa); - var label_map = RefMap.init(gpa); - defer label_map.deinit(); + var label_map: RefMap = .empty; + defer label_map.deinit(gpa); const ret_inst = decl.body.items[decl.body.items.len - 1]; const ret_operand = data[@intFromEnum(ret_inst)].un; @@ -412,14 +413,14 @@ fn dumpDecl(ir: *const Ir, decl: *const Decl, gpa: Allocator, name: []const u8, const ref = decl.body.items[arg_count]; if (tags[@intFromEnum(ref)] != .arg) break; if (arg_count != 0) try w.writeAll(", "); - try ref_map.put(ref, {}); + try ref_map.put(gpa, ref, {}); try ir.writeRef(decl, &ref_map, ref, config, w); try config.setColor(w, .reset); } try w.writeAll(") {\n"); for (decl.body.items[arg_count..]) |ref| { switch (tags[@intFromEnum(ref)]) { - .label => try label_map.put(ref, {}), + .label => try label_map.put(gpa, ref, {}), else => {}, } } @@ -460,7 +461,7 @@ fn dumpDecl(ir: *const Ir, decl: *const Decl, gpa: Allocator, name: []const u8, }, .select => { const br = data[i].branch; - try ir.writeNewRef(decl, &ref_map, ref, config, w); + try ir.writeNewRef(gpa, decl, &ref_map, ref, config, w); try w.writeAll("select "); try ir.writeRef(decl, &ref_map, br.cond, config, w); try config.setColor(w, .reset); @@ -500,7 +501,7 @@ fn dumpDecl(ir: *const Ir, decl: *const Decl, gpa: Allocator, name: []const u8, }, .call => { const call = data[i].call; - try ir.writeNewRef(decl, &ref_map, ref, config, w); + try ir.writeNewRef(gpa, decl, &ref_map, ref, config, w); try w.writeAll("call "); try ir.writeRef(decl, &ref_map, call.func, config, w); try config.setColor(w, .reset); @@ -514,7 +515,7 @@ fn dumpDecl(ir: *const Ir, decl: *const Decl, gpa: Allocator, name: []const u8, }, .alloc => { const alloc = data[i].alloc; - try ir.writeNewRef(decl, &ref_map, ref, config, w); + try ir.writeNewRef(gpa, decl, &ref_map, ref, config, w); try w.writeAll("alloc "); try config.setColor(w, ATTRIBUTE); try w.writeAll("size "); @@ -527,7 +528,7 @@ fn dumpDecl(ir: *const Ir, decl: *const Decl, gpa: Allocator, name: []const u8, try w.writeByte('\n'); }, .phi => { - try ir.writeNewRef(decl, &ref_map, ref, config, w); + try ir.writeNewRef(gpa, decl, &ref_map, ref, config, w); try w.writeAll("phi"); try config.setColor(w, .reset); try w.writeAll(" {"); @@ -559,7 +560,7 @@ fn dumpDecl(ir: *const Ir, decl: *const Decl, gpa: Allocator, name: []const u8, try w.writeByte('\n'); }, .load => { - try ir.writeNewRef(decl, &ref_map, ref, config, w); + try ir.writeNewRef(gpa, decl, &ref_map, ref, config, w); try w.writeAll("load "); try ir.writeRef(decl, &ref_map, data[i].un, config, w); try w.writeByte('\n'); @@ -582,7 +583,7 @@ fn dumpDecl(ir: *const Ir, decl: *const Decl, gpa: Allocator, name: []const u8, .mod, => { const bin = data[i].bin; - try ir.writeNewRef(decl, &ref_map, ref, config, w); + try ir.writeNewRef(gpa, decl, &ref_map, ref, config, w); try w.print("{s} ", .{@tagName(tag)}); try ir.writeRef(decl, &ref_map, bin.lhs, config, w); try config.setColor(w, .reset); @@ -597,7 +598,7 @@ fn dumpDecl(ir: *const Ir, decl: *const Decl, gpa: Allocator, name: []const u8, .sext, => { const un = data[i].un; - try ir.writeNewRef(decl, &ref_map, ref, config, w); + try ir.writeNewRef(gpa, decl, &ref_map, ref, config, w); try w.print("{s} ", .{@tagName(tag)}); try ir.writeRef(decl, &ref_map, un, config, w); try w.writeByte('\n'); @@ -609,7 +610,7 @@ fn dumpDecl(ir: *const Ir, decl: *const Decl, gpa: Allocator, name: []const u8, try w.writeAll("}\n\n"); } -fn writeType(ir: Ir, ty_ref: Interner.Ref, config: std.io.tty.Config, w: anytype) !void { +fn writeType(ir: Ir, ty_ref: Interner.Ref, config: std.Io.tty.Config, w: *std.Io.Writer) !void { const ty = ir.interner.get(ty_ref); try config.setColor(w, TYPE); switch (ty) { @@ -639,7 +640,7 @@ fn writeType(ir: Ir, ty_ref: Interner.Ref, config: std.io.tty.Config, w: anytype } } -fn writeValue(ir: Ir, val: Interner.Ref, config: std.io.tty.Config, w: anytype) !void { +fn writeValue(ir: Ir, val: Interner.Ref, config: std.Io.tty.Config, w: *std.Io.Writer) !void { try config.setColor(w, LITERAL); const key = ir.interner.get(val); switch (key) { @@ -650,12 +651,12 @@ fn writeValue(ir: Ir, val: Interner.Ref, config: std.io.tty.Config, w: anytype) .float => |repr| switch (repr) { inline else => |x| return w.print("{d}", .{@as(f64, @floatCast(x))}), }, - .bytes => |b| return std.zig.stringEscape(b, "", .{}, w), + .bytes => |b| return std.zig.stringEscape(b, w), else => unreachable, // not a value } } -fn writeRef(ir: Ir, decl: *const Decl, ref_map: *RefMap, ref: Ref, config: std.io.tty.Config, w: anytype) !void { +fn writeRef(ir: Ir, decl: *const Decl, ref_map: *RefMap, ref: Ref, config: std.Io.tty.Config, w: *std.Io.Writer) !void { assert(ref != .none); const index = @intFromEnum(ref); const ty_ref = decl.instructions.items(.ty)[index]; @@ -678,8 +679,8 @@ fn writeRef(ir: Ir, decl: *const Decl, ref_map: *RefMap, ref: Ref, config: std.i try w.print(" %{d}", .{ref_index}); } -fn writeNewRef(ir: Ir, decl: *const Decl, ref_map: *RefMap, ref: Ref, config: std.io.tty.Config, w: anytype) !void { - try ref_map.put(ref, {}); +fn writeNewRef(ir: Ir, gpa: Allocator, decl: *const Decl, ref_map: *RefMap, ref: Ref, config: std.Io.tty.Config, w: *std.Io.Writer) !void { + try ref_map.put(gpa, ref, {}); try w.writeAll(" "); try ir.writeRef(decl, ref_map, ref, config, w); try config.setColor(w, .reset); @@ -687,7 +688,7 @@ fn writeNewRef(ir: Ir, decl: *const Decl, ref_map: *RefMap, ref: Ref, config: st try config.setColor(w, INST); } -fn writeLabel(decl: *const Decl, label_map: *RefMap, ref: Ref, config: std.io.tty.Config, w: anytype) !void { +fn writeLabel(decl: *const Decl, label_map: *RefMap, ref: Ref, config: std.Io.tty.Config, w: *std.Io.Writer) !void { assert(ref != .none); const index = @intFromEnum(ref); const label = decl.instructions.items(.data)[index].label; diff --git a/lib/compiler/aro/backend/Object.zig b/lib/compiler/aro/backend/Object.zig index d8b2dd2b9a21..4f295a013500 100644 --- a/lib/compiler/aro/backend/Object.zig +++ b/lib/compiler/aro/backend/Object.zig @@ -30,7 +30,7 @@ pub const Section = union(enum) { custom: []const u8, }; -pub fn getSection(obj: *Object, section: Section) !*std.array_list.Managed(u8) { +pub fn getSection(obj: *Object, section: Section) !*std.ArrayList(u8) { switch (obj.format) { .elf => return @as(*Elf, @alignCast(@fieldParentPtr("obj", obj))).getSection(section), else => unreachable, @@ -65,9 +65,9 @@ pub fn addRelocation(obj: *Object, name: []const u8, section: Section, address: } } -pub fn finish(obj: *Object, file: std.fs.File) !void { +pub fn finish(obj: *Object, w: *std.Io.Writer) !void { switch (obj.format) { - .elf => return @as(*Elf, @alignCast(@fieldParentPtr("obj", obj))).finish(file), + .elf => return @as(*Elf, @alignCast(@fieldParentPtr("obj", obj))).finish(w), else => unreachable, } } diff --git a/lib/compiler/aro/backend/Object/Elf.zig b/lib/compiler/aro/backend/Object/Elf.zig index b38ad251cfec..82bcfba8e8ed 100644 --- a/lib/compiler/aro/backend/Object/Elf.zig +++ b/lib/compiler/aro/backend/Object/Elf.zig @@ -4,8 +4,8 @@ const Target = std.Target; const Object = @import("../Object.zig"); const Section = struct { - data: std.array_list.Managed(u8), - relocations: std.ArrayListUnmanaged(Relocation) = .empty, + data: std.ArrayList(u8) = .empty, + relocations: std.ArrayList(Relocation) = .empty, flags: u64, type: u32, index: u16 = undefined, @@ -58,7 +58,7 @@ pub fn deinit(elf: *Elf) void { { var it = elf.sections.valueIterator(); while (it.next()) |sect| { - sect.*.data.deinit(); + sect.*.data.deinit(gpa); sect.*.relocations.deinit(gpa); } } @@ -80,12 +80,12 @@ fn sectionString(sec: Object.Section) []const u8 { }; } -pub fn getSection(elf: *Elf, section_kind: Object.Section) !*std.array_list.Managed(u8) { +pub fn getSection(elf: *Elf, section_kind: Object.Section) !*std.ArrayList(u8) { const section_name = sectionString(section_kind); const section = elf.sections.get(section_name) orelse blk: { const section = try elf.arena.allocator().create(Section); section.* = .{ - .data = std.array_list.Managed(u8).init(elf.arena.child_allocator), + .data = std.ArrayList(u8).init(elf.arena.child_allocator), .type = std.elf.SHT_PROGBITS, .flags = switch (section_kind) { .func, .custom => std.elf.SHF_ALLOC + std.elf.SHF_EXECINSTR, @@ -170,12 +170,8 @@ pub fn addRelocation(elf: *Elf, name: []const u8, section_kind: Object.Section, /// relocations /// strtab /// section headers -pub fn finish(elf: *Elf, file: std.fs.File) !void { - var file_buffer: [1024]u8 = undefined; - var file_writer = file.writer(&file_buffer); - const w = &file_writer.interface; - - var num_sections: std.elf.Elf64_Half = additional_sections; +pub fn finish(elf: *Elf, w: *std.Io.Writer) !void { + var num_sections: std.elf.Half = additional_sections; var relocations_len: std.elf.Elf64_Off = 0; var sections_len: std.elf.Elf64_Off = 0; { @@ -196,8 +192,9 @@ pub fn finish(elf: *Elf, file: std.fs.File) !void { const strtab_offset = rela_offset + relocations_len; const sh_offset = strtab_offset + elf.strtab_len; const sh_offset_aligned = std.mem.alignForward(u64, sh_offset, 16); + const endian = elf.obj.target.cpu.arch.endian(); - const elf_header = std.elf.Elf64_Ehdr{ + const elf_header: std.elf.Elf64_Ehdr = .{ .e_ident = .{ 0x7F, 'E', 'L', 'F', 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, .e_type = std.elf.ET.REL, // we only produce relocatables .e_machine = elf.obj.target.toElfMachine(), @@ -213,7 +210,7 @@ pub fn finish(elf: *Elf, file: std.fs.File) !void { .e_shnum = num_sections, .e_shstrndx = strtab_index, }; - try w.writeStruct(elf_header); + try w.writeStruct(elf_header, endian); // write contents of sections { @@ -222,13 +219,13 @@ pub fn finish(elf: *Elf, file: std.fs.File) !void { } // pad to 8 bytes - try w.writeByteNTimes(0, @intCast(symtab_offset_aligned - symtab_offset)); + try w.splatByteAll(0, @intCast(symtab_offset_aligned - symtab_offset)); var name_offset: u32 = strtab_default.len; // write symbols { // first symbol must be null - try w.writeStruct(std.mem.zeroes(std.elf.Elf64_Sym)); + try w.writeStruct(std.mem.zeroes(std.elf.Elf64_Sym), endian); var sym_index: u16 = 1; var it = elf.local_symbols.iterator(); @@ -241,7 +238,7 @@ pub fn finish(elf: *Elf, file: std.fs.File) !void { .st_shndx = if (sym.section) |some| some.index else 0, .st_value = sym.offset, .st_size = sym.size, - }); + }, endian); sym.index = sym_index; sym_index += 1; name_offset += @intCast(entry.key_ptr.len + 1); // +1 for null byte @@ -256,7 +253,7 @@ pub fn finish(elf: *Elf, file: std.fs.File) !void { .st_shndx = if (sym.section) |some| some.index else 0, .st_value = sym.offset, .st_size = sym.size, - }); + }, endian); sym.index = sym_index; sym_index += 1; name_offset += @intCast(entry.key_ptr.len + 1); // +1 for null byte @@ -272,7 +269,7 @@ pub fn finish(elf: *Elf, file: std.fs.File) !void { .r_offset = rela.offset, .r_addend = rela.addend, .r_info = (@as(u64, rela.symbol.index) << 32) | rela.type, - }); + }, endian); } } } @@ -294,13 +291,13 @@ pub fn finish(elf: *Elf, file: std.fs.File) !void { } // pad to 16 bytes - try w.writeByteNTimes(0, @intCast(sh_offset_aligned - sh_offset)); + try w.splatByteAll(0, @intCast(sh_offset_aligned - sh_offset)); // mandatory null header - try w.writeStruct(std.mem.zeroes(std.elf.Elf64_Shdr)); + try w.writeStruct(std.mem.zeroes(std.elf.Elf64_Shdr), endian); // write strtab section header { - const sect_header = std.elf.Elf64_Shdr{ + const sect_header: std.elf.Elf64_Shdr = .{ .sh_name = strtab_name, .sh_type = std.elf.SHT_STRTAB, .sh_flags = 0, @@ -312,12 +309,12 @@ pub fn finish(elf: *Elf, file: std.fs.File) !void { .sh_addralign = 1, .sh_entsize = 0, }; - try w.writeStruct(sect_header); + try w.writeStruct(sect_header, endian); } // write symtab section header { - const sect_header = std.elf.Elf64_Shdr{ + const sect_header: std.elf.Elf64_Shdr = .{ .sh_name = symtab_name, .sh_type = std.elf.SHT_SYMTAB, .sh_flags = 0, @@ -329,7 +326,7 @@ pub fn finish(elf: *Elf, file: std.fs.File) !void { .sh_addralign = 8, .sh_entsize = @sizeOf(std.elf.Elf64_Sym), }; - try w.writeStruct(sect_header); + try w.writeStruct(sect_header, endian); } // remaining section headers @@ -352,7 +349,7 @@ pub fn finish(elf: *Elf, file: std.fs.File) !void { .sh_info = 0, .sh_addralign = if (sect.flags & std.elf.SHF_EXECINSTR != 0) 16 else 1, .sh_entsize = 0, - }); + }, endian); if (rela_count != 0) { const size = rela_count * @sizeOf(std.elf.Elf64_Rela); @@ -367,7 +364,7 @@ pub fn finish(elf: *Elf, file: std.fs.File) !void { .sh_info = sect.index, .sh_addralign = 8, .sh_entsize = @sizeOf(std.elf.Elf64_Rela), - }); + }, endian); rela_sect_offset += size; } diff --git a/lib/compiler/aro/include/float.h b/lib/compiler/aro/include/float.h new file mode 100644 index 000000000000..f6fe454ab2b6 --- /dev/null +++ b/lib/compiler/aro/include/float.h @@ -0,0 +1,126 @@ +/* for the Aro C compiler */ + +#pragma once + +#undef FLT_RADIX +#define FLT_RADIX __FLT_RADIX__ + +#undef FLT_MANT_DIG +#define FLT_MANT_DIG __FLT_MANT_DIG__ + +#undef DBL_MANT_DIG +#define DBL_MANT_DIG __DBL_MANT_DIG__ + +#undef LDBL_MANT_DIG +#define LDBL_MANT_DIG __LDBL_MANT_DIG__ + +#if __STDC_VERSION__ >= 199901L +#undef FLT_EVAL_METHOD +#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__ + +#undef DECIMAL_DIG +#define DECIMAL_DIG __DECIMAL_DIG__ +#endif /* __STDC_VERSION__ >= 199901L */ + +#undef FLT_DIG +#define FLT_DIG __FLT_DIG__ + +#undef DBL_DIG +#define DBL_DIG __DBL_DIG__ + +#undef LDBL_DIG +#define LDBL_DIG __LDBL_DIG__ + +#undef FLT_MIN_EXP +#define FLT_MIN_EXP __FLT_MIN_EXP__ + +#undef DBL_MIN_EXP +#define DBL_MIN_EXP __DBL_MIN_EXP__ + +#undef LDBL_MIN_EXP +#define LDBL_MIN_EXP __LDBL_MIN_EXP__ + +#undef FLT_MIN_10_EXP +#define FLT_MIN_10_EXP __FLT_MIN_10_EXP__ + +#undef DBL_MIN_10_EXP +#define DBL_MIN_10_EXP __DBL_MIN_10_EXP__ + +#undef LDBL_MIN_10_EXP +#define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__ + +#undef FLT_MAX_EXP +#define FLT_MAX_EXP __FLT_MAX_EXP__ + +#undef DBL_MAX_EXP +#define DBL_MAX_EXP __DBL_MAX_EXP__ + +#undef LDBL_MAX_EXP +#define LDBL_MAX_EXP __LDBL_MAX_EXP__ + +#undef FLT_MAX_10_EXP +#define FLT_MAX_10_EXP __FLT_MAX_10_EXP__ + +#undef DBL_MAX_10_EXP +#define DBL_MAX_10_EXP __DBL_MAX_10_EXP__ + +#undef LDBL_MAX_10_EXP +#define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__ + +#undef FLT_MAX +#define FLT_MAX __FLT_MAX__ + +#undef DBL_MAX +#define DBL_MAX __DBL_MAX__ + +#undef LDBL_MAX +#define LDBL_MAX __LDBL_MAX__ + +#undef FLT_EPSILON +#define FLT_EPSILON __FLT_EPSILON__ + +#undef DBL_EPSILON +#define DBL_EPSILON __DBL_EPSILON__ + +#undef LDBL_EPSILON +#define LDBL_EPSILON __LDBL_EPSILON__ + +#undef FLT_MIN +#define FLT_MIN __FLT_MIN__ + +#undef DBL_MIN +#define DBL_MIN __DBL_MIN__ + +#undef LDBL_MIN +#define LDBL_MIN __LDBL_MIN__ + +#if __STDC_VERSION__ >= 201112L + +#undef FLT_TRUE_MIN +#define FLT_TRUE_MIN __FLT_DENORM_MIN__ + +#undef DBL_TRUE_MIN +#define DBL_TRUE_MIN __DBL_DENORM_MIN__ + +#undef LDBL_TRUE_MIN +#define LDBL_TRUE_MIN __LDBL_DENORM_MIN__ + +#undef FLT_DECIMAL_DIG +#define FLT_DECIMAL_DIG __FLT_DECIMAL_DIG__ + +#undef DBL_DECIMAL_DIG +#define DBL_DECIMAL_DIG __DBL_DECIMAL_DIG__ + +#undef LDBL_DECIMAL_DIG +#define LDBL_DECIMAL_DIG __LDBL_DECIMAL_DIG__ + +#undef FLT_HAS_SUBNORM +#define FLT_HAS_SUBNORM __FLT_HAS_DENORM__ + +#undef DBL_HAS_SUBNORM +#define DBL_HAS_SUBNORM __DBL_HAS_DENORM__ + +#undef LDBL_HAS_SUBNORM +#define LDBL_HAS_SUBNORM __LDBL_HAS_DENORM__ + +#endif /* __STDC_VERSION__ >= 201112L */ diff --git a/lib/compiler/aro/include/iso646.h b/lib/compiler/aro/include/iso646.h new file mode 100644 index 000000000000..3e46910b8fd5 --- /dev/null +++ b/lib/compiler/aro/include/iso646.h @@ -0,0 +1,15 @@ +/* for the Aro C compiler */ + +#pragma once + +#define and && +#define and_eq &= +#define bitand & +#define bitor | +#define compl ~ +#define not ! +#define not_eq != +#define or || +#define or_eq |= +#define xor ^ +#define xor_eq ^= diff --git a/lib/compiler/aro/include/limits.h b/lib/compiler/aro/include/limits.h new file mode 100644 index 000000000000..4980bd7dbc55 --- /dev/null +++ b/lib/compiler/aro/include/limits.h @@ -0,0 +1,124 @@ +/* for the Aro C compiler */ + +#pragma once + +/* GlibC will try to include_next GCC's limits.h which will fail. + Define _GCC_LIMITS_H_ to prevent it. */ +#if defined __GNUC__ && !defined _GCC_LIMITS_H_ +#define _GCC_LIMITS_H_ +#endif + +/* Include the system's limits.h */ +#if __STDC_HOSTED__ && __has_include_next() +#include_next +#endif + +#undef SCHAR_MAX +#define SCHAR_MAX __SCHAR_MAX__ + +#undef SHRT_MAX +#define SHRT_MAX __SHRT_MAX__ + +#undef INT_MAX +#define INT_MAX __INT_MAX__ + +#undef LONG_MAX +#define LONG_MAX __LONG_MAX__ + +#undef SCHAR_MIN +#define SCHAR_MIN (-__SCHAR_MAX__-1) + +#undef SHRT_MIN +#define SHRT_MIN (-__SHRT_MAX__ -1) + +#undef INT_MIN +#define INT_MIN (-__INT_MAX__ -1) + +#undef LONG_MIN +#define LONG_MIN (-__LONG_MAX__ -1L) + +#undef UCHAR_MAX +#define UCHAR_MAX (__SCHAR_MAX__*2 +1) + +#undef USHRT_MAX +#define USHRT_MAX (__SHRT_MAX__ *2 +1) + +#undef UINT_MAX +#define UINT_MAX (__INT_MAX__ *2U +1U) + +#undef ULONG_MAX +#define ULONG_MAX (__LONG_MAX__ *2UL+1UL) + +#ifndef MB_LEN_MAX +#define MB_LEN_MAX 1 +#endif + +#undef CHAR_BIT +#define CHAR_BIT __CHAR_BIT__ + +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L + +#undef BOOL_WIDTH +#define BOOL_WIDTH __BOOL_WIDTH__ + +#undef CHAR_WIDTH +#define CHAR_WIDTH CHAR_BIT + +#undef SCHAR_WIDTH +#define SCHAR_WIDTH CHAR_BIT + +#undef UCHAR_WIDTH +#define UCHAR_WIDTH CHAR_BIT + +#undef USHRT_WIDTH +#define USHRT_WIDTH __SHRT_WIDTH__ + +#undef SHRT_WIDTH +#define SHRT_WIDTH __SHRT_WIDTH__ + +#undef UINT_WIDTH +#define UINT_WIDTH __INT_WIDTH__ + +#undef INT_WIDTH +#define INT_WIDTH __INT_WIDTH__ + +#undef ULONG_WIDTH +#define ULONG_WIDTH __LONG_WIDTH__ + +#undef LONG_WIDTH +#define LONG_WIDTH __LONG_WIDTH__ + +#undef ULLONG_WIDTH +#define ULLONG_WIDTH __LLONG_WIDTH__ + +#undef LLONG_WIDTH +#define LLONG_WIDTH __LLONG_WIDTH__ + +#undef BITINT_MAXWIDTH +#define BITINT_MAXWIDTH __BITINT_MAXWIDTH__ + +#endif /* defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L */ + +#undef CHAR_MIN +#undef CHAR_MAX +#ifdef __CHAR_UNSIGNED__ +#define CHAR_MIN 0 +#define CHAR_MAX UCHAR_MAX +#else +#define CHAR_MIN SCHAR_MIN +#define CHAR_MAX __SCHAR_MAX__ +#endif + +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +#undef LLONG_MIN +#define LLONG_MIN (-__LONG_LONG_MAX__-1LL) + +#undef LLONG_MAX +#define LLONG_MAX __LONG_LONG_MAX__ + +#undef ULLONG_MAX +#define ULLONG_MAX (__LONG_LONG_MAX__*2ULL+1ULL) + +#endif + diff --git a/lib/compiler/aro/include/stdalign.h b/lib/compiler/aro/include/stdalign.h new file mode 100644 index 000000000000..a83656161927 --- /dev/null +++ b/lib/compiler/aro/include/stdalign.h @@ -0,0 +1,11 @@ +/* for the Aro C compiler */ + +#pragma once +#if __STDC_VERSION__ < 202311L + +#define alignas _Alignas +#define alignof _Alignof + +#define __alignas_is_defined 1 +#define __alignof_is_defined 1 +#endif diff --git a/lib/compiler/aro/include/stdarg.h b/lib/compiler/aro/include/stdarg.h new file mode 100644 index 000000000000..49f7968ad882 --- /dev/null +++ b/lib/compiler/aro/include/stdarg.h @@ -0,0 +1,28 @@ +/* for the Aro C compiler */ + +#pragma once +/* Todo: Set to 202311L once header is compliant with C23 */ +#define __STDC_VERSION_STDARG_H__ 0 + +typedef __builtin_va_list va_list; +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202000L +/* C23 no longer requires the second parameter */ +#define va_start(ap, ...) __builtin_va_start(ap, __VA_ARGS__) +#else +#define va_start(ap, param) __builtin_va_start(ap, param) +#endif +#define va_end(ap) __builtin_va_end(ap) +#define va_arg(ap, type) __builtin_va_arg(ap, type) + +/* GCC and Clang always define __va_copy */ +#define __va_copy(d, s) __builtin_va_copy(d, s) + +/* but va_copy only on c99+ or when strict ansi mode is turned off */ +#if __STDC_VERSION__ >= 199901L || !defined(__STRICT_ANSI__) +#define va_copy(d, s) __builtin_va_copy(d, s) +#endif + +#ifndef __GNUC_VA_LIST +#define __GNUC_VA_LIST 1 +typedef __builtin_va_list __gnuc_va_list; +#endif diff --git a/lib/compiler/aro/include/stdatomic.h b/lib/compiler/aro/include/stdatomic.h new file mode 100644 index 000000000000..19fe0fa8de76 --- /dev/null +++ b/lib/compiler/aro/include/stdatomic.h @@ -0,0 +1,138 @@ +/* for the Aro C compiler */ + +#pragma once + +#define __STDC_VERSION_STDATOMIC_H__ 202311L + +#if __STDC_HOSTED__ && __has_include_next() +#include_next +#else + +#include +#include + +#define ATOMIC_BOOL_LOCK_FREE __ATOMIC_BOOL_LOCK_FREE +#define ATOMIC_CHAR_LOCK_FREE __ATOMIC_CHAR_LOCK_FREE +#define ATOMIC_CHAR16_T_LOCK_FREE __ATOMIC_CHAR16_T_LOCK_FREE +#define ATOMIC_CHAR32_T_LOCK_FREE __ATOMIC_CHAR32_T_LOCK_FREE +#define ATOMIC_WCHAR_T_LOCK_FREE __ATOMIC_WCHAR_T_LOCK_FREE +#define ATOMIC_SHORT_LOCK_FREE __ATOMIC_SHORT_LOCK_FREE +#define ATOMIC_INT_LOCK_FREE __ATOMIC_INT_LOCK_FREE +#define ATOMIC_LONG_LOCK_FREE __ATOMIC_LONG_LOCK_FREE +#define ATOMIC_LLONG_LOCK_FREE __ATOMIC_LLONG_LOCK_FREE +#define ATOMIC_POINTER_LOCK_FREE __ATOMIC_POINTER_LOCK_FREE +#if defined(__ATOMIC_CHAR8_T_LOCK_FREE) +#define ATOMIC_CHAR8_T_LOCK_FREE __ATOMIC_CHAR8_T_LOCK_FREE +#endif + +#if __STDC_VERSION__ < 202311L +/* ATOMIC_VAR_INIT was removed in C23 */ +#define ATOMIC_VAR_INIT(value) (value) +#endif + +#define atomic_init __c11_atomic_init + +typedef enum memory_order { + memory_order_relaxed = __ATOMIC_RELAXED, + memory_order_consume = __ATOMIC_CONSUME, + memory_order_acquire = __ATOMIC_ACQUIRE, + memory_order_release = __ATOMIC_RELEASE, + memory_order_acq_rel = __ATOMIC_ACQ_REL, + memory_order_seq_cst = __ATOMIC_SEQ_CST +} memory_order; + +#define kill_dependency(y) (y) + +void atomic_thread_fence(memory_order); +void atomic_signal_fence(memory_order); + +#define atomic_thread_fence(order) __c11_atomic_thread_fence(order) +#define atomic_signal_fence(order) __c11_atomic_signal_fence(order) + +#define atomic_is_lock_free(obj) __c11_atomic_is_lock_free(sizeof(*(obj))) + +typedef _Atomic(_Bool) atomic_bool; +typedef _Atomic(char) atomic_char; +typedef _Atomic(signed char) atomic_schar; +typedef _Atomic(unsigned char) atomic_uchar; +typedef _Atomic(short) atomic_short; +typedef _Atomic(unsigned short) atomic_ushort; +typedef _Atomic(int) atomic_int; +typedef _Atomic(unsigned int) atomic_uint; +typedef _Atomic(long) atomic_long; +typedef _Atomic(unsigned long) atomic_ulong; +typedef _Atomic(long long) atomic_llong; +typedef _Atomic(unsigned long long) atomic_ullong; +typedef _Atomic(uint_least16_t) atomic_char16_t; +typedef _Atomic(uint_least32_t) atomic_char32_t; +typedef _Atomic(wchar_t) atomic_wchar_t; +typedef _Atomic(int_least8_t) atomic_int_least8_t; +typedef _Atomic(uint_least8_t) atomic_uint_least8_t; +typedef _Atomic(int_least16_t) atomic_int_least16_t; +typedef _Atomic(uint_least16_t) atomic_uint_least16_t; +typedef _Atomic(int_least32_t) atomic_int_least32_t; +typedef _Atomic(uint_least32_t) atomic_uint_least32_t; +typedef _Atomic(int_least64_t) atomic_int_least64_t; +typedef _Atomic(uint_least64_t) atomic_uint_least64_t; +typedef _Atomic(int_fast8_t) atomic_int_fast8_t; +typedef _Atomic(uint_fast8_t) atomic_uint_fast8_t; +typedef _Atomic(int_fast16_t) atomic_int_fast16_t; +typedef _Atomic(uint_fast16_t) atomic_uint_fast16_t; +typedef _Atomic(int_fast32_t) atomic_int_fast32_t; +typedef _Atomic(uint_fast32_t) atomic_uint_fast32_t; +typedef _Atomic(int_fast64_t) atomic_int_fast64_t; +typedef _Atomic(uint_fast64_t) atomic_uint_fast64_t; +typedef _Atomic(intptr_t) atomic_intptr_t; +typedef _Atomic(uintptr_t) atomic_uintptr_t; +typedef _Atomic(size_t) atomic_size_t; +typedef _Atomic(ptrdiff_t) atomic_ptrdiff_t; +typedef _Atomic(intmax_t) atomic_intmax_t; +typedef _Atomic(uintmax_t) atomic_uintmax_t; + +#define atomic_store(object, desired) __c11_atomic_store(object, desired, __ATOMIC_SEQ_CST) +#define atomic_store_explicit __c11_atomic_store + +#define atomic_load(object) __c11_atomic_load(object, __ATOMIC_SEQ_CST) +#define atomic_load_explicit __c11_atomic_load + +#define atomic_exchange(object, desired) __c11_atomic_exchange(object, desired, __ATOMIC_SEQ_CST) +#define atomic_exchange_explicit __c11_atomic_exchange + +#define atomic_compare_exchange_strong(object, expected, desired) __c11_atomic_compare_exchange_strong(object, expected, desired, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) +#define atomic_compare_exchange_strong_explicit __c11_atomic_compare_exchange_strong + +#define atomic_compare_exchange_weak(object, expected, desired) __c11_atomic_compare_exchange_weak(object, expected, desired, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) +#define atomic_compare_exchange_weak_explicit __c11_atomic_compare_exchange_weak + +#define atomic_fetch_add(object, operand) __c11_atomic_fetch_add(object, operand, __ATOMIC_SEQ_CST) +#define atomic_fetch_add_explicit __c11_atomic_fetch_add + +#define atomic_fetch_sub(object, operand) __c11_atomic_fetch_sub(object, operand, __ATOMIC_SEQ_CST) +#define atomic_fetch_sub_explicit __c11_atomic_fetch_sub + +#define atomic_fetch_or(object, operand) __c11_atomic_fetch_or(object, operand, __ATOMIC_SEQ_CST) +#define atomic_fetch_or_explicit __c11_atomic_fetch_or + +#define atomic_fetch_xor(object, operand) __c11_atomic_fetch_xor(object, operand, __ATOMIC_SEQ_CST) +#define atomic_fetch_xor_explicit __c11_atomic_fetch_xor + +#define atomic_fetch_and(object, operand) __c11_atomic_fetch_and(object, operand, __ATOMIC_SEQ_CST) +#define atomic_fetch_and_explicit __c11_atomic_fetch_and + +typedef struct atomic_flag { atomic_bool _Value; } atomic_flag; + +#define ATOMIC_FLAG_INIT { 0 } + +_Bool atomic_flag_test_and_set(volatile atomic_flag *); +_Bool atomic_flag_test_and_set_explicit(volatile atomic_flag *, memory_order); +void atomic_flag_clear(volatile atomic_flag *); +void atomic_flag_clear_explicit(volatile atomic_flag *, memory_order); + +#define atomic_flag_test_and_set(object) __c11_atomic_exchange(&(object)->_Value, 1, __ATOMIC_SEQ_CST) +#define atomic_flag_test_and_set_explicit(object, order) __c11_atomic_exchange(&(object)->_Value, 1, order) + +#define atomic_flag_clear(object) __c11_atomic_store(&(object)->_Value, 0, __ATOMIC_SEQ_CST) +#define atomic_flag_clear_explicit(object, order) __c11_atomic_store(&(object)->_Value, 0, order) + + +#endif diff --git a/lib/compiler/aro/include/stdbool.h b/lib/compiler/aro/include/stdbool.h new file mode 100644 index 000000000000..58ce2b1244fe --- /dev/null +++ b/lib/compiler/aro/include/stdbool.h @@ -0,0 +1,13 @@ +/* for the Aro C compiler */ + +#pragma once + +#if __STDC_VERSION__ < 202311L +#define bool _Bool + +#define true 1 +#define false 0 + +#define __bool_true_false_are_defined 1 + +#endif diff --git a/lib/compiler/aro/include/stdckdint.h b/lib/compiler/aro/include/stdckdint.h new file mode 100644 index 000000000000..44d954cf93f0 --- /dev/null +++ b/lib/compiler/aro/include/stdckdint.h @@ -0,0 +1,9 @@ +/* for the Aro C compiler */ + +#pragma once + +#define __STDC_VERSION_STDCKDINT_H__ 202311L + +#define ckd_add(result, a, b) __builtin_add_overflow(a, b, result) +#define ckd_sub(result, a, b) __builtin_sub_overflow(a, b, result) +#define ckd_mul(result, a, b) __builtin_mul_overflow(a, b, result) diff --git a/lib/compiler/aro/include/stddef.h b/lib/compiler/aro/include/stddef.h new file mode 100644 index 000000000000..bda4c942974b --- /dev/null +++ b/lib/compiler/aro/include/stddef.h @@ -0,0 +1,31 @@ +/* for the Aro C compiler */ + +#pragma once + +#define __STDC_VERSION_STDDEF_H__ 202311L + +typedef __PTRDIFF_TYPE__ ptrdiff_t; +typedef __SIZE_TYPE__ size_t; +typedef __WCHAR_TYPE__ wchar_t; + +/* define max_align_t to match GCC and Clang */ +typedef struct { + long long __aro_max_align_ll; + long double __aro_max_align_ld; +} max_align_t; + +#define NULL ((void*)0) +#define offsetof(T, member) __builtin_offsetof(T, member) + +#if __STDC_VERSION__ >= 202311L +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wpre-c23-compat" + typedef typeof(nullptr) nullptr_t; +# pragma GCC diagnostic pop + +# if defined unreachable +# error unreachable() is a standard macro in C23 +# else +# define unreachable() __builtin_unreachable() +# endif +#endif diff --git a/lib/compiler/aro/include/stdint.h b/lib/compiler/aro/include/stdint.h new file mode 100644 index 000000000000..2e1929097d4d --- /dev/null +++ b/lib/compiler/aro/include/stdint.h @@ -0,0 +1,289 @@ +/* for the Aro C compiler */ + +#pragma once + + +#if __STDC_HOSTED__ && __has_include_next() + +# include_next + +#else + +#define __stdint_int_c_cat(X, Y) X ## Y +#define __stdint_int_c(V, SUFFIX) __stdint_int_c_cat(V, SUFFIX) +#define __stdint_uint_c(V, SUFFIX) __stdint_int_c_cat(V##U, SUFFIX) + +#define INTPTR_MIN (-__INTPTR_MAX__-1) +#define INTPTR_MAX __INTPTR_MAX__ +#define UINTPTR_MAX __UINTPTR_MAX__ +#define PTRDIFF_MIN (-__PTRDIFF_MAX__-1) +#define PTRDIFF_MAX __PTRDIFF_MAX__ +#define SIZE_MAX __SIZE_MAX__ +#define INTMAX_MIN (-__INTMAX_MAX__-1) +#define INTMAX_MAX __INTMAX_MAX__ +#define UINTMAX_MAX __UINTMAX_MAX__ +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L +# define INTPTR_WIDTH __INTPTR_WIDTH__ +# define UINTPTR_WIDTH __UINTPTR_WIDTH__ +# define INTMAX_WIDTH __INTMAX_WIDTH__ +# define UINTMAX_WIDTH __UINTMAX_WIDTH__ +# define PTRDIFF_WIDTH __PTRDIFF_WIDTH__ +# define SIZE_WIDTH __SIZE_WIDTH__ +# define WCHAR_WIDTH __WCHAR_WIDTH__ +#endif + +typedef __INTMAX_TYPE__ intmax_t; +typedef __UINTMAX_TYPE__ uintmax_t; + +#ifndef _INTPTR_T +# ifndef __intptr_t_defined + typedef __INTPTR_TYPE__ intptr_t; +# define __intptr_t_defined +# define _INTPTR_T +# endif +#endif + +#ifndef _UINTPTR_T + typedef __UINTPTR_TYPE__ uintptr_t; +# define _UINTPTR_T +#endif + + +#ifdef __INT64_TYPE__ +# ifndef __int8_t_defined /* glibc sys/types.h also defines int64_t*/ + typedef __INT64_TYPE__ int64_t; +# endif /* __int8_t_defined */ + typedef __UINT64_TYPE__ uint64_t; + +# undef __int64_c_suffix +# undef __int32_c_suffix +# undef __int16_c_suffix +# undef __int8_c_suffix +# ifdef __INT64_C_SUFFIX__ +# define __int64_c_suffix __INT64_C_SUFFIX__ +# define __int32_c_suffix __INT64_C_SUFFIX__ +# define __int16_c_suffix __INT64_C_SUFFIX__ +# define __int8_c_suffix __INT64_C_SUFFIX__ +# endif /* __INT64_C_SUFFIX__ */ + +# ifdef __int64_c_suffix +# define INT64_C(v) (__stdint_int_c(v, __int64_c_suffix)) +# define UINT64_C(v) (__stdint_uint_c(v, __int64_c_suffix)) +# else +# define INT64_C(v) (v) +# define UINT64_C(v) (v ## U) +# endif /* __int64_c_suffix */ + +# define INT64_MAX INT64_C( 9223372036854775807) +# define INT64_MIN (-INT64_C( 9223372036854775807)-1) +# define UINT64_MAX UINT64_C(18446744073709551615) +# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L +# define UINT64_WIDTH 64 +# define INT64_WIDTH UINT64_WIDTH +# endif /* __STDC_VERSION__ */ + +#endif /* __INT64_TYPE__ */ + +#ifdef __INT32_TYPE__ +# ifndef __int8_t_defined /* glibc sys/types.h also defines int32_t*/ + typedef __INT32_TYPE__ int32_t; +# endif /* __int8_t_defined */ + typedef __UINT32_TYPE__ uint32_t; + +# undef __int32_c_suffix +# undef __int16_c_suffix +# undef __int8_c_suffix +# ifdef __INT32_C_SUFFIX__ +# define __int32_c_suffix __INT32_C_SUFFIX__ +# define __int16_c_suffix __INT32_C_SUFFIX__ +# define __int8_c_suffix __INT32_C_SUFFIX__ +# endif /* __INT32_C_SUFFIX__ */ + +# ifdef __int32_c_suffix +# define INT32_C(v) (__stdint_int_c(v, __int32_c_suffix)) +# define UINT32_C(v) (__stdint_uint_c(v, __int32_c_suffix)) +# else +# define INT32_C(v) (v) +# define UINT32_C(v) (v ## U) +# endif /* __int32_c_suffix */ + +# define INT32_MAX INT32_C( 2147483647) +# define INT32_MIN (-INT32_C( 2147483647)-1) +# define UINT32_MAX UINT32_C(4294967295) +# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L +# define UINT32_WIDTH 32 +# define INT32_WIDTH UINT32_WIDTH +# endif /* __STDC_VERSION__ */ + +#endif /* __INT32_TYPE__ */ + +#ifdef __INT16_TYPE__ +# ifndef __int8_t_defined /* glibc sys/types.h also defines int16_t*/ + typedef __INT16_TYPE__ int16_t; +# endif /* __int8_t_defined */ + typedef __UINT16_TYPE__ uint16_t; + +# undef __int16_c_suffix +# undef __int8_c_suffix +# ifdef __INT16_C_SUFFIX__ +# define __int16_c_suffix __INT16_C_SUFFIX__ +# define __int8_c_suffix __INT16_C_SUFFIX__ +# endif /* __INT16_C_SUFFIX__ */ + +# ifdef __int16_c_suffix +# define INT16_C(v) (__stdint_int_c(v, __int16_c_suffix)) +# define UINT16_C(v) (__stdint_uint_c(v, __int16_c_suffix)) +# else +# define INT16_C(v) (v) +# define UINT16_C(v) (v ## U) +# endif /* __int16_c_suffix */ + +# define INT16_MAX INT16_C( 32767) +# define INT16_MIN (-INT16_C( 32767)-1) +# define UINT16_MAX UINT16_C(65535) +# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L +# define UINT16_WIDTH 16 +# define INT16_WIDTH UINT16_WIDTH +# endif /* __STDC_VERSION__ */ + +#endif /* __INT16_TYPE__ */ + +#ifdef __INT8_TYPE__ +# ifndef __int8_t_defined /* glibc sys/types.h also defines int8_t*/ + typedef __INT8_TYPE__ int8_t; +# endif /* __int8_t_defined */ + typedef __UINT8_TYPE__ uint8_t; + +# undef __int8_c_suffix +# ifdef __INT8_C_SUFFIX__ +# define __int8_c_suffix __INT8_C_SUFFIX__ +# endif /* __INT8_C_SUFFIX__ */ + +# ifdef __int8_c_suffix +# define INT8_C(v) (__stdint_int_c(v, __int8_c_suffix)) +# define UINT8_C(v) (__stdint_uint_c(v, __int8_c_suffix)) +# else +# define INT8_C(v) (v) +# define UINT8_C(v) (v ## U) +# endif /* __int8_c_suffix */ + +# define INT8_MAX INT8_C(127) +# define INT8_MIN (-INT8_C(127)-1) +# define UINT8_MAX UINT8_C(255) +# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L +# define UINT8_WIDTH 8 +# define INT8_WIDTH UINT8_WIDTH +# endif /* __STDC_VERSION__ */ + +#endif /* __INT8_TYPE__ */ + +typedef __INT_LEAST64_TYPE__ int_least64_t; +typedef __INT_LEAST32_TYPE__ int_least32_t; +typedef __INT_LEAST16_TYPE__ int_least16_t; +typedef __INT_LEAST8_TYPE__ int_least8_t; + +typedef __UINT_LEAST64_TYPE__ uint_least64_t; +typedef __UINT_LEAST32_TYPE__ uint_least32_t; +typedef __UINT_LEAST16_TYPE__ uint_least16_t; +typedef __UINT_LEAST8_TYPE__ uint_least8_t; + +#define INT_LEAST8_MAX __INT_LEAST8_MAX__ +#define INT_LEAST8_MIN (-__INT_LEAST8_MAX__-1) +#define UINT_LEAST8_MAX __UINT_LEAST8_MAX__ + +#define INT_LEAST16_MAX __INT_LEAST16_MAX__ +#define INT_LEAST16_MIN (-__INT_LEAST16_MAX__-1) +#define UINT_LEAST16_MAX __UINT_LEAST16_MAX__ + +#define INT_LEAST32_MAX __INT_LEAST32_MAX__ +#define INT_LEAST32_MIN (-__INT_LEAST32_MAX__-1) +#define UINT_LEAST32_MAX __UINT_LEAST32_MAX__ + +#define INT_LEAST64_MAX __INT_LEAST64_MAX__ +#define INT_LEAST64_MIN (-__INT_LEAST64_MAX__-1) +#define UINT_LEAST64_MAX __UINT_LEAST64_MAX__ + + +typedef __INT_FAST64_TYPE__ int_fast64_t; +typedef __INT_FAST32_TYPE__ int_fast32_t; +typedef __INT_FAST16_TYPE__ int_fast16_t; +typedef __INT_FAST8_TYPE__ int_fast8_t; + +typedef __UINT_FAST64_TYPE__ uint_fast64_t; +typedef __UINT_FAST32_TYPE__ uint_fast32_t; +typedef __UINT_FAST16_TYPE__ uint_fast16_t; +typedef __UINT_FAST8_TYPE__ uint_fast8_t; + +#define INT_FAST8_MAX __INT_FAST8_MAX__ +#define INT_FAST8_MIN (-__INT_FAST8_MAX__-1) +#define UINT_FAST8_MAX __UINT_FAST8_MAX__ + +#define INT_FAST16_MAX __INT_FAST16_MAX__ +#define INT_FAST16_MIN (-__INT_FAST16_MAX__-1) +#define UINT_FAST16_MAX __UINT_FAST16_MAX__ + +#define INT_FAST32_MAX __INT_FAST32_MAX__ +#define INT_FAST32_MIN (-__INT_FAST32_MAX__-1) +#define UINT_FAST32_MAX __UINT_FAST32_MAX__ + +#define INT_FAST64_MAX __INT_FAST64_MAX__ +#define INT_FAST64_MIN (-__INT_FAST64_MAX__-1) +#define UINT_FAST64_MAX __UINT_FAST64_MAX__ + + +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L + +#define INT_FAST8_WIDTH __INT_FAST8_WIDTH__ +#define UINT_FAST8_WIDTH __INT_FAST8_WIDTH__ +#define INT_LEAST8_WIDTH __INT_LEAST8_WIDTH__ +#define UINT_LEAST8_WIDTH __INT_LEAST8_WIDTH__ + +#define INT_FAST16_WIDTH __INT_FAST16_WIDTH__ +#define UINT_FAST16_WIDTH __INT_FAST16_WIDTH__ +#define INT_LEAST16_WIDTH __INT_LEAST16_WIDTH__ +#define UINT_LEAST16_WIDTH __INT_LEAST16_WIDTH__ + +#define INT_FAST32_WIDTH __INT_FAST32_WIDTH__ +#define UINT_FAST32_WIDTH __INT_FAST32_WIDTH__ +#define INT_LEAST32_WIDTH __INT_LEAST32_WIDTH__ +#define UINT_LEAST32_WIDTH __INT_LEAST32_WIDTH__ + +#define INT_FAST64_WIDTH __INT_FAST64_WIDTH__ +#define UINT_FAST64_WIDTH __INT_FAST64_WIDTH__ +#define INT_LEAST64_WIDTH __INT_LEAST64_WIDTH__ +#define UINT_LEAST64_WIDTH __INT_LEAST64_WIDTH__ + +#endif + +#ifdef __SIZEOF_INT128__ +typedef signed __int128 int128_t; +typedef unsigned __int128 uint128_t; +typedef signed __int128 int_fast128_t; +typedef unsigned __int128 uint_fast128_t; +typedef signed __int128 int_least128_t; +typedef unsigned __int128 uint_least128_t; +# define UINT128_MAX ((uint128_t)-1) +# define INT128_MAX ((int128_t)+(UINT128_MAX/2)) +# define INT128_MIN (-INT128_MAX-1) +# define UINT_LEAST128_MAX UINT128_MAX +# define INT_LEAST128_MAX INT128_MAX +# define INT_LEAST128_MIN INT128_MIN +# define UINT_FAST128_MAX UINT128_MAX +# define INT_FAST128_MAX INT128_MAX +# define INT_FAST128_MIN INT128_MIN +# define INT128_WIDTH 128 +# define UINT128_WIDTH 128 +# define INT_LEAST128_WIDTH 128 +# define UINT_LEAST128_WIDTH 128 +# define INT_FAST128_WIDTH 128 +# define UINT_FAST128_WIDTH 128 +# if UINT128_WIDTH > __LLONG_WIDTH__ +# define INT128_C(N) ((int_least128_t)+N ## WB) +# define UINT128_C(N) ((uint_least128_t)+N ## WBU) +# else +# define INT128_C(N) ((int_least128_t)+N ## LL) +# define UINT128_C(N) ((uint_least128_t)+N ## LLU) +# endif +#endif + +#endif /* __STDC_HOSTED__ && __has_include_next() */ diff --git a/lib/compiler/aro/include/stdnoreturn.h b/lib/compiler/aro/include/stdnoreturn.h new file mode 100644 index 000000000000..200789f54789 --- /dev/null +++ b/lib/compiler/aro/include/stdnoreturn.h @@ -0,0 +1,6 @@ +/* for the Aro C compiler */ + +#pragma once + +#define noreturn _Noreturn +#define __noreturn_is_defined 1 diff --git a/lib/compiler/aro/include/varargs.h b/lib/compiler/aro/include/varargs.h new file mode 100644 index 000000000000..c6a6db41b819 --- /dev/null +++ b/lib/compiler/aro/include/varargs.h @@ -0,0 +1,3 @@ +/* for the Aro C compiler */ +#pragma once +#error please use instead of diff --git a/lib/compiler/aro/main.zig b/lib/compiler/aro/main.zig new file mode 100644 index 000000000000..3a293f40671e --- /dev/null +++ b/lib/compiler/aro/main.zig @@ -0,0 +1,80 @@ +const std = @import("std"); +const Allocator = mem.Allocator; +const mem = std.mem; +const process = std.process; +const aro = @import("aro"); +const Compilation = aro.Compilation; +const Diagnostics = aro.Diagnostics; +const Driver = aro.Driver; +const Toolchain = aro.Toolchain; +const assembly_backend = @import("assembly_backend"); + +var general_purpose_allocator = std.heap.GeneralPurposeAllocator(.{}){}; + +pub fn main() u8 { + const gpa = if (@import("builtin").link_libc) + std.heap.raw_c_allocator + else + general_purpose_allocator.allocator(); + defer if (!@import("builtin").link_libc) { + _ = general_purpose_allocator.deinit(); + }; + + var arena_instance = std.heap.ArenaAllocator.init(gpa); + defer arena_instance.deinit(); + const arena = arena_instance.allocator(); + + const fast_exit = @import("builtin").mode != .Debug; + + const args = process.argsAlloc(arena) catch { + std.debug.print("out of memory\n", .{}); + if (fast_exit) process.exit(1); + return 1; + }; + + const aro_name = std.fs.selfExePathAlloc(gpa) catch { + std.debug.print("unable to find Aro executable path\n", .{}); + if (fast_exit) process.exit(1); + return 1; + }; + defer gpa.free(aro_name); + + var stderr_buf: [1024]u8 = undefined; + var stderr = std.fs.File.stderr().writer(&stderr_buf); + var diagnostics: Diagnostics = .{ + .output = .{ .to_writer = .{ + .color = .detect(stderr.file), + .writer = &stderr.interface, + } }, + }; + + var comp = Compilation.initDefault(gpa, arena, &diagnostics, std.fs.cwd()) catch |er| switch (er) { + error.OutOfMemory => { + std.debug.print("out of memory\n", .{}); + if (fast_exit) process.exit(1); + return 1; + }, + }; + defer comp.deinit(); + + var driver: Driver = .{ .comp = &comp, .aro_name = aro_name, .diagnostics = &diagnostics }; + defer driver.deinit(); + + var toolchain: Toolchain = .{ .driver = &driver, .filesystem = .{ .real = comp.cwd } }; + defer toolchain.deinit(); + + driver.main(&toolchain, args, fast_exit, assembly_backend.genAsm) catch |er| switch (er) { + error.OutOfMemory => { + std.debug.print("out of memory\n", .{}); + if (fast_exit) process.exit(1); + return 1; + }, + error.FatalError => { + driver.printDiagnosticsStats(); + if (fast_exit) process.exit(1); + return 1; + }, + }; + if (fast_exit) process.exit(@intFromBool(comp.diagnostics.errors != 0)); + return @intFromBool(diagnostics.errors != 0); +} diff --git a/lib/compiler/aro_translate_c.zig b/lib/compiler/aro_translate_c.zig deleted file mode 100644 index cd8bd05c7cd7..000000000000 --- a/lib/compiler/aro_translate_c.zig +++ /dev/null @@ -1,1830 +0,0 @@ -const std = @import("std"); -const mem = std.mem; -const assert = std.debug.assert; -const CallingConvention = std.builtin.CallingConvention; -const aro = @import("aro"); -const CToken = aro.Tokenizer.Token; -const Tree = aro.Tree; -const NodeIndex = Tree.NodeIndex; -const TokenIndex = Tree.TokenIndex; -const Type = aro.Type; -pub const ast = @import("aro_translate_c/ast.zig"); -const ZigNode = ast.Node; -const ZigTag = ZigNode.Tag; -const Scope = ScopeExtra(Context, Type); -const Context = @This(); - -gpa: mem.Allocator, -arena: mem.Allocator, -decl_table: std.AutoArrayHashMapUnmanaged(usize, []const u8) = .empty, -alias_list: AliasList, -global_scope: *Scope.Root, -mangle_count: u32 = 0, -/// Table of record decls that have been demoted to opaques. -opaque_demotes: std.AutoHashMapUnmanaged(usize, void) = .empty, -/// Table of unnamed enums and records that are child types of typedefs. -unnamed_typedefs: std.AutoHashMapUnmanaged(usize, []const u8) = .empty, -/// Needed to decide if we are parsing a typename -typedefs: std.StringArrayHashMapUnmanaged(void) = .empty, - -/// This one is different than the root scope's name table. This contains -/// a list of names that we found by visiting all the top level decls without -/// translating them. The other maps are updated as we translate; this one is updated -/// up front in a pre-processing step. -global_names: std.StringArrayHashMapUnmanaged(void) = .empty, - -/// This is similar to `global_names`, but contains names which we would -/// *like* to use, but do not strictly *have* to if they are unavailable. -/// These are relevant to types, which ideally we would name like -/// 'struct_foo' with an alias 'foo', but if either of those names is taken, -/// may be mangled. -/// This is distinct from `global_names` so we can detect at a type -/// declaration whether or not the name is available. -weak_global_names: std.StringArrayHashMapUnmanaged(void) = .empty, - -pattern_list: PatternList, -tree: Tree, -comp: *aro.Compilation, -mapper: aro.TypeMapper, - -fn getMangle(c: *Context) u32 { - c.mangle_count += 1; - return c.mangle_count; -} - -/// Convert an aro TokenIndex to a 'file:line:column' string -fn locStr(c: *Context, tok_idx: TokenIndex) ![]const u8 { - const token_loc = c.tree.tokens.items(.loc)[tok_idx]; - const source = c.comp.getSource(token_loc.id); - const line_col = source.lineCol(token_loc); - const filename = source.path; - - const line = source.physicalLine(token_loc); - const col = line_col.col; - - return std.fmt.allocPrint(c.arena, "{s}:{d}:{d}", .{ filename, line, col }); -} - -fn maybeSuppressResult(c: *Context, used: ResultUsed, result: ZigNode) TransError!ZigNode { - if (used == .used) return result; - return ZigTag.discard.create(c.arena, .{ .should_skip = false, .value = result }); -} - -fn addTopLevelDecl(c: *Context, name: []const u8, decl_node: ZigNode) !void { - const gop = try c.global_scope.sym_table.getOrPut(name); - if (!gop.found_existing) { - gop.value_ptr.* = decl_node; - try c.global_scope.nodes.append(decl_node); - } -} - -fn fail( - c: *Context, - err: anytype, - source_loc: TokenIndex, - comptime format: []const u8, - args: anytype, -) (@TypeOf(err) || error{OutOfMemory}) { - try warn(c, &c.global_scope.base, source_loc, format, args); - return err; -} - -fn failDecl(c: *Context, loc: TokenIndex, name: []const u8, comptime format: []const u8, args: anytype) Error!void { - // location - // pub const name = @compileError(msg); - const fail_msg = try std.fmt.allocPrint(c.arena, format, args); - try addTopLevelDecl(c, name, try ZigTag.fail_decl.create(c.arena, .{ .actual = name, .mangled = fail_msg })); - const str = try c.locStr(loc); - const location_comment = try std.fmt.allocPrint(c.arena, "// {s}", .{str}); - try c.global_scope.nodes.append(try ZigTag.warning.create(c.arena, location_comment)); -} - -fn warn(c: *Context, scope: *Scope, loc: TokenIndex, comptime format: []const u8, args: anytype) !void { - const str = try c.locStr(loc); - const value = try std.fmt.allocPrint(c.arena, "// {s}: warning: " ++ format, .{str} ++ args); - try scope.appendNode(try ZigTag.warning.create(c.arena, value)); -} - -pub fn translate( - gpa: mem.Allocator, - comp: *aro.Compilation, - args: []const []const u8, -) !std.zig.Ast { - try comp.addDefaultPragmaHandlers(); - comp.langopts.setEmulatedCompiler(aro.target_util.systemCompiler(comp.target)); - - var driver: aro.Driver = .{ .comp = comp }; - defer driver.deinit(); - - var macro_buf = std.array_list.Managed(u8).init(gpa); - defer macro_buf.deinit(); - - assert(!try driver.parseArgs(std.io.null_writer, macro_buf.writer(), args)); - assert(driver.inputs.items.len == 1); - const source = driver.inputs.items[0]; - - const builtin_macros = try comp.generateBuiltinMacros(.include_system_defines); - const user_macros = try comp.addSourceFromBuffer("", macro_buf.items); - - var pp = try aro.Preprocessor.initDefault(comp); - defer pp.deinit(); - - try pp.preprocessSources(&.{ source, builtin_macros, user_macros }); - - var tree = try pp.parse(); - defer tree.deinit(); - - // Workaround for https://github.com/Vexu/arocc/issues/603 - for (comp.diagnostics.list.items) |msg| { - if (msg.kind == .@"error" or msg.kind == .@"fatal error") return error.ParsingFailed; - } - - const mapper = tree.comp.string_interner.getFastTypeMapper(tree.comp.gpa) catch tree.comp.string_interner.getSlowTypeMapper(); - defer mapper.deinit(tree.comp.gpa); - - var arena_allocator = std.heap.ArenaAllocator.init(gpa); - defer arena_allocator.deinit(); - const arena = arena_allocator.allocator(); - - var context = Context{ - .gpa = gpa, - .arena = arena, - .alias_list = AliasList.init(gpa), - .global_scope = try arena.create(Scope.Root), - .pattern_list = try PatternList.init(gpa), - .comp = comp, - .mapper = mapper, - .tree = tree, - }; - context.global_scope.* = Scope.Root.init(&context); - defer { - context.decl_table.deinit(gpa); - context.alias_list.deinit(); - context.global_names.deinit(gpa); - context.opaque_demotes.deinit(gpa); - context.unnamed_typedefs.deinit(gpa); - context.typedefs.deinit(gpa); - context.global_scope.deinit(); - context.pattern_list.deinit(gpa); - } - - @setEvalBranchQuota(2000); - inline for (@typeInfo(std.zig.c_builtins).@"struct".decls) |decl| { - const builtin_fn = try ZigTag.pub_var_simple.create(arena, .{ - .name = decl.name, - .init = try ZigTag.import_c_builtin.create(arena, decl.name), - }); - try addTopLevelDecl(&context, decl.name, builtin_fn); - } - - try prepopulateGlobalNameTable(&context); - try transTopLevelDecls(&context); - - for (context.alias_list.items) |alias| { - if (!context.global_scope.sym_table.contains(alias.alias)) { - const node = try ZigTag.alias.create(arena, .{ .actual = alias.alias, .mangled = alias.name }); - try addTopLevelDecl(&context, alias.alias, node); - } - } - - return ast.render(gpa, context.global_scope.nodes.items); -} - -fn prepopulateGlobalNameTable(c: *Context) !void { - const node_tags = c.tree.nodes.items(.tag); - const node_types = c.tree.nodes.items(.ty); - const node_data = c.tree.nodes.items(.data); - for (c.tree.root_decls) |node| { - const data = node_data[@intFromEnum(node)]; - switch (node_tags[@intFromEnum(node)]) { - .typedef => {}, - - .struct_decl_two, - .union_decl_two, - .struct_decl, - .union_decl, - .struct_forward_decl, - .union_forward_decl, - .enum_decl_two, - .enum_decl, - .enum_forward_decl, - => { - const raw_ty = node_types[@intFromEnum(node)]; - const ty = raw_ty.canonicalize(.standard); - const name_id = if (ty.isRecord()) ty.data.record.name else ty.data.@"enum".name; - const decl_name = c.mapper.lookup(name_id); - const container_prefix = if (ty.is(.@"struct")) "struct" else if (ty.is(.@"union")) "union" else "enum"; - const prefixed_name = try std.fmt.allocPrint(c.arena, "{s}_{s}", .{ container_prefix, decl_name }); - // `decl_name` and `prefixed_name` are the preferred names for this type. - // However, we can name it anything else if necessary, so these are "weak names". - try c.weak_global_names.ensureUnusedCapacity(c.gpa, 2); - c.weak_global_names.putAssumeCapacity(decl_name, {}); - c.weak_global_names.putAssumeCapacity(prefixed_name, {}); - }, - - .fn_proto, - .static_fn_proto, - .inline_fn_proto, - .inline_static_fn_proto, - .fn_def, - .static_fn_def, - .inline_fn_def, - .inline_static_fn_def, - .@"var", - .extern_var, - .static_var, - .threadlocal_var, - .threadlocal_extern_var, - .threadlocal_static_var, - => { - const decl_name = c.tree.tokSlice(data.decl.name); - try c.global_names.put(c.gpa, decl_name, {}); - }, - .static_assert => {}, - else => unreachable, - } - } -} - -fn transTopLevelDecls(c: *Context) !void { - for (c.tree.root_decls) |node| { - try transDecl(c, &c.global_scope.base, node); - } -} - -fn transDecl(c: *Context, scope: *Scope, decl: NodeIndex) !void { - const node_tags = c.tree.nodes.items(.tag); - const node_data = c.tree.nodes.items(.data); - const node_ty = c.tree.nodes.items(.ty); - const data = node_data[@intFromEnum(decl)]; - switch (node_tags[@intFromEnum(decl)]) { - .typedef => { - try transTypeDef(c, scope, decl); - }, - - .struct_decl_two, - .union_decl_two, - => { - try transRecordDecl(c, scope, node_ty[@intFromEnum(decl)]); - }, - .struct_decl, - .union_decl, - => { - try transRecordDecl(c, scope, node_ty[@intFromEnum(decl)]); - }, - - .enum_decl_two => { - var fields = [2]NodeIndex{ data.bin.lhs, data.bin.rhs }; - var field_count: u8 = 0; - if (fields[0] != .none) field_count += 1; - if (fields[1] != .none) field_count += 1; - const enum_decl = node_ty[@intFromEnum(decl)].canonicalize(.standard).data.@"enum"; - try transEnumDecl(c, scope, enum_decl, fields[0..field_count]); - }, - .enum_decl => { - const fields = c.tree.data[data.range.start..data.range.end]; - const enum_decl = node_ty[@intFromEnum(decl)].canonicalize(.standard).data.@"enum"; - try transEnumDecl(c, scope, enum_decl, fields); - }, - - .enum_field_decl, - .record_field_decl, - .indirect_record_field_decl, - .struct_forward_decl, - .union_forward_decl, - .enum_forward_decl, - => return, - - .fn_proto, - .static_fn_proto, - .inline_fn_proto, - .inline_static_fn_proto, - .fn_def, - .static_fn_def, - .inline_fn_def, - .inline_static_fn_def, - => { - try transFnDecl(c, decl, true); - }, - - .@"var", - .extern_var, - .static_var, - .threadlocal_var, - .threadlocal_extern_var, - .threadlocal_static_var, - => { - try transVarDecl(c, decl); - }, - .static_assert => try warn(c, &c.global_scope.base, 0, "ignoring _Static_assert declaration", .{}), - else => unreachable, - } -} - -fn transTypeDef(c: *Context, scope: *Scope, typedef_decl: NodeIndex) Error!void { - const ty = c.tree.nodes.items(.ty)[@intFromEnum(typedef_decl)]; - const data = c.tree.nodes.items(.data)[@intFromEnum(typedef_decl)]; - - const toplevel = scope.id == .root; - const bs: *Scope.Block = if (!toplevel) try scope.findBlockScope(c) else undefined; - - var name: []const u8 = c.tree.tokSlice(data.decl.name); - try c.typedefs.put(c.gpa, name, {}); - - if (!toplevel) name = try bs.makeMangledName(c, name); - - const typedef_loc = data.decl.name; - const init_node = transType(c, scope, ty, .standard, typedef_loc) catch |err| switch (err) { - error.UnsupportedType => { - return failDecl(c, typedef_loc, name, "unable to resolve typedef child type", .{}); - }, - error.OutOfMemory => |e| return e, - }; - - const payload = try c.arena.create(ast.Payload.SimpleVarDecl); - payload.* = .{ - .base = .{ .tag = ([2]ZigTag{ .var_simple, .pub_var_simple })[@intFromBool(toplevel)] }, - .data = .{ - .name = name, - .init = init_node, - }, - }; - const node = ZigNode.initPayload(&payload.base); - - if (toplevel) { - try addTopLevelDecl(c, name, node); - } else { - try scope.appendNode(node); - if (node.tag() != .pub_var_simple) { - try bs.discardVariable(c, name); - } - } -} - -fn mangleWeakGlobalName(c: *Context, want_name: []const u8) ![]const u8 { - var cur_name = want_name; - - if (!c.weak_global_names.contains(want_name)) { - // This type wasn't noticed by the name detection pass, so nothing has been treating this as - // a weak global name. We must mangle it to avoid conflicts with locals. - cur_name = try std.fmt.allocPrint(c.arena, "{s}_{d}", .{ want_name, c.getMangle() }); - } - - while (c.global_names.contains(cur_name)) { - cur_name = try std.fmt.allocPrint(c.arena, "{s}_{d}", .{ want_name, c.getMangle() }); - } - return cur_name; -} - -fn transRecordDecl(c: *Context, scope: *Scope, record_ty: Type) Error!void { - const record_decl = record_ty.getRecord().?; - if (c.decl_table.get(@intFromPtr(record_decl))) |_| - return; // Avoid processing this decl twice - const toplevel = scope.id == .root; - const bs: *Scope.Block = if (!toplevel) try scope.findBlockScope(c) else undefined; - - const container_kind: ZigTag = if (record_ty.is(.@"union")) .@"union" else .@"struct"; - const container_kind_name: []const u8 = @tagName(container_kind); - - var is_unnamed = false; - var bare_name: []const u8 = c.mapper.lookup(record_decl.name); - var name = bare_name; - - if (c.unnamed_typedefs.get(@intFromPtr(record_decl))) |typedef_name| { - bare_name = typedef_name; - name = typedef_name; - } else { - if (record_ty.isAnonymousRecord(c.comp)) { - bare_name = try std.fmt.allocPrint(c.arena, "unnamed_{d}", .{c.getMangle()}); - is_unnamed = true; - } - name = try std.fmt.allocPrint(c.arena, "{s}_{s}", .{ container_kind_name, bare_name }); - if (toplevel and !is_unnamed) { - name = try mangleWeakGlobalName(c, name); - } - } - if (!toplevel) name = try bs.makeMangledName(c, name); - try c.decl_table.putNoClobber(c.gpa, @intFromPtr(record_decl), name); - - const is_pub = toplevel and !is_unnamed; - const init_node = blk: { - if (record_decl.isIncomplete()) { - try c.opaque_demotes.put(c.gpa, @intFromPtr(record_decl), {}); - break :blk ZigTag.opaque_literal.init(); - } - - var fields = try std.array_list.Managed(ast.Payload.Record.Field).initCapacity(c.gpa, record_decl.fields.len); - defer fields.deinit(); - - // TODO: Add support for flexible array field functions - var functions = std.array_list.Managed(ZigNode).init(c.gpa); - defer functions.deinit(); - - var unnamed_field_count: u32 = 0; - - // If a record doesn't have any attributes that would affect the alignment and - // layout, then we can just use a simple `extern` type. If it does have attributes, - // then we need to inspect the layout and assign an `align` value for each field. - const has_alignment_attributes = record_decl.field_attributes != null or - record_ty.hasAttribute(.@"packed") or - record_ty.hasAttribute(.aligned); - const head_field_alignment: ?c_uint = if (has_alignment_attributes) headFieldAlignment(record_decl) else null; - - for (record_decl.fields, 0..) |field, field_index| { - const field_loc = field.name_tok; - - // Demote record to opaque if it contains a bitfield - if (!field.isRegularField()) { - try c.opaque_demotes.put(c.gpa, @intFromPtr(record_decl), {}); - try warn(c, scope, field_loc, "{s} demoted to opaque type - has bitfield", .{container_kind_name}); - break :blk ZigTag.opaque_literal.init(); - } - - var field_name = c.mapper.lookup(field.name); - if (!field.isNamed()) { - field_name = try std.fmt.allocPrint(c.arena, "unnamed_{d}", .{unnamed_field_count}); - unnamed_field_count += 1; - } - const field_type = transType(c, scope, field.ty, .preserve_quals, field_loc) catch |err| switch (err) { - error.UnsupportedType => { - try c.opaque_demotes.put(c.gpa, @intFromPtr(record_decl), {}); - try warn(c, scope, 0, "{s} demoted to opaque type - unable to translate type of field {s}", .{ - container_kind_name, - field_name, - }); - break :blk ZigTag.opaque_literal.init(); - }, - else => |e| return e, - }; - - const field_alignment = if (has_alignment_attributes) - alignmentForField(record_decl, head_field_alignment, field_index) - else - null; - - // C99 introduced designated initializers for structs. Omitted fields are implicitly - // initialized to zero. Some C APIs are designed with this in mind. Defaulting to zero - // values for translated struct fields permits Zig code to comfortably use such an API. - const default_value = if (container_kind == .@"struct") - try ZigTag.std_mem_zeroes.create(c.arena, field_type) - else - null; - - fields.appendAssumeCapacity(.{ - .name = field_name, - .type = field_type, - .alignment = field_alignment, - .default_value = default_value, - }); - } - - const record_payload = try c.arena.create(ast.Payload.Record); - record_payload.* = .{ - .base = .{ .tag = container_kind }, - .data = .{ - .layout = .@"extern", - .fields = try c.arena.dupe(ast.Payload.Record.Field, fields.items), - .functions = try c.arena.dupe(ZigNode, functions.items), - .variables = &.{}, - }, - }; - break :blk ZigNode.initPayload(&record_payload.base); - }; - - const payload = try c.arena.create(ast.Payload.SimpleVarDecl); - payload.* = .{ - .base = .{ .tag = ([2]ZigTag{ .var_simple, .pub_var_simple })[@intFromBool(is_pub)] }, - .data = .{ - .name = name, - .init = init_node, - }, - }; - const node = ZigNode.initPayload(&payload.base); - if (toplevel) { - try addTopLevelDecl(c, name, node); - // Only add the alias if the name is available *and* it was caught by - // name detection. Don't bother performing a weak mangle, since a - // mangled name is of no real use here. - if (!is_unnamed and !c.global_names.contains(bare_name) and c.weak_global_names.contains(bare_name)) - try c.alias_list.append(.{ .alias = bare_name, .name = name }); - } else { - try scope.appendNode(node); - if (node.tag() != .pub_var_simple) { - try bs.discardVariable(c, name); - } - } -} - -fn transFnDecl(c: *Context, fn_decl: NodeIndex, is_pub: bool) Error!void { - const raw_ty = c.tree.nodes.items(.ty)[@intFromEnum(fn_decl)]; - const fn_ty = raw_ty.canonicalize(.standard); - const node_data = c.tree.nodes.items(.data)[@intFromEnum(fn_decl)]; - if (c.decl_table.get(@intFromPtr(fn_ty.data.func))) |_| - return; // Avoid processing this decl twice - - const fn_name = c.tree.tokSlice(node_data.decl.name); - if (c.global_scope.sym_table.contains(fn_name)) - return; // Avoid processing this decl twice - - const fn_decl_loc = 0; // TODO - const has_body = node_data.decl.node != .none; - const is_always_inline = has_body and raw_ty.getAttribute(.always_inline) != null; - const proto_ctx = FnProtoContext{ - .fn_name = fn_name, - .is_inline = is_always_inline, - .is_extern = !has_body, - .is_export = switch (c.tree.nodes.items(.tag)[@intFromEnum(fn_decl)]) { - .fn_proto, .fn_def => has_body and !is_always_inline, - - .inline_fn_proto, .inline_fn_def, .inline_static_fn_proto, .inline_static_fn_def, .static_fn_proto, .static_fn_def => false, - - else => unreachable, - }, - .is_pub = is_pub, - }; - - const proto_node = transFnType(c, &c.global_scope.base, raw_ty, fn_ty, fn_decl_loc, proto_ctx) catch |err| switch (err) { - error.UnsupportedType => { - return failDecl(c, fn_decl_loc, fn_name, "unable to resolve prototype of function", .{}); - }, - error.OutOfMemory => |e| return e, - }; - - if (!has_body) { - return addTopLevelDecl(c, fn_name, proto_node); - } - const proto_payload = proto_node.castTag(.func).?; - - // actual function definition with body - const body_stmt = node_data.decl.node; - var block_scope = try Scope.Block.init(c, &c.global_scope.base, false); - block_scope.return_type = fn_ty.data.func.return_type; - defer block_scope.deinit(); - - var scope = &block_scope.base; - _ = &scope; - - var param_id: c_uint = 0; - for (proto_payload.data.params, fn_ty.data.func.params) |*param, param_info| { - const param_name = param.name orelse { - proto_payload.data.is_extern = true; - proto_payload.data.is_export = false; - proto_payload.data.is_inline = false; - try warn(c, &c.global_scope.base, fn_decl_loc, "function {s} parameter has no name, demoted to extern", .{fn_name}); - return addTopLevelDecl(c, fn_name, proto_node); - }; - - const is_const = param_info.ty.qual.@"const"; - - const mangled_param_name = try block_scope.makeMangledName(c, param_name); - param.name = mangled_param_name; - - if (!is_const) { - const bare_arg_name = try std.fmt.allocPrint(c.arena, "arg_{s}", .{mangled_param_name}); - const arg_name = try block_scope.makeMangledName(c, bare_arg_name); - param.name = arg_name; - - const redecl_node = try ZigTag.arg_redecl.create(c.arena, .{ .actual = mangled_param_name, .mangled = arg_name }); - try block_scope.statements.append(redecl_node); - } - try block_scope.discardVariable(c, mangled_param_name); - - param_id += 1; - } - - transCompoundStmtInline(c, body_stmt, &block_scope) catch |err| switch (err) { - error.OutOfMemory => |e| return e, - error.UnsupportedTranslation, - error.UnsupportedType, - => { - proto_payload.data.is_extern = true; - proto_payload.data.is_export = false; - proto_payload.data.is_inline = false; - try warn(c, &c.global_scope.base, fn_decl_loc, "unable to translate function, demoted to extern", .{}); - return addTopLevelDecl(c, fn_name, proto_node); - }, - }; - - proto_payload.data.body = try block_scope.complete(c); - return addTopLevelDecl(c, fn_name, proto_node); -} - -fn transVarDecl(c: *Context, node: NodeIndex) Error!void { - const data = c.tree.nodes.items(.data)[@intFromEnum(node)]; - const name = c.tree.tokSlice(data.decl.name); - return failDecl(c, data.decl.name, name, "unable to translate variable declaration", .{}); -} - -fn transEnumDecl(c: *Context, scope: *Scope, enum_decl: *const Type.Enum, field_nodes: []const NodeIndex) Error!void { - if (c.decl_table.get(@intFromPtr(enum_decl))) |_| - return; // Avoid processing this decl twice - const toplevel = scope.id == .root; - const bs: *Scope.Block = if (!toplevel) try scope.findBlockScope(c) else undefined; - - var is_unnamed = false; - var bare_name: []const u8 = c.mapper.lookup(enum_decl.name); - var name = bare_name; - if (c.unnamed_typedefs.get(@intFromPtr(enum_decl))) |typedef_name| { - bare_name = typedef_name; - name = typedef_name; - } else { - if (bare_name.len == 0) { - bare_name = try std.fmt.allocPrint(c.arena, "unnamed_{d}", .{c.getMangle()}); - is_unnamed = true; - } - name = try std.fmt.allocPrint(c.arena, "enum_{s}", .{bare_name}); - } - if (!toplevel) name = try bs.makeMangledName(c, name); - try c.decl_table.putNoClobber(c.gpa, @intFromPtr(enum_decl), name); - - const enum_type_node = if (!enum_decl.isIncomplete()) blk: { - for (enum_decl.fields, field_nodes) |field, field_node| { - var enum_val_name: []const u8 = c.mapper.lookup(field.name); - if (!toplevel) { - enum_val_name = try bs.makeMangledName(c, enum_val_name); - } - - const enum_const_type_node: ?ZigNode = transType(c, scope, field.ty, .standard, field.name_tok) catch |err| switch (err) { - error.UnsupportedType => null, - else => |e| return e, - }; - - const val = c.tree.value_map.get(field_node).?; - const enum_const_def = try ZigTag.enum_constant.create(c.arena, .{ - .name = enum_val_name, - .is_public = toplevel, - .type = enum_const_type_node, - .value = try transCreateNodeAPInt(c, val), - }); - if (toplevel) - try addTopLevelDecl(c, enum_val_name, enum_const_def) - else { - try scope.appendNode(enum_const_def); - try bs.discardVariable(c, enum_val_name); - } - } - - break :blk transType(c, scope, enum_decl.tag_ty, .standard, 0) catch |err| switch (err) { - error.UnsupportedType => { - return failDecl(c, 0, name, "unable to translate enum integer type", .{}); - }, - else => |e| return e, - }; - } else blk: { - try c.opaque_demotes.put(c.gpa, @intFromPtr(enum_decl), {}); - break :blk ZigTag.opaque_literal.init(); - }; - - const is_pub = toplevel and !is_unnamed; - const payload = try c.arena.create(ast.Payload.SimpleVarDecl); - payload.* = .{ - .base = .{ .tag = ([2]ZigTag{ .var_simple, .pub_var_simple })[@intFromBool(is_pub)] }, - .data = .{ - .init = enum_type_node, - .name = name, - }, - }; - const node = ZigNode.initPayload(&payload.base); - if (toplevel) { - try addTopLevelDecl(c, name, node); - if (!is_unnamed) - try c.alias_list.append(.{ .alias = bare_name, .name = name }); - } else { - try scope.appendNode(node); - if (node.tag() != .pub_var_simple) { - try bs.discardVariable(c, name); - } - } -} - -fn getTypeStr(c: *Context, ty: Type) ![]const u8 { - var buf: std.ArrayListUnmanaged(u8) = .empty; - defer buf.deinit(c.gpa); - const w = buf.writer(c.gpa); - try ty.print(c.mapper, c.comp.langopts, w); - return c.arena.dupe(u8, buf.items); -} - -fn transType(c: *Context, scope: *Scope, raw_ty: Type, qual_handling: Type.QualHandling, source_loc: TokenIndex) TypeError!ZigNode { - const ty = raw_ty.canonicalize(qual_handling); - if (ty.qual.atomic) { - const type_name = try getTypeStr(c, ty); - return fail(c, error.UnsupportedType, source_loc, "unsupported type: '{s}'", .{type_name}); - } - - switch (ty.specifier) { - .void => return ZigTag.type.create(c.arena, "anyopaque"), - .bool => return ZigTag.type.create(c.arena, "bool"), - .char => return ZigTag.type.create(c.arena, "c_char"), - .schar => return ZigTag.type.create(c.arena, "i8"), - .uchar => return ZigTag.type.create(c.arena, "u8"), - .short => return ZigTag.type.create(c.arena, "c_short"), - .ushort => return ZigTag.type.create(c.arena, "c_ushort"), - .int => return ZigTag.type.create(c.arena, "c_int"), - .uint => return ZigTag.type.create(c.arena, "c_uint"), - .long => return ZigTag.type.create(c.arena, "c_long"), - .ulong => return ZigTag.type.create(c.arena, "c_ulong"), - .long_long => return ZigTag.type.create(c.arena, "c_longlong"), - .ulong_long => return ZigTag.type.create(c.arena, "c_ulonglong"), - .int128 => return ZigTag.type.create(c.arena, "i128"), - .uint128 => return ZigTag.type.create(c.arena, "u128"), - .fp16, .float16 => return ZigTag.type.create(c.arena, "f16"), - .float => return ZigTag.type.create(c.arena, "f32"), - .double => return ZigTag.type.create(c.arena, "f64"), - .long_double => return ZigTag.type.create(c.arena, "c_longdouble"), - .float128 => return ZigTag.type.create(c.arena, "f128"), - .@"enum" => { - const enum_decl = ty.data.@"enum"; - var trans_scope = scope; - if (enum_decl.name != .empty) { - const decl_name = c.mapper.lookup(enum_decl.name); - if (c.weak_global_names.contains(decl_name)) trans_scope = &c.global_scope.base; - } - try transEnumDecl(c, trans_scope, enum_decl, &.{}); - return ZigTag.identifier.create(c.arena, c.decl_table.get(@intFromPtr(enum_decl)).?); - }, - .pointer => { - const child_type = ty.elemType(); - - const is_fn_proto = child_type.isFunc(); - const is_const = is_fn_proto or child_type.isConst(); - const is_volatile = child_type.qual.@"volatile"; - const elem_type = try transType(c, scope, child_type, qual_handling, source_loc); - const ptr_info: @FieldType(ast.Payload.Pointer, "data") = .{ - .is_const = is_const, - .is_volatile = is_volatile, - .elem_type = elem_type, - }; - if (is_fn_proto or - typeIsOpaque(c, child_type) or - typeWasDemotedToOpaque(c, child_type)) - { - const ptr = try ZigTag.single_pointer.create(c.arena, ptr_info); - return ZigTag.optional_type.create(c.arena, ptr); - } - - return ZigTag.c_pointer.create(c.arena, ptr_info); - }, - .unspecified_variable_len_array, .incomplete_array => { - const child_type = ty.elemType(); - const is_const = child_type.qual.@"const"; - const is_volatile = child_type.qual.@"volatile"; - const elem_type = try transType(c, scope, child_type, qual_handling, source_loc); - - return ZigTag.c_pointer.create(c.arena, .{ .is_const = is_const, .is_volatile = is_volatile, .elem_type = elem_type }); - }, - .array, - .static_array, - => { - const size = ty.arrayLen().?; - const elem_type = try transType(c, scope, ty.elemType(), qual_handling, source_loc); - return ZigTag.array_type.create(c.arena, .{ .len = size, .elem_type = elem_type }); - }, - .func, - .var_args_func, - .old_style_func, - => return transFnType(c, scope, ty, ty, source_loc, .{}), - .@"struct", - .@"union", - => { - var trans_scope = scope; - if (ty.isAnonymousRecord(c.comp)) { - const record_decl = ty.data.record; - const name_id = c.mapper.lookup(record_decl.name); - if (c.weak_global_names.contains(name_id)) trans_scope = &c.global_scope.base; - } - try transRecordDecl(c, trans_scope, ty); - const name = c.decl_table.get(@intFromPtr(ty.data.record)).?; - return ZigTag.identifier.create(c.arena, name); - }, - .attributed, - .typeof_type, - .typeof_expr, - => unreachable, - else => return error.UnsupportedType, - } -} - -/// Look ahead through the fields of the record to determine what the alignment of the record -/// would be without any align/packed/etc. attributes. This helps us determine whether or not -/// the fields with 0 offset need an `align` qualifier. Strictly speaking, we could just -/// pedantically assign those fields the same alignment as the parent's pointer alignment, -/// but this helps the generated code to be a little less verbose. -fn headFieldAlignment(record_decl: *const Type.Record) ?c_uint { - const bits_per_byte = 8; - const parent_ptr_alignment_bits = record_decl.type_layout.pointer_alignment_bits; - const parent_ptr_alignment = parent_ptr_alignment_bits / bits_per_byte; - var max_field_alignment_bits: u64 = 0; - for (record_decl.fields) |field| { - if (field.ty.getRecord()) |field_record_decl| { - const child_record_alignment = field_record_decl.type_layout.field_alignment_bits; - if (child_record_alignment > max_field_alignment_bits) - max_field_alignment_bits = child_record_alignment; - } else { - const field_size = field.layout.size_bits; - if (field_size > max_field_alignment_bits) - max_field_alignment_bits = field_size; - } - } - if (max_field_alignment_bits != parent_ptr_alignment_bits) { - return parent_ptr_alignment; - } else { - return null; - } -} - -/// This function inspects the generated layout of a record to determine the alignment for a -/// particular field. This approach is necessary because unlike Zig, a C compiler is not -/// required to fulfill the requested alignment, which means we'd risk generating different code -/// if we only look at the user-requested alignment. -/// -/// Returns a ?c_uint to match Clang's behaviour of using c_uint. The return type can be changed -/// after the Clang frontend for translate-c is removed. A null value indicates that a field is -/// 'naturally aligned'. -fn alignmentForField( - record_decl: *const Type.Record, - head_field_alignment: ?c_uint, - field_index: usize, -) ?c_uint { - const fields = record_decl.fields; - assert(fields.len != 0); - const field = fields[field_index]; - - const bits_per_byte = 8; - const parent_ptr_alignment_bits = record_decl.type_layout.pointer_alignment_bits; - const parent_ptr_alignment = parent_ptr_alignment_bits / bits_per_byte; - - // bitfields aren't supported yet. Until support is added, records with bitfields - // should be demoted to opaque, and this function shouldn't be called for them. - if (!field.isRegularField()) { - @panic("TODO: add bitfield support for records"); - } - - const field_offset_bits: u64 = field.layout.offset_bits; - const field_size_bits: u64 = field.layout.size_bits; - - // Fields with zero width always have an alignment of 1 - if (field_size_bits == 0) { - return 1; - } - - // Fields with 0 offset inherit the parent's pointer alignment. - if (field_offset_bits == 0) { - return head_field_alignment; - } - - // Records have a natural alignment when used as a field, and their size is - // a multiple of this alignment value. For all other types, the natural alignment - // is their size. - const field_natural_alignment_bits: u64 = if (field.ty.getRecord()) |record| record.type_layout.field_alignment_bits else field_size_bits; - const rem_bits = field_offset_bits % field_natural_alignment_bits; - - // If there's a remainder, then the alignment is smaller than the field's - // natural alignment - if (rem_bits > 0) { - const rem_alignment = rem_bits / bits_per_byte; - if (rem_alignment > 0 and std.math.isPowerOfTwo(rem_alignment)) { - const actual_alignment = @min(rem_alignment, parent_ptr_alignment); - return @as(c_uint, @truncate(actual_alignment)); - } else { - return 1; - } - } - - // A field may have an offset which positions it to be naturally aligned, but the - // parent's pointer alignment determines if this is actually true, so we take the minimum - // value. - // For example, a float field (4 bytes wide) with a 4 byte offset is positioned to have natural - // alignment, but if the parent pointer alignment is 2, then the actual alignment of the - // float is 2. - const field_natural_alignment: u64 = field_natural_alignment_bits / bits_per_byte; - const offset_alignment = field_offset_bits / bits_per_byte; - const possible_alignment = @min(parent_ptr_alignment, offset_alignment); - if (possible_alignment == field_natural_alignment) { - return null; - } else if (possible_alignment < field_natural_alignment) { - if (std.math.isPowerOfTwo(possible_alignment)) { - return possible_alignment; - } else { - return 1; - } - } else { // possible_alignment > field_natural_alignment - // Here, the field is positioned be at a higher alignment than it's natural alignment. This means we - // need to determine whether it's a specified alignment. We can determine that from the padding preceding - // the field. - const padding_from_prev_field: u64 = blk: { - if (field_offset_bits != 0) { - const previous_field = fields[field_index - 1]; - break :blk (field_offset_bits - previous_field.layout.offset_bits) - previous_field.layout.size_bits; - } else { - break :blk 0; - } - }; - if (padding_from_prev_field < field_natural_alignment_bits) { - return null; - } else { - return possible_alignment; - } - } -} - -const FnProtoContext = struct { - is_pub: bool = false, - is_export: bool = false, - is_extern: bool = false, - is_inline: bool = false, - fn_name: ?[]const u8 = null, -}; - -fn transFnType( - c: *Context, - scope: *Scope, - raw_ty: Type, - fn_ty: Type, - source_loc: TokenIndex, - ctx: FnProtoContext, -) !ZigNode { - const param_count: usize = fn_ty.data.func.params.len; - const fn_params = try c.arena.alloc(ast.Payload.Param, param_count); - - for (fn_ty.data.func.params, fn_params) |param_info, *param_node| { - const param_ty = param_info.ty; - const is_noalias = param_ty.qual.restrict; - - const param_name: ?[]const u8 = if (param_info.name == .empty) - null - else - c.mapper.lookup(param_info.name); - - const type_node = try transType(c, scope, param_ty, .standard, param_info.name_tok); - param_node.* = .{ - .is_noalias = is_noalias, - .name = param_name, - .type = type_node, - }; - } - - const linksection_string = blk: { - if (raw_ty.getAttribute(.section)) |section| { - break :blk c.comp.interner.get(section.name.ref()).bytes; - } - break :blk null; - }; - - const alignment: ?c_uint = raw_ty.requestedAlignment(c.comp) orelse null; - - const explicit_callconv = null; - // const explicit_callconv = if ((ctx.is_inline or ctx.is_export or ctx.is_extern) and ctx.cc == .C) null else ctx.cc; - - const return_type_node = blk: { - if (raw_ty.getAttribute(.noreturn) != null) { - break :blk ZigTag.noreturn_type.init(); - } else { - const return_ty = fn_ty.data.func.return_type; - if (return_ty.is(.void)) { - // convert primitive anyopaque to actual void (only for return type) - break :blk ZigTag.void_type.init(); - } else { - break :blk transType(c, scope, return_ty, .standard, source_loc) catch |err| switch (err) { - error.UnsupportedType => { - try warn(c, scope, source_loc, "unsupported function proto return type", .{}); - return err; - }, - error.OutOfMemory => |e| return e, - }; - } - } - }; - - const payload = try c.arena.create(ast.Payload.Func); - payload.* = .{ - .base = .{ .tag = .func }, - .data = .{ - .is_pub = ctx.is_pub, - .is_extern = ctx.is_extern, - .is_export = ctx.is_export, - .is_inline = ctx.is_inline, - .is_var_args = switch (fn_ty.specifier) { - .func => false, - .var_args_func => true, - .old_style_func => !ctx.is_export and !ctx.is_inline, - else => unreachable, - }, - .name = ctx.fn_name, - .linksection_string = linksection_string, - .explicit_callconv = explicit_callconv, - .params = fn_params, - .return_type = return_type_node, - .body = null, - .alignment = alignment, - }, - }; - return ZigNode.initPayload(&payload.base); -} - -fn transStmt(c: *Context, node: NodeIndex) TransError!ZigNode { - _ = c; - _ = node; - return error.UnsupportedTranslation; -} - -fn transCompoundStmtInline(c: *Context, compound: NodeIndex, block: *Scope.Block) TransError!void { - const data = c.tree.nodes.items(.data)[@intFromEnum(compound)]; - var buf: [2]NodeIndex = undefined; - // TODO move these helpers to Aro - const stmts = switch (c.tree.nodes.items(.tag)[@intFromEnum(compound)]) { - .compound_stmt_two => blk: { - if (data.bin.lhs != .none) buf[0] = data.bin.lhs; - if (data.bin.rhs != .none) buf[1] = data.bin.rhs; - break :blk buf[0 .. @as(u32, @intFromBool(data.bin.lhs != .none)) + @intFromBool(data.bin.rhs != .none)]; - }, - .compound_stmt => c.tree.data[data.range.start..data.range.end], - else => unreachable, - }; - for (stmts) |stmt| { - const result = try transStmt(c, stmt); - switch (result.tag()) { - .declaration, .empty_block => {}, - else => try block.statements.append(result), - } - } -} - -fn recordHasBitfield(record: *const Type.Record) bool { - if (record.isIncomplete()) return false; - for (record.fields) |field| { - if (!field.isRegularField()) return true; - } - return false; -} - -fn typeIsOpaque(c: *Context, ty: Type) bool { - return switch (ty.specifier) { - .void => true, - .@"struct", .@"union" => recordHasBitfield(ty.getRecord().?), - .typeof_type => typeIsOpaque(c, ty.data.sub_type.*), - .typeof_expr => typeIsOpaque(c, ty.data.expr.ty), - .attributed => typeIsOpaque(c, ty.data.attributed.base), - else => false, - }; -} - -fn typeWasDemotedToOpaque(c: *Context, ty: Type) bool { - switch (ty.specifier) { - .@"struct", .@"union" => { - const record = ty.getRecord().?; - if (c.opaque_demotes.contains(@intFromPtr(record))) return true; - for (record.fields) |field| { - if (typeWasDemotedToOpaque(c, field.ty)) return true; - } - return false; - }, - - .@"enum" => return c.opaque_demotes.contains(@intFromPtr(ty.data.@"enum")), - - .typeof_type => return typeWasDemotedToOpaque(c, ty.data.sub_type.*), - .typeof_expr => return typeWasDemotedToOpaque(c, ty.data.expr.ty), - .attributed => return typeWasDemotedToOpaque(c, ty.data.attributed.base), - else => return false, - } -} - -fn transCompoundStmt(c: *Context, scope: *Scope, compound: NodeIndex) TransError!ZigNode { - var block_scope = try Scope.Block.init(c, scope, false); - defer block_scope.deinit(); - try transCompoundStmtInline(c, compound, &block_scope); - return try block_scope.complete(c); -} - -fn transExpr(c: *Context, node: NodeIndex, result_used: ResultUsed) TransError!ZigNode { - std.debug.assert(node != .none); - const ty = c.tree.nodes.items(.ty)[@intFromEnum(node)]; - if (c.tree.value_map.get(node)) |val| { - // TODO handle other values - const int = try transCreateNodeAPInt(c, val); - const as_node = try ZigTag.as.create(c.arena, .{ - .lhs = try transType(c, undefined, ty, .standard, undefined), - .rhs = int, - }); - return maybeSuppressResult(c, result_used, as_node); - } - const node_tags = c.tree.nodes.items(.tag); - switch (node_tags[@intFromEnum(node)]) { - else => unreachable, // Not an expression. - } - return .none; -} - -fn transCreateNodeAPInt(c: *Context, int: aro.Value) !ZigNode { - var space: aro.Interner.Tag.Int.BigIntSpace = undefined; - var big = int.toBigInt(&space, c.comp); - const is_negative = !big.positive; - big.positive = true; - - const str = big.toStringAlloc(c.arena, 10, .lower) catch |err| switch (err) { - error.OutOfMemory => return error.OutOfMemory, - }; - const res = try ZigTag.integer_literal.create(c.arena, str); - if (is_negative) return ZigTag.negate.create(c.arena, res); - return res; -} - -pub const PatternList = struct { - patterns: []Pattern, - - /// Templates must be function-like macros - /// first element is macro source, second element is the name of the function - /// in std.lib.zig.c_translation.Macros which implements it - const templates = [_][2][]const u8{ - [2][]const u8{ "f_SUFFIX(X) (X ## f)", "F_SUFFIX" }, - [2][]const u8{ "F_SUFFIX(X) (X ## F)", "F_SUFFIX" }, - - [2][]const u8{ "u_SUFFIX(X) (X ## u)", "U_SUFFIX" }, - [2][]const u8{ "U_SUFFIX(X) (X ## U)", "U_SUFFIX" }, - - [2][]const u8{ "l_SUFFIX(X) (X ## l)", "L_SUFFIX" }, - [2][]const u8{ "L_SUFFIX(X) (X ## L)", "L_SUFFIX" }, - - [2][]const u8{ "ul_SUFFIX(X) (X ## ul)", "UL_SUFFIX" }, - [2][]const u8{ "uL_SUFFIX(X) (X ## uL)", "UL_SUFFIX" }, - [2][]const u8{ "Ul_SUFFIX(X) (X ## Ul)", "UL_SUFFIX" }, - [2][]const u8{ "UL_SUFFIX(X) (X ## UL)", "UL_SUFFIX" }, - - [2][]const u8{ "ll_SUFFIX(X) (X ## ll)", "LL_SUFFIX" }, - [2][]const u8{ "LL_SUFFIX(X) (X ## LL)", "LL_SUFFIX" }, - - [2][]const u8{ "ull_SUFFIX(X) (X ## ull)", "ULL_SUFFIX" }, - [2][]const u8{ "uLL_SUFFIX(X) (X ## uLL)", "ULL_SUFFIX" }, - [2][]const u8{ "Ull_SUFFIX(X) (X ## Ull)", "ULL_SUFFIX" }, - [2][]const u8{ "ULL_SUFFIX(X) (X ## ULL)", "ULL_SUFFIX" }, - - [2][]const u8{ "f_SUFFIX(X) X ## f", "F_SUFFIX" }, - [2][]const u8{ "F_SUFFIX(X) X ## F", "F_SUFFIX" }, - - [2][]const u8{ "u_SUFFIX(X) X ## u", "U_SUFFIX" }, - [2][]const u8{ "U_SUFFIX(X) X ## U", "U_SUFFIX" }, - - [2][]const u8{ "l_SUFFIX(X) X ## l", "L_SUFFIX" }, - [2][]const u8{ "L_SUFFIX(X) X ## L", "L_SUFFIX" }, - - [2][]const u8{ "ul_SUFFIX(X) X ## ul", "UL_SUFFIX" }, - [2][]const u8{ "uL_SUFFIX(X) X ## uL", "UL_SUFFIX" }, - [2][]const u8{ "Ul_SUFFIX(X) X ## Ul", "UL_SUFFIX" }, - [2][]const u8{ "UL_SUFFIX(X) X ## UL", "UL_SUFFIX" }, - - [2][]const u8{ "ll_SUFFIX(X) X ## ll", "LL_SUFFIX" }, - [2][]const u8{ "LL_SUFFIX(X) X ## LL", "LL_SUFFIX" }, - - [2][]const u8{ "ull_SUFFIX(X) X ## ull", "ULL_SUFFIX" }, - [2][]const u8{ "uLL_SUFFIX(X) X ## uLL", "ULL_SUFFIX" }, - [2][]const u8{ "Ull_SUFFIX(X) X ## Ull", "ULL_SUFFIX" }, - [2][]const u8{ "ULL_SUFFIX(X) X ## ULL", "ULL_SUFFIX" }, - - [2][]const u8{ "CAST_OR_CALL(X, Y) (X)(Y)", "CAST_OR_CALL" }, - [2][]const u8{ "CAST_OR_CALL(X, Y) ((X)(Y))", "CAST_OR_CALL" }, - - [2][]const u8{ - \\wl_container_of(ptr, sample, member) \ - \\(__typeof__(sample))((char *)(ptr) - \ - \\ offsetof(__typeof__(*sample), member)) - , - "WL_CONTAINER_OF", - }, - - [2][]const u8{ "IGNORE_ME(X) ((void)(X))", "DISCARD" }, - [2][]const u8{ "IGNORE_ME(X) (void)(X)", "DISCARD" }, - [2][]const u8{ "IGNORE_ME(X) ((const void)(X))", "DISCARD" }, - [2][]const u8{ "IGNORE_ME(X) (const void)(X)", "DISCARD" }, - [2][]const u8{ "IGNORE_ME(X) ((volatile void)(X))", "DISCARD" }, - [2][]const u8{ "IGNORE_ME(X) (volatile void)(X)", "DISCARD" }, - [2][]const u8{ "IGNORE_ME(X) ((const volatile void)(X))", "DISCARD" }, - [2][]const u8{ "IGNORE_ME(X) (const volatile void)(X)", "DISCARD" }, - [2][]const u8{ "IGNORE_ME(X) ((volatile const void)(X))", "DISCARD" }, - [2][]const u8{ "IGNORE_ME(X) (volatile const void)(X)", "DISCARD" }, - }; - - /// Assumes that `ms` represents a tokenized function-like macro. - fn buildArgsHash(allocator: mem.Allocator, ms: MacroSlicer, hash: *ArgsPositionMap) MacroProcessingError!void { - assert(ms.tokens.len > 2); - assert(ms.tokens[0].id.isMacroIdentifier()); - assert(ms.tokens[1].id == .l_paren); - - var i: usize = 2; - while (true) : (i += 1) { - const token = ms.tokens[i]; - switch (token.id) { - .r_paren => break, - .comma => continue, - .identifier, .extended_identifier => { - const identifier = ms.slice(token); - try hash.put(allocator, identifier, i); - }, - else => return error.UnexpectedMacroToken, - } - } - } - - const Pattern = struct { - tokens: []const CToken, - source: []const u8, - impl: []const u8, - args_hash: ArgsPositionMap, - - fn init(self: *Pattern, allocator: mem.Allocator, template: [2][]const u8) Error!void { - const source = template[0]; - const impl = template[1]; - - var tok_list = std.array_list.Managed(CToken).init(allocator); - defer tok_list.deinit(); - try tokenizeMacro(source, &tok_list); - const tokens = try allocator.dupe(CToken, tok_list.items); - - self.* = .{ - .tokens = tokens, - .source = source, - .impl = impl, - .args_hash = .{}, - }; - const ms = MacroSlicer{ .source = source, .tokens = tokens }; - buildArgsHash(allocator, ms, &self.args_hash) catch |err| switch (err) { - error.UnexpectedMacroToken => unreachable, - else => |e| return e, - }; - } - - fn deinit(self: *Pattern, allocator: mem.Allocator) void { - self.args_hash.deinit(allocator); - allocator.free(self.tokens); - } - - /// This function assumes that `ms` has already been validated to contain a function-like - /// macro, and that the parsed template macro in `self` also contains a function-like - /// macro. Please review this logic carefully if changing that assumption. Two - /// function-like macros are considered equivalent if and only if they contain the same - /// list of tokens, modulo parameter names. - pub fn isEquivalent(self: Pattern, ms: MacroSlicer, args_hash: ArgsPositionMap) bool { - if (self.tokens.len != ms.tokens.len) return false; - if (args_hash.count() != self.args_hash.count()) return false; - - var i: usize = 2; - while (self.tokens[i].id != .r_paren) : (i += 1) {} - - const pattern_slicer = MacroSlicer{ .source = self.source, .tokens = self.tokens }; - while (i < self.tokens.len) : (i += 1) { - const pattern_token = self.tokens[i]; - const macro_token = ms.tokens[i]; - if (pattern_token.id != macro_token.id) return false; - - const pattern_bytes = pattern_slicer.slice(pattern_token); - const macro_bytes = ms.slice(macro_token); - switch (pattern_token.id) { - .identifier, .extended_identifier => { - const pattern_arg_index = self.args_hash.get(pattern_bytes); - const macro_arg_index = args_hash.get(macro_bytes); - - if (pattern_arg_index == null and macro_arg_index == null) { - if (!mem.eql(u8, pattern_bytes, macro_bytes)) return false; - } else if (pattern_arg_index != null and macro_arg_index != null) { - if (pattern_arg_index.? != macro_arg_index.?) return false; - } else { - return false; - } - }, - .string_literal, .char_literal, .pp_num => { - if (!mem.eql(u8, pattern_bytes, macro_bytes)) return false; - }, - else => { - // other tags correspond to keywords and operators that do not contain a "payload" - // that can vary - }, - } - } - return true; - } - }; - - pub fn init(allocator: mem.Allocator) Error!PatternList { - const patterns = try allocator.alloc(Pattern, templates.len); - for (templates, 0..) |template, i| { - try patterns[i].init(allocator, template); - } - return PatternList{ .patterns = patterns }; - } - - pub fn deinit(self: *PatternList, allocator: mem.Allocator) void { - for (self.patterns) |*pattern| pattern.deinit(allocator); - allocator.free(self.patterns); - } - - pub fn match(self: PatternList, allocator: mem.Allocator, ms: MacroSlicer) Error!?Pattern { - var args_hash: ArgsPositionMap = .{}; - defer args_hash.deinit(allocator); - - buildArgsHash(allocator, ms, &args_hash) catch |err| switch (err) { - error.UnexpectedMacroToken => return null, - else => |e| return e, - }; - - for (self.patterns) |pattern| if (pattern.isEquivalent(ms, args_hash)) return pattern; - return null; - } -}; - -pub const MacroSlicer = struct { - source: []const u8, - tokens: []const CToken, - - pub fn slice(self: MacroSlicer, token: CToken) []const u8 { - return self.source[token.start..token.end]; - } -}; - -// Maps macro parameter names to token position, for determining if different -// identifiers refer to the same positional argument in different macros. -pub const ArgsPositionMap = std.StringArrayHashMapUnmanaged(usize); - -pub const Error = std.mem.Allocator.Error; -pub const MacroProcessingError = Error || error{UnexpectedMacroToken}; -pub const TypeError = Error || error{UnsupportedType}; -pub const TransError = TypeError || error{UnsupportedTranslation}; - -pub const SymbolTable = std.StringArrayHashMap(ast.Node); -pub const AliasList = std.array_list.Managed(struct { - alias: []const u8, - name: []const u8, -}); - -pub const ResultUsed = enum { - used, - unused, -}; - -pub fn ScopeExtra(comptime ScopeExtraContext: type, comptime ScopeExtraType: type) type { - return struct { - id: Id, - parent: ?*ScopeExtraScope, - - const ScopeExtraScope = @This(); - - pub const Id = enum { - block, - root, - condition, - loop, - do_loop, - }; - - /// Used for the scope of condition expressions, for example `if (cond)`. - /// The block is lazily initialised because it is only needed for rare - /// cases of comma operators being used. - pub const Condition = struct { - base: ScopeExtraScope, - block: ?Block = null, - - pub fn getBlockScope(self: *Condition, c: *ScopeExtraContext) !*Block { - if (self.block) |*b| return b; - self.block = try Block.init(c, &self.base, true); - return &self.block.?; - } - - pub fn deinit(self: *Condition) void { - if (self.block) |*b| b.deinit(); - } - }; - - /// Represents an in-progress Node.Block. This struct is stack-allocated. - /// When it is deinitialized, it produces an Node.Block which is allocated - /// into the main arena. - pub const Block = struct { - base: ScopeExtraScope, - statements: std.array_list.Managed(ast.Node), - variables: AliasList, - mangle_count: u32 = 0, - label: ?[]const u8 = null, - - /// By default all variables are discarded, since we do not know in advance if they - /// will be used. This maps the variable's name to the Discard payload, so that if - /// the variable is subsequently referenced we can indicate that the discard should - /// be skipped during the intermediate AST -> Zig AST render step. - variable_discards: std.StringArrayHashMap(*ast.Payload.Discard), - - /// When the block corresponds to a function, keep track of the return type - /// so that the return expression can be cast, if necessary - return_type: ?ScopeExtraType = null, - - /// C static local variables are wrapped in a block-local struct. The struct - /// is named after the (mangled) variable name, the Zig variable within the - /// struct itself is given this name. - pub const static_inner_name = "static"; - - /// C extern variables declared within a block are wrapped in a block-local - /// struct. The struct is named ExternLocal_[variable_name], the Zig variable - /// within the struct itself is [variable_name] by neccessity since it's an - /// extern reference to an existing symbol. - pub const extern_inner_prepend = "ExternLocal"; - - pub fn init(c: *ScopeExtraContext, parent: *ScopeExtraScope, labeled: bool) !Block { - var blk = Block{ - .base = .{ - .id = .block, - .parent = parent, - }, - .statements = std.array_list.Managed(ast.Node).init(c.gpa), - .variables = AliasList.init(c.gpa), - .variable_discards = std.StringArrayHashMap(*ast.Payload.Discard).init(c.gpa), - }; - if (labeled) { - blk.label = try blk.makeMangledName(c, "blk"); - } - return blk; - } - - pub fn deinit(self: *Block) void { - self.statements.deinit(); - self.variables.deinit(); - self.variable_discards.deinit(); - self.* = undefined; - } - - pub fn complete(self: *Block, c: *ScopeExtraContext) !ast.Node { - if (self.base.parent.?.id == .do_loop) { - // We reserve 1 extra statement if the parent is a do_loop. This is in case of - // do while, we want to put `if (cond) break;` at the end. - const alloc_len = self.statements.items.len + @intFromBool(self.base.parent.?.id == .do_loop); - var stmts = try c.arena.alloc(ast.Node, alloc_len); - stmts.len = self.statements.items.len; - @memcpy(stmts[0..self.statements.items.len], self.statements.items); - return ast.Node.Tag.block.create(c.arena, .{ - .label = self.label, - .stmts = stmts, - }); - } - if (self.statements.items.len == 0) return ast.Node.Tag.empty_block.init(); - return ast.Node.Tag.block.create(c.arena, .{ - .label = self.label, - .stmts = try c.arena.dupe(ast.Node, self.statements.items), - }); - } - - /// Given the desired name, return a name that does not shadow anything from outer scopes. - /// Inserts the returned name into the scope. - /// The name will not be visible to callers of getAlias. - pub fn reserveMangledName(scope: *Block, c: *ScopeExtraContext, name: []const u8) ![]const u8 { - return scope.createMangledName(c, name, true); - } - - /// Same as reserveMangledName, but enables the alias immediately. - pub fn makeMangledName(scope: *Block, c: *ScopeExtraContext, name: []const u8) ![]const u8 { - return scope.createMangledName(c, name, false); - } - - pub fn createMangledName(scope: *Block, c: *ScopeExtraContext, name: []const u8, reservation: bool) ![]const u8 { - const name_copy = try c.arena.dupe(u8, name); - var proposed_name = name_copy; - while (scope.contains(proposed_name)) { - scope.mangle_count += 1; - proposed_name = try std.fmt.allocPrint(c.arena, "{s}_{d}", .{ name, scope.mangle_count }); - } - const new_mangle = try scope.variables.addOne(); - if (reservation) { - new_mangle.* = .{ .name = name_copy, .alias = name_copy }; - } else { - new_mangle.* = .{ .name = name_copy, .alias = proposed_name }; - } - return proposed_name; - } - - pub fn getAlias(scope: *Block, name: []const u8) []const u8 { - for (scope.variables.items) |p| { - if (std.mem.eql(u8, p.name, name)) - return p.alias; - } - return scope.base.parent.?.getAlias(name); - } - - /// Finds the (potentially) mangled struct name for a locally scoped extern variable or function given the original declaration name. - /// - /// Block scoped extern declarations translate to: - /// const MangledStructName = struct {extern [qualifiers] original_extern_variable_name: [type]}; - /// This finds MangledStructName given original_extern_variable_name for referencing correctly in transDeclRefExpr() - pub fn getLocalExternAlias(scope: *Block, name: []const u8) ?[]const u8 { - for (scope.statements.items) |node| { - switch (node.tag()) { - .extern_local_var => { - const parent_node = node.castTag(.extern_local_var).?; - const init_node = parent_node.data.init.castTag(.var_decl).?; - if (std.mem.eql(u8, init_node.data.name, name)) { - return parent_node.data.name; - } - }, - .extern_local_fn => { - const parent_node = node.castTag(.extern_local_fn).?; - const init_node = parent_node.data.init.castTag(.func).?; - if (std.mem.eql(u8, init_node.data.name.?, name)) { - return parent_node.data.name; - } - }, - else => {}, - } - } - return null; - } - - pub fn localContains(scope: *Block, name: []const u8) bool { - for (scope.variables.items) |p| { - if (std.mem.eql(u8, p.alias, name)) - return true; - } - return false; - } - - pub fn contains(scope: *Block, name: []const u8) bool { - if (scope.localContains(name)) - return true; - return scope.base.parent.?.contains(name); - } - - pub fn discardVariable(scope: *Block, c: *ScopeExtraContext, name: []const u8) Error!void { - const name_node = try ast.Node.Tag.identifier.create(c.arena, name); - const discard = try ast.Node.Tag.discard.create(c.arena, .{ .should_skip = false, .value = name_node }); - try scope.statements.append(discard); - try scope.variable_discards.putNoClobber(name, discard.castTag(.discard).?); - } - }; - - pub const Root = struct { - base: ScopeExtraScope, - sym_table: SymbolTable, - blank_macros: std.StringArrayHashMap(void), - context: *ScopeExtraContext, - nodes: std.array_list.Managed(ast.Node), - - pub fn init(c: *ScopeExtraContext) Root { - return .{ - .base = .{ - .id = .root, - .parent = null, - }, - .sym_table = SymbolTable.init(c.gpa), - .blank_macros = std.StringArrayHashMap(void).init(c.gpa), - .context = c, - .nodes = std.array_list.Managed(ast.Node).init(c.gpa), - }; - } - - pub fn deinit(scope: *Root) void { - scope.sym_table.deinit(); - scope.blank_macros.deinit(); - scope.nodes.deinit(); - } - - /// Check if the global scope contains this name, without looking into the "future", e.g. - /// ignore the preprocessed decl and macro names. - pub fn containsNow(scope: *Root, name: []const u8) bool { - return scope.sym_table.contains(name); - } - - /// Check if the global scope contains the name, includes all decls that haven't been translated yet. - pub fn contains(scope: *Root, name: []const u8) bool { - return scope.containsNow(name) or scope.context.global_names.contains(name) or scope.context.weak_global_names.contains(name); - } - }; - - pub fn findBlockScope(inner: *ScopeExtraScope, c: *ScopeExtraContext) !*Block { - var scope = inner; - while (true) { - switch (scope.id) { - .root => unreachable, - .block => return @fieldParentPtr("base", scope), - .condition => return @as(*Condition, @fieldParentPtr("base", scope)).getBlockScope(c), - else => scope = scope.parent.?, - } - } - } - - pub fn findBlockReturnType(inner: *ScopeExtraScope) ScopeExtraType { - var scope = inner; - while (true) { - switch (scope.id) { - .root => unreachable, - .block => { - const block: *Block = @fieldParentPtr("base", scope); - if (block.return_type) |ty| return ty; - scope = scope.parent.?; - }, - else => scope = scope.parent.?, - } - } - } - - pub fn getAlias(scope: *ScopeExtraScope, name: []const u8) []const u8 { - return switch (scope.id) { - .root => name, - .block => @as(*Block, @fieldParentPtr("base", scope)).getAlias(name), - .loop, .do_loop, .condition => scope.parent.?.getAlias(name), - }; - } - - pub fn getLocalExternAlias(scope: *ScopeExtraScope, name: []const u8) ?[]const u8 { - return switch (scope.id) { - .root => null, - .block => ret: { - const block = @as(*Block, @fieldParentPtr("base", scope)); - const alias_name = block.getLocalExternAlias(name); - if (alias_name) |_alias_name| { - break :ret _alias_name; - } - break :ret scope.parent.?.getLocalExternAlias(name); - }, - .loop, .do_loop, .condition => scope.parent.?.getLocalExternAlias(name), - }; - } - - pub fn contains(scope: *ScopeExtraScope, name: []const u8) bool { - return switch (scope.id) { - .root => @as(*Root, @fieldParentPtr("base", scope)).contains(name), - .block => @as(*Block, @fieldParentPtr("base", scope)).contains(name), - .loop, .do_loop, .condition => scope.parent.?.contains(name), - }; - } - - pub fn getBreakableScope(inner: *ScopeExtraScope) *ScopeExtraScope { - var scope = inner; - while (true) { - switch (scope.id) { - .root => unreachable, - .loop, .do_loop => return scope, - else => scope = scope.parent.?, - } - } - } - - /// Appends a node to the first block scope if inside a function, or to the root tree if not. - pub fn appendNode(inner: *ScopeExtraScope, node: ast.Node) !void { - var scope = inner; - while (true) { - switch (scope.id) { - .root => { - const root: *Root = @fieldParentPtr("base", scope); - return root.nodes.append(node); - }, - .block => { - const block: *Block = @fieldParentPtr("base", scope); - return block.statements.append(node); - }, - else => scope = scope.parent.?, - } - } - } - - pub fn skipVariableDiscard(inner: *ScopeExtraScope, name: []const u8) void { - if (true) { - // TODO: due to 'local variable is never mutated' errors, we can - // only skip discards if a variable is used as an lvalue, which - // we don't currently have detection for in translate-c. - // Once #17584 is completed, perhaps we can do away with this - // logic entirely, and instead rely on render to fixup code. - return; - } - var scope = inner; - while (true) { - switch (scope.id) { - .root => return, - .block => { - const block: *Block = @fieldParentPtr("base", scope); - if (block.variable_discards.get(name)) |discard| { - discard.data.should_skip = true; - return; - } - }, - else => {}, - } - scope = scope.parent.?; - } - } - }; -} - -pub fn tokenizeMacro(source: []const u8, tok_list: *std.array_list.Managed(CToken)) Error!void { - var tokenizer: aro.Tokenizer = .{ - .buf = source, - .source = .unused, - .langopts = .{}, - }; - while (true) { - const tok = tokenizer.next(); - switch (tok.id) { - .whitespace => continue, - .nl, .eof => { - try tok_list.append(tok); - break; - }, - else => {}, - } - try tok_list.append(tok); - } -} - -// Testing here instead of test/translate_c.zig allows us to also test that the -// mapped function exists in `std.zig.c_translation.Macros` -test "Macro matching" { - const testing = std.testing; - const helper = struct { - const MacroFunctions = std.zig.c_translation.Macros; - fn checkMacro(allocator: mem.Allocator, pattern_list: PatternList, source: []const u8, comptime expected_match: ?[]const u8) !void { - var tok_list = std.array_list.Managed(CToken).init(allocator); - defer tok_list.deinit(); - try tokenizeMacro(source, &tok_list); - const macro_slicer: MacroSlicer = .{ .source = source, .tokens = tok_list.items }; - const matched = try pattern_list.match(allocator, macro_slicer); - if (expected_match) |expected| { - try testing.expectEqualStrings(expected, matched.?.impl); - try testing.expect(@hasDecl(MacroFunctions, expected)); - } else { - try testing.expectEqual(@as(@TypeOf(matched), null), matched); - } - } - }; - const allocator = std.testing.allocator; - var pattern_list = try PatternList.init(allocator); - defer pattern_list.deinit(allocator); - - try helper.checkMacro(allocator, pattern_list, "BAR(Z) (Z ## F)", "F_SUFFIX"); - try helper.checkMacro(allocator, pattern_list, "BAR(Z) (Z ## U)", "U_SUFFIX"); - try helper.checkMacro(allocator, pattern_list, "BAR(Z) (Z ## L)", "L_SUFFIX"); - try helper.checkMacro(allocator, pattern_list, "BAR(Z) (Z ## LL)", "LL_SUFFIX"); - try helper.checkMacro(allocator, pattern_list, "BAR(Z) (Z ## UL)", "UL_SUFFIX"); - try helper.checkMacro(allocator, pattern_list, "BAR(Z) (Z ## ULL)", "ULL_SUFFIX"); - try helper.checkMacro(allocator, pattern_list, - \\container_of(a, b, c) \ - \\(__typeof__(b))((char *)(a) - \ - \\ offsetof(__typeof__(*b), c)) - , "WL_CONTAINER_OF"); - - try helper.checkMacro(allocator, pattern_list, "NO_MATCH(X, Y) (X + Y)", null); - try helper.checkMacro(allocator, pattern_list, "CAST_OR_CALL(X, Y) (X)(Y)", "CAST_OR_CALL"); - try helper.checkMacro(allocator, pattern_list, "CAST_OR_CALL(X, Y) ((X)(Y))", "CAST_OR_CALL"); - try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) (void)(X)", "DISCARD"); - try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) ((void)(X))", "DISCARD"); - try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) (const void)(X)", "DISCARD"); - try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) ((const void)(X))", "DISCARD"); - try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) (volatile void)(X)", "DISCARD"); - try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) ((volatile void)(X))", "DISCARD"); - try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) (const volatile void)(X)", "DISCARD"); - try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) ((const volatile void)(X))", "DISCARD"); - try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) (volatile const void)(X)", "DISCARD"); - try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) ((volatile const void)(X))", "DISCARD"); -} - -/// Renders errors and fatal errors + associated notes (e.g. "expanded from here"); does not render warnings or associated notes -/// Terminates with exit code 1 -fn renderErrorsAndExit(comp: *aro.Compilation) noreturn { - defer std.process.exit(1); - - var buffer: [1000]u8 = undefined; - var writer = aro.Diagnostics.defaultMsgWriter(std.io.tty.detectConfig(std.fs.File.stderr()), &buffer); - defer writer.deinit(); // writer deinit must run *before* exit so that stderr is flushed - - var saw_error = false; - for (comp.diagnostics.list.items) |msg| { - switch (msg.kind) { - .@"error", .@"fatal error" => { - saw_error = true; - aro.Diagnostics.renderMessage(comp, &writer, msg); - }, - .warning => saw_error = false, - .note => { - if (saw_error) { - aro.Diagnostics.renderMessage(comp, &writer, msg); - } - }, - .off => {}, - .default => unreachable, - } - } -} - -pub fn main() !void { - var arena_instance = std.heap.ArenaAllocator.init(std.heap.page_allocator); - defer arena_instance.deinit(); - const arena = arena_instance.allocator(); - - var general_purpose_allocator: std.heap.GeneralPurposeAllocator(.{}) = .init; - const gpa = general_purpose_allocator.allocator(); - - const args = try std.process.argsAlloc(arena); - - var aro_comp = aro.Compilation.init(gpa, std.fs.cwd()); - defer aro_comp.deinit(); - - var tree = translate(gpa, &aro_comp, args) catch |err| switch (err) { - error.ParsingFailed, error.FatalError => renderErrorsAndExit(&aro_comp), - error.OutOfMemory => return error.OutOfMemory, - error.StreamTooLong => std.process.fatal("An input file was larger than 4GiB", .{}), - }; - defer tree.deinit(gpa); - - const formatted = try tree.renderAlloc(arena); - try std.fs.File.stdout().writeAll(formatted); - return std.process.cleanExit(); -} diff --git a/lib/compiler/resinator/main.zig b/lib/compiler/resinator/main.zig index 6e7315e771e5..9a9691e7e40c 100644 --- a/lib/compiler/resinator/main.zig +++ b/lib/compiler/resinator/main.zig @@ -115,7 +115,7 @@ pub fn main() !void { const full_input = full_input: { if (options.input_format == .rc and options.preprocess != .no) { - var preprocessed_buf = std.array_list.Managed(u8).init(allocator); + var preprocessed_buf: std.Io.Writer.Allocating = .init(allocator); errdefer preprocessed_buf.deinit(); // We're going to throw away everything except the final preprocessed output anyway, @@ -124,7 +124,20 @@ pub fn main() !void { defer aro_arena_state.deinit(); const aro_arena = aro_arena_state.allocator(); - var comp = aro.Compilation.init(aro_arena, std.fs.cwd()); + var stderr_buf: [512]u8 = undefined; + var stderr_writer = stderr.writer(&stderr_buf); + var diagnostics: aro.Diagnostics = switch (zig_integration) { + false => .{ .output = .{ .to_writer = .{ + .writer = &stderr_writer.interface, + .color = stderr_config, + } } }, + true => .{ .output = .{ .to_list = .{ + .arena = .init(allocator), + } } }, + }; + defer diagnostics.deinit(); + + var comp = aro.Compilation.init(aro_arena, aro_arena, &diagnostics, std.fs.cwd()); defer comp.deinit(); var argv = std.array_list.Managed([]const u8).init(comp.gpa); @@ -146,20 +159,24 @@ pub fn main() !void { try stdout_writer.print("{s}\n\n", .{argv.items[argv.items.len - 1]}); } - preprocess.preprocess(&comp, preprocessed_buf.writer(), argv.items, maybe_dependencies_list) catch |err| switch (err) { + preprocess.preprocess(&comp, &preprocessed_buf.writer, argv.items, maybe_dependencies_list) catch |err| switch (err) { error.GeneratedSourceError => { - try error_handler.emitAroDiagnostics(allocator, "failed during preprocessor setup (this is always a bug):", &comp); + try error_handler.emitAroDiagnostics(allocator, "failed during preprocessor setup (this is always a bug)", &comp); std.process.exit(1); }, // ArgError can occur if e.g. the .rc file is not found error.ArgError, error.PreprocessError => { - try error_handler.emitAroDiagnostics(allocator, "failed during preprocessing:", &comp); + try error_handler.emitAroDiagnostics(allocator, "failed during preprocessing", &comp); std.process.exit(1); }, - error.StreamTooLong => { + error.FileTooBig => { try error_handler.emitMessage(allocator, .err, "failed during preprocessing: maximum file size exceeded", .{}); std.process.exit(1); }, + error.WriteFailed => { + try error_handler.emitMessage(allocator, .err, "failed during preprocessing: error writing the preprocessed output", .{}); + std.process.exit(1); + }, error.OutOfMemory => |e| return e, }; @@ -650,11 +667,10 @@ const ErrorHandler = union(enum) { try server.serveErrorBundle(error_bundle); }, .tty => { - // extra newline to separate this line from the aro errors + // aro errors have already been emitted const stderr = std.debug.lockStderrWriter(&.{}); defer std.debug.unlockStderrWriter(); - try renderErrorMessage(stderr, self.tty, .err, "{s}\n", .{fail_msg}); - aro.Diagnostics.render(comp, self.tty); + try renderErrorMessage(stderr, self.tty, .err, "{s}", .{fail_msg}); }, } } @@ -873,12 +889,10 @@ fn aroDiagnosticsToErrorBundle( .msg = try bundle.addString(fail_msg), }); - var msg_writer = MsgWriter.init(gpa); - defer msg_writer.deinit(); var cur_err: ?ErrorBundle.ErrorMessage = null; var cur_notes: std.ArrayListUnmanaged(ErrorBundle.ErrorMessage) = .empty; defer cur_notes.deinit(gpa); - for (comp.diagnostics.list.items) |msg| { + for (comp.diagnostics.output.to_list.messages.items) |msg| { switch (msg.kind) { // Clear the current error so that notes don't bleed into unassociated errors .off, .warning => { @@ -887,28 +901,19 @@ fn aroDiagnosticsToErrorBundle( }, .note => if (cur_err == null) continue, .@"fatal error", .@"error" => {}, - .default => unreachable, } - msg_writer.resetRetainingCapacity(); - aro.Diagnostics.renderMessage(comp, &msg_writer, msg); const src_loc = src_loc: { - if (msg_writer.path) |src_path| { - var src_loc: ErrorBundle.SourceLocation = .{ - .src_path = try bundle.addString(src_path), - .line = msg_writer.line - 1, // 1-based -> 0-based - .column = msg_writer.col - 1, // 1-based -> 0-based - .span_start = 0, - .span_main = 0, - .span_end = 0, - }; - if (msg_writer.source_line) |source_line| { - src_loc.span_start = msg_writer.span_main; - src_loc.span_main = msg_writer.span_main; - src_loc.span_end = msg_writer.span_main; - src_loc.source_line = try bundle.addString(source_line); - } - break :src_loc try bundle.addSourceLocation(src_loc); + if (msg.location) |location| { + break :src_loc try bundle.addSourceLocation(.{ + .src_path = try bundle.addString(location.path), + .line = location.line_no - 1, // 1-based -> 0-based + .column = location.col - 1, // 1-based -> 0-based + .span_start = location.width, + .span_main = location.width, + .span_end = location.width, + .source_line = try bundle.addString(location.line), + }); } break :src_loc ErrorBundle.SourceLocationIndex.none; }; @@ -919,7 +924,7 @@ fn aroDiagnosticsToErrorBundle( try flushErrorMessageIntoBundle(&bundle, err, cur_notes.items); } cur_err = .{ - .msg = try bundle.addString(msg_writer.buf.items), + .msg = try bundle.addString(msg.text), .src_loc = src_loc, }; cur_notes.clearRetainingCapacity(); @@ -927,11 +932,11 @@ fn aroDiagnosticsToErrorBundle( .note => { cur_err.?.notes_len += 1; try cur_notes.append(gpa, .{ - .msg = try bundle.addString(msg_writer.buf.items), + .msg = try bundle.addString(msg.text), .src_loc = src_loc, }); }, - .off, .warning, .default => unreachable, + .off, .warning => unreachable, } } if (cur_err) |err| { @@ -940,63 +945,3 @@ fn aroDiagnosticsToErrorBundle( return try bundle.toOwnedBundle(""); } - -// Similar to aro.Diagnostics.MsgWriter but: -// - Writers to an ArrayList -// - Only prints the message itself (no location, source line, error: prefix, etc) -// - Keeps track of source path/line/col instead -const MsgWriter = struct { - buf: std.array_list.Managed(u8), - path: ?[]const u8 = null, - // 1-indexed - line: u32 = undefined, - col: u32 = undefined, - source_line: ?[]const u8 = null, - span_main: u32 = undefined, - - fn init(allocator: std.mem.Allocator) MsgWriter { - return .{ - .buf = std.array_list.Managed(u8).init(allocator), - }; - } - - fn deinit(m: *MsgWriter) void { - m.buf.deinit(); - } - - fn resetRetainingCapacity(m: *MsgWriter) void { - m.buf.clearRetainingCapacity(); - m.path = null; - m.source_line = null; - } - - pub fn print(m: *MsgWriter, comptime fmt: []const u8, args: anytype) void { - m.buf.writer().print(fmt, args) catch {}; - } - - pub fn write(m: *MsgWriter, msg: []const u8) void { - m.buf.writer().writeAll(msg) catch {}; - } - - pub fn setColor(m: *MsgWriter, color: std.io.tty.Color) void { - _ = m; - _ = color; - } - - pub fn location(m: *MsgWriter, path: []const u8, line: u32, col: u32) void { - m.path = path; - m.line = line; - m.col = col; - } - - pub fn start(m: *MsgWriter, kind: aro.Diagnostics.Kind) void { - _ = m; - _ = kind; - } - - pub fn end(m: *MsgWriter, maybe_line: ?[]const u8, col: u32, end_with_splice: bool) void { - _ = end_with_splice; - m.source_line = maybe_line; - m.span_main = col; - } -}; diff --git a/lib/compiler/resinator/preprocess.zig b/lib/compiler/resinator/preprocess.zig index ff6de00461a0..70c57af71357 100644 --- a/lib/compiler/resinator/preprocess.zig +++ b/lib/compiler/resinator/preprocess.zig @@ -4,26 +4,29 @@ const Allocator = std.mem.Allocator; const cli = @import("cli.zig"); const aro = @import("aro"); -const PreprocessError = error{ ArgError, GeneratedSourceError, PreprocessError, StreamTooLong, OutOfMemory }; +const PreprocessError = error{ ArgError, GeneratedSourceError, PreprocessError, FileTooBig, OutOfMemory, WriteFailed }; pub fn preprocess( comp: *aro.Compilation, - writer: anytype, + writer: *std.Io.Writer, /// Expects argv[0] to be the command name argv: []const []const u8, maybe_dependencies_list: ?*std.array_list.Managed([]const u8), ) PreprocessError!void { try comp.addDefaultPragmaHandlers(); - var driver: aro.Driver = .{ .comp = comp, .aro_name = "arocc" }; + var driver: aro.Driver = .{ .comp = comp, .diagnostics = comp.diagnostics, .aro_name = "arocc" }; defer driver.deinit(); - var macro_buf = std.array_list.Managed(u8).init(comp.gpa); - defer macro_buf.deinit(); + var macro_buf: std.ArrayListUnmanaged(u8) = .empty; + defer macro_buf.deinit(comp.gpa); - _ = driver.parseArgs(std.io.null_writer, macro_buf.writer(), argv) catch |err| switch (err) { + var discard_buffer: [64]u8 = undefined; + var discarding: std.Io.Writer.Discarding = .init(&discard_buffer); + _ = driver.parseArgs(&discarding.writer, ¯o_buf, argv) catch |err| switch (err) { error.FatalError => return error.ArgError, error.OutOfMemory => |e| return e, + error.WriteFailed => unreachable, }; if (hasAnyErrors(comp)) return error.ArgError; @@ -42,7 +45,10 @@ pub fn preprocess( if (hasAnyErrors(comp)) return error.GeneratedSourceError; comp.generated_buf.items.len = 0; - var pp = try aro.Preprocessor.initDefault(comp); + var pp = aro.Preprocessor.initDefault(comp) catch |err| switch (err) { + error.FatalError => return error.GeneratedSourceError, + error.OutOfMemory => |e| return e, + }; defer pp.deinit(); if (comp.langopts.ms_extensions) { @@ -73,16 +79,7 @@ pub fn preprocess( } fn hasAnyErrors(comp: *aro.Compilation) bool { - // In theory we could just check Diagnostics.errors != 0, but that only - // gets set during rendering of the error messages, see: - // https://github.com/Vexu/arocc/issues/603 - for (comp.diagnostics.list.items) |msg| { - switch (msg.kind) { - .@"fatal error", .@"error" => return true, - else => {}, - } - } - return false; + return comp.diagnostics.errors != 0; } /// `arena` is used for temporary -D argument strings and the INCLUDE environment variable. diff --git a/lib/compiler/translate-c/MacroTranslator.zig b/lib/compiler/translate-c/MacroTranslator.zig new file mode 100644 index 000000000000..c205a2382845 --- /dev/null +++ b/lib/compiler/translate-c/MacroTranslator.zig @@ -0,0 +1,1307 @@ +const std = @import("std"); +const math = std.math; +const mem = std.mem; +const assert = std.debug.assert; + +const aro = @import("aro"); +const CToken = aro.Tokenizer.Token; + +const ast = @import("ast.zig"); +const builtins = @import("builtins.zig"); +const ZigNode = ast.Node; +const ZigTag = ZigNode.Tag; +const Scope = @import("Scope.zig"); +const Translator = @import("Translator.zig"); + +const Error = Translator.Error; +pub const ParseError = Error || error{ParseError}; + +const MacroTranslator = @This(); + +t: *Translator, +macro: aro.Preprocessor.Macro, +name: []const u8, + +tokens: []const CToken, +source: []const u8, +i: usize = 0, +/// If an object macro references a global var it needs to be converted into +/// an inline function. +refs_var_decl: bool = false, + +fn peek(mt: *MacroTranslator) CToken.Id { + if (mt.i >= mt.tokens.len) return .eof; + return mt.tokens[mt.i].id; +} + +fn eat(mt: *MacroTranslator, expected_id: CToken.Id) bool { + if (mt.peek() == expected_id) { + mt.i += 1; + return true; + } + return false; +} + +fn expect(mt: *MacroTranslator, expected_id: CToken.Id) ParseError!void { + const next_id = mt.peek(); + if (next_id != expected_id and !(expected_id == .identifier and next_id == .extended_identifier)) { + try mt.fail( + "unable to translate C expr: expected '{s}' instead got '{s}'", + .{ expected_id.symbol(), next_id.symbol() }, + ); + return error.ParseError; + } + mt.i += 1; +} + +fn fail(mt: *MacroTranslator, comptime fmt: []const u8, args: anytype) !void { + return mt.t.failDeclExtra(&mt.t.global_scope.base, mt.macro.loc, mt.name, fmt, args); +} + +fn tokSlice(mt: *const MacroTranslator) []const u8 { + const tok = mt.tokens[mt.i]; + return mt.source[tok.start..tok.end]; +} + +pub fn transFnMacro(mt: *MacroTranslator) ParseError!void { + var block_scope = try Scope.Block.init(mt.t, &mt.t.global_scope.base, false); + defer block_scope.deinit(); + const scope = &block_scope.base; + + const fn_params = try mt.t.arena.alloc(ast.Payload.Param, mt.macro.params.len); + for (fn_params, mt.macro.params) |*param, param_name| { + const mangled_name = try block_scope.makeMangledName(param_name); + param.* = .{ + .is_noalias = false, + .name = mangled_name, + .type = ZigTag.@"anytype".init(), + }; + try block_scope.discardVariable(mangled_name); + } + + const expr = try mt.parseCExpr(scope); + const last = mt.peek(); + if (last != .eof) + return mt.fail("unable to translate C expr: unexpected token '{s}'", .{last.symbol()}); + + const typeof_arg = if (expr.castTag(.block)) |some| blk: { + const stmts = some.data.stmts; + const blk_last = stmts[stmts.len - 1]; + const br = blk_last.castTag(.break_val).?; + break :blk br.data.val; + } else expr; + + const return_type = ret: { + if (typeof_arg.castTag(.helper_call)) |some| { + if (std.mem.eql(u8, some.data.name, "cast")) { + break :ret some.data.args[0]; + } + } + if (typeof_arg.castTag(.std_mem_zeroinit)) |some| break :ret some.data.lhs; + if (typeof_arg.castTag(.std_mem_zeroes)) |some| break :ret some.data; + break :ret try ZigTag.typeof.create(mt.t.arena, typeof_arg); + }; + + const return_expr = try ZigTag.@"return".create(mt.t.arena, expr); + try block_scope.statements.append(mt.t.gpa, return_expr); + + const fn_decl = try ZigTag.pub_inline_fn.create(mt.t.arena, .{ + .name = mt.name, + .params = fn_params, + .return_type = return_type, + .body = try block_scope.complete(), + }); + try mt.t.addTopLevelDecl(mt.name, fn_decl); +} + +pub fn transMacro(mt: *MacroTranslator) ParseError!void { + const scope = &mt.t.global_scope.base; + + // Check if the macro only uses other blank macros. + while (true) { + switch (mt.peek()) { + .identifier, .extended_identifier => { + if (mt.t.global_scope.blank_macros.contains(mt.tokSlice())) { + mt.i += 1; + continue; + } + }, + .eof, .nl => { + try mt.t.global_scope.blank_macros.put(mt.t.gpa, mt.name, {}); + const init_node = try ZigTag.string_literal.create(mt.t.arena, "\"\""); + const var_decl = try ZigTag.pub_var_simple.create(mt.t.arena, .{ .name = mt.name, .init = init_node }); + try mt.t.addTopLevelDecl(mt.name, var_decl); + return; + }, + else => {}, + } + break; + } + + const init_node = try mt.parseCExpr(scope); + const last = mt.peek(); + if (last != .eof) + return mt.fail("unable to translate C expr: unexpected token '{s}'", .{last.symbol()}); + + const node = node: { + const var_decl = try ZigTag.pub_var_simple.create(mt.t.arena, .{ .name = mt.name, .init = init_node }); + + if (mt.t.getFnProto(var_decl)) |proto_node| { + // If a macro aliases a global variable which is a function pointer, we conclude that + // the macro is intended to represent a function that assumes the function pointer + // variable is non-null and calls it. + break :node try mt.createMacroFn(mt.name, var_decl, proto_node); + } else if (mt.refs_var_decl) { + const return_type = try ZigTag.typeof.create(mt.t.arena, init_node); + const return_expr = try ZigTag.@"return".create(mt.t.arena, init_node); + const block = try ZigTag.block_single.create(mt.t.arena, return_expr); + + const loc_str = try mt.t.locStr(mt.macro.loc); + const value = try std.fmt.allocPrint(mt.t.arena, "\n// {s}: warning: macro '{s}' contains a runtime value, translated to function", .{ loc_str, mt.name }); + try scope.appendNode(try ZigTag.warning.create(mt.t.arena, value)); + + break :node try ZigTag.pub_inline_fn.create(mt.t.arena, .{ + .name = mt.name, + .params = &.{}, + .return_type = return_type, + .body = block, + }); + } + + break :node var_decl; + }; + + try mt.t.addTopLevelDecl(mt.name, node); +} + +fn createMacroFn(mt: *MacroTranslator, name: []const u8, ref: ZigNode, proto_alias: *ast.Payload.Func) !ZigNode { + var fn_params = std.array_list.Managed(ast.Payload.Param).init(mt.t.gpa); + defer fn_params.deinit(); + + var block_scope = try Scope.Block.init(mt.t, &mt.t.global_scope.base, false); + defer block_scope.deinit(); + + for (proto_alias.data.params) |param| { + const param_name = try block_scope.makeMangledName(param.name orelse "arg"); + + try fn_params.append(.{ + .name = param_name, + .type = param.type, + .is_noalias = param.is_noalias, + }); + } + + const init = if (ref.castTag(.var_decl)) |v| + v.data.init.? + else if (ref.castTag(.var_simple) orelse ref.castTag(.pub_var_simple)) |v| + v.data.init + else + unreachable; + + const unwrap_expr = try ZigTag.unwrap.create(mt.t.arena, init); + const args = try mt.t.arena.alloc(ZigNode, fn_params.items.len); + for (fn_params.items, 0..) |param, i| { + args[i] = try ZigTag.identifier.create(mt.t.arena, param.name.?); + } + const call_expr = try ZigTag.call.create(mt.t.arena, .{ + .lhs = unwrap_expr, + .args = args, + }); + const return_expr = try ZigTag.@"return".create(mt.t.arena, call_expr); + const block = try ZigTag.block_single.create(mt.t.arena, return_expr); + + return ZigTag.pub_inline_fn.create(mt.t.arena, .{ + .name = name, + .params = try mt.t.arena.dupe(ast.Payload.Param, fn_params.items), + .return_type = proto_alias.data.return_type, + .body = block, + }); +} + +fn parseCExpr(mt: *MacroTranslator, scope: *Scope) ParseError!ZigNode { + // TODO parseCAssignExpr here + var block_scope = try Scope.Block.init(mt.t, scope, true); + defer block_scope.deinit(); + + const node = try mt.parseCCondExpr(&block_scope.base); + if (!mt.eat(.comma)) return node; + + var last = node; + while (true) { + // suppress result + const ignore = try ZigTag.discard.create(mt.t.arena, .{ .should_skip = false, .value = last }); + try block_scope.statements.append(mt.t.gpa, ignore); + + last = try mt.parseCCondExpr(&block_scope.base); + if (!mt.eat(.comma)) break; + } + + const break_node = try ZigTag.break_val.create(mt.t.arena, .{ + .label = block_scope.label, + .val = last, + }); + try block_scope.statements.append(mt.t.gpa, break_node); + return try block_scope.complete(); +} + +fn parseCNumLit(mt: *MacroTranslator) ParseError!ZigNode { + const lit_bytes = mt.tokSlice(); + mt.i += 1; + + var bytes = try std.ArrayListUnmanaged(u8).initCapacity(mt.t.arena, lit_bytes.len + 3); + + const prefix = aro.Tree.Token.NumberPrefix.fromString(lit_bytes); + switch (prefix) { + .binary => bytes.appendSliceAssumeCapacity("0b"), + .octal => bytes.appendSliceAssumeCapacity("0o"), + .hex => bytes.appendSliceAssumeCapacity("0x"), + .decimal => {}, + } + + const after_prefix = lit_bytes[prefix.stringLen()..]; + const after_int = for (after_prefix, 0..) |c, i| switch (c) { + '.' => { + if (i == 0) { + bytes.appendAssumeCapacity('0'); + } + break after_prefix[i..]; + }, + 'e', 'E' => { + if (prefix != .hex) break after_prefix[i..]; + bytes.appendAssumeCapacity(c); + }, + 'p', 'P' => break after_prefix[i..], + '0'...'9', 'a'...'d', 'A'...'D', 'f', 'F' => { + if (!prefix.digitAllowed(c)) break after_prefix[i..]; + bytes.appendAssumeCapacity(c); + }, + '\'' => { + bytes.appendAssumeCapacity('_'); + }, + else => break after_prefix[i..], + } else ""; + + const after_frac = frac: { + if (after_int.len == 0 or after_int[0] != '.') break :frac after_int; + bytes.appendAssumeCapacity('.'); + for (after_int[1..], 1..) |c, i| { + if (c == '\'') { + bytes.appendAssumeCapacity('_'); + continue; + } + if (!prefix.digitAllowed(c)) break :frac after_int[i..]; + bytes.appendAssumeCapacity(c); + } + break :frac ""; + }; + + const suffix_str = exponent: { + if (after_frac.len == 0) break :exponent after_frac; + switch (after_frac[0]) { + 'e', 'E' => {}, + 'p', 'P' => if (prefix != .hex) break :exponent after_frac, + else => break :exponent after_frac, + } + bytes.appendAssumeCapacity(after_frac[0]); + for (after_frac[1..], 1..) |c, i| switch (c) { + '+', '-', '0'...'9' => { + bytes.appendAssumeCapacity(c); + }, + '\'' => { + bytes.appendAssumeCapacity('_'); + }, + else => break :exponent after_frac[i..], + }; + break :exponent ""; + }; + + const is_float = after_int.len != suffix_str.len; + const suffix = aro.Tree.Token.NumberSuffix.fromString(suffix_str, if (is_float) .float else .int) orelse { + try mt.fail("invalid number suffix: '{s}'", .{suffix_str}); + return error.ParseError; + }; + if (suffix.isImaginary()) { + try mt.fail("TODO: imaginary literals", .{}); + return error.ParseError; + } + if (suffix.isBitInt()) { + try mt.fail("TODO: _BitInt literals", .{}); + return error.ParseError; + } + + if (is_float) { + const type_node = try ZigTag.type.create(mt.t.arena, switch (suffix) { + .F16 => "f16", + .F => "f32", + .None => "f64", + .L => "c_longdouble", + .W => "f80", + .Q, .F128 => "f128", + else => unreachable, + }); + const rhs = try ZigTag.float_literal.create(mt.t.arena, bytes.items); + return ZigTag.as.create(mt.t.arena, .{ .lhs = type_node, .rhs = rhs }); + } else { + const type_node = try ZigTag.type.create(mt.t.arena, switch (suffix) { + .None => "c_int", + .U => "c_uint", + .L => "c_long", + .UL => "c_ulong", + .LL => "c_longlong", + .ULL => "c_ulonglong", + else => unreachable, + }); + const value = std.fmt.parseInt(i128, bytes.items, 0) catch math.maxInt(i128); + + // make the output less noisy by skipping promoteIntLiteral where + // it's guaranteed to not be required because of C standard type constraints + const guaranteed_to_fit = switch (suffix) { + .None => math.cast(i16, value) != null, + .U => math.cast(u16, value) != null, + .L => math.cast(i32, value) != null, + .UL => math.cast(u32, value) != null, + .LL => math.cast(i64, value) != null, + .ULL => math.cast(u64, value) != null, + else => unreachable, + }; + + const literal_node = try ZigTag.integer_literal.create(mt.t.arena, bytes.items); + if (guaranteed_to_fit) { + return ZigTag.as.create(mt.t.arena, .{ .lhs = type_node, .rhs = literal_node }); + } else { + return mt.t.createHelperCallNode(.promoteIntLiteral, &.{ type_node, literal_node, try ZigTag.enum_literal.create(mt.t.arena, @tagName(prefix)) }); + } + } +} + +fn zigifyEscapeSequences(mt: *MacroTranslator, slice: []const u8) ![]const u8 { + var source = slice; + for (source, 0..) |c, i| { + if (c == '\"' or c == '\'') { + source = source[i..]; + break; + } + } + for (source) |c| { + if (c == '\\' or c == '\t') { + break; + } + } else return source; + const bytes = try mt.t.arena.alloc(u8, source.len * 2); + var state: enum { + start, + escape, + hex, + octal, + } = .start; + var i: usize = 0; + var count: u8 = 0; + var num: u8 = 0; + for (source) |c| { + switch (state) { + .escape => { + switch (c) { + 'n', 'r', 't', '\\', '\'', '\"' => { + bytes[i] = c; + }, + '0'...'7' => { + count += 1; + num += c - '0'; + state = .octal; + bytes[i] = 'x'; + }, + 'x' => { + state = .hex; + bytes[i] = 'x'; + }, + 'a' => { + bytes[i] = 'x'; + i += 1; + bytes[i] = '0'; + i += 1; + bytes[i] = '7'; + }, + 'b' => { + bytes[i] = 'x'; + i += 1; + bytes[i] = '0'; + i += 1; + bytes[i] = '8'; + }, + 'f' => { + bytes[i] = 'x'; + i += 1; + bytes[i] = '0'; + i += 1; + bytes[i] = 'C'; + }, + 'v' => { + bytes[i] = 'x'; + i += 1; + bytes[i] = '0'; + i += 1; + bytes[i] = 'B'; + }, + '?' => { + i -= 1; + bytes[i] = '?'; + }, + 'u', 'U' => { + try mt.fail("macro tokenizing failed: TODO unicode escape sequences", .{}); + return error.ParseError; + }, + else => { + try mt.fail("macro tokenizing failed: unknown escape sequence", .{}); + return error.ParseError; + }, + } + i += 1; + if (state == .escape) + state = .start; + }, + .start => { + if (c == '\t') { + bytes[i] = '\\'; + i += 1; + bytes[i] = 't'; + i += 1; + continue; + } + if (c == '\\') { + state = .escape; + } + bytes[i] = c; + i += 1; + }, + .hex => { + switch (c) { + '0'...'9' => { + num = std.math.mul(u8, num, 16) catch { + try mt.fail("macro tokenizing failed: hex literal overflowed", .{}); + return error.ParseError; + }; + num += c - '0'; + }, + 'a'...'f' => { + num = std.math.mul(u8, num, 16) catch { + try mt.fail("macro tokenizing failed: hex literal overflowed", .{}); + return error.ParseError; + }; + num += c - 'a' + 10; + }, + 'A'...'F' => { + num = std.math.mul(u8, num, 16) catch { + try mt.fail("macro tokenizing failed: hex literal overflowed", .{}); + return error.ParseError; + }; + num += c - 'A' + 10; + }, + else => { + i += std.fmt.printInt(bytes[i..], num, 16, .lower, .{ .fill = '0', .width = 2 }); + num = 0; + if (c == '\\') + state = .escape + else + state = .start; + bytes[i] = c; + i += 1; + }, + } + }, + .octal => { + const accept_digit = switch (c) { + // The maximum length of a octal literal is 3 digits + '0'...'7' => count < 3, + else => false, + }; + + if (accept_digit) { + count += 1; + num = std.math.mul(u8, num, 8) catch { + try mt.fail("macro tokenizing failed: octal literal overflowed", .{}); + return error.ParseError; + }; + num += c - '0'; + } else { + i += std.fmt.printInt(bytes[i..], num, 16, .lower, .{ .fill = '0', .width = 2 }); + num = 0; + count = 0; + if (c == '\\') + state = .escape + else + state = .start; + bytes[i] = c; + i += 1; + } + }, + } + } + if (state == .hex or state == .octal) { + i += std.fmt.printInt(bytes[i..], num, 16, .lower, .{ .fill = '0', .width = 2 }); + } + + return bytes[0..i]; +} + +/// non-ASCII characters (mt > 127) are also treated as non-printable by fmtSliceEscapeLower. +/// If a C string literal or char literal in a macro is not valid UTF-8, we need to escape +/// non-ASCII characters so that the Zig source we output will itself be UTF-8. +fn escapeUnprintables(mt: *MacroTranslator) ![]const u8 { + const slice = mt.tokSlice(); + mt.i += 1; + + const zigified = try mt.zigifyEscapeSequences(slice); + if (std.unicode.utf8ValidateSlice(zigified)) return zigified; + + const formatter = std.ascii.hexEscape(zigified, .lower); + const encoded_size = @as(usize, @intCast(std.fmt.count("{f}", .{formatter}))); + const output = try mt.t.arena.alloc(u8, encoded_size); + return std.fmt.bufPrint(output, "{f}", .{formatter}) catch |err| switch (err) { + error.NoSpaceLeft => unreachable, + else => |e| return e, + }; +} + +fn parseCPrimaryExpr(mt: *MacroTranslator, scope: *Scope) ParseError!ZigNode { + const tok = mt.peek(); + switch (tok) { + .char_literal, + .char_literal_utf_8, + .char_literal_utf_16, + .char_literal_utf_32, + .char_literal_wide, + => { + const slice = mt.tokSlice(); + if (slice[0] != '\'' or slice[1] == '\\' or slice.len == 3) { + return ZigTag.char_literal.create(mt.t.arena, try mt.escapeUnprintables()); + } else { + mt.i += 1; + + const str = try std.fmt.allocPrint(mt.t.arena, "0x{x}", .{slice[1 .. slice.len - 1]}); + return ZigTag.integer_literal.create(mt.t.arena, str); + } + }, + .string_literal, + .string_literal_utf_16, + .string_literal_utf_8, + .string_literal_utf_32, + .string_literal_wide, + => return ZigTag.string_literal.create(mt.t.arena, try mt.escapeUnprintables()), + .pp_num => return mt.parseCNumLit(), + .l_paren => { + mt.i += 1; + const inner_node = try mt.parseCExpr(scope); + + try mt.expect(.r_paren); + return inner_node; + }, + .macro_param, .macro_param_no_expand => { + const param = mt.macro.params[mt.tokens[mt.i].end]; + mt.i += 1; + + const mangled_name = scope.getAlias(param) orelse param; + return try ZigTag.identifier.create(mt.t.arena, mangled_name); + }, + .identifier, .extended_identifier => { + const slice = mt.tokSlice(); + mt.i += 1; + + const mangled_name = scope.getAlias(slice) orelse slice; + if (Translator.builtin_typedef_map.get(mangled_name)) |ty| { + return ZigTag.type.create(mt.t.arena, ty); + } + if (builtins.map.get(mangled_name)) |builtin| { + const builtin_identifier = try ZigTag.identifier.create(mt.t.arena, "__builtin"); + return ZigTag.field_access.create(mt.t.arena, .{ + .lhs = builtin_identifier, + .field_name = builtin.name, + }); + } + + const identifier = try ZigTag.identifier.create(mt.t.arena, mangled_name); + scope.skipVariableDiscard(mangled_name); + refs_var: { + const ident_node = mt.t.global_scope.sym_table.get(slice) orelse break :refs_var; + const var_decl_node = ident_node.castTag(.var_decl) orelse break :refs_var; + if (!var_decl_node.data.is_const) mt.refs_var_decl = true; + } + return identifier; + }, + else => {}, + } + + // for handling type macros (EVIL) + // TODO maybe detect and treat type macros as typedefs in parseCSpecifierQualifierList? + if (try mt.parseCTypeName(scope, true)) |type_name| { + return type_name; + } + + try mt.fail("unable to translate C expr: unexpected token '{s}'", .{tok.symbol()}); + return error.ParseError; +} + +fn macroIntFromBool(mt: *MacroTranslator, node: ZigNode) !ZigNode { + if (!node.isBoolRes()) return node; + + return ZigTag.int_from_bool.create(mt.t.arena, node); +} + +fn macroIntToBool(mt: *MacroTranslator, node: ZigNode) !ZigNode { + if (node.isBoolRes()) return node; + + if (node.tag() == .string_literal) { + // @intFromPtr(node) != 0 + const int_from_ptr = try ZigTag.int_from_ptr.create(mt.t.arena, node); + return ZigTag.not_equal.create(mt.t.arena, .{ .lhs = int_from_ptr, .rhs = ZigTag.zero_literal.init() }); + } + // node != 0 + return ZigTag.not_equal.create(mt.t.arena, .{ .lhs = node, .rhs = ZigTag.zero_literal.init() }); +} + +fn parseCCondExpr(mt: *MacroTranslator, scope: *Scope) ParseError!ZigNode { + const node = try mt.parseCOrExpr(scope); + if (!mt.eat(.question_mark)) return node; + + const then_body = try mt.parseCOrExpr(scope); + try mt.expect(.colon); + const else_body = try mt.parseCCondExpr(scope); + return ZigTag.@"if".create(mt.t.arena, .{ .cond = node, .then = then_body, .@"else" = else_body }); +} + +fn parseCOrExpr(mt: *MacroTranslator, scope: *Scope) ParseError!ZigNode { + var node = try mt.parseCAndExpr(scope); + while (mt.eat(.pipe_pipe)) { + const lhs = try mt.macroIntToBool(node); + const rhs = try mt.macroIntToBool(try mt.parseCAndExpr(scope)); + node = try ZigTag.@"or".create(mt.t.arena, .{ .lhs = lhs, .rhs = rhs }); + } + return node; +} + +fn parseCAndExpr(mt: *MacroTranslator, scope: *Scope) ParseError!ZigNode { + var node = try mt.parseCBitOrExpr(scope); + while (mt.eat(.ampersand_ampersand)) { + const lhs = try mt.macroIntToBool(node); + const rhs = try mt.macroIntToBool(try mt.parseCBitOrExpr(scope)); + node = try ZigTag.@"and".create(mt.t.arena, .{ .lhs = lhs, .rhs = rhs }); + } + return node; +} + +fn parseCBitOrExpr(mt: *MacroTranslator, scope: *Scope) ParseError!ZigNode { + var node = try mt.parseCBitXorExpr(scope); + while (mt.eat(.pipe)) { + const lhs = try mt.macroIntFromBool(node); + const rhs = try mt.macroIntFromBool(try mt.parseCBitXorExpr(scope)); + node = try ZigTag.bit_or.create(mt.t.arena, .{ .lhs = lhs, .rhs = rhs }); + } + return node; +} + +fn parseCBitXorExpr(mt: *MacroTranslator, scope: *Scope) ParseError!ZigNode { + var node = try mt.parseCBitAndExpr(scope); + while (mt.eat(.caret)) { + const lhs = try mt.macroIntFromBool(node); + const rhs = try mt.macroIntFromBool(try mt.parseCBitAndExpr(scope)); + node = try ZigTag.bit_xor.create(mt.t.arena, .{ .lhs = lhs, .rhs = rhs }); + } + return node; +} + +fn parseCBitAndExpr(mt: *MacroTranslator, scope: *Scope) ParseError!ZigNode { + var node = try mt.parseCEqExpr(scope); + while (mt.eat(.ampersand)) { + const lhs = try mt.macroIntFromBool(node); + const rhs = try mt.macroIntFromBool(try mt.parseCEqExpr(scope)); + node = try ZigTag.bit_and.create(mt.t.arena, .{ .lhs = lhs, .rhs = rhs }); + } + return node; +} + +fn parseCEqExpr(mt: *MacroTranslator, scope: *Scope) ParseError!ZigNode { + var node = try mt.parseCRelExpr(scope); + while (true) { + switch (mt.peek()) { + .bang_equal => { + mt.i += 1; + const lhs = try mt.macroIntFromBool(node); + const rhs = try mt.macroIntFromBool(try mt.parseCRelExpr(scope)); + node = try ZigTag.not_equal.create(mt.t.arena, .{ .lhs = lhs, .rhs = rhs }); + }, + .equal_equal => { + mt.i += 1; + const lhs = try mt.macroIntFromBool(node); + const rhs = try mt.macroIntFromBool(try mt.parseCRelExpr(scope)); + node = try ZigTag.equal.create(mt.t.arena, .{ .lhs = lhs, .rhs = rhs }); + }, + else => return node, + } + } +} + +fn parseCRelExpr(mt: *MacroTranslator, scope: *Scope) ParseError!ZigNode { + var node = try mt.parseCShiftExpr(scope); + while (true) { + switch (mt.peek()) { + .angle_bracket_right => { + mt.i += 1; + const lhs = try mt.macroIntFromBool(node); + const rhs = try mt.macroIntFromBool(try mt.parseCShiftExpr(scope)); + node = try ZigTag.greater_than.create(mt.t.arena, .{ .lhs = lhs, .rhs = rhs }); + }, + .angle_bracket_right_equal => { + mt.i += 1; + const lhs = try mt.macroIntFromBool(node); + const rhs = try mt.macroIntFromBool(try mt.parseCShiftExpr(scope)); + node = try ZigTag.greater_than_equal.create(mt.t.arena, .{ .lhs = lhs, .rhs = rhs }); + }, + .angle_bracket_left => { + mt.i += 1; + const lhs = try mt.macroIntFromBool(node); + const rhs = try mt.macroIntFromBool(try mt.parseCShiftExpr(scope)); + node = try ZigTag.less_than.create(mt.t.arena, .{ .lhs = lhs, .rhs = rhs }); + }, + .angle_bracket_left_equal => { + mt.i += 1; + const lhs = try mt.macroIntFromBool(node); + const rhs = try mt.macroIntFromBool(try mt.parseCShiftExpr(scope)); + node = try ZigTag.less_than_equal.create(mt.t.arena, .{ .lhs = lhs, .rhs = rhs }); + }, + else => return node, + } + } +} + +fn parseCShiftExpr(mt: *MacroTranslator, scope: *Scope) ParseError!ZigNode { + var node = try mt.parseCAddSubExpr(scope); + while (true) { + switch (mt.peek()) { + .angle_bracket_angle_bracket_left => { + mt.i += 1; + const lhs = try mt.macroIntFromBool(node); + const rhs = try mt.macroIntFromBool(try mt.parseCAddSubExpr(scope)); + node = try ZigTag.shl.create(mt.t.arena, .{ .lhs = lhs, .rhs = rhs }); + }, + .angle_bracket_angle_bracket_right => { + mt.i += 1; + const lhs = try mt.macroIntFromBool(node); + const rhs = try mt.macroIntFromBool(try mt.parseCAddSubExpr(scope)); + node = try ZigTag.shr.create(mt.t.arena, .{ .lhs = lhs, .rhs = rhs }); + }, + else => return node, + } + } +} + +fn parseCAddSubExpr(mt: *MacroTranslator, scope: *Scope) ParseError!ZigNode { + var node = try mt.parseCMulExpr(scope); + while (true) { + switch (mt.peek()) { + .plus => { + mt.i += 1; + const lhs = try mt.macroIntFromBool(node); + const rhs = try mt.macroIntFromBool(try mt.parseCMulExpr(scope)); + node = try ZigTag.add.create(mt.t.arena, .{ .lhs = lhs, .rhs = rhs }); + }, + .minus => { + mt.i += 1; + const lhs = try mt.macroIntFromBool(node); + const rhs = try mt.macroIntFromBool(try mt.parseCMulExpr(scope)); + node = try ZigTag.sub.create(mt.t.arena, .{ .lhs = lhs, .rhs = rhs }); + }, + else => return node, + } + } +} + +fn parseCMulExpr(mt: *MacroTranslator, scope: *Scope) ParseError!ZigNode { + var node = try mt.parseCCastExpr(scope); + while (true) { + switch (mt.peek()) { + .asterisk => { + mt.i += 1; + const lhs = try mt.macroIntFromBool(node); + const rhs = try mt.macroIntFromBool(try mt.parseCCastExpr(scope)); + node = try ZigTag.mul.create(mt.t.arena, .{ .lhs = lhs, .rhs = rhs }); + }, + .slash => { + mt.i += 1; + const lhs = try mt.macroIntFromBool(node); + const rhs = try mt.macroIntFromBool(try mt.parseCCastExpr(scope)); + node = try mt.t.createHelperCallNode(.div, &.{ lhs, rhs }); + }, + .percent => { + mt.i += 1; + const lhs = try mt.macroIntFromBool(node); + const rhs = try mt.macroIntFromBool(try mt.parseCCastExpr(scope)); + node = try mt.t.createHelperCallNode(.rem, &.{ lhs, rhs }); + }, + else => return node, + } + } +} + +fn parseCCastExpr(mt: *MacroTranslator, scope: *Scope) ParseError!ZigNode { + if (mt.eat(.l_paren)) { + if (try mt.parseCTypeName(scope, true)) |type_name| { + while (true) { + const next_tok = mt.peek(); + if (next_tok == .r_paren) { + mt.i += 1; + break; + } + // Skip trailing blank defined before the RParen. + if ((next_tok == .identifier or next_tok == .extended_identifier) and + mt.t.global_scope.blank_macros.contains(mt.tokSlice())) + { + mt.i += 1; + continue; + } + + try mt.fail( + "unable to translate C expr: expected ')' instead got '{s}'", + .{next_tok.symbol()}, + ); + return error.ParseError; + } + if (mt.peek() == .l_brace) { + // initializer list + return mt.parseCPostfixExpr(scope, type_name); + } + const node_to_cast = try mt.parseCCastExpr(scope); + return mt.t.createHelperCallNode(.cast, &.{ type_name, node_to_cast }); + } + mt.i -= 1; // l_paren + } + return mt.parseCUnaryExpr(scope); +} + +// allow_fail is set when unsure if we are parsing a type-name +fn parseCTypeName(mt: *MacroTranslator, scope: *Scope, allow_fail: bool) ParseError!?ZigNode { + if (try mt.parseCSpecifierQualifierList(scope, allow_fail)) |node| { + return try mt.parseCAbstractDeclarator(node); + } + return null; +} + +fn parseCSpecifierQualifierList(mt: *MacroTranslator, scope: *Scope, allow_fail: bool) ParseError!?ZigNode { + const tok = mt.peek(); + switch (tok) { + .macro_param, .macro_param_no_expand => { + const param = mt.macro.params[mt.tokens[mt.i].end]; + + // Assume that this is only a cast if the next token is ')' + // e.g. param)identifier + if (allow_fail and (mt.macro.tokens.len < mt.i + 3 or + mt.macro.tokens[mt.i + 1].id != .r_paren or + mt.macro.tokens[mt.i + 2].id != .identifier)) + return null; + + mt.i += 1; + const mangled_name = scope.getAlias(param) orelse param; + return try ZigTag.identifier.create(mt.t.arena, mangled_name); + }, + .identifier, .extended_identifier => { + const slice = mt.tokSlice(); + const mangled_name = scope.getAlias(slice) orelse slice; + + if (mt.t.global_scope.blank_macros.contains(slice)) { + mt.i += 1; + return try mt.parseCSpecifierQualifierList(scope, allow_fail); + } + + if (!allow_fail or mt.t.typedefs.contains(mangled_name)) { + mt.i += 1; + if (Translator.builtin_typedef_map.get(mangled_name)) |ty| { + return try ZigTag.type.create(mt.t.arena, ty); + } + if (builtins.map.get(mangled_name)) |builtin| { + const builtin_identifier = try ZigTag.identifier.create(mt.t.arena, "__builtin"); + return try ZigTag.field_access.create(mt.t.arena, .{ + .lhs = builtin_identifier, + .field_name = builtin.name, + }); + } + + return try ZigTag.identifier.create(mt.t.arena, mangled_name); + } + }, + .keyword_void => { + mt.i += 1; + return try ZigTag.type.create(mt.t.arena, "anyopaque"); + }, + .keyword_bool => { + mt.i += 1; + return try ZigTag.type.create(mt.t.arena, "bool"); + }, + .keyword_char, + .keyword_int, + .keyword_short, + .keyword_long, + .keyword_float, + .keyword_double, + .keyword_signed, + .keyword_unsigned, + .keyword_complex, + => return try mt.parseCNumericType(), + .keyword_enum, .keyword_struct, .keyword_union => { + const tag_name = mt.tokSlice(); + mt.i += 1; + + // struct Foo will be declared as struct_Foo by transRecordDecl + const identifier = mt.tokSlice(); + try mt.expect(.identifier); + + const name = try std.fmt.allocPrint(mt.t.arena, "{s}_{s}", .{ tag_name, identifier }); + return try ZigTag.identifier.create(mt.t.arena, name); + }, + else => {}, + } + + if (allow_fail) return null; + + try mt.fail("unable to translate C expr: unexpected token '{s}'", .{tok.symbol()}); + return error.ParseError; +} + +fn parseCNumericType(mt: *MacroTranslator) ParseError!ZigNode { + const KwCounter = struct { + double: u8 = 0, + long: u8 = 0, + int: u8 = 0, + float: u8 = 0, + short: u8 = 0, + char: u8 = 0, + unsigned: u8 = 0, + signed: u8 = 0, + complex: u8 = 0, + + fn eql(self: @This(), other: @This()) bool { + return std.meta.eql(self, other); + } + }; + + // Yes, these can be in *any* order + // This still doesn't cover cases where for example volatile is intermixed + + var kw = KwCounter{}; + // prevent overflow + var i: u8 = 0; + while (i < math.maxInt(u8)) : (i += 1) { + switch (mt.peek()) { + .keyword_double => kw.double += 1, + .keyword_long => kw.long += 1, + .keyword_int => kw.int += 1, + .keyword_float => kw.float += 1, + .keyword_short => kw.short += 1, + .keyword_char => kw.char += 1, + .keyword_unsigned => kw.unsigned += 1, + .keyword_signed => kw.signed += 1, + .keyword_complex => kw.complex += 1, + else => break, + } + mt.i += 1; + } + + if (kw.eql(.{ .int = 1 }) or kw.eql(.{ .signed = 1 }) or kw.eql(.{ .signed = 1, .int = 1 })) + return ZigTag.type.create(mt.t.arena, "c_int"); + + if (kw.eql(.{ .unsigned = 1 }) or kw.eql(.{ .unsigned = 1, .int = 1 })) + return ZigTag.type.create(mt.t.arena, "c_uint"); + + if (kw.eql(.{ .long = 1 }) or kw.eql(.{ .signed = 1, .long = 1 }) or kw.eql(.{ .long = 1, .int = 1 }) or kw.eql(.{ .signed = 1, .long = 1, .int = 1 })) + return ZigTag.type.create(mt.t.arena, "c_long"); + + if (kw.eql(.{ .unsigned = 1, .long = 1 }) or kw.eql(.{ .unsigned = 1, .long = 1, .int = 1 })) + return ZigTag.type.create(mt.t.arena, "c_ulong"); + + if (kw.eql(.{ .long = 2 }) or kw.eql(.{ .signed = 1, .long = 2 }) or kw.eql(.{ .long = 2, .int = 1 }) or kw.eql(.{ .signed = 1, .long = 2, .int = 1 })) + return ZigTag.type.create(mt.t.arena, "c_longlong"); + + if (kw.eql(.{ .unsigned = 1, .long = 2 }) or kw.eql(.{ .unsigned = 1, .long = 2, .int = 1 })) + return ZigTag.type.create(mt.t.arena, "c_ulonglong"); + + if (kw.eql(.{ .signed = 1, .char = 1 })) + return ZigTag.type.create(mt.t.arena, "i8"); + + if (kw.eql(.{ .char = 1 }) or kw.eql(.{ .unsigned = 1, .char = 1 })) + return ZigTag.type.create(mt.t.arena, "u8"); + + if (kw.eql(.{ .short = 1 }) or kw.eql(.{ .signed = 1, .short = 1 }) or kw.eql(.{ .short = 1, .int = 1 }) or kw.eql(.{ .signed = 1, .short = 1, .int = 1 })) + return ZigTag.type.create(mt.t.arena, "c_short"); + + if (kw.eql(.{ .unsigned = 1, .short = 1 }) or kw.eql(.{ .unsigned = 1, .short = 1, .int = 1 })) + return ZigTag.type.create(mt.t.arena, "c_ushort"); + + if (kw.eql(.{ .float = 1 })) + return ZigTag.type.create(mt.t.arena, "f32"); + + if (kw.eql(.{ .double = 1 })) + return ZigTag.type.create(mt.t.arena, "f64"); + + if (kw.eql(.{ .long = 1, .double = 1 })) { + try mt.fail("unable to translate: TODO long double", .{}); + return error.ParseError; + } + + if (kw.eql(.{ .float = 1, .complex = 1 })) { + try mt.fail("unable to translate: TODO _Complex", .{}); + return error.ParseError; + } + + if (kw.eql(.{ .double = 1, .complex = 1 })) { + try mt.fail("unable to translate: TODO _Complex", .{}); + return error.ParseError; + } + + if (kw.eql(.{ .long = 1, .double = 1, .complex = 1 })) { + try mt.fail("unable to translate: TODO _Complex", .{}); + return error.ParseError; + } + + try mt.fail("unable to translate: invalid numeric type", .{}); + return error.ParseError; +} + +fn parseCAbstractDeclarator(mt: *MacroTranslator, node: ZigNode) ParseError!ZigNode { + if (mt.eat(.asterisk)) { + if (node.castTag(.type)) |some| { + if (std.mem.eql(u8, some.data, "anyopaque")) { + const ptr = try ZigTag.single_pointer.create(mt.t.arena, .{ + .is_const = false, + .is_volatile = false, + .is_allowzero = false, + .elem_type = node, + }); + return ZigTag.optional_type.create(mt.t.arena, ptr); + } + } + return ZigTag.c_pointer.create(mt.t.arena, .{ + .is_const = false, + .is_volatile = false, + .is_allowzero = false, + .elem_type = node, + }); + } + return node; +} + +fn parseCPostfixExpr(mt: *MacroTranslator, scope: *Scope, type_name: ?ZigNode) ParseError!ZigNode { + var node = try mt.parseCPostfixExprInner(scope, type_name); + // In C the preprocessor would handle concatting strings while expanding macros. + // This should do approximately the same by concatting any strings and identifiers + // after a primary or postfix expression. + while (true) { + switch (mt.peek()) { + .string_literal, + .string_literal_utf_16, + .string_literal_utf_8, + .string_literal_utf_32, + .string_literal_wide, + => {}, + .identifier, .extended_identifier => { + if (mt.t.global_scope.blank_macros.contains(mt.tokSlice())) { + mt.i += 1; + continue; + } + }, + else => break, + } + const rhs = try mt.parseCPostfixExprInner(scope, type_name); + node = try ZigTag.array_cat.create(mt.t.arena, .{ .lhs = node, .rhs = rhs }); + } + return node; +} + +fn parseCPostfixExprInner(mt: *MacroTranslator, scope: *Scope, type_name: ?ZigNode) ParseError!ZigNode { + var node = type_name orelse try mt.parseCPrimaryExpr(scope); + while (true) { + switch (mt.peek()) { + .period => { + mt.i += 1; + const field_name = mt.tokSlice(); + try mt.expect(.identifier); + + node = try ZigTag.field_access.create(mt.t.arena, .{ .lhs = node, .field_name = field_name }); + }, + .arrow => { + mt.i += 1; + const field_name = mt.tokSlice(); + try mt.expect(.identifier); + + const deref = try ZigTag.deref.create(mt.t.arena, node); + node = try ZigTag.field_access.create(mt.t.arena, .{ .lhs = deref, .field_name = field_name }); + }, + .l_bracket => { + mt.i += 1; + + const index_val = try mt.macroIntFromBool(try mt.parseCExpr(scope)); + const index = try ZigTag.as.create(mt.t.arena, .{ + .lhs = try ZigTag.type.create(mt.t.arena, "usize"), + .rhs = try ZigTag.int_cast.create(mt.t.arena, index_val), + }); + node = try ZigTag.array_access.create(mt.t.arena, .{ .lhs = node, .rhs = index }); + try mt.expect(.r_bracket); + }, + .l_paren => { + mt.i += 1; + + if (mt.eat(.r_paren)) { + node = try ZigTag.call.create(mt.t.arena, .{ .lhs = node, .args = &.{} }); + } else { + var args = std.array_list.Managed(ZigNode).init(mt.t.gpa); + defer args.deinit(); + + while (true) { + const arg = try mt.parseCCondExpr(scope); + try args.append(arg); + + const next_id = mt.peek(); + switch (next_id) { + .comma => { + mt.i += 1; + }, + .r_paren => { + mt.i += 1; + break; + }, + else => { + try mt.fail("unable to translate C expr: expected ',' or ')' instead got '{s}'", .{next_id.symbol()}); + return error.ParseError; + }, + } + } + node = try ZigTag.call.create(mt.t.arena, .{ .lhs = node, .args = try mt.t.arena.dupe(ZigNode, args.items) }); + } + }, + .l_brace => { + mt.i += 1; + + // Check for designated field initializers + if (mt.peek() == .period) { + var init_vals = std.array_list.Managed(ast.Payload.ContainerInitDot.Initializer).init(mt.t.gpa); + defer init_vals.deinit(); + + while (true) { + try mt.expect(.period); + const name = mt.tokSlice(); + try mt.expect(.identifier); + try mt.expect(.equal); + + const val = try mt.parseCCondExpr(scope); + try init_vals.append(.{ .name = name, .value = val }); + + const next_id = mt.peek(); + switch (next_id) { + .comma => { + mt.i += 1; + }, + .r_brace => { + mt.i += 1; + break; + }, + else => { + try mt.fail("unable to translate C expr: expected ',' or '}}' instead got '{s}'", .{next_id.symbol()}); + return error.ParseError; + }, + } + } + const tuple_node = try ZigTag.container_init_dot.create(mt.t.arena, try mt.t.arena.dupe(ast.Payload.ContainerInitDot.Initializer, init_vals.items)); + node = try ZigTag.std_mem_zeroinit.create(mt.t.arena, .{ .lhs = node, .rhs = tuple_node }); + continue; + } + + var init_vals = std.array_list.Managed(ZigNode).init(mt.t.gpa); + defer init_vals.deinit(); + + while (true) { + const val = try mt.parseCCondExpr(scope); + try init_vals.append(val); + + const next_id = mt.peek(); + switch (next_id) { + .comma => { + mt.i += 1; + }, + .r_brace => { + mt.i += 1; + break; + }, + else => { + try mt.fail("unable to translate C expr: expected ',' or '}}' instead got '{s}'", .{next_id.symbol()}); + return error.ParseError; + }, + } + } + const tuple_node = try ZigTag.tuple.create(mt.t.arena, try mt.t.arena.dupe(ZigNode, init_vals.items)); + node = try ZigTag.std_mem_zeroinit.create(mt.t.arena, .{ .lhs = node, .rhs = tuple_node }); + }, + .plus_plus, .minus_minus => { + try mt.fail("TODO postfix inc/dec expr", .{}); + return error.ParseError; + }, + else => return node, + } + } +} + +fn parseCUnaryExpr(mt: *MacroTranslator, scope: *Scope) ParseError!ZigNode { + switch (mt.peek()) { + .bang => { + mt.i += 1; + const operand = try mt.macroIntToBool(try mt.parseCCastExpr(scope)); + return ZigTag.not.create(mt.t.arena, operand); + }, + .minus => { + mt.i += 1; + const operand = try mt.macroIntFromBool(try mt.parseCCastExpr(scope)); + return ZigTag.negate.create(mt.t.arena, operand); + }, + .plus => { + mt.i += 1; + return try mt.parseCCastExpr(scope); + }, + .tilde => { + mt.i += 1; + const operand = try mt.macroIntFromBool(try mt.parseCCastExpr(scope)); + return ZigTag.bit_not.create(mt.t.arena, operand); + }, + .asterisk => { + mt.i += 1; + const operand = try mt.parseCCastExpr(scope); + return ZigTag.deref.create(mt.t.arena, operand); + }, + .ampersand => { + mt.i += 1; + const operand = try mt.parseCCastExpr(scope); + return ZigTag.address_of.create(mt.t.arena, operand); + }, + .keyword_sizeof => { + mt.i += 1; + const operand = if (mt.eat(.l_paren)) blk: { + const inner = (try mt.parseCTypeName(scope, false)).?; + try mt.expect(.r_paren); + break :blk inner; + } else try mt.parseCUnaryExpr(scope); + + return mt.t.createHelperCallNode(.sizeof, &.{operand}); + }, + .keyword_alignof => { + mt.i += 1; + // TODO this won't work if using 's + // #define alignof _Alignof + try mt.expect(.l_paren); + const operand = (try mt.parseCTypeName(scope, false)).?; + try mt.expect(.r_paren); + + return ZigTag.alignof.create(mt.t.arena, operand); + }, + .plus_plus, .minus_minus => { + try mt.fail("TODO unary inc/dec expr", .{}); + return error.ParseError; + }, + else => {}, + } + + return try mt.parseCPostfixExpr(scope, null); +} diff --git a/lib/compiler/translate-c/PatternList.zig b/lib/compiler/translate-c/PatternList.zig new file mode 100644 index 000000000000..d1adf7d77433 --- /dev/null +++ b/lib/compiler/translate-c/PatternList.zig @@ -0,0 +1,288 @@ +const std = @import("std"); +const mem = std.mem; +const assert = std.debug.assert; + +const aro = @import("aro"); +const CToken = aro.Tokenizer.Token; + +const helpers = @import("helpers.zig"); +const Translator = @import("Translator.zig"); +const Error = Translator.Error; +pub const MacroProcessingError = Error || error{UnexpectedMacroToken}; + +const Impl = std.meta.DeclEnum(std.zig.c_translation.helpers); +const Template = struct { []const u8, Impl }; + +/// Templates must be function-like macros +/// first element is macro source, second element is the name of the function +/// in __helpers which implements it +const templates = [_]Template{ + .{ "f_SUFFIX(X) (X ## f)", .F_SUFFIX }, + .{ "F_SUFFIX(X) (X ## F)", .F_SUFFIX }, + + .{ "u_SUFFIX(X) (X ## u)", .U_SUFFIX }, + .{ "U_SUFFIX(X) (X ## U)", .U_SUFFIX }, + + .{ "l_SUFFIX(X) (X ## l)", .L_SUFFIX }, + .{ "L_SUFFIX(X) (X ## L)", .L_SUFFIX }, + + .{ "ul_SUFFIX(X) (X ## ul)", .UL_SUFFIX }, + .{ "uL_SUFFIX(X) (X ## uL)", .UL_SUFFIX }, + .{ "Ul_SUFFIX(X) (X ## Ul)", .UL_SUFFIX }, + .{ "UL_SUFFIX(X) (X ## UL)", .UL_SUFFIX }, + + .{ "ll_SUFFIX(X) (X ## ll)", .LL_SUFFIX }, + .{ "LL_SUFFIX(X) (X ## LL)", .LL_SUFFIX }, + + .{ "ull_SUFFIX(X) (X ## ull)", .ULL_SUFFIX }, + .{ "uLL_SUFFIX(X) (X ## uLL)", .ULL_SUFFIX }, + .{ "Ull_SUFFIX(X) (X ## Ull)", .ULL_SUFFIX }, + .{ "ULL_SUFFIX(X) (X ## ULL)", .ULL_SUFFIX }, + + .{ "f_SUFFIX(X) X ## f", .F_SUFFIX }, + .{ "F_SUFFIX(X) X ## F", .F_SUFFIX }, + + .{ "u_SUFFIX(X) X ## u", .U_SUFFIX }, + .{ "U_SUFFIX(X) X ## U", .U_SUFFIX }, + + .{ "l_SUFFIX(X) X ## l", .L_SUFFIX }, + .{ "L_SUFFIX(X) X ## L", .L_SUFFIX }, + + .{ "ul_SUFFIX(X) X ## ul", .UL_SUFFIX }, + .{ "uL_SUFFIX(X) X ## uL", .UL_SUFFIX }, + .{ "Ul_SUFFIX(X) X ## Ul", .UL_SUFFIX }, + .{ "UL_SUFFIX(X) X ## UL", .UL_SUFFIX }, + + .{ "ll_SUFFIX(X) X ## ll", .LL_SUFFIX }, + .{ "LL_SUFFIX(X) X ## LL", .LL_SUFFIX }, + + .{ "ull_SUFFIX(X) X ## ull", .ULL_SUFFIX }, + .{ "uLL_SUFFIX(X) X ## uLL", .ULL_SUFFIX }, + .{ "Ull_SUFFIX(X) X ## Ull", .ULL_SUFFIX }, + .{ "ULL_SUFFIX(X) X ## ULL", .ULL_SUFFIX }, + + .{ "CAST_OR_CALL(X, Y) (X)(Y)", .CAST_OR_CALL }, + .{ "CAST_OR_CALL(X, Y) ((X)(Y))", .CAST_OR_CALL }, + + .{ + \\wl_container_of(ptr, sample, member) \ + \\(__typeof__(sample))((char *)(ptr) - \ + \\ offsetof(__typeof__(*sample), member)) + , + .WL_CONTAINER_OF, + }, + + .{ "IGNORE_ME(X) ((void)(X))", .DISCARD }, + .{ "IGNORE_ME(X) (void)(X)", .DISCARD }, + .{ "IGNORE_ME(X) ((const void)(X))", .DISCARD }, + .{ "IGNORE_ME(X) (const void)(X)", .DISCARD }, + .{ "IGNORE_ME(X) ((volatile void)(X))", .DISCARD }, + .{ "IGNORE_ME(X) (volatile void)(X)", .DISCARD }, + .{ "IGNORE_ME(X) ((const volatile void)(X))", .DISCARD }, + .{ "IGNORE_ME(X) (const volatile void)(X)", .DISCARD }, + .{ "IGNORE_ME(X) ((volatile const void)(X))", .DISCARD }, + .{ "IGNORE_ME(X) (volatile const void)(X)", .DISCARD }, +}; + +const Pattern = struct { + slicer: MacroSlicer, + impl: Impl, + + fn init(pl: *Pattern, allocator: mem.Allocator, template: Template) Error!void { + const source = template[0]; + const impl = template[1]; + var tok_list = std.array_list.Managed(CToken).init(allocator); + defer tok_list.deinit(); + + pl.* = .{ + .slicer = try tokenizeMacro(source, &tok_list), + .impl = impl, + }; + } + + fn deinit(pl: *Pattern, allocator: mem.Allocator) void { + allocator.free(pl.slicer.tokens); + pl.* = undefined; + } + + /// This function assumes that `ms` has already been validated to contain a function-like + /// macro, and that the parsed template macro in `pl` also contains a function-like + /// macro. Please review this logic carefully if changing that assumption. Two + /// function-like macros are considered equivalent if and only if they contain the same + /// list of tokens, modulo parameter names. + fn matches(pat: Pattern, ms: MacroSlicer) bool { + if (ms.params != pat.slicer.params) return false; + if (ms.tokens.len != pat.slicer.tokens.len) return false; + + for (ms.tokens, pat.slicer.tokens) |macro_tok, pat_tok| { + if (macro_tok.id != pat_tok.id) return false; + switch (macro_tok.id) { + .macro_param, .macro_param_no_expand => { + // `.end` is the parameter index. + if (macro_tok.end != pat_tok.end) return false; + }, + .identifier, .extended_identifier, .string_literal, .char_literal, .pp_num => { + const macro_bytes = ms.slice(macro_tok); + const pattern_bytes = pat.slicer.slice(pat_tok); + + if (!mem.eql(u8, pattern_bytes, macro_bytes)) return false; + }, + else => { + // other tags correspond to keywords and operators that do not contain a "payload" + // that can vary + }, + } + } + return true; + } +}; + +const PatternList = @This(); + +patterns: []Pattern, + +pub const MacroSlicer = struct { + source: []const u8, + tokens: []const CToken, + params: u32, + + fn slice(pl: MacroSlicer, token: CToken) []const u8 { + return pl.source[token.start..token.end]; + } +}; + +pub fn init(allocator: mem.Allocator) Error!PatternList { + const patterns = try allocator.alloc(Pattern, templates.len); + for (patterns, templates) |*pattern, template| { + try pattern.init(allocator, template); + } + return .{ .patterns = patterns }; +} + +pub fn deinit(pl: *PatternList, allocator: mem.Allocator) void { + for (pl.patterns) |*pattern| pattern.deinit(allocator); + allocator.free(pl.patterns); + pl.* = undefined; +} + +pub fn match(pl: PatternList, ms: MacroSlicer) Error!?Impl { + for (pl.patterns) |pattern| if (pattern.matches(ms)) return pattern.impl; + return null; +} + +fn tokenizeMacro(source: []const u8, tok_list: *std.array_list.Managed(CToken)) Error!MacroSlicer { + var param_count: u32 = 0; + var param_buf: [8][]const u8 = undefined; + + var tokenizer: aro.Tokenizer = .{ + .buf = source, + .source = .unused, + .langopts = .{}, + }; + { + const name_tok = tokenizer.nextNoWS(); + assert(name_tok.id == .identifier); + const l_paren = tokenizer.nextNoWS(); + assert(l_paren.id == .l_paren); + } + + while (true) { + const param = tokenizer.nextNoWS(); + if (param.id == .r_paren) break; + assert(param.id == .identifier); + const slice = source[param.start..param.end]; + param_buf[param_count] = slice; + param_count += 1; + + const comma = tokenizer.nextNoWS(); + if (comma.id == .r_paren) break; + assert(comma.id == .comma); + } + + outer: while (true) { + const tok = tokenizer.next(); + switch (tok.id) { + .whitespace, .comment => continue, + .identifier => { + const slice = source[tok.start..tok.end]; + for (param_buf[0..param_count], 0..) |param, i| { + if (std.mem.eql(u8, param, slice)) { + try tok_list.append(.{ + .id = .macro_param, + .source = .unused, + .end = @intCast(i), + }); + continue :outer; + } + } + }, + .hash_hash => { + if (tok_list.items[tok_list.items.len - 1].id == .macro_param) { + tok_list.items[tok_list.items.len - 1].id = .macro_param_no_expand; + } + }, + .nl, .eof => break, + else => {}, + } + try tok_list.append(tok); + } + + return .{ + .source = source, + .tokens = try tok_list.toOwnedSlice(), + .params = param_count, + }; +} + +test "Macro matching" { + const testing = std.testing; + const helper = struct { + fn checkMacro( + allocator: mem.Allocator, + pattern_list: PatternList, + source: []const u8, + comptime expected_match: ?Impl, + ) !void { + var tok_list = std.array_list.Managed(CToken).init(allocator); + defer tok_list.deinit(); + const ms = try tokenizeMacro(source, &tok_list); + defer allocator.free(ms.tokens); + + const matched = try pattern_list.match(ms); + if (expected_match) |expected| { + try testing.expectEqual(expected, matched); + } else { + try testing.expectEqual(@as(@TypeOf(matched), null), matched); + } + } + }; + const allocator = std.testing.allocator; + var pattern_list = try PatternList.init(allocator); + defer pattern_list.deinit(allocator); + + try helper.checkMacro(allocator, pattern_list, "BAR(Z) (Z ## F)", .F_SUFFIX); + try helper.checkMacro(allocator, pattern_list, "BAR(Z) (Z ## U)", .U_SUFFIX); + try helper.checkMacro(allocator, pattern_list, "BAR(Z) (Z ## L)", .L_SUFFIX); + try helper.checkMacro(allocator, pattern_list, "BAR(Z) (Z ## LL)", .LL_SUFFIX); + try helper.checkMacro(allocator, pattern_list, "BAR(Z) (Z ## UL)", .UL_SUFFIX); + try helper.checkMacro(allocator, pattern_list, "BAR(Z) (Z ## ULL)", .ULL_SUFFIX); + try helper.checkMacro(allocator, pattern_list, + \\container_of(a, b, c) \ + \\(__typeof__(b))((char *)(a) - \ + \\ offsetof(__typeof__(*b), c)) + , .WL_CONTAINER_OF); + + try helper.checkMacro(allocator, pattern_list, "NO_MATCH(X, Y) (X + Y)", null); + try helper.checkMacro(allocator, pattern_list, "CAST_OR_CALL(X, Y) (X)(Y)", .CAST_OR_CALL); + try helper.checkMacro(allocator, pattern_list, "CAST_OR_CALL(X, Y) ((X)(Y))", .CAST_OR_CALL); + try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) (void)(X)", .DISCARD); + try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) ((void)(X))", .DISCARD); + try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) (const void)(X)", .DISCARD); + try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) ((const void)(X))", .DISCARD); + try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) (volatile void)(X)", .DISCARD); + try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) ((volatile void)(X))", .DISCARD); + try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) (const volatile void)(X)", .DISCARD); + try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) ((const volatile void)(X))", .DISCARD); + try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) (volatile const void)(X)", .DISCARD); + try helper.checkMacro(allocator, pattern_list, "IGNORE_ME(X) ((volatile const void)(X))", .DISCARD); +} diff --git a/lib/compiler/translate-c/Scope.zig b/lib/compiler/translate-c/Scope.zig new file mode 100644 index 000000000000..0317adb7d21f --- /dev/null +++ b/lib/compiler/translate-c/Scope.zig @@ -0,0 +1,399 @@ +const std = @import("std"); + +const aro = @import("aro"); + +const ast = @import("ast.zig"); +const Translator = @import("Translator.zig"); + +const Scope = @This(); + +pub const SymbolTable = std.StringArrayHashMapUnmanaged(ast.Node); +pub const AliasList = std.ArrayListUnmanaged(struct { + alias: []const u8, + name: []const u8, +}); + +/// Associates a container (structure or union) with its relevant member functions. +pub const ContainerMemberFns = struct { + container_decl_ptr: *ast.Node, + member_fns: std.ArrayListUnmanaged(*ast.Payload.Func) = .empty, +}; +pub const ContainerMemberFnsHashMap = std.AutoArrayHashMapUnmanaged(aro.QualType, ContainerMemberFns); + +id: Id, +parent: ?*Scope, + +pub const Id = enum { + block, + root, + condition, + loop, + do_loop, +}; + +/// Used for the scope of condition expressions, for example `if (cond)`. +/// The block is lazily initialized because it is only needed for rare +/// cases of comma operators being used. +pub const Condition = struct { + base: Scope, + block: ?Block = null, + + fn getBlockScope(cond: *Condition, t: *Translator) !*Block { + if (cond.block) |*b| return b; + cond.block = try Block.init(t, &cond.base, true); + return &cond.block.?; + } + + pub fn deinit(cond: *Condition) void { + if (cond.block) |*b| b.deinit(); + } +}; + +/// Represents an in-progress Node.Block. This struct is stack-allocated. +/// When it is deinitialized, it produces an Node.Block which is allocated +/// into the main arena. +pub const Block = struct { + base: Scope, + translator: *Translator, + statements: std.ArrayListUnmanaged(ast.Node), + variables: AliasList, + mangle_count: u32 = 0, + label: ?[]const u8 = null, + + /// By default all variables are discarded, since we do not know in advance if they + /// will be used. This maps the variable's name to the Discard payload, so that if + /// the variable is subsequently referenced we can indicate that the discard should + /// be skipped during the intermediate AST -> Zig AST render step. + variable_discards: std.StringArrayHashMapUnmanaged(*ast.Payload.Discard), + + /// When the block corresponds to a function, keep track of the return type + /// so that the return expression can be cast, if necessary + return_type: ?aro.QualType = null, + + /// C static local variables are wrapped in a block-local struct. The struct + /// is named `mangle(static_local_ + name)` and the Zig variable within the + /// struct keeps the name of the C variable. + pub const static_local_prefix = "static_local"; + + /// C extern local variables are wrapped in a block-local struct. The struct + /// is named `mangle(extern_local + name)` and the Zig variable within the + /// struct keeps the name of the C variable. + pub const extern_local_prefix = "extern_local"; + + pub fn init(t: *Translator, parent: *Scope, labeled: bool) !Block { + var blk: Block = .{ + .base = .{ + .id = .block, + .parent = parent, + }, + .translator = t, + .statements = .empty, + .variables = .empty, + .variable_discards = .empty, + }; + if (labeled) { + blk.label = try blk.makeMangledName("blk"); + } + return blk; + } + + pub fn deinit(block: *Block) void { + block.statements.deinit(block.translator.gpa); + block.variables.deinit(block.translator.gpa); + block.variable_discards.deinit(block.translator.gpa); + block.* = undefined; + } + + pub fn complete(block: *Block) !ast.Node { + const arena = block.translator.arena; + if (block.base.parent.?.id == .do_loop) { + // We reserve 1 extra statement if the parent is a do_loop. This is in case of + // do while, we want to put `if (cond) break;` at the end. + const alloc_len = block.statements.items.len + @intFromBool(block.base.parent.?.id == .do_loop); + var stmts = try arena.alloc(ast.Node, alloc_len); + stmts.len = block.statements.items.len; + @memcpy(stmts[0..block.statements.items.len], block.statements.items); + return ast.Node.Tag.block.create(arena, .{ + .label = block.label, + .stmts = stmts, + }); + } + if (block.statements.items.len == 0) return ast.Node.Tag.empty_block.init(); + return ast.Node.Tag.block.create(arena, .{ + .label = block.label, + .stmts = try arena.dupe(ast.Node, block.statements.items), + }); + } + + /// Given the desired name, return a name that does not shadow anything from outer scopes. + /// Inserts the returned name into the scope. + /// The name will not be visible to callers of getAlias. + pub fn reserveMangledName(block: *Block, name: []const u8) ![]const u8 { + return block.createMangledName(name, true, null); + } + + /// Same as reserveMangledName, but enables the alias immediately. + pub fn makeMangledName(block: *Block, name: []const u8) ![]const u8 { + return block.createMangledName(name, false, null); + } + + pub fn createMangledName(block: *Block, name: []const u8, reservation: bool, prefix_opt: ?[]const u8) ![]const u8 { + const arena = block.translator.arena; + const name_copy = try arena.dupe(u8, name); + const alias_base = if (prefix_opt) |prefix| + try std.fmt.allocPrint(arena, "{s}_{s}", .{ prefix, name }) + else + name; + var proposed_name = alias_base; + while (block.contains(proposed_name)) { + block.mangle_count += 1; + proposed_name = try std.fmt.allocPrint(arena, "{s}_{d}", .{ alias_base, block.mangle_count }); + } + const new_mangle = try block.variables.addOne(block.translator.gpa); + if (reservation) { + new_mangle.* = .{ .name = name_copy, .alias = name_copy }; + } else { + new_mangle.* = .{ .name = name_copy, .alias = proposed_name }; + } + return proposed_name; + } + + fn getAlias(block: *Block, name: []const u8) ?[]const u8 { + for (block.variables.items) |p| { + if (std.mem.eql(u8, p.name, name)) + return p.alias; + } + return block.base.parent.?.getAlias(name); + } + + fn localContains(block: *Block, name: []const u8) bool { + for (block.variables.items) |p| { + if (std.mem.eql(u8, p.alias, name)) + return true; + } + return false; + } + + fn contains(block: *Block, name: []const u8) bool { + if (block.localContains(name)) + return true; + return block.base.parent.?.contains(name); + } + + pub fn discardVariable(block: *Block, name: []const u8) Translator.Error!void { + const gpa = block.translator.gpa; + const arena = block.translator.arena; + const name_node = try ast.Node.Tag.identifier.create(arena, name); + const discard = try ast.Node.Tag.discard.create(arena, .{ .should_skip = false, .value = name_node }); + try block.statements.append(gpa, discard); + try block.variable_discards.putNoClobber(gpa, name, discard.castTag(.discard).?); + } +}; + +pub const Root = struct { + base: Scope, + translator: *Translator, + sym_table: SymbolTable, + blank_macros: std.StringArrayHashMapUnmanaged(void), + nodes: std.ArrayListUnmanaged(ast.Node), + container_member_fns_map: ContainerMemberFnsHashMap, + + pub fn init(t: *Translator) Root { + return .{ + .base = .{ + .id = .root, + .parent = null, + }, + .translator = t, + .sym_table = .empty, + .blank_macros = .empty, + .nodes = .empty, + .container_member_fns_map = .empty, + }; + } + + pub fn deinit(root: *Root) void { + root.sym_table.deinit(root.translator.gpa); + root.blank_macros.deinit(root.translator.gpa); + root.nodes.deinit(root.translator.gpa); + for (root.container_member_fns_map.values()) |*members| { + members.member_fns.deinit(root.translator.gpa); + } + root.container_member_fns_map.deinit(root.translator.gpa); + } + + /// Check if the global scope contains this name, without looking into the "future", e.g. + /// ignore the preprocessed decl and macro names. + pub fn containsNow(root: *Root, name: []const u8) bool { + return root.sym_table.contains(name); + } + + /// Check if the global scope contains the name, includes all decls that haven't been translated yet. + pub fn contains(root: *Root, name: []const u8) bool { + return root.containsNow(name) or root.translator.global_names.contains(name) or root.translator.weak_global_names.contains(name); + } + + pub fn addMemberFunction(root: *Root, func_ty: aro.Type.Func, func: *ast.Payload.Func) !void { + std.debug.assert(func.data.name != null); + if (func_ty.params.len == 0) return; + + const param1_base = func_ty.params[0].qt.base(root.translator.comp); + const container_qt = if (param1_base.type == .pointer) + param1_base.type.pointer.child.base(root.translator.comp).qt + else + param1_base.qt; + + if (root.container_member_fns_map.getPtr(container_qt)) |members| { + try members.member_fns.append(root.translator.gpa, func); + } + } + + pub fn processContainerMemberFns(root: *Root) !void { + const gpa = root.translator.gpa; + const arena = root.translator.arena; + + var member_names: std.StringArrayHashMapUnmanaged(u32) = .empty; + defer member_names.deinit(gpa); + for (root.container_member_fns_map.values()) |members| { + member_names.clearRetainingCapacity(); + const decls_ptr = switch (members.container_decl_ptr.tag()) { + .@"struct", .@"union" => blk_record: { + const payload: *ast.Payload.Container = @alignCast(@fieldParentPtr("base", members.container_decl_ptr.ptr_otherwise)); + // Avoid duplication with field names + for (payload.data.fields) |field| { + try member_names.put(gpa, field.name, 0); + } + break :blk_record &payload.data.decls; + }, + .opaque_literal => blk_opaque: { + const container_decl = try ast.Node.Tag.@"opaque".create(arena, .{ + .layout = .none, + .fields = &.{}, + .decls = &.{}, + }); + members.container_decl_ptr.* = container_decl; + break :blk_opaque &container_decl.castTag(.@"opaque").?.data.decls; + }, + else => return, + }; + + const old_decls = decls_ptr.*; + const new_decls = try arena.alloc(ast.Node, old_decls.len + members.member_fns.items.len); + @memcpy(new_decls[0..old_decls.len], old_decls); + // Assume the allocator of payload.data.decls is arena, + // so don't add arena.free(old_variables). + const func_ref_vars = new_decls[old_decls.len..]; + var count: u32 = 0; + for (members.member_fns.items) |func| { + const func_name = func.data.name.?; + + const last_index = std.mem.lastIndexOf(u8, func_name, "_"); + const last_name = if (last_index) |index| func_name[index + 1 ..] else continue; + var same_count: u32 = 0; + const gop = try member_names.getOrPutValue(gpa, last_name, same_count); + if (gop.found_existing) { + gop.value_ptr.* += 1; + same_count = gop.value_ptr.*; + } + const var_name = if (same_count == 0) + last_name + else + try std.fmt.allocPrint(arena, "{s}{d}", .{ last_name, same_count }); + + func_ref_vars[count] = try ast.Node.Tag.pub_var_simple.create(arena, .{ + .name = var_name, + .init = try ast.Node.Tag.identifier.create(arena, func_name), + }); + count += 1; + } + decls_ptr.* = new_decls[0 .. old_decls.len + count]; + } + } +}; + +pub fn findBlockScope(inner: *Scope, t: *Translator) !*Block { + var scope = inner; + while (true) { + switch (scope.id) { + .root => unreachable, + .block => return @fieldParentPtr("base", scope), + .condition => return @as(*Condition, @fieldParentPtr("base", scope)).getBlockScope(t), + else => scope = scope.parent.?, + } + } +} + +pub fn findBlockReturnType(inner: *Scope) aro.QualType { + var scope = inner; + while (true) { + switch (scope.id) { + .root => unreachable, + .block => { + const block: *Block = @fieldParentPtr("base", scope); + if (block.return_type) |qt| return qt; + scope = scope.parent.?; + }, + else => scope = scope.parent.?, + } + } +} + +pub fn getAlias(scope: *Scope, name: []const u8) ?[]const u8 { + return switch (scope.id) { + .root => null, + .block => @as(*Block, @fieldParentPtr("base", scope)).getAlias(name), + .loop, .do_loop, .condition => scope.parent.?.getAlias(name), + }; +} + +fn contains(scope: *Scope, name: []const u8) bool { + return switch (scope.id) { + .root => @as(*Root, @fieldParentPtr("base", scope)).contains(name), + .block => @as(*Block, @fieldParentPtr("base", scope)).contains(name), + .loop, .do_loop, .condition => scope.parent.?.contains(name), + }; +} + +/// Appends a node to the first block scope if inside a function, or to the root tree if not. +pub fn appendNode(inner: *Scope, node: ast.Node) !void { + var scope = inner; + while (true) { + switch (scope.id) { + .root => { + const root: *Root = @fieldParentPtr("base", scope); + return root.nodes.append(root.translator.gpa, node); + }, + .block => { + const block: *Block = @fieldParentPtr("base", scope); + return block.statements.append(block.translator.gpa, node); + }, + else => scope = scope.parent.?, + } + } +} + +pub fn skipVariableDiscard(inner: *Scope, name: []const u8) void { + if (true) { + // TODO: due to 'local variable is never mutated' errors, we can + // only skip discards if a variable is used as an lvalue, which + // we don't currently have detection for in translate-c. + // Once #17584 is completed, perhaps we can do away with this + // logic entirely, and instead rely on render to fixup code. + return; + } + var scope = inner; + while (true) { + switch (scope.id) { + .root => return, + .block => { + const block: *Block = @fieldParentPtr("base", scope); + if (block.variable_discards.get(name)) |discard| { + discard.data.should_skip = true; + return; + } + }, + else => {}, + } + scope = scope.parent.?; + } +} diff --git a/lib/compiler/translate-c/Translator.zig b/lib/compiler/translate-c/Translator.zig new file mode 100644 index 000000000000..cd42134a88a4 --- /dev/null +++ b/lib/compiler/translate-c/Translator.zig @@ -0,0 +1,4173 @@ +const std = @import("std"); +const mem = std.mem; +const assert = std.debug.assert; +const CallingConvention = std.builtin.CallingConvention; + +const aro = @import("aro"); +const CToken = aro.Tokenizer.Token; +const Tree = aro.Tree; +const Node = Tree.Node; +const TokenIndex = Tree.TokenIndex; +const QualType = aro.QualType; + +const ast = @import("ast.zig"); +const ZigNode = ast.Node; +const ZigTag = ZigNode.Tag; +const builtins = @import("builtins.zig"); +const helpers = @import("helpers.zig"); +const MacroTranslator = @import("MacroTranslator.zig"); +const PatternList = @import("PatternList.zig"); +const Scope = @import("Scope.zig"); + +pub const Error = std.mem.Allocator.Error; +pub const MacroProcessingError = Error || error{UnexpectedMacroToken}; +pub const TypeError = Error || error{UnsupportedType}; +pub const TransError = TypeError || error{UnsupportedTranslation}; + +const Translator = @This(); + +/// The C AST to be translated. +tree: *const Tree, +/// The compilation corresponding to the AST. +comp: *aro.Compilation, +/// The Preprocessor that produced the source for `tree`. +pp: *const aro.Preprocessor, + +gpa: mem.Allocator, +arena: mem.Allocator, + +alias_list: Scope.AliasList, +global_scope: *Scope.Root, +/// Running number used for creating new unique identifiers. +mangle_count: u32 = 0, + +/// Table of declarations for enum, struct, union and typedef types. +type_decls: std.AutoArrayHashMapUnmanaged(Node.Index, []const u8) = .empty, +/// Table of record decls that have been demoted to opaques. +opaque_demotes: std.AutoHashMapUnmanaged(QualType, void) = .empty, +/// Table of unnamed enums and records that are child types of typedefs. +unnamed_typedefs: std.AutoHashMapUnmanaged(QualType, []const u8) = .empty, +/// Table of anonymous record to generated field names. +anonymous_record_field_names: std.AutoHashMapUnmanaged(struct { + parent: QualType, + field: QualType, +}, []const u8) = .empty, + +/// This one is different than the root scope's name table. This contains +/// a list of names that we found by visiting all the top level decls without +/// translating them. The other maps are updated as we translate; this one is updated +/// up front in a pre-processing step. +global_names: std.StringArrayHashMapUnmanaged(void) = .empty, + +/// This is similar to `global_names`, but contains names which we would +/// *like* to use, but do not strictly *have* to if they are unavailable. +/// These are relevant to types, which ideally we would name like +/// 'struct_foo' with an alias 'foo', but if either of those names is taken, +/// may be mangled. +/// This is distinct from `global_names` so we can detect at a type +/// declaration whether or not the name is available. +weak_global_names: std.StringArrayHashMapUnmanaged(void) = .empty, + +/// Set of identifiers known to refer to typedef declarations. +/// Used when parsing macros. +typedefs: std.StringArrayHashMapUnmanaged(void) = .empty, + +/// The lhs lval of a compound assignment expression. +compound_assign_dummy: ?ZigNode = null, + +pub fn getMangle(t: *Translator) u32 { + t.mangle_count += 1; + return t.mangle_count; +} + +/// Convert an `aro.Source.Location` to a 'file:line:column' string. +pub fn locStr(t: *Translator, loc: aro.Source.Location) ![]const u8 { + const source = t.comp.getSource(loc.id); + const line_col = source.lineCol(loc); + const filename = source.path; + + const line = source.physicalLine(loc); + const col = line_col.col; + + return std.fmt.allocPrint(t.arena, "{s}:{d}:{d}", .{ filename, line, col }); +} + +fn maybeSuppressResult(t: *Translator, used: ResultUsed, result: ZigNode) TransError!ZigNode { + if (used == .used) return result; + return ZigTag.discard.create(t.arena, .{ .should_skip = false, .value = result }); +} + +pub fn addTopLevelDecl(t: *Translator, name: []const u8, decl_node: ZigNode) !void { + const gop = try t.global_scope.sym_table.getOrPut(t.gpa, name); + if (!gop.found_existing) { + gop.value_ptr.* = decl_node; + try t.global_scope.nodes.append(t.gpa, decl_node); + } +} + +fn fail( + t: *Translator, + err: anytype, + source_loc: TokenIndex, + comptime format: []const u8, + args: anytype, +) (@TypeOf(err) || error{OutOfMemory}) { + try t.warn(&t.global_scope.base, source_loc, format, args); + return err; +} + +pub fn failDecl( + t: *Translator, + scope: *Scope, + tok_idx: TokenIndex, + name: []const u8, + comptime format: []const u8, + args: anytype, +) Error!void { + const loc = t.tree.tokens.items(.loc)[tok_idx]; + return t.failDeclExtra(scope, loc, name, format, args); +} + +pub fn failDeclExtra( + t: *Translator, + scope: *Scope, + loc: aro.Source.Location, + name: []const u8, + comptime format: []const u8, + args: anytype, +) Error!void { + // location + // pub const name = @compileError(msg); + const fail_msg = try std.fmt.allocPrint(t.arena, format, args); + const fail_decl = try ZigTag.fail_decl.create(t.arena, .{ .actual = name, .mangled = fail_msg }); + + const str = try t.locStr(loc); + const location_comment = try std.fmt.allocPrint(t.arena, "// {s}", .{str}); + const loc_node = try ZigTag.warning.create(t.arena, location_comment); + + if (scope.id == .root) { + try t.addTopLevelDecl(name, fail_decl); + try scope.appendNode(loc_node); + } else { + try scope.appendNode(fail_decl); + try scope.appendNode(loc_node); + + const bs = try scope.findBlockScope(t); + try bs.discardVariable(name); + } +} + +fn warn(t: *Translator, scope: *Scope, tok_idx: TokenIndex, comptime format: []const u8, args: anytype) !void { + const loc = t.tree.tokens.items(.loc)[tok_idx]; + const str = try t.locStr(loc); + const value = try std.fmt.allocPrint(t.arena, "// {s}: warning: " ++ format, .{str} ++ args); + try scope.appendNode(try ZigTag.warning.create(t.arena, value)); +} + +pub const Options = struct { + gpa: mem.Allocator, + comp: *aro.Compilation, + pp: *const aro.Preprocessor, + tree: *const aro.Tree, +}; + +pub fn translate(options: Options) mem.Allocator.Error![]u8 { + const gpa = options.gpa; + var arena_allocator = std.heap.ArenaAllocator.init(gpa); + defer arena_allocator.deinit(); + const arena = arena_allocator.allocator(); + + var translator: Translator = .{ + .gpa = gpa, + .arena = arena, + .alias_list = .empty, + .global_scope = try arena.create(Scope.Root), + .comp = options.comp, + .pp = options.pp, + .tree = options.tree, + }; + translator.global_scope.* = Scope.Root.init(&translator); + defer { + translator.type_decls.deinit(gpa); + translator.alias_list.deinit(gpa); + translator.global_names.deinit(gpa); + translator.weak_global_names.deinit(gpa); + translator.opaque_demotes.deinit(gpa); + translator.unnamed_typedefs.deinit(gpa); + translator.anonymous_record_field_names.deinit(gpa); + translator.typedefs.deinit(gpa); + translator.global_scope.deinit(); + } + + try translator.prepopulateGlobalNameTable(); + try translator.transTopLevelDecls(); + + // Insert empty line before macros. + try translator.global_scope.nodes.append(gpa, try ZigTag.warning.create(arena, "\n")); + + try translator.transMacros(); + + for (translator.alias_list.items) |alias| { + if (!translator.global_scope.sym_table.contains(alias.alias)) { + const node = try ZigTag.alias.create(arena, .{ .actual = alias.alias, .mangled = alias.name }); + try translator.addTopLevelDecl(alias.alias, node); + } + } + + try translator.global_scope.processContainerMemberFns(); + + var aw: std.Io.Writer.Allocating = .init(gpa); + defer aw.deinit(); + + aw.writer.writeAll( + \\pub const __builtin = @import("std").zig.c_translation.builtins; + \\pub const __helpers = @import("std").zig.c_translation.helpers; + \\ + \\ + ) catch return error.OutOfMemory; + + var zig_ast = try ast.render(gpa, translator.global_scope.nodes.items); + defer { + gpa.free(zig_ast.source); + zig_ast.deinit(gpa); + } + zig_ast.render(gpa, &aw.writer, .{}) catch return error.OutOfMemory; + return aw.toOwnedSlice(); +} + +fn prepopulateGlobalNameTable(t: *Translator) !void { + for (t.tree.root_decls.items) |decl| { + switch (decl.get(t.tree)) { + .typedef => |typedef_decl| { + const decl_name = t.tree.tokSlice(typedef_decl.name_tok); + try t.global_names.put(t.gpa, decl_name, {}); + + // Check for typedefs with unnamed enum/record child types. + const base = typedef_decl.qt.base(t.comp); + switch (base.type) { + .@"enum" => |enum_ty| { + if (enum_ty.name.lookup(t.comp)[0] != '(') continue; + }, + .@"struct", .@"union" => |record_ty| { + if (record_ty.name.lookup(t.comp)[0] != '(') continue; + }, + else => continue, + } + + const gop = try t.unnamed_typedefs.getOrPut(t.gpa, base.qt); + if (gop.found_existing) { + // One typedef can declare multiple names. + // TODO Don't put this one in `decl_table` so it's processed later. + continue; + } + gop.value_ptr.* = decl_name; + }, + + .struct_decl, + .union_decl, + .struct_forward_decl, + .union_forward_decl, + .enum_decl, + .enum_forward_decl, + => { + const decl_qt = decl.qt(t.tree); + const prefix, const name = switch (decl_qt.base(t.comp).type) { + .@"struct" => |struct_ty| .{ "struct", struct_ty.name.lookup(t.comp) }, + .@"union" => |union_ty| .{ "union", union_ty.name.lookup(t.comp) }, + .@"enum" => |enum_ty| .{ "enum", enum_ty.name.lookup(t.comp) }, + else => unreachable, + }; + const prefixed_name = try std.fmt.allocPrint(t.arena, "{s}_{s}", .{ prefix, name }); + // `name` and `prefixed_name` are the preferred names for this type. + // However, we can name it anything else if necessary, so these are "weak names". + try t.weak_global_names.ensureUnusedCapacity(t.gpa, 2); + t.weak_global_names.putAssumeCapacity(name, {}); + t.weak_global_names.putAssumeCapacity(prefixed_name, {}); + }, + + .function, .variable => { + const decl_name = t.tree.tokSlice(decl.tok(t.tree)); + try t.global_names.put(t.gpa, decl_name, {}); + }, + .static_assert => {}, + .empty_decl => {}, + .global_asm => {}, + else => unreachable, + } + } + + for (t.pp.defines.keys(), t.pp.defines.values()) |name, macro| { + if (macro.is_builtin) continue; + if (!t.isSelfDefinedMacro(name, macro)) { + try t.global_names.put(t.gpa, name, {}); + } + } +} + +/// Determines whether macro is of the form: `#define FOO FOO` (Possibly with trailing tokens) +/// Macros of this form will not be translated. +fn isSelfDefinedMacro(t: *Translator, name: []const u8, macro: aro.Preprocessor.Macro) bool { + if (macro.is_func) return false; + + if (macro.tokens.len < 1) return false; + const first_tok = macro.tokens[0]; + + const source = t.comp.getSource(macro.loc.id); + const slice = source.buf[first_tok.start..first_tok.end]; + + return std.mem.eql(u8, name, slice); +} + +// ======================= +// Declaration translation +// ======================= + +fn transTopLevelDecls(t: *Translator) !void { + for (t.tree.root_decls.items) |decl| { + try t.transDecl(&t.global_scope.base, decl); + } +} + +fn transDecl(t: *Translator, scope: *Scope, decl: Node.Index) !void { + switch (decl.get(t.tree)) { + .typedef => |typedef_decl| { + // Implicit typedefs are translated only if referenced. + if (typedef_decl.implicit) return; + try t.transTypeDef(scope, decl); + }, + + .struct_decl, .union_decl => |record_decl| { + try t.transRecordDecl(scope, record_decl.container_qt); + }, + + .enum_decl => |enum_decl| { + try t.transEnumDecl(scope, enum_decl.container_qt); + }, + + .enum_field, + .record_field, + .struct_forward_decl, + .union_forward_decl, + .enum_forward_decl, + => return, + + .function => |function| { + if (function.definition) |definition| { + return t.transFnDecl(scope, definition.get(t.tree).function); + } + try t.transFnDecl(scope, function); + }, + + .variable => |variable| { + if (variable.definition != null) return; + try t.transVarDecl(scope, variable); + }, + .static_assert => |static_assert| { + try t.transStaticAssert(&t.global_scope.base, static_assert); + }, + .global_asm => |global_asm| { + try t.transGlobalAsm(&t.global_scope.base, global_asm); + }, + .empty_decl => {}, + else => unreachable, + } +} + +pub const builtin_typedef_map = std.StaticStringMap([]const u8).initComptime(.{ + .{ "uint8_t", "u8" }, + .{ "int8_t", "i8" }, + .{ "uint16_t", "u16" }, + .{ "int16_t", "i16" }, + .{ "uint32_t", "u32" }, + .{ "int32_t", "i32" }, + .{ "uint64_t", "u64" }, + .{ "int64_t", "i64" }, + .{ "intptr_t", "isize" }, + .{ "uintptr_t", "usize" }, + .{ "ssize_t", "isize" }, + .{ "size_t", "usize" }, +}); + +fn transTypeDef(t: *Translator, scope: *Scope, typedef_node: Node.Index) Error!void { + const typedef_decl = typedef_node.get(t.tree).typedef; + if (t.type_decls.get(typedef_node)) |_| + return; // Avoid processing this decl twice + + const toplevel = scope.id == .root; + const bs: *Scope.Block = if (!toplevel) try scope.findBlockScope(t) else undefined; + + var name: []const u8 = t.tree.tokSlice(typedef_decl.name_tok); + try t.typedefs.put(t.gpa, name, {}); + + if (builtin_typedef_map.get(name)) |builtin| { + return t.type_decls.putNoClobber(t.gpa, typedef_node, builtin); + } + if (!toplevel) name = try bs.makeMangledName(name); + try t.type_decls.putNoClobber(t.gpa, typedef_node, name); + + const typedef_loc = typedef_decl.name_tok; + const init_node = t.transType(scope, typedef_decl.qt, typedef_loc) catch |err| switch (err) { + error.UnsupportedType => { + return t.failDecl(scope, typedef_loc, name, "unable to resolve typedef child type", .{}); + }, + error.OutOfMemory => |e| return e, + }; + + const payload = try t.arena.create(ast.Payload.SimpleVarDecl); + payload.* = .{ + .base = .{ .tag = if (toplevel) .pub_var_simple else .var_simple }, + .data = .{ + .name = name, + .init = init_node, + }, + }; + const node = ZigNode.initPayload(&payload.base); + + if (toplevel) { + try t.addTopLevelDecl(name, node); + } else { + try scope.appendNode(node); + try bs.discardVariable(name); + } +} + +fn mangleWeakGlobalName(t: *Translator, want_name: []const u8) Error![]const u8 { + var cur_name = want_name; + + if (!t.weak_global_names.contains(want_name)) { + // This type wasn't noticed by the name detection pass, so nothing has been treating this as + // a weak global name. We must mangle it to avoid conflicts with locals. + cur_name = try std.fmt.allocPrint(t.arena, "{s}_{d}", .{ want_name, t.getMangle() }); + } + + while (t.global_names.contains(cur_name)) { + cur_name = try std.fmt.allocPrint(t.arena, "{s}_{d}", .{ want_name, t.getMangle() }); + } + return cur_name; +} + +fn transRecordDecl(t: *Translator, scope: *Scope, record_qt: QualType) Error!void { + const base = record_qt.base(t.comp); + const record_ty = switch (base.type) { + .@"struct", .@"union" => |record_ty| record_ty, + else => unreachable, + }; + + if (t.type_decls.get(record_ty.decl_node)) |_| + return; // Avoid processing this decl twice + + const toplevel = scope.id == .root; + const bs: *Scope.Block = if (!toplevel) try scope.findBlockScope(t) else undefined; + + const container_kind: ZigTag = if (base.type == .@"union") .@"union" else .@"struct"; + const container_kind_name = @tagName(container_kind); + + var bare_name = record_ty.name.lookup(t.comp); + var is_unnamed = false; + var name = bare_name; + + if (t.unnamed_typedefs.get(base.qt)) |typedef_name| { + bare_name = typedef_name; + name = typedef_name; + } else { + if (record_ty.isAnonymous(t.comp)) { + bare_name = try std.fmt.allocPrint(t.arena, "unnamed_{d}", .{t.getMangle()}); + is_unnamed = true; + } + name = try std.fmt.allocPrint(t.arena, "{s}_{s}", .{ container_kind_name, bare_name }); + if (toplevel and !is_unnamed) { + name = try t.mangleWeakGlobalName(name); + } + } + if (!toplevel) name = try bs.makeMangledName(name); + try t.type_decls.putNoClobber(t.gpa, record_ty.decl_node, name); + + const is_pub = toplevel and !is_unnamed; + const init_node = init: { + if (record_ty.layout == null) { + try t.opaque_demotes.put(t.gpa, base.qt, {}); + break :init ZigTag.opaque_literal.init(); + } + + var fields = try std.array_list.Managed(ast.Payload.Container.Field).initCapacity(t.gpa, record_ty.fields.len); + defer fields.deinit(); + + var functions = std.array_list.Managed(ZigNode).init(t.gpa); + defer functions.deinit(); + + var unnamed_field_count: u32 = 0; + + // If a record doesn't have any attributes that would affect the alignment and + // layout, then we can just use a simple `extern` type. If it does have attributes, + // then we need to inspect the layout and assign an `align` value for each field. + const has_alignment_attributes = aligned: { + if (record_qt.hasAttribute(t.comp, .@"packed")) break :aligned true; + if (record_qt.hasAttribute(t.comp, .aligned)) break :aligned true; + for (record_ty.fields) |field| { + const field_attrs = field.attributes(t.comp); + for (field_attrs) |field_attr| { + switch (field_attr.tag) { + .@"packed", .aligned => break :aligned true, + else => {}, + } + } + } + break :aligned false; + }; + const head_field_alignment: ?c_uint = if (has_alignment_attributes) t.headFieldAlignment(record_ty) else null; + + for (record_ty.fields, 0..) |field, field_index| { + const field_loc = field.name_tok; + + // Demote record to opaque if it contains a bitfield + if (field.bit_width != .null) { + try t.opaque_demotes.put(t.gpa, base.qt, {}); + try t.warn(scope, field_loc, "{s} demoted to opaque type - has bitfield", .{container_kind_name}); + break :init ZigTag.opaque_literal.init(); + } + + var field_name = field.name.lookup(t.comp); + if (field.name_tok == 0) { + field_name = try std.fmt.allocPrint(t.arena, "unnamed_{d}", .{unnamed_field_count}); + unnamed_field_count += 1; + try t.anonymous_record_field_names.put(t.gpa, .{ + .parent = base.qt, + .field = field.qt, + }, field_name); + } + + const field_alignment = if (has_alignment_attributes) + t.alignmentForField(record_ty, head_field_alignment, field_index) + else + null; + + const field_type = field_type: { + // Check if this is a flexible array member. + flexible: { + if (field_index != record_ty.fields.len - 1 and container_kind != .@"union") break :flexible; + const array_ty = field.qt.get(t.comp, .array) orelse break :flexible; + if (array_ty.len != .incomplete and (array_ty.len != .fixed or array_ty.len.fixed != 0)) break :flexible; + + const elem_type = t.transType(scope, array_ty.elem, field_loc) catch |err| switch (err) { + error.UnsupportedType => break :flexible, + else => |e| return e, + }; + const zero_array = try ZigTag.array_type.create(t.arena, .{ .len = 0, .elem_type = elem_type }); + + const member_name = field_name; + field_name = try std.fmt.allocPrint(t.arena, "_{s}", .{field_name}); + + const member = try t.createFlexibleMemberFn(member_name, field_name); + try functions.append(member); + + break :field_type zero_array; + } + + break :field_type t.transType(scope, field.qt, field_loc) catch |err| switch (err) { + error.UnsupportedType => { + try t.opaque_demotes.put(t.gpa, base.qt, {}); + try t.warn(scope, field.name_tok, "{s} demoted to opaque type - unable to translate type of field {s}", .{ + container_kind_name, + field_name, + }); + break :init ZigTag.opaque_literal.init(); + }, + else => |e| return e, + }; + }; + + // C99 introduced designated initializers for structs. Omitted fields are implicitly + // initialized to zero. Some C APIs are designed with this in mind. Defaulting to zero + // values for translated struct fields permits Zig code to comfortably use such an API. + const default_value = if (container_kind == .@"struct") + try t.createZeroValueNode(field.qt, field_type, .no_as) + else + null; + + fields.appendAssumeCapacity(.{ + .name = field_name, + .type = field_type, + .alignment = field_alignment, + .default_value = default_value, + }); + } + + // A record is empty if it has no fields or only flexible array fields. + if (record_ty.fields.len == functions.items.len and + t.comp.target.os.tag == .windows and t.comp.target.abi == .msvc) + { + // In MSVC empty records have the same size as their alignment. + const padding_bits = record_ty.layout.?.size_bits; + const alignment_bits = record_ty.layout.?.field_alignment_bits; + + try fields.append(.{ + .name = "_padding", + .type = try ZigTag.type.create(t.arena, try std.fmt.allocPrint(t.arena, "u{d}", .{padding_bits})), + .alignment = @divExact(alignment_bits, 8), + .default_value = if (container_kind == .@"struct") + ZigTag.zero_literal.init() + else + null, + }); + } + + const container_payload = try t.arena.create(ast.Payload.Container); + container_payload.* = .{ + .base = .{ .tag = container_kind }, + .data = .{ + .layout = .@"extern", + .fields = try t.arena.dupe(ast.Payload.Container.Field, fields.items), + .decls = try t.arena.dupe(ZigNode, functions.items), + }, + }; + break :init ZigNode.initPayload(&container_payload.base); + }; + + const payload = try t.arena.create(ast.Payload.SimpleVarDecl); + payload.* = .{ + .base = .{ .tag = if (is_pub) .pub_var_simple else .var_simple }, + .data = .{ + .name = name, + .init = init_node, + }, + }; + const node = ZigNode.initPayload(&payload.base); + if (toplevel) { + try t.addTopLevelDecl(name, node); + // Only add the alias if the name is available *and* it was caught by + // name detection. Don't bother performing a weak mangle, since a + // mangled name is of no real use here. + if (!is_unnamed and !t.global_names.contains(bare_name) and t.weak_global_names.contains(bare_name)) + try t.alias_list.append(t.gpa, .{ .alias = bare_name, .name = name }); + try t.global_scope.container_member_fns_map.put(t.gpa, record_qt, .{ + .container_decl_ptr = &payload.data.init, + }); + } else { + try scope.appendNode(node); + try bs.discardVariable(name); + } +} + +fn transFnDecl(t: *Translator, scope: *Scope, function: Node.Function) Error!void { + const func_ty = function.qt.get(t.comp, .func).?; + + const is_pub = scope.id == .root; + + const fn_name = t.tree.tokSlice(function.name_tok); + if (scope.getAlias(fn_name) != null or t.global_scope.containsNow(fn_name)) + return; // Avoid processing this decl twice + + const fn_decl_loc = function.name_tok; + const has_body = function.body != null and func_ty.kind != .variadic; + if (function.body != null and func_ty.kind == .variadic) { + try t.warn(scope, function.name_tok, "TODO unable to translate variadic function, demoted to extern", .{}); + } + + const is_always_inline = has_body and function.qt.getAttribute(t.comp, .always_inline) != null; + const proto_ctx: FnProtoContext = .{ + .fn_name = fn_name, + .is_always_inline = is_always_inline, + .is_extern = !has_body, + .is_export = !function.static and has_body and !is_always_inline and !function.@"inline", + .is_pub = is_pub, + .has_body = has_body, + .cc = if (function.qt.getAttribute(t.comp, .calling_convention)) |some| switch (some.cc) { + .c => .c, + .stdcall => .x86_stdcall, + .thiscall => .x86_thiscall, + .fastcall => .x86_fastcall, + .regcall => .x86_regcall, + .riscv_vector => .riscv_vector, + .aarch64_sve_pcs => .aarch64_sve_pcs, + .aarch64_vector_pcs => .aarch64_vfabi, + .arm_aapcs => .arm_aapcs, + .arm_aapcs_vfp => .arm_aapcs_vfp, + .vectorcall => switch (t.comp.target.cpu.arch) { + .x86 => .x86_vectorcall, + .aarch64, .aarch64_be => .aarch64_vfabi, + else => .c, + }, + .x86_64_sysv => .x86_64_sysv, + .x86_64_win => .x86_64_win, + } else .c, + }; + + const proto_node = t.transFnType(&t.global_scope.base, function.qt, func_ty, fn_decl_loc, proto_ctx) catch |err| switch (err) { + error.UnsupportedType => { + return t.failDecl(scope, fn_decl_loc, fn_name, "unable to resolve prototype of function", .{}); + }, + error.OutOfMemory => |e| return e, + }; + + const proto_payload = proto_node.castTag(.func).?; + if (!has_body) { + if (scope.id != .root) { + const bs: *Scope.Block = try scope.findBlockScope(t); + const mangled_name = try bs.createMangledName(fn_name, false, Scope.Block.extern_local_prefix); + const wrapped = try ZigTag.wrapped_local.create(t.arena, .{ .name = mangled_name, .init = proto_node }); + try scope.appendNode(wrapped); + try bs.discardVariable(mangled_name); + return; + } + try t.global_scope.addMemberFunction(func_ty, proto_payload); + return t.addTopLevelDecl(fn_name, proto_node); + } + + // actual function definition with body + const body_stmt = function.body.?.get(t.tree).compound_stmt; + var block_scope = try Scope.Block.init(t, &t.global_scope.base, false); + block_scope.return_type = func_ty.return_type; + defer block_scope.deinit(); + + var param_id: c_uint = 0; + for (proto_payload.data.params, func_ty.params) |*param, param_info| { + const param_name = param.name orelse { + proto_payload.data.is_extern = true; + proto_payload.data.is_export = false; + proto_payload.data.is_inline = false; + try t.warn(&t.global_scope.base, fn_decl_loc, "function {s} parameter has no name, demoted to extern", .{fn_name}); + return t.addTopLevelDecl(fn_name, proto_node); + }; + + const is_const = param_info.qt.@"const"; + + const mangled_param_name = try block_scope.makeMangledName(param_name); + param.name = mangled_param_name; + + if (!is_const) { + const bare_arg_name = try std.fmt.allocPrint(t.arena, "arg_{s}", .{mangled_param_name}); + const arg_name = try block_scope.makeMangledName(bare_arg_name); + param.name = arg_name; + + const redecl_node = try ZigTag.arg_redecl.create(t.arena, .{ .actual = mangled_param_name, .mangled = arg_name }); + try block_scope.statements.append(t.gpa, redecl_node); + } + try block_scope.discardVariable(mangled_param_name); + + param_id += 1; + } + + t.transCompoundStmtInline(body_stmt, &block_scope) catch |err| switch (err) { + error.OutOfMemory => |e| return e, + error.UnsupportedTranslation, + error.UnsupportedType, + => { + proto_payload.data.is_extern = true; + proto_payload.data.is_export = false; + proto_payload.data.is_inline = false; + try t.warn(&t.global_scope.base, fn_decl_loc, "unable to translate function, demoted to extern", .{}); + return t.addTopLevelDecl(fn_name, proto_node); + }, + }; + + try t.global_scope.addMemberFunction(func_ty, proto_payload); + proto_payload.data.body = try block_scope.complete(); + return t.addTopLevelDecl(fn_name, proto_node); +} + +fn transVarDecl(t: *Translator, scope: *Scope, variable: Node.Variable) Error!void { + const base_name = t.tree.tokSlice(variable.name_tok); + const toplevel = scope.id == .root; + const bs: *Scope.Block = if (!toplevel) try scope.findBlockScope(t) else undefined; + const name, const use_base_name = blk: { + if (toplevel) break :blk .{ base_name, false }; + + // Local extern and static variables are wrapped in a struct. + const prefix: ?[]const u8 = switch (variable.storage_class) { + .@"extern" => Scope.Block.extern_local_prefix, + .static => Scope.Block.static_local_prefix, + else => null, + }; + break :blk .{ try bs.createMangledName(base_name, false, prefix), prefix != null }; + }; + + if (t.typeWasDemotedToOpaque(variable.qt)) { + if (variable.storage_class != .@"extern" and scope.id == .root) { + return t.failDecl(scope, variable.name_tok, name, "non-extern variable has opaque type", .{}); + } else { + return t.failDecl(scope, variable.name_tok, name, "local variable has opaque type", .{}); + } + } + + const type_node = (if (variable.initializer) |init| + t.transTypeInit(scope, variable.qt, init, variable.name_tok) + else + t.transType(scope, variable.qt, variable.name_tok)) catch |err| switch (err) { + error.UnsupportedType => { + return t.failDecl(scope, variable.name_tok, name, "unable to translate variable declaration type", .{}); + }, + else => |e| return e, + }; + + const array_ty = variable.qt.get(t.comp, .array); + var is_const = variable.qt.@"const" or (array_ty != null and array_ty.?.elem.@"const"); + var is_extern = variable.storage_class == .@"extern"; + + const init_node = init: { + if (variable.initializer) |init| { + const maybe_literal = init.get(t.tree); + const init_node = (if (maybe_literal == .string_literal_expr) + t.transStringLiteralInitializer(init, maybe_literal.string_literal_expr, type_node) + else + t.transExprCoercing(scope, init, .used)) catch |err| switch (err) { + error.UnsupportedTranslation, error.UnsupportedType => { + return t.failDecl(scope, variable.name_tok, name, "unable to resolve var init expr", .{}); + }, + else => |e| return e, + }; + + if (!variable.qt.is(t.comp, .bool) and init_node.isBoolRes()) { + break :init try ZigTag.int_from_bool.create(t.arena, init_node); + } else { + break :init init_node; + } + } + if (variable.storage_class == .@"extern") { + if (array_ty != null and array_ty.?.len == .incomplete) { + // Oh no, an extern array of unknown size! These are really fun because there's no + // direct equivalent in Zig. To translate correctly, we'll have to create a C-pointer + // to the data initialized via @extern. + + // Since this is really a pointer to the underlying data, we tweak a few properties. + is_extern = false; + is_const = true; + + const name_str = try std.fmt.allocPrint(t.arena, "\"{s}\"", .{base_name}); + break :init try ZigTag.builtin_extern.create(t.arena, .{ + .type = type_node, + .name = try ZigTag.string_literal.create(t.arena, name_str), + }); + } + break :init null; + } + if (toplevel or variable.storage_class == .static or variable.thread_local) { + // The C language specification states that variables with static or threadlocal + // storage without an initializer are initialized to a zero value. + break :init try t.createZeroValueNode(variable.qt, type_node, .no_as); + } + break :init ZigTag.undefined_literal.init(); + }; + + const linksection_string = blk: { + if (variable.qt.getAttribute(t.comp, .section)) |section| { + break :blk t.comp.interner.get(section.name.ref()).bytes; + } + break :blk null; + }; + + const alignment: ?c_uint = variable.qt.requestedAlignment(t.comp) orelse null; + var node = try ZigTag.var_decl.create(t.arena, .{ + .is_pub = toplevel, + .is_const = is_const, + .is_extern = is_extern, + .is_export = toplevel and variable.storage_class == .auto, + .is_threadlocal = variable.thread_local, + .linksection_string = linksection_string, + .alignment = alignment, + .name = if (use_base_name) base_name else name, + .type = type_node, + .init = init_node, + }); + + if (toplevel) { + try t.addTopLevelDecl(name, node); + } else { + if (use_base_name) { + node = try ZigTag.wrapped_local.create(t.arena, .{ .name = name, .init = node }); + } + try scope.appendNode(node); + try bs.discardVariable(name); + + if (variable.qt.getAttribute(t.comp, .cleanup)) |cleanup_attr| { + const cleanup_fn_name = t.tree.tokSlice(cleanup_attr.function.tok); + const mangled_fn_name = scope.getAlias(cleanup_fn_name) orelse cleanup_fn_name; + const fn_id = try ZigTag.identifier.create(t.arena, mangled_fn_name); + + const varname = try ZigTag.identifier.create(t.arena, name); + const args = try t.arena.alloc(ZigNode, 1); + args[0] = try ZigTag.address_of.create(t.arena, varname); + + const cleanup_call = try ZigTag.call.create(t.arena, .{ .lhs = fn_id, .args = args }); + const discard = try ZigTag.discard.create(t.arena, .{ .should_skip = false, .value = cleanup_call }); + const deferred_cleanup = try ZigTag.@"defer".create(t.arena, discard); + + try bs.statements.append(t.gpa, deferred_cleanup); + } + } +} + +fn transEnumDecl(t: *Translator, scope: *Scope, enum_qt: QualType) Error!void { + const base = enum_qt.base(t.comp); + const enum_ty = base.type.@"enum"; + + if (t.type_decls.get(enum_ty.decl_node)) |_| + return; // Avoid processing this decl twice + + const toplevel = scope.id == .root; + const bs: *Scope.Block = if (!toplevel) try scope.findBlockScope(t) else undefined; + + var bare_name = enum_ty.name.lookup(t.comp); + var is_unnamed = false; + var name = bare_name; + if (t.unnamed_typedefs.get(base.qt)) |typedef_name| { + bare_name = typedef_name; + name = typedef_name; + } else { + if (enum_ty.isAnonymous(t.comp)) { + bare_name = try std.fmt.allocPrint(t.arena, "unnamed_{d}", .{t.getMangle()}); + is_unnamed = true; + } + name = try std.fmt.allocPrint(t.arena, "enum_{s}", .{bare_name}); + } + if (!toplevel) name = try bs.makeMangledName(name); + try t.type_decls.putNoClobber(t.gpa, enum_ty.decl_node, name); + + const enum_type_node = if (!base.qt.hasIncompleteSize(t.comp)) blk: { + const enum_decl = enum_ty.decl_node.get(t.tree).enum_decl; + for (enum_ty.fields, enum_decl.fields) |field, field_node| { + var enum_val_name = field.name.lookup(t.comp); + if (!toplevel) { + enum_val_name = try bs.makeMangledName(enum_val_name); + } + + const enum_const_type_node: ?ZigNode = t.transType(scope, field.qt, field.name_tok) catch |err| switch (err) { + error.UnsupportedType => null, + else => |e| return e, + }; + + const val = t.tree.value_map.get(field_node).?; + const enum_const_def = try ZigTag.enum_constant.create(t.arena, .{ + .name = enum_val_name, + .is_public = toplevel, + .type = enum_const_type_node, + .value = try t.createIntNode(val), + }); + if (toplevel) + try t.addTopLevelDecl(enum_val_name, enum_const_def) + else { + try scope.appendNode(enum_const_def); + try bs.discardVariable(enum_val_name); + } + } + + break :blk t.transType(scope, enum_ty.tag.?, enum_decl.name_or_kind_tok) catch |err| switch (err) { + error.UnsupportedType => { + return t.failDecl(scope, enum_decl.name_or_kind_tok, name, "unable to translate enum integer type", .{}); + }, + else => |e| return e, + }; + } else blk: { + try t.opaque_demotes.put(t.gpa, base.qt, {}); + break :blk ZigTag.opaque_literal.init(); + }; + + const is_pub = toplevel and !is_unnamed; + const payload = try t.arena.create(ast.Payload.SimpleVarDecl); + payload.* = .{ + .base = .{ .tag = if (is_pub) .pub_var_simple else .var_simple }, + .data = .{ + .init = enum_type_node, + .name = name, + }, + }; + const node = ZigNode.initPayload(&payload.base); + if (toplevel) { + try t.addTopLevelDecl(name, node); + if (!is_unnamed) + try t.alias_list.append(t.gpa, .{ .alias = bare_name, .name = name }); + } else { + try scope.appendNode(node); + try bs.discardVariable(name); + } +} + +fn transStaticAssert(t: *Translator, scope: *Scope, static_assert: Node.StaticAssert) Error!void { + const condition = t.transExpr(scope, static_assert.cond, .used) catch |err| switch (err) { + error.UnsupportedTranslation, error.UnsupportedType => { + return try t.warn(&t.global_scope.base, static_assert.cond.tok(t.tree), "unable to translate _Static_assert condition", .{}); + }, + error.OutOfMemory => |e| return e, + }; + + // generate @compileError message that matches C compiler output + const diagnostic = if (static_assert.message) |message| str: { + // Aro guarantees this to be a string literal. + const str_val = t.tree.value_map.get(message).?; + const str_qt = message.qt(t.tree); + + const bytes = t.comp.interner.get(str_val.ref()).bytes; + var allocating: std.Io.Writer.Allocating = .init(t.gpa); + defer allocating.deinit(); + + allocating.writer.writeAll("\"static assertion failed \\") catch return error.OutOfMemory; + + aro.Value.printString(bytes, str_qt, t.comp, &allocating.writer) catch return error.OutOfMemory; + allocating.writer.end -= 1; // printString adds a terminating " so we need to remove it + allocating.writer.writeAll("\\\"\"") catch return error.OutOfMemory; + + break :str try ZigTag.string_literal.create(t.arena, try t.arena.dupe(u8, allocating.written())); + } else try ZigTag.string_literal.create(t.arena, "\"static assertion failed\""); + + const assert_node = try ZigTag.static_assert.create(t.arena, .{ .lhs = condition, .rhs = diagnostic }); + try scope.appendNode(assert_node); +} + +fn transGlobalAsm(t: *Translator, scope: *Scope, global_asm: Node.SimpleAsm) Error!void { + const asm_string = t.tree.value_map.get(global_asm.asm_str).?; + const bytes = t.comp.interner.get(asm_string.ref()).bytes; + + var allocating: std.Io.Writer.Allocating = try .initCapacity(t.gpa, bytes.len); + defer allocating.deinit(); + aro.Value.printString(bytes, global_asm.asm_str.qt(t.tree), t.comp, &allocating.writer) catch return error.OutOfMemory; + + const str_node = try ZigTag.string_literal.create(t.arena, try t.arena.dupe(u8, allocating.written())); + + const asm_node = try ZigTag.asm_simple.create(t.arena, str_node); + const block = try ZigTag.block_single.create(t.arena, asm_node); + const comptime_node = try ZigTag.@"comptime".create(t.arena, block); + + try scope.appendNode(comptime_node); +} + +// ================ +// Type translation +// ================ + +fn getTypeStr(t: *Translator, qt: QualType) ![]const u8 { + var allocating: std.Io.Writer.Allocating = .init(t.gpa); + defer allocating.deinit(); + qt.print(t.comp, &allocating.writer) catch return error.OutOfMemory; + return t.arena.dupe(u8, allocating.written()); +} + +fn transType(t: *Translator, scope: *Scope, qt: QualType, source_loc: TokenIndex) TypeError!ZigNode { + loop: switch (qt.type(t.comp)) { + .atomic => { + const type_name = try t.getTypeStr(qt); + return t.fail(error.UnsupportedType, source_loc, "TODO support atomic type: '{s}'", .{type_name}); + }, + .void => return ZigTag.type.create(t.arena, "anyopaque"), + .bool => return ZigTag.type.create(t.arena, "bool"), + .int => |int_ty| switch (int_ty) { + //.char => return ZigTag.type.create(t.arena, "c_char"), // TODO: this is the preferred translation + .char => return ZigTag.type.create(t.arena, "u8"), + .schar => return ZigTag.type.create(t.arena, "i8"), + .uchar => return ZigTag.type.create(t.arena, "u8"), + .short => return ZigTag.type.create(t.arena, "c_short"), + .ushort => return ZigTag.type.create(t.arena, "c_ushort"), + .int => return ZigTag.type.create(t.arena, "c_int"), + .uint => return ZigTag.type.create(t.arena, "c_uint"), + .long => return ZigTag.type.create(t.arena, "c_long"), + .ulong => return ZigTag.type.create(t.arena, "c_ulong"), + .long_long => return ZigTag.type.create(t.arena, "c_longlong"), + .ulong_long => return ZigTag.type.create(t.arena, "c_ulonglong"), + .int128 => return ZigTag.type.create(t.arena, "i128"), + .uint128 => return ZigTag.type.create(t.arena, "u128"), + }, + .float => |float_ty| switch (float_ty) { + .fp16, .float16 => return ZigTag.type.create(t.arena, "f16"), + .float => return ZigTag.type.create(t.arena, "f32"), + .double => return ZigTag.type.create(t.arena, "f64"), + .long_double => return ZigTag.type.create(t.arena, "c_longdouble"), + .float128 => return ZigTag.type.create(t.arena, "f128"), + }, + .pointer => |pointer_ty| { + const child_qt = pointer_ty.child; + + const is_fn_proto = child_qt.is(t.comp, .func); + const is_const = is_fn_proto or child_qt.@"const"; + const is_volatile = child_qt.@"volatile"; + const elem_type = try t.transType(scope, child_qt, source_loc); + const ptr_info: @FieldType(ast.Payload.Pointer, "data") = .{ + .is_const = is_const, + .is_volatile = is_volatile, + .elem_type = elem_type, + .is_allowzero = false, + }; + if (is_fn_proto or + t.typeIsOpaque(child_qt) or + t.typeWasDemotedToOpaque(child_qt)) + { + const ptr = try ZigTag.single_pointer.create(t.arena, ptr_info); + return ZigTag.optional_type.create(t.arena, ptr); + } + + return ZigTag.c_pointer.create(t.arena, ptr_info); + }, + .array => |array_ty| { + const elem_qt = array_ty.elem; + switch (array_ty.len) { + .incomplete, .unspecified_variable => { + const elem_type = try t.transType(scope, elem_qt, source_loc); + return ZigTag.c_pointer.create(t.arena, .{ + .is_const = elem_qt.@"const", + .is_volatile = elem_qt.@"volatile", + .is_allowzero = false, + .elem_type = elem_type, + }); + }, + .fixed, .static => |len| { + const elem_type = try t.transType(scope, elem_qt, source_loc); + return ZigTag.array_type.create(t.arena, .{ .len = len, .elem_type = elem_type }); + }, + .variable => return t.fail(error.UnsupportedType, source_loc, "VLA unsupported '{s}'", .{try t.getTypeStr(qt)}), + } + }, + .func => |func_ty| return t.transFnType(scope, qt, func_ty, source_loc, .{}), + .@"struct", .@"union" => |record_ty| { + var trans_scope = scope; + if (!record_ty.isAnonymous(t.comp)) { + if (t.weak_global_names.contains(record_ty.name.lookup(t.comp))) trans_scope = &t.global_scope.base; + } + try t.transRecordDecl(trans_scope, qt); + const name = t.type_decls.get(record_ty.decl_node).?; + return ZigTag.identifier.create(t.arena, name); + }, + .@"enum" => |enum_ty| { + var trans_scope = scope; + const is_anonymous = enum_ty.isAnonymous(t.comp); + if (!is_anonymous) { + if (t.weak_global_names.contains(enum_ty.name.lookup(t.comp))) trans_scope = &t.global_scope.base; + } + try t.transEnumDecl(trans_scope, qt); + const name = t.type_decls.get(enum_ty.decl_node).?; + return ZigTag.identifier.create(t.arena, name); + }, + .typedef => |typedef_ty| { + var trans_scope = scope; + const typedef_name = typedef_ty.name.lookup(t.comp); + if (builtin_typedef_map.get(typedef_name)) |builtin| return ZigTag.type.create(t.arena, builtin); + if (t.global_names.contains(typedef_name)) trans_scope = &t.global_scope.base; + + try t.transTypeDef(trans_scope, typedef_ty.decl_node); + const name = t.type_decls.get(typedef_ty.decl_node).?; + return ZigTag.identifier.create(t.arena, name); + }, + .attributed => |attributed_ty| continue :loop attributed_ty.base.type(t.comp), + .typeof => |typeof_ty| continue :loop typeof_ty.base.type(t.comp), + .vector => |vector_ty| { + const len = try t.createNumberNode(vector_ty.len, .int); + const elem_type = try t.transType(scope, vector_ty.elem, source_loc); + return ZigTag.vector.create(t.arena, .{ .lhs = len, .rhs = elem_type }); + }, + else => return t.fail(error.UnsupportedType, source_loc, "unsupported type: '{s}'", .{try t.getTypeStr(qt)}), + } +} + +/// Look ahead through the fields of the record to determine what the alignment of the record +/// would be without any align/packed/etc. attributes. This helps us determine whether or not +/// the fields with 0 offset need an `align` qualifier. Strictly speaking, we could just +/// pedantically assign those fields the same alignment as the parent's pointer alignment, +/// but this helps the generated code to be a little less verbose. +fn headFieldAlignment(t: *Translator, record_decl: aro.Type.Record) ?c_uint { + const bits_per_byte = 8; + const parent_ptr_alignment_bits = record_decl.layout.?.pointer_alignment_bits; + const parent_ptr_alignment = parent_ptr_alignment_bits / bits_per_byte; + var max_field_alignment_bits: u64 = 0; + for (record_decl.fields) |field| { + if (field.qt.getRecord(t.comp)) |field_record_decl| { + const child_record_alignment = field_record_decl.layout.?.field_alignment_bits; + if (child_record_alignment > max_field_alignment_bits) + max_field_alignment_bits = child_record_alignment; + } else { + const field_size = field.layout.size_bits; + if (field_size > max_field_alignment_bits) + max_field_alignment_bits = field_size; + } + } + if (max_field_alignment_bits != parent_ptr_alignment_bits) { + return parent_ptr_alignment; + } else { + return null; + } +} + +/// This function inspects the generated layout of a record to determine the alignment for a +/// particular field. This approach is necessary because unlike Zig, a C compiler is not +/// required to fulfill the requested alignment, which means we'd risk generating different code +/// if we only look at the user-requested alignment. +/// +/// Returns a ?c_uint to match Clang's behavior of using c_uint. The return type can be changed +/// after the Clang frontend for translate-c is removed. A null value indicates that a field is +/// 'naturally aligned'. +fn alignmentForField( + t: *Translator, + record_decl: aro.Type.Record, + head_field_alignment: ?c_uint, + field_index: usize, +) ?c_uint { + const fields = record_decl.fields; + assert(fields.len != 0); + const field = fields[field_index]; + + const bits_per_byte = 8; + const parent_ptr_alignment_bits = record_decl.layout.?.pointer_alignment_bits; + const parent_ptr_alignment = parent_ptr_alignment_bits / bits_per_byte; + + // bitfields aren't supported yet. Until support is added, records with bitfields + // should be demoted to opaque, and this function shouldn't be called for them. + if (field.bit_width != .null) { + @panic("TODO: add bitfield support for records"); + } + + const field_offset_bits: u64 = field.layout.offset_bits; + const field_size_bits: u64 = field.layout.size_bits; + + // Fields with zero width always have an alignment of 1 + if (field_size_bits == 0) { + return 1; + } + + // Fields with 0 offset inherit the parent's pointer alignment. + if (field_offset_bits == 0) { + return head_field_alignment; + } + + // Records have a natural alignment when used as a field, and their size is + // a multiple of this alignment value. For all other types, the natural alignment + // is their size. + const field_natural_alignment_bits: u64 = if (field.qt.getRecord(t.comp)) |record| + record.layout.?.field_alignment_bits + else + field_size_bits; + const rem_bits = field_offset_bits % field_natural_alignment_bits; + + // If there's a remainder, then the alignment is smaller than the field's + // natural alignment + if (rem_bits > 0) { + const rem_alignment = rem_bits / bits_per_byte; + if (rem_alignment > 0 and std.math.isPowerOfTwo(rem_alignment)) { + const actual_alignment = @min(rem_alignment, parent_ptr_alignment); + return @as(c_uint, @truncate(actual_alignment)); + } else { + return 1; + } + } + + // A field may have an offset which positions it to be naturally aligned, but the + // parent's pointer alignment determines if this is actually true, so we take the minimum + // value. + // For example, a float field (4 bytes wide) with a 4 byte offset is positioned to have natural + // alignment, but if the parent pointer alignment is 2, then the actual alignment of the + // float is 2. + const field_natural_alignment: u64 = field_natural_alignment_bits / bits_per_byte; + const offset_alignment = field_offset_bits / bits_per_byte; + const possible_alignment = @min(parent_ptr_alignment, offset_alignment); + if (possible_alignment == field_natural_alignment) { + return null; + } else if (possible_alignment < field_natural_alignment) { + if (std.math.isPowerOfTwo(possible_alignment)) { + return possible_alignment; + } else { + return 1; + } + } else { // possible_alignment > field_natural_alignment + // Here, the field is positioned be at a higher alignment than it's natural alignment. This means we + // need to determine whether it's a specified alignment. We can determine that from the padding preceding + // the field. + const padding_from_prev_field: u64 = blk: { + if (field_offset_bits != 0) { + const previous_field = fields[field_index - 1]; + break :blk (field_offset_bits - previous_field.layout.offset_bits) - previous_field.layout.size_bits; + } else { + break :blk 0; + } + }; + if (padding_from_prev_field < field_natural_alignment_bits) { + return null; + } else { + return possible_alignment; + } + } +} + +const FnProtoContext = struct { + is_pub: bool = false, + is_export: bool = false, + is_extern: bool = false, + is_always_inline: bool = false, + fn_name: ?[]const u8 = null, + has_body: bool = false, + cc: ast.Payload.Func.CallingConvention = .c, +}; + +fn transFnType( + t: *Translator, + scope: *Scope, + func_qt: QualType, + func_ty: aro.Type.Func, + source_loc: TokenIndex, + ctx: FnProtoContext, +) !ZigNode { + const param_count: usize = func_ty.params.len; + const fn_params = try t.arena.alloc(ast.Payload.Param, param_count); + + for (func_ty.params, fn_params) |param_info, *param_node| { + const param_qt = param_info.qt; + const is_noalias = param_qt.restrict; + + const param_name: ?[]const u8 = if (param_info.name == .empty) + null + else + param_info.name.lookup(t.comp); + + const type_node = try t.transType(scope, param_qt, param_info.name_tok); + param_node.* = .{ + .is_noalias = is_noalias, + .name = param_name, + .type = type_node, + }; + } + + const linksection_string = blk: { + if (func_qt.getAttribute(t.comp, .section)) |section| { + break :blk t.comp.interner.get(section.name.ref()).bytes; + } + break :blk null; + }; + + const alignment: ?c_uint = func_qt.requestedAlignment(t.comp) orelse null; + + const explicit_callconv = if ((ctx.is_always_inline or ctx.is_export or ctx.is_extern) and ctx.cc == .c) null else ctx.cc; + + const return_type_node = blk: { + if (func_qt.getAttribute(t.comp, .noreturn) != null) { + break :blk ZigTag.noreturn_type.init(); + } else { + const return_qt = func_ty.return_type; + if (return_qt.is(t.comp, .void)) { + // convert primitive anyopaque to actual void (only for return type) + break :blk ZigTag.void_type.init(); + } else { + break :blk t.transType(scope, return_qt, source_loc) catch |err| switch (err) { + error.UnsupportedType => { + try t.warn(scope, source_loc, "unsupported function proto return type", .{}); + return err; + }, + error.OutOfMemory => |e| return e, + }; + } + } + }; + + const payload = try t.arena.create(ast.Payload.Func); + payload.* = .{ + .base = .{ .tag = .func }, + .data = .{ + .is_pub = ctx.is_pub, + .is_extern = ctx.is_extern, + .is_export = ctx.is_export, + .is_inline = ctx.is_always_inline, + .is_var_args = switch (func_ty.kind) { + .normal => false, + .variadic => true, + .old_style => !ctx.is_export and !ctx.is_always_inline and !ctx.has_body, + }, + .name = ctx.fn_name, + .linksection_string = linksection_string, + .explicit_callconv = explicit_callconv, + .params = fn_params, + .return_type = return_type_node, + .body = null, + .alignment = alignment, + }, + }; + return ZigNode.initPayload(&payload.base); +} + +/// Produces a Zig AST node by translating a Type, respecting the width, but modifying the signed-ness. +/// Asserts the type is an integer. +fn transTypeIntWidthOf(t: *Translator, qt: QualType, is_signed: bool) TypeError!ZigNode { + return ZigTag.type.create(t.arena, loop: switch (qt.base(t.comp).type) { + .int => |int_ty| switch (int_ty) { + .char, .schar, .uchar => if (is_signed) "i8" else "u8", + .short, .ushort => if (is_signed) "c_short" else "c_ushort", + .int, .uint => if (is_signed) "c_int" else "c_uint", + .long, .ulong => if (is_signed) "c_long" else "c_ulong", + .long_long, .ulong_long => if (is_signed) "c_longlong" else "c_ulonglong", + .int128, .uint128 => if (is_signed) "i128" else "u128", + }, + .bit_int => |bit_int_ty| try std.fmt.allocPrint(t.arena, "{s}{d}", .{ + if (is_signed) "i" else "u", + bit_int_ty.bits, + }), + .@"enum" => |enum_ty| blk: { + const tag_ty = enum_ty.tag orelse + break :blk if (is_signed) "c_int" else "c_uint"; + + continue :loop tag_ty.base(t.comp).type; + }, + else => unreachable, // only call this function when it has already been determined the type is int + }); +} + +fn transTypeInit( + t: *Translator, + scope: *Scope, + qt: QualType, + init: Node.Index, + source_loc: TokenIndex, +) TypeError!ZigNode { + switch (init.get(t.tree)) { + .string_literal_expr => |literal| { + const elem_ty = try t.transType(scope, qt.childType(t.comp), source_loc); + + const string_lit_size = literal.qt.arrayLen(t.comp).?; + const array_size = qt.arrayLen(t.comp).?; + + if (array_size == string_lit_size) { + return ZigTag.null_sentinel_array_type.create(t.arena, .{ .len = array_size - 1, .elem_type = elem_ty }); + } else { + return ZigTag.array_type.create(t.arena, .{ .len = array_size, .elem_type = elem_ty }); + } + }, + else => {}, + } + return t.transType(scope, qt, source_loc); +} + +// ============ +// Type helpers +// ============ + +fn typeIsOpaque(t: *Translator, qt: QualType) bool { + return switch (qt.base(t.comp).type) { + .void => true, + .@"struct", .@"union" => |record_ty| { + if (record_ty.layout == null) return true; + for (record_ty.fields) |field| { + if (field.bit_width != .null) return true; + } + return false; + }, + else => false, + }; +} + +fn typeWasDemotedToOpaque(t: *Translator, qt: QualType) bool { + const base = qt.base(t.comp); + switch (base.type) { + .@"struct", .@"union" => |record_ty| { + if (t.opaque_demotes.contains(base.qt)) return true; + for (record_ty.fields) |field| { + if (t.typeWasDemotedToOpaque(field.qt)) return true; + } + return false; + }, + .@"enum" => return t.opaque_demotes.contains(base.qt), + else => return false, + } +} + +fn typeHasWrappingOverflow(t: *Translator, qt: QualType) bool { + if (t.signedness(qt) == .unsigned) { + // unsigned integer overflow wraps around. + return true; + } else { + // float, signed integer, and pointer overflow is undefined behavior. + return false; + } +} + +/// Signedness of type when translated to Zig. +/// Different from `QualType.signedness()` for `char` and enums. +/// Returns null for non-int types. +fn signedness(t: *Translator, qt: QualType) ?std.builtin.Signedness { + return loop: switch (qt.base(t.comp).type) { + .bool => .unsigned, + .bit_int => |bit_int| bit_int.signedness, + .int => |int_ty| switch (int_ty) { + .char => .unsigned, // Always translated as u8 + .schar, .short, .int, .long, .long_long, .int128 => .signed, + .uchar, .ushort, .uint, .ulong, .ulong_long, .uint128 => .unsigned, + }, + .@"enum" => |enum_ty| { + const tag_qt = enum_ty.tag orelse return .signed; + continue :loop tag_qt.base(t.comp).type; + }, + else => return null, + }; +} + +// ===================== +// Statement translation +// ===================== + +fn transStmt(t: *Translator, scope: *Scope, stmt: Node.Index) TransError!ZigNode { + switch (stmt.get(t.tree)) { + .compound_stmt => |compound| { + return t.transCompoundStmt(scope, compound); + }, + .static_assert => |static_assert| { + try t.transStaticAssert(scope, static_assert); + return ZigTag.declaration.init(); + }, + .return_stmt => |return_stmt| return t.transReturnStmt(scope, return_stmt), + .null_stmt => return ZigTag.empty_block.init(), + .if_stmt => |if_stmt| return t.transIfStmt(scope, if_stmt), + .while_stmt => |while_stmt| return t.transWhileStmt(scope, while_stmt), + .do_while_stmt => |do_while_stmt| return t.transDoWhileStmt(scope, do_while_stmt), + .for_stmt => |for_stmt| return t.transForStmt(scope, for_stmt), + .continue_stmt => return ZigTag.@"continue".init(), + .break_stmt => return ZigTag.@"break".init(), + .typedef => |typedef_decl| { + assert(!typedef_decl.implicit); + try t.transTypeDef(scope, stmt); + return ZigTag.declaration.init(); + }, + .struct_decl, .union_decl => |record_decl| { + try t.transRecordDecl(scope, record_decl.container_qt); + return ZigTag.declaration.init(); + }, + .enum_decl => |enum_decl| { + try t.transEnumDecl(scope, enum_decl.container_qt); + return ZigTag.declaration.init(); + }, + .function => |function| { + try t.transFnDecl(scope, function); + return ZigTag.declaration.init(); + }, + .variable => |variable| { + try t.transVarDecl(scope, variable); + return ZigTag.declaration.init(); + }, + .switch_stmt => |switch_stmt| return t.transSwitch(scope, switch_stmt), + .case_stmt, .default_stmt => { + return t.fail(error.UnsupportedTranslation, stmt.tok(t.tree), "TODO complex switch", .{}); + }, + .goto_stmt, .computed_goto_stmt, .labeled_stmt => { + return t.fail(error.UnsupportedTranslation, stmt.tok(t.tree), "TODO goto", .{}); + }, + else => return t.transExprCoercing(scope, stmt, .unused), + } +} + +fn transCompoundStmtInline(t: *Translator, compound: Node.CompoundStmt, block: *Scope.Block) TransError!void { + for (compound.body) |stmt| { + const result = try t.transStmt(&block.base, stmt); + switch (result.tag()) { + .declaration, .empty_block => {}, + else => try block.statements.append(t.gpa, result), + } + } +} + +fn transCompoundStmt(t: *Translator, scope: *Scope, compound: Node.CompoundStmt) TransError!ZigNode { + var block_scope = try Scope.Block.init(t, scope, false); + defer block_scope.deinit(); + try t.transCompoundStmtInline(compound, &block_scope); + return try block_scope.complete(); +} + +fn transReturnStmt(t: *Translator, scope: *Scope, return_stmt: Node.ReturnStmt) TransError!ZigNode { + switch (return_stmt.operand) { + .none => return ZigTag.return_void.init(), + .expr => |operand| { + var rhs = try t.transExprCoercing(scope, operand, .used); + const return_qt = scope.findBlockReturnType(); + if (rhs.isBoolRes() and !return_qt.is(t.comp, .bool)) { + rhs = try ZigTag.int_from_bool.create(t.arena, rhs); + } + return ZigTag.@"return".create(t.arena, rhs); + }, + .implicit => |zero| { + if (zero) return ZigTag.@"return".create(t.arena, ZigTag.zero_literal.init()); + + const return_qt = scope.findBlockReturnType(); + if (return_qt.is(t.comp, .void)) return ZigTag.empty_block.init(); + + return ZigTag.@"return".create(t.arena, ZigTag.undefined_literal.init()); + }, + } +} + +/// If a statement can possibly translate to a Zig assignment (either directly because it's +/// an assignment in C or indirectly via result assignment to `_`) AND it's the sole statement +/// in the body of an if statement or loop, then we need to put the statement into its own block. +/// The `else` case here corresponds to statements that could result in an assignment. If a statement +/// class never needs a block, add its enum to the top prong. +fn maybeBlockify(t: *Translator, scope: *Scope, stmt: Node.Index) TransError!ZigNode { + switch (stmt.get(t.tree)) { + .break_stmt, + .continue_stmt, + .compound_stmt, + .decl_ref_expr, + .enumeration_ref, + .do_while_stmt, + .for_stmt, + .if_stmt, + .return_stmt, + .null_stmt, + .while_stmt, + => return t.transStmt(scope, stmt), + else => return t.blockify(scope, stmt), + } +} + +/// Translate statement and place it in its own block. +fn blockify(t: *Translator, scope: *Scope, stmt: Node.Index) TransError!ZigNode { + var block_scope = try Scope.Block.init(t, scope, false); + defer block_scope.deinit(); + const result = try t.transStmt(&block_scope.base, stmt); + try block_scope.statements.append(t.gpa, result); + return block_scope.complete(); +} + +fn transIfStmt(t: *Translator, scope: *Scope, if_stmt: Node.IfStmt) TransError!ZigNode { + var cond_scope: Scope.Condition = .{ + .base = .{ + .parent = scope, + .id = .condition, + }, + }; + defer cond_scope.deinit(); + const cond = try t.transBoolExpr(&cond_scope.base, if_stmt.cond); + + // block needed to keep else statement from attaching to inner while + const must_blockify = (if_stmt.else_body != null) and switch (if_stmt.then_body.get(t.tree)) { + .while_stmt, .do_while_stmt, .for_stmt => true, + else => false, + }; + + const then_node = if (must_blockify) + try t.blockify(scope, if_stmt.then_body) + else + try t.maybeBlockify(scope, if_stmt.then_body); + + const else_node = if (if_stmt.else_body) |stmt| + try t.maybeBlockify(scope, stmt) + else + null; + return ZigTag.@"if".create(t.arena, .{ .cond = cond, .then = then_node, .@"else" = else_node }); +} + +fn transWhileStmt(t: *Translator, scope: *Scope, while_stmt: Node.WhileStmt) TransError!ZigNode { + var cond_scope: Scope.Condition = .{ + .base = .{ + .parent = scope, + .id = .condition, + }, + }; + defer cond_scope.deinit(); + const cond = try t.transBoolExpr(&cond_scope.base, while_stmt.cond); + + var loop_scope: Scope = .{ + .parent = scope, + .id = .loop, + }; + const body = try t.maybeBlockify(&loop_scope, while_stmt.body); + return ZigTag.@"while".create(t.arena, .{ .cond = cond, .body = body, .cont_expr = null }); +} + +fn transDoWhileStmt(t: *Translator, scope: *Scope, do_stmt: Node.DoWhileStmt) TransError!ZigNode { + var loop_scope: Scope = .{ + .parent = scope, + .id = .do_loop, + }; + + // if (!cond) break; + var cond_scope: Scope.Condition = .{ + .base = .{ + .parent = scope, + .id = .condition, + }, + }; + defer cond_scope.deinit(); + const cond = try t.transBoolExpr(&cond_scope.base, do_stmt.cond); + const if_not_break = switch (cond.tag()) { + .true_literal => { + const body_node = try t.maybeBlockify(scope, do_stmt.body); + return ZigTag.while_true.create(t.arena, body_node); + }, + else => try ZigTag.if_not_break.create(t.arena, cond), + }; + + var body_node = try t.transStmt(&loop_scope, do_stmt.body); + if (body_node.isNoreturn(true)) { + // The body node ends in a noreturn statement. Simply put it in a while (true) + // in case it contains breaks or continues. + } else if (do_stmt.body.get(t.tree) == .compound_stmt) { + // there's already a block in C, so we'll append our condition to it. + // c: do { + // c: a; + // c: b; + // c: } while(c); + // zig: while (true) { + // zig: a; + // zig: b; + // zig: if (!cond) break; + // zig: } + const block = body_node.castTag(.block).?; + block.data.stmts.len += 1; // This is safe since we reserve one extra space in Scope.Block.complete. + block.data.stmts[block.data.stmts.len - 1] = if_not_break; + } else { + // the C statement is without a block, so we need to create a block to contain it. + // c: do + // c: a; + // c: while(c); + // zig: while (true) { + // zig: a; + // zig: if (!cond) break; + // zig: } + const statements = try t.arena.alloc(ZigNode, 2); + statements[0] = body_node; + statements[1] = if_not_break; + body_node = try ZigTag.block.create(t.arena, .{ .label = null, .stmts = statements }); + } + return ZigTag.while_true.create(t.arena, body_node); +} + +fn transForStmt(t: *Translator, scope: *Scope, for_stmt: Node.ForStmt) TransError!ZigNode { + var loop_scope: Scope = .{ + .parent = scope, + .id = .loop, + }; + + var block_scope: ?Scope.Block = null; + defer if (block_scope) |*bs| bs.deinit(); + + switch (for_stmt.init) { + .decls => |decls| { + block_scope = try Scope.Block.init(t, scope, false); + loop_scope.parent = &block_scope.?.base; + for (decls) |decl| { + try t.transDecl(&block_scope.?.base, decl); + } + }, + .expr => |maybe_init| if (maybe_init) |init| { + block_scope = try Scope.Block.init(t, scope, false); + loop_scope.parent = &block_scope.?.base; + const init_node = try t.transStmt(&block_scope.?.base, init); + try loop_scope.appendNode(init_node); + }, + } + var cond_scope: Scope.Condition = .{ + .base = .{ + .parent = &loop_scope, + .id = .condition, + }, + }; + defer cond_scope.deinit(); + + const cond = if (for_stmt.cond) |cond| + try t.transBoolExpr(&cond_scope.base, cond) + else + ZigTag.true_literal.init(); + + const cont_expr = if (for_stmt.incr) |incr| + try t.transExpr(&cond_scope.base, incr, .unused) + else + null; + + const body = try t.maybeBlockify(&loop_scope, for_stmt.body); + const while_node = try ZigTag.@"while".create(t.arena, .{ .cond = cond, .body = body, .cont_expr = cont_expr }); + if (block_scope) |*bs| { + try bs.statements.append(t.gpa, while_node); + return try bs.complete(); + } else { + return while_node; + } +} + +fn transSwitch(t: *Translator, scope: *Scope, switch_stmt: Node.SwitchStmt) TransError!ZigNode { + var loop_scope: Scope = .{ + .parent = scope, + .id = .loop, + }; + + var block_scope = try Scope.Block.init(t, &loop_scope, false); + defer block_scope.deinit(); + + const base_scope = &block_scope.base; + + var cond_scope: Scope.Condition = .{ + .base = .{ + .parent = base_scope, + .id = .condition, + }, + }; + defer cond_scope.deinit(); + const switch_expr = try t.transExpr(&cond_scope.base, switch_stmt.cond, .used); + + var cases = std.array_list.Managed(ZigNode).init(t.gpa); + defer cases.deinit(); + var has_default = false; + + const body_node = switch_stmt.body.get(t.tree); + if (body_node != .compound_stmt) { + return t.fail(error.UnsupportedTranslation, switch_stmt.switch_tok, "TODO complex switch", .{}); + } + const body = body_node.compound_stmt.body; + // Iterate over switch body and collect all cases. + // Fallthrough is handled by duplicating statements. + for (body, 0..) |stmt, i| { + switch (stmt.get(t.tree)) { + .case_stmt => { + var items = std.array_list.Managed(ZigNode).init(t.gpa); + defer items.deinit(); + const sub = try t.transCaseStmt(base_scope, stmt, &items); + const res = try t.transSwitchProngStmt(base_scope, sub, body[i..]); + + if (items.items.len == 0) { + has_default = true; + const switch_else = try ZigTag.switch_else.create(t.arena, res); + try cases.append(switch_else); + } else { + const switch_prong = try ZigTag.switch_prong.create(t.arena, .{ + .cases = try t.arena.dupe(ZigNode, items.items), + .cond = res, + }); + try cases.append(switch_prong); + } + }, + .default_stmt => |default_stmt| { + has_default = true; + + var sub = default_stmt.body; + while (true) switch (sub.get(t.tree)) { + .case_stmt => |sub_case| sub = sub_case.body, + .default_stmt => |sub_default| sub = sub_default.body, + else => break, + }; + + const res = try t.transSwitchProngStmt(base_scope, sub, body[i..]); + + const switch_else = try ZigTag.switch_else.create(t.arena, res); + try cases.append(switch_else); + }, + else => {}, // collected in transSwitchProngStmt + } + } + + if (!has_default) { + const else_prong = try ZigTag.switch_else.create(t.arena, ZigTag.empty_block.init()); + try cases.append(else_prong); + } + + const switch_node = try ZigTag.@"switch".create(t.arena, .{ + .cond = switch_expr, + .cases = try t.arena.dupe(ZigNode, cases.items), + }); + try block_scope.statements.append(t.gpa, switch_node); + try block_scope.statements.append(t.gpa, ZigTag.@"break".init()); + const while_body = try block_scope.complete(); + + return ZigTag.while_true.create(t.arena, while_body); +} + +/// Collects all items for this case, returns the first statement after the labels. +/// If items ends up empty, the prong should be translated as an else. +fn transCaseStmt( + t: *Translator, + scope: *Scope, + stmt: Node.Index, + items: *std.array_list.Managed(ZigNode), +) TransError!Node.Index { + var sub = stmt; + var seen_default = false; + while (true) { + switch (sub.get(t.tree)) { + .default_stmt => |default_stmt| { + seen_default = true; + items.items.len = 0; + sub = default_stmt.body; + }, + .case_stmt => |case_stmt| { + if (seen_default) { + items.items.len = 0; + sub = case_stmt.body; + continue; + } + + const expr = if (case_stmt.end) |end| blk: { + const start_node = try t.transExpr(scope, case_stmt.start, .used); + const end_node = try t.transExpr(scope, end, .used); + + break :blk try ZigTag.ellipsis3.create(t.arena, .{ .lhs = start_node, .rhs = end_node }); + } else try t.transExpr(scope, case_stmt.start, .used); + + try items.append(expr); + sub = case_stmt.body; + }, + else => return sub, + } + } +} + +/// Collects all statements seen by this case into a block. +/// Avoids creating a block if the first statement is a break or return. +fn transSwitchProngStmt( + t: *Translator, + scope: *Scope, + stmt: Node.Index, + body: []const Node.Index, +) TransError!ZigNode { + switch (stmt.get(t.tree)) { + .break_stmt => return ZigTag.@"break".init(), + .return_stmt => return t.transStmt(scope, stmt), + .case_stmt, .default_stmt => unreachable, + else => { + var block_scope = try Scope.Block.init(t, scope, false); + defer block_scope.deinit(); + + // we do not need to translate `stmt` since it is the first stmt of `body` + try t.transSwitchProngStmtInline(&block_scope, body); + return try block_scope.complete(); + }, + } +} + +/// Collects all statements seen by this case into a block. +fn transSwitchProngStmtInline( + t: *Translator, + block: *Scope.Block, + body: []const Node.Index, +) TransError!void { + for (body) |stmt| { + switch (stmt.get(t.tree)) { + .return_stmt => { + const result = try t.transStmt(&block.base, stmt); + try block.statements.append(t.gpa, result); + return; + }, + .break_stmt => { + try block.statements.append(t.gpa, ZigTag.@"break".init()); + return; + }, + .case_stmt => |case_stmt| { + var sub = case_stmt.body; + while (true) switch (sub.get(t.tree)) { + .case_stmt => |sub_case| sub = sub_case.body, + .default_stmt => |sub_default| sub = sub_default.body, + else => break, + }; + const result = try t.transStmt(&block.base, sub); + assert(result.tag() != .declaration); + try block.statements.append(t.gpa, result); + if (result.isNoreturn(true)) return; + }, + .default_stmt => |default_stmt| { + var sub = default_stmt.body; + while (true) switch (sub.get(t.tree)) { + .case_stmt => |sub_case| sub = sub_case.body, + .default_stmt => |sub_default| sub = sub_default.body, + else => break, + }; + const result = try t.transStmt(&block.base, sub); + assert(result.tag() != .declaration); + try block.statements.append(t.gpa, result); + if (result.isNoreturn(true)) return; + }, + .compound_stmt => |compound_stmt| { + const result = try t.transCompoundStmt(&block.base, compound_stmt); + try block.statements.append(t.gpa, result); + if (result.isNoreturn(true)) return; + }, + else => { + const result = try t.transStmt(&block.base, stmt); + switch (result.tag()) { + .declaration, .empty_block => {}, + else => try block.statements.append(t.gpa, result), + } + }, + } + } +} + +// ====================== +// Expression translation +// ====================== + +const ResultUsed = enum { used, unused }; + +fn transExpr(t: *Translator, scope: *Scope, expr: Node.Index, used: ResultUsed) TransError!ZigNode { + const qt = expr.qt(t.tree); + return t.maybeSuppressResult(used, switch (expr.get(t.tree)) { + .paren_expr => |paren_expr| { + return t.transExpr(scope, paren_expr.operand, used); + }, + .cast => |cast| return t.transCastExpr(scope, cast, cast.qt, used, .with_as), + .decl_ref_expr => |decl_ref| try t.transDeclRefExpr(scope, decl_ref), + .enumeration_ref => |enum_ref| try t.transDeclRefExpr(scope, enum_ref), + .addr_of_expr => |addr_of_expr| try ZigTag.address_of.create(t.arena, try t.transExpr(scope, addr_of_expr.operand, .used)), + .deref_expr => |deref_expr| res: { + if (t.typeWasDemotedToOpaque(qt)) + return t.fail(error.UnsupportedTranslation, deref_expr.op_tok, "cannot dereference opaque type", .{}); + + // Dereferencing a function pointer is a no-op. + if (qt.is(t.comp, .func)) return t.transExpr(scope, deref_expr.operand, used); + + break :res try ZigTag.deref.create(t.arena, try t.transExpr(scope, deref_expr.operand, .used)); + }, + .bool_not_expr => |bool_not_expr| try ZigTag.not.create(t.arena, try t.transBoolExpr(scope, bool_not_expr.operand)), + .bit_not_expr => |bit_not_expr| try ZigTag.bit_not.create(t.arena, try t.transExpr(scope, bit_not_expr.operand, .used)), + .plus_expr => |plus_expr| return t.transExpr(scope, plus_expr.operand, used), + .negate_expr => |negate_expr| res: { + const operand_qt = negate_expr.operand.qt(t.tree); + if (!t.typeHasWrappingOverflow(operand_qt)) { + const sub_expr_node = try t.transExpr(scope, negate_expr.operand, .used); + const to_negate = if (sub_expr_node.isBoolRes()) blk: { + const ty_node = try ZigTag.type.create(t.arena, "c_int"); + const int_node = try ZigTag.int_from_bool.create(t.arena, sub_expr_node); + break :blk try ZigTag.as.create(t.arena, .{ .lhs = ty_node, .rhs = int_node }); + } else sub_expr_node; + + break :res try ZigTag.negate.create(t.arena, to_negate); + } else if (t.signedness(operand_qt) == .unsigned) { + // use -% x for unsigned integers + break :res try ZigTag.negate_wrap.create(t.arena, try t.transExpr(scope, negate_expr.operand, .used)); + } else return t.fail(error.UnsupportedTranslation, negate_expr.op_tok, "C negation with non float non integer", .{}); + }, + .div_expr => |div_expr| res: { + if (qt.isInt(t.comp) and t.signedness(qt) == .signed) { + // signed integer division uses @divTrunc + const lhs = try t.transExpr(scope, div_expr.lhs, .used); + const rhs = try t.transExpr(scope, div_expr.rhs, .used); + break :res try ZigTag.div_trunc.create(t.arena, .{ .lhs = lhs, .rhs = rhs }); + } + // unsigned/float division uses the operator + break :res try t.transBinExpr(scope, div_expr, .div); + }, + .mod_expr => |mod_expr| res: { + if (qt.isInt(t.comp) and t.signedness(qt) == .signed) { + // signed integer remainder uses __helpers.signedRemainder + const lhs = try t.transExpr(scope, mod_expr.lhs, .used); + const rhs = try t.transExpr(scope, mod_expr.rhs, .used); + break :res try t.createHelperCallNode(.signedRemainder, &.{ lhs, rhs }); + } + // unsigned/float division uses the operator + break :res try t.transBinExpr(scope, mod_expr, .mod); + }, + .add_expr => |add_expr| res: { + // `ptr + idx` and `idx + ptr` -> ptr + @as(usize, @bitCast(@as(isize, @intCast(idx)))) + const lhs_qt = add_expr.lhs.qt(t.tree); + const rhs_qt = add_expr.rhs.qt(t.tree); + if (qt.isPointer(t.comp) and (t.signedness(lhs_qt) == .signed or + t.signedness(rhs_qt) == .signed)) + { + break :res try t.transPointerArithmeticSignedOp(scope, add_expr, .add); + } + + if (t.signedness(qt) == .unsigned) { + break :res try t.transBinExpr(scope, add_expr, .add_wrap); + } else { + break :res try t.transBinExpr(scope, add_expr, .add); + } + }, + .sub_expr => |sub_expr| res: { + // `ptr - idx` -> ptr - @as(usize, @bitCast(@as(isize, @intCast(idx)))) + const lhs_qt = sub_expr.lhs.qt(t.tree); + const rhs_qt = sub_expr.rhs.qt(t.tree); + if (qt.isPointer(t.comp) and (t.signedness(lhs_qt) == .signed or + t.signedness(rhs_qt) == .signed)) + { + break :res try t.transPointerArithmeticSignedOp(scope, sub_expr, .sub); + } + + if (sub_expr.lhs.qt(t.tree).isPointer(t.comp) and sub_expr.rhs.qt(t.tree).isPointer(t.comp)) { + break :res try t.transPtrDiffExpr(scope, sub_expr); + } else if (t.signedness(qt) == .unsigned) { + break :res try t.transBinExpr(scope, sub_expr, .sub_wrap); + } else { + break :res try t.transBinExpr(scope, sub_expr, .sub); + } + }, + .mul_expr => |mul_expr| if (t.signedness(qt) == .unsigned) + try t.transBinExpr(scope, mul_expr, .mul_wrap) + else + try t.transBinExpr(scope, mul_expr, .mul), + + .less_than_expr => |lt| try t.transBinExpr(scope, lt, .less_than), + .greater_than_expr => |gt| try t.transBinExpr(scope, gt, .greater_than), + .less_than_equal_expr => |lte| try t.transBinExpr(scope, lte, .less_than_equal), + .greater_than_equal_expr => |gte| try t.transBinExpr(scope, gte, .greater_than_equal), + .equal_expr => |equal_expr| try t.transBinExpr(scope, equal_expr, .equal), + .not_equal_expr => |not_equal_expr| try t.transBinExpr(scope, not_equal_expr, .not_equal), + + .bool_and_expr => |bool_and_expr| try t.transBoolBinExpr(scope, bool_and_expr, .@"and"), + .bool_or_expr => |bool_or_expr| try t.transBoolBinExpr(scope, bool_or_expr, .@"or"), + + .bit_and_expr => |bit_and_expr| try t.transBinExpr(scope, bit_and_expr, .bit_and), + .bit_or_expr => |bit_or_expr| try t.transBinExpr(scope, bit_or_expr, .bit_or), + .bit_xor_expr => |bit_xor_expr| try t.transBinExpr(scope, bit_xor_expr, .bit_xor), + + .shl_expr => |shl_expr| try t.transShiftExpr(scope, shl_expr, .shl), + .shr_expr => |shr_expr| try t.transShiftExpr(scope, shr_expr, .shr), + + .member_access_expr => |member_access| try t.transMemberAccess(scope, .normal, member_access, null), + .member_access_ptr_expr => |member_access| try t.transMemberAccess(scope, .ptr, member_access, null), + .array_access_expr => |array_access| try t.transArrayAccess(scope, array_access, null), + + .builtin_ref => unreachable, + .builtin_call_expr => |call| return t.transBuiltinCall(scope, call, used), + .call_expr => |call| return t.transCall(scope, call, used), + + .builtin_types_compatible_p => |compatible| blk: { + const lhs = try t.transType(scope, compatible.lhs, compatible.builtin_tok); + const rhs = try t.transType(scope, compatible.rhs, compatible.builtin_tok); + + break :blk try ZigTag.equal.create(t.arena, .{ + .lhs = lhs, + .rhs = rhs, + }); + }, + .builtin_choose_expr => |choose| return t.transCondExpr(scope, choose, used), + .cond_expr => |cond_expr| return t.transCondExpr(scope, cond_expr, used), + .binary_cond_expr => |conditional| return t.transBinaryCondExpr(scope, conditional, used), + .cond_dummy_expr => unreachable, + + .assign_expr => |assign| return t.transAssignExpr(scope, assign, used), + .add_assign_expr => |assign| return t.transCompoundAssign(scope, assign, used), + .sub_assign_expr => |assign| return t.transCompoundAssign(scope, assign, used), + .mul_assign_expr => |assign| return t.transCompoundAssign(scope, assign, used), + .div_assign_expr => |assign| return t.transCompoundAssign(scope, assign, used), + .mod_assign_expr => |assign| return t.transCompoundAssign(scope, assign, used), + .shl_assign_expr => |assign| return t.transCompoundAssign(scope, assign, used), + .shr_assign_expr => |assign| return t.transCompoundAssign(scope, assign, used), + .bit_and_assign_expr => |assign| return t.transCompoundAssign(scope, assign, used), + .bit_xor_assign_expr => |assign| return t.transCompoundAssign(scope, assign, used), + .bit_or_assign_expr => |assign| return t.transCompoundAssign(scope, assign, used), + .compound_assign_dummy_expr => { + assert(used == .used); + return t.compound_assign_dummy.?; + }, + + .comma_expr => |comma_expr| return t.transCommaExpr(scope, comma_expr, used), + .pre_inc_expr => |un| return t.transIncDecExpr(scope, un, .pre, .inc, used), + .pre_dec_expr => |un| return t.transIncDecExpr(scope, un, .pre, .dec, used), + .post_inc_expr => |un| return t.transIncDecExpr(scope, un, .post, .inc, used), + .post_dec_expr => |un| return t.transIncDecExpr(scope, un, .post, .dec, used), + + .int_literal => return t.transIntLiteral(scope, expr, used, .with_as), + .char_literal => return t.transCharLiteral(scope, expr, used, .with_as), + .float_literal => return t.transFloatLiteral(scope, expr, used, .with_as), + .string_literal_expr => |literal| try t.transStringLiteral(scope, expr, literal), + .bool_literal => res: { + const val = t.tree.value_map.get(expr).?; + break :res if (val.toBool(t.comp)) + ZigTag.true_literal.init() + else + ZigTag.false_literal.init(); + }, + .nullptr_literal => ZigTag.null_literal.init(), + .imaginary_literal => |literal| { + return t.fail(error.UnsupportedTranslation, literal.op_tok, "TODO complex numbers", .{}); + }, + .compound_literal_expr => |literal| return t.transCompoundLiteral(scope, literal, used), + + .default_init_expr => |default_init| return t.transDefaultInit(scope, default_init, used, .with_as), + .array_init_expr => |array_init| return t.transArrayInit(scope, array_init, used), + .union_init_expr => |union_init| return t.transUnionInit(scope, union_init, used), + .struct_init_expr => |struct_init| return t.transStructInit(scope, struct_init, used), + .array_filler_expr => unreachable, + + .sizeof_expr => |sizeof| try t.transTypeInfo(scope, .sizeof, sizeof), + .alignof_expr => |alignof| try t.transTypeInfo(scope, .alignof, alignof), + + .imag_expr, .real_expr => |un| { + return t.fail(error.UnsupportedTranslation, un.op_tok, "TODO complex numbers", .{}); + }, + .addr_of_label => |addr_of_label| { + return t.fail(error.UnsupportedTranslation, addr_of_label.label_tok, "TODO computed goto", .{}); + }, + + .generic_expr => |generic| return t.transExpr(scope, generic.chosen, used), + .generic_association_expr => |generic| return t.transExpr(scope, generic.expr, used), + .generic_default_expr => |generic| return t.transExpr(scope, generic.expr, used), + + .stmt_expr => |stmt_expr| return t.transStmtExpr(scope, stmt_expr, used), + + .builtin_convertvector => |convertvector| try t.transConvertvectorExpr(scope, convertvector), + .builtin_shufflevector => |shufflevector| try t.transShufflevectorExpr(scope, shufflevector), + + .compound_stmt, + .static_assert, + .return_stmt, + .null_stmt, + .if_stmt, + .while_stmt, + .do_while_stmt, + .for_stmt, + .continue_stmt, + .break_stmt, + .labeled_stmt, + .switch_stmt, + .case_stmt, + .default_stmt, + .goto_stmt, + .computed_goto_stmt, + .gnu_asm_simple, + .global_asm, + .typedef, + .struct_decl, + .union_decl, + .enum_decl, + .function, + .param, + .variable, + .enum_field, + .record_field, + .struct_forward_decl, + .union_forward_decl, + .enum_forward_decl, + .empty_decl, + => unreachable, // not an expression + }); +} + +/// Same as `transExpr` but with the knowledge that the operand will be type coerced, and therefore +/// an `@as` would be redundant. This is used to prevent redundant `@as` in integer literals. +fn transExprCoercing(t: *Translator, scope: *Scope, expr: Node.Index, used: ResultUsed) TransError!ZigNode { + switch (expr.get(t.tree)) { + .int_literal => return t.transIntLiteral(scope, expr, used, .no_as), + .char_literal => return t.transCharLiteral(scope, expr, used, .no_as), + .float_literal => return t.transFloatLiteral(scope, expr, used, .no_as), + .cast => |cast| switch (cast.kind) { + .no_op => { + const operand = cast.operand.get(t.tree); + if (operand == .cast) { + return t.transCastExpr(scope, operand.cast, cast.qt, used, .no_as); + } + return t.transExprCoercing(scope, cast.operand, used); + }, + .lval_to_rval => return t.transExprCoercing(scope, cast.operand, used), + else => return t.transCastExpr(scope, cast, cast.qt, used, .no_as), + }, + .default_init_expr => |default_init| return try t.transDefaultInit(scope, default_init, used, .no_as), + .compound_literal_expr => |literal| { + if (!literal.thread_local and literal.storage_class != .static) { + return t.transExprCoercing(scope, literal.initializer, used); + } + }, + else => {}, + } + + return t.transExpr(scope, expr, used); +} + +fn transBoolExpr(t: *Translator, scope: *Scope, expr: Node.Index) TransError!ZigNode { + switch (expr.get(t.tree)) { + .int_literal => { + const int_val = t.tree.value_map.get(expr).?; + return if (int_val.isZero(t.comp)) + ZigTag.false_literal.init() + else + ZigTag.true_literal.init(); + }, + .cast => |cast| switch (cast.kind) { + .bool_to_int => return t.transExpr(scope, cast.operand, .used), + .array_to_pointer => { + const operand = cast.operand.get(t.tree); + if (operand == .string_literal_expr) { + // @intFromPtr("foo") != 0, always true + const str = try t.transStringLiteral(scope, cast.operand, operand.string_literal_expr); + const int_from_ptr = try ZigTag.int_from_ptr.create(t.arena, str); + return ZigTag.not_equal.create(t.arena, .{ .lhs = int_from_ptr, .rhs = ZigTag.zero_literal.init() }); + } + }, + else => {}, + }, + else => {}, + } + + const maybe_bool_res = try t.transExpr(scope, expr, .used); + if (maybe_bool_res.isBoolRes()) { + return maybe_bool_res; + } + + return t.finishBoolExpr(expr.qt(t.tree), maybe_bool_res); +} + +fn finishBoolExpr(t: *Translator, qt: QualType, node: ZigNode) TransError!ZigNode { + const sk = qt.scalarKind(t.comp); + if (sk == .bool) return node; + if (sk == .nullptr_t) { + // node == null, always true + return ZigTag.equal.create(t.arena, .{ .lhs = node, .rhs = ZigTag.null_literal.init() }); + } + if (sk.isPointer()) { + // node != null + return ZigTag.not_equal.create(t.arena, .{ .lhs = node, .rhs = ZigTag.null_literal.init() }); + } + if (sk != .none) { + // node != 0 + return ZigTag.not_equal.create(t.arena, .{ .lhs = node, .rhs = ZigTag.zero_literal.init() }); + } + unreachable; // Unexpected bool expression type +} + +fn transCastExpr( + t: *Translator, + scope: *Scope, + cast: Node.Cast, + dest_qt: QualType, + used: ResultUsed, + suppress_as: SuppressCast, +) TransError!ZigNode { + const operand = switch (cast.kind) { + .no_op => { + const operand = cast.operand.get(t.tree); + if (operand == .cast) { + return t.transCastExpr(scope, operand.cast, cast.qt, used, suppress_as); + } + return t.transExpr(scope, cast.operand, used); + }, + .lval_to_rval, .function_to_pointer => { + return t.transExpr(scope, cast.operand, used); + }, + .int_cast => int_cast: { + const src_qt = cast.operand.qt(t.tree); + + if (cast.implicit) { + if (t.tree.value_map.get(cast.operand)) |val| { + const max_int = try aro.Value.maxInt(dest_qt, t.comp); + const min_int = try aro.Value.minInt(dest_qt, t.comp); + + if (val.compare(.lte, max_int, t.comp) and val.compare(.gte, min_int, t.comp)) { + break :int_cast try t.transExprCoercing(scope, cast.operand, .used); + } + } + } + const operand = try t.transExpr(scope, cast.operand, .used); + break :int_cast try t.transIntCast(operand, src_qt, dest_qt); + }, + .to_void => { + assert(used == .unused); + return try t.transExpr(scope, cast.operand, .unused); + }, + .null_to_pointer => ZigTag.null_literal.init(), + .array_to_pointer => array_to_pointer: { + const child_qt = dest_qt.childType(t.comp); + + loop: switch (cast.operand.get(t.tree)) { + .string_literal_expr => |literal| { + const sub_expr_node = try t.transExpr(scope, cast.operand, .used); + + const ref = if (literal.kind == .utf8 or literal.kind == .ascii) + sub_expr_node + else + try ZigTag.address_of.create(t.arena, sub_expr_node); + + const casted = if (child_qt.@"const") + ref + else + try ZigTag.const_cast.create(t.arena, sub_expr_node); + + return t.maybeSuppressResult(used, casted); + }, + .paren_expr => |paren_expr| { + continue :loop paren_expr.operand.get(t.tree); + }, + .generic_expr => |generic| { + continue :loop generic.chosen.get(t.tree); + }, + .generic_association_expr => |generic| { + continue :loop generic.expr.get(t.tree); + }, + .generic_default_expr => |generic| { + continue :loop generic.expr.get(t.tree); + }, + else => {}, + } + + if (cast.operand.qt(t.tree).arrayLen(t.comp) == null) { + return try t.transExpr(scope, cast.operand, used); + } + + const sub_expr_node = try t.transExpr(scope, cast.operand, .used); + const ref = try ZigTag.address_of.create(t.arena, sub_expr_node); + const align_cast = try ZigTag.align_cast.create(t.arena, ref); + break :array_to_pointer try ZigTag.ptr_cast.create(t.arena, align_cast); + }, + .int_to_pointer => int_to_pointer: { + var sub_expr_node = try t.transExpr(scope, cast.operand, .used); + const operand_qt = cast.operand.qt(t.tree); + if (t.signedness(operand_qt) == .signed or operand_qt.bitSizeof(t.comp) > t.comp.target.ptrBitWidth()) { + sub_expr_node = try ZigTag.as.create(t.arena, .{ + .lhs = try ZigTag.type.create(t.arena, "usize"), + .rhs = try ZigTag.int_cast.create(t.arena, sub_expr_node), + }); + } + break :int_to_pointer try ZigTag.ptr_from_int.create(t.arena, sub_expr_node); + }, + .int_to_bool => { + const sub_expr_node = try t.transExpr(scope, cast.operand, .used); + if (sub_expr_node.isBoolRes()) return sub_expr_node; + if (cast.operand.qt(t.tree).is(t.comp, .bool)) return sub_expr_node; + const cmp_node = try ZigTag.not_equal.create(t.arena, .{ .lhs = sub_expr_node, .rhs = ZigTag.zero_literal.init() }); + return t.maybeSuppressResult(used, cmp_node); + }, + .float_to_bool => { + const sub_expr_node = try t.transExpr(scope, cast.operand, .used); + const cmp_node = try ZigTag.not_equal.create(t.arena, .{ .lhs = sub_expr_node, .rhs = ZigTag.zero_literal.init() }); + return t.maybeSuppressResult(used, cmp_node); + }, + .pointer_to_bool => { + const sub_expr_node = try t.transExpr(scope, cast.operand, .used); + + // Special case function pointers as @intFromPtr(expr) != 0 + if (cast.operand.qt(t.tree).get(t.comp, .pointer)) |ptr_ty| if (ptr_ty.child.is(t.comp, .func)) { + const ptr_node = if (sub_expr_node.tag() == .identifier) + try ZigTag.address_of.create(t.arena, sub_expr_node) + else + sub_expr_node; + const int_from_ptr = try ZigTag.int_from_ptr.create(t.arena, ptr_node); + const cmp_node = try ZigTag.not_equal.create(t.arena, .{ .lhs = int_from_ptr, .rhs = ZigTag.zero_literal.init() }); + return t.maybeSuppressResult(used, cmp_node); + }; + + const cmp_node = try ZigTag.not_equal.create(t.arena, .{ .lhs = sub_expr_node, .rhs = ZigTag.null_literal.init() }); + return t.maybeSuppressResult(used, cmp_node); + }, + .bool_to_int => bool_to_int: { + const sub_expr_node = try t.transExpr(scope, cast.operand, .used); + break :bool_to_int try ZigTag.int_from_bool.create(t.arena, sub_expr_node); + }, + .bool_to_float => bool_to_float: { + const sub_expr_node = try t.transExpr(scope, cast.operand, .used); + const int_from_bool = try ZigTag.int_from_bool.create(t.arena, sub_expr_node); + break :bool_to_float try ZigTag.float_from_int.create(t.arena, int_from_bool); + }, + .bool_to_pointer => bool_to_pointer: { + const sub_expr_node = try t.transExpr(scope, cast.operand, .used); + const int_from_bool = try ZigTag.int_from_bool.create(t.arena, sub_expr_node); + break :bool_to_pointer try ZigTag.ptr_from_int.create(t.arena, int_from_bool); + }, + .float_cast => float_cast: { + const sub_expr_node = try t.transExpr(scope, cast.operand, .used); + break :float_cast try ZigTag.float_cast.create(t.arena, sub_expr_node); + }, + .int_to_float => int_to_float: { + const sub_expr_node = try t.transExpr(scope, cast.operand, used); + const int_node = if (sub_expr_node.isBoolRes()) + try ZigTag.int_from_bool.create(t.arena, sub_expr_node) + else + sub_expr_node; + break :int_to_float try ZigTag.float_from_int.create(t.arena, int_node); + }, + .float_to_int => float_to_int: { + const sub_expr_node = try t.transExpr(scope, cast.operand, .used); + break :float_to_int try ZigTag.int_from_float.create(t.arena, sub_expr_node); + }, + .pointer_to_int => pointer_to_int: { + const sub_expr_node = try t.transPointerCastExpr(scope, cast.operand); + const ptr_node = try ZigTag.int_from_ptr.create(t.arena, sub_expr_node); + break :pointer_to_int try ZigTag.int_cast.create(t.arena, ptr_node); + }, + .bitcast => bitcast: { + const sub_expr_node = try t.transPointerCastExpr(scope, cast.operand); + const operand_qt = cast.operand.qt(t.tree); + if (dest_qt.isPointer(t.comp) and operand_qt.isPointer(t.comp)) { + var casted = try ZigTag.align_cast.create(t.arena, sub_expr_node); + casted = try ZigTag.ptr_cast.create(t.arena, casted); + + const src_elem = operand_qt.childType(t.comp); + const dest_elem = dest_qt.childType(t.comp); + if ((src_elem.@"const" or src_elem.is(t.comp, .func)) and !dest_elem.@"const") { + casted = try ZigTag.const_cast.create(t.arena, casted); + } + if (src_elem.@"volatile" and !dest_elem.@"volatile") { + casted = try ZigTag.volatile_cast.create(t.arena, casted); + } + break :bitcast casted; + } + + break :bitcast try ZigTag.bit_cast.create(t.arena, sub_expr_node); + }, + .union_cast => union_cast: { + const union_type = try t.transType(scope, dest_qt, cast.l_paren); + + const operand_qt = cast.operand.qt(t.tree); + const union_base = dest_qt.base(t.comp); + const field = for (union_base.type.@"union".fields) |field| { + if (field.qt.eql(operand_qt, t.comp)) break field; + } else unreachable; + const field_name = if (field.name_tok == 0) t.anonymous_record_field_names.get(.{ + .parent = union_base.qt, + .field = field.qt, + }).? else field.name.lookup(t.comp); + + const field_init = try t.arena.create(ast.Payload.ContainerInit.Initializer); + field_init.* = .{ + .name = field_name, + .value = try t.transExpr(scope, cast.operand, .used), + }; + break :union_cast try ZigTag.container_init.create(t.arena, .{ + .lhs = union_type, + .inits = field_init[0..1], + }); + }, + else => return t.fail(error.UnsupportedTranslation, cast.l_paren, "TODO translate {s} cast", .{@tagName(cast.kind)}), + }; + if (suppress_as == .no_as) return t.maybeSuppressResult(used, operand); + if (used == .unused) return t.maybeSuppressResult(used, operand); + const as = try ZigTag.as.create(t.arena, .{ + .lhs = try t.transType(scope, dest_qt, cast.l_paren), + .rhs = operand, + }); + return as; +} + +fn transIntCast(t: *Translator, operand: ZigNode, src_qt: QualType, dest_qt: QualType) !ZigNode { + const src_dest_order = src_qt.intRankOrder(dest_qt, t.comp); + const different_sign = t.signedness(src_qt) != t.signedness(dest_qt); + const needs_bitcast = different_sign and !(t.signedness(src_qt) == .unsigned and src_dest_order == .lt); + + var casted = operand; + if (casted.isBoolRes()) { + casted = try ZigTag.int_from_bool.create(t.arena, casted); + } else if (src_dest_order == .gt) { + // No C type is smaller than the 1 bit from @intFromBool + casted = try ZigTag.truncate.create(t.arena, casted); + } + if (needs_bitcast) { + if (src_dest_order != .eq) { + casted = try ZigTag.as.create(t.arena, .{ + .lhs = try t.transTypeIntWidthOf(dest_qt, t.signedness(src_qt) == .signed), + .rhs = casted, + }); + } + return ZigTag.bit_cast.create(t.arena, casted); + } + return casted; +} + +/// Same as `transExpr` but adds a `&` if the expression is an identifier referencing a function type. +fn transPointerCastExpr(t: *Translator, scope: *Scope, expr: Node.Index) TransError!ZigNode { + const sub_expr_node = try t.transExpr(scope, expr, .used); + switch (expr.get(t.tree)) { + .cast => |cast| if (cast.kind == .function_to_pointer and sub_expr_node.tag() == .identifier) { + return ZigTag.address_of.create(t.arena, sub_expr_node); + }, + else => {}, + } + return sub_expr_node; +} + +fn transDeclRefExpr(t: *Translator, scope: *Scope, decl_ref: Node.DeclRef) TransError!ZigNode { + const name = t.tree.tokSlice(decl_ref.name_tok); + const maybe_alias = scope.getAlias(name); + const mangled_name = maybe_alias orelse name; + + switch (decl_ref.decl.get(t.tree)) { + .function => |function| if (function.definition == null and function.body == null) { + // Try translating the decl again in case of out of scope declaration. + try t.transFnDecl(scope, function); + }, + else => {}, + } + + const decl = decl_ref.decl.get(t.tree); + const ref_expr = blk: { + const identifier = try ZigTag.identifier.create(t.arena, mangled_name); + if (decl_ref.qt.is(t.comp, .func) and maybe_alias != null) { + break :blk try ZigTag.field_access.create(t.arena, .{ + .lhs = identifier, + .field_name = name, + }); + } + if (decl == .variable and maybe_alias != null) { + switch (decl.variable.storage_class) { + .@"extern", .static => { + break :blk try ZigTag.field_access.create(t.arena, .{ + .lhs = identifier, + .field_name = name, + }); + }, + else => {}, + } + } + break :blk identifier; + }; + + scope.skipVariableDiscard(mangled_name); + return ref_expr; +} + +fn transBinExpr(t: *Translator, scope: *Scope, bin: Node.Binary, op_id: ZigTag) TransError!ZigNode { + const lhs_uncasted = try t.transExpr(scope, bin.lhs, .used); + const rhs_uncasted = try t.transExpr(scope, bin.rhs, .used); + + const lhs = if (lhs_uncasted.isBoolRes()) + try ZigTag.int_from_bool.create(t.arena, lhs_uncasted) + else + lhs_uncasted; + + const rhs = if (rhs_uncasted.isBoolRes()) + try ZigTag.int_from_bool.create(t.arena, rhs_uncasted) + else + rhs_uncasted; + + return t.createBinOpNode(op_id, lhs, rhs); +} + +fn transBoolBinExpr(t: *Translator, scope: *Scope, bin: Node.Binary, op: ZigTag) !ZigNode { + std.debug.assert(op == .@"and" or op == .@"or"); + + const lhs = try t.transBoolExpr(scope, bin.lhs); + const rhs = try t.transBoolExpr(scope, bin.rhs); + + return t.createBinOpNode(op, lhs, rhs); +} + +fn transShiftExpr(t: *Translator, scope: *Scope, bin: Node.Binary, op_id: ZigTag) !ZigNode { + std.debug.assert(op_id == .shl or op_id == .shr); + + // lhs >> @intCast(rh) + const lhs = try t.transExpr(scope, bin.lhs, .used); + + const rhs = try t.transExprCoercing(scope, bin.rhs, .used); + const rhs_casted = try ZigTag.int_cast.create(t.arena, rhs); + + return t.createBinOpNode(op_id, lhs, rhs_casted); +} + +fn transCondExpr( + t: *Translator, + scope: *Scope, + conditional: Node.Conditional, + used: ResultUsed, +) TransError!ZigNode { + var cond_scope: Scope.Condition = .{ + .base = .{ + .parent = scope, + .id = .condition, + }, + }; + defer cond_scope.deinit(); + + const res_is_bool = conditional.qt.is(t.comp, .bool); + const cond = try t.transBoolExpr(&cond_scope.base, conditional.cond); + + var then_body = try t.transExpr(scope, conditional.then_expr, used); + if (!res_is_bool and then_body.isBoolRes()) { + then_body = try ZigTag.int_from_bool.create(t.arena, then_body); + } + + var else_body = try t.transExpr(scope, conditional.else_expr, used); + if (!res_is_bool and else_body.isBoolRes()) { + else_body = try ZigTag.int_from_bool.create(t.arena, else_body); + } + + // The `ResultUsed` is forwarded to both branches so no need to suppress the result here. + return ZigTag.@"if".create(t.arena, .{ .cond = cond, .then = then_body, .@"else" = else_body }); +} + +fn transBinaryCondExpr( + t: *Translator, + scope: *Scope, + conditional: Node.Conditional, + used: ResultUsed, +) TransError!ZigNode { + // GNU extension of the ternary operator where the middle expression is + // omitted, the condition itself is returned if it evaluates to true. + + if (used == .unused) { + // Result unused so this can be translated as + // if (condition) else_expr; + var cond_scope: Scope.Condition = .{ + .base = .{ + .parent = scope, + .id = .condition, + }, + }; + defer cond_scope.deinit(); + + return ZigTag.@"if".create(t.arena, .{ + .cond = try t.transBoolExpr(&cond_scope.base, conditional.cond), + .then = try t.transExpr(scope, conditional.else_expr, .unused), + .@"else" = null, + }); + } + + const res_is_bool = conditional.qt.is(t.comp, .bool); + // c: (condition)?:(else_expr) + // zig: (blk: { + // const _cond_temp = (condition); + // break :blk if (_cond_temp) _cond_temp else (else_expr); + // }) + var block_scope = try Scope.Block.init(t, scope, true); + defer block_scope.deinit(); + + const cond_temp = try block_scope.reserveMangledName("cond_temp"); + const init_node = try t.transExpr(&block_scope.base, conditional.cond, .used); + const temp_decl = try ZigTag.var_simple.create(t.arena, .{ .name = cond_temp, .init = init_node }); + try block_scope.statements.append(t.gpa, temp_decl); + + var cond_scope: Scope.Condition = .{ + .base = .{ + .parent = &block_scope.base, + .id = .condition, + }, + }; + defer cond_scope.deinit(); + + const cond_ident = try ZigTag.identifier.create(t.arena, cond_temp); + const cond_node = try t.finishBoolExpr(conditional.cond.qt(t.tree), cond_ident); + var then_body = cond_ident; + if (!res_is_bool and init_node.isBoolRes()) { + then_body = try ZigTag.int_from_bool.create(t.arena, then_body); + } + + var else_body = try t.transExpr(&block_scope.base, conditional.else_expr, .used); + if (!res_is_bool and else_body.isBoolRes()) { + else_body = try ZigTag.int_from_bool.create(t.arena, else_body); + } + const if_node = try ZigTag.@"if".create(t.arena, .{ + .cond = cond_node, + .then = then_body, + .@"else" = else_body, + }); + const break_node = try ZigTag.break_val.create(t.arena, .{ + .label = block_scope.label, + .val = if_node, + }); + try block_scope.statements.append(t.gpa, break_node); + return block_scope.complete(); +} + +fn transCommaExpr(t: *Translator, scope: *Scope, bin: Node.Binary, used: ResultUsed) TransError!ZigNode { + if (used == .unused) { + const lhs = try t.transExprCoercing(scope, bin.lhs, .unused); + try scope.appendNode(lhs); + const rhs = try t.transExprCoercing(scope, bin.rhs, .unused); + return rhs; + } + + var block_scope = try Scope.Block.init(t, scope, true); + defer block_scope.deinit(); + + const lhs = try t.transExprCoercing(&block_scope.base, bin.lhs, .unused); + try block_scope.statements.append(t.gpa, lhs); + + const rhs = try t.transExprCoercing(&block_scope.base, bin.rhs, .used); + const break_node = try ZigTag.break_val.create(t.arena, .{ + .label = block_scope.label, + .val = rhs, + }); + try block_scope.statements.append(t.gpa, break_node); + + return try block_scope.complete(); +} + +fn transAssignExpr(t: *Translator, scope: *Scope, bin: Node.Binary, used: ResultUsed) !ZigNode { + if (used == .unused) { + const lhs = try t.transExpr(scope, bin.lhs, .used); + var rhs = try t.transExprCoercing(scope, bin.rhs, .used); + + const lhs_qt = bin.lhs.qt(t.tree); + if (rhs.isBoolRes() and !lhs_qt.is(t.comp, .bool)) { + rhs = try ZigTag.int_from_bool.create(t.arena, rhs); + } + + return t.createBinOpNode(.assign, lhs, rhs); + } + + var block_scope = try Scope.Block.init(t, scope, true); + defer block_scope.deinit(); + + const tmp = try block_scope.reserveMangledName("tmp"); + + var rhs = try t.transExpr(&block_scope.base, bin.rhs, .used); + const lhs_qt = bin.lhs.qt(t.tree); + if (rhs.isBoolRes() and !lhs_qt.is(t.comp, .bool)) { + rhs = try ZigTag.int_from_bool.create(t.arena, rhs); + } + + const tmp_decl = try ZigTag.var_simple.create(t.arena, .{ .name = tmp, .init = rhs }); + try block_scope.statements.append(t.gpa, tmp_decl); + + const lhs = try t.transExprCoercing(&block_scope.base, bin.lhs, .used); + const tmp_ident = try ZigTag.identifier.create(t.arena, tmp); + + const assign = try t.createBinOpNode(.assign, lhs, tmp_ident); + try block_scope.statements.append(t.gpa, assign); + + const break_node = try ZigTag.break_val.create(t.arena, .{ + .label = block_scope.label, + .val = tmp_ident, + }); + try block_scope.statements.append(t.gpa, break_node); + + return try block_scope.complete(); +} + +fn transCompoundAssign( + t: *Translator, + scope: *Scope, + assign: Node.Binary, + used: ResultUsed, +) !ZigNode { + // If the result is unused we can try using the equivalent Zig operator + // without a block + if (used == .unused) { + if (try t.transCompoundAssignSimple(scope, null, assign)) |some| { + return some; + } + } + + // Otherwise we need to wrap the the compound assignment in a block. + var block_scope = try Scope.Block.init(t, scope, used == .used); + defer block_scope.deinit(); + const ref = try block_scope.reserveMangledName("ref"); + + const lhs_expr = try t.transExpr(&block_scope.base, assign.lhs, .used); + const addr_of = try ZigTag.address_of.create(t.arena, lhs_expr); + const ref_decl = try ZigTag.var_simple.create(t.arena, .{ .name = ref, .init = addr_of }); + try block_scope.statements.append(t.gpa, ref_decl); + + const lhs_node = try ZigTag.identifier.create(t.arena, ref); + const ref_node = try ZigTag.deref.create(t.arena, lhs_node); + + // Use the equivalent Zig operator if possible. + if (try t.transCompoundAssignSimple(scope, ref_node, assign)) |some| { + try block_scope.statements.append(t.gpa, some); + } else { + const old_dummy = t.compound_assign_dummy; + defer t.compound_assign_dummy = old_dummy; + t.compound_assign_dummy = ref_node; + + // Otherwise do the operation and assignment separately. + const rhs_node = try t.transExprCoercing(&block_scope.base, assign.rhs, .used); + const assign_node = try t.createBinOpNode(.assign, ref_node, rhs_node); + try block_scope.statements.append(t.gpa, assign_node); + } + + if (used == .used) { + const break_node = try ZigTag.break_val.create(t.arena, .{ + .label = block_scope.label, + .val = ref_node, + }); + try block_scope.statements.append(t.gpa, break_node); + } + return block_scope.complete(); +} + +/// Translates compound assignment using the equivalent Zig operator if possible. +fn transCompoundAssignSimple(t: *Translator, scope: *Scope, lhs_dummy_opt: ?ZigNode, assign: Node.Binary) TransError!?ZigNode { + const assign_rhs = assign.rhs.get(t.tree); + if (assign_rhs == .cast) return null; + + const is_signed = t.signedness(assign.qt) == .signed; + switch (assign_rhs) { + .div_expr, .mod_expr => if (is_signed) return null, + else => {}, + } + const lhs_ptr = assign.qt.isPointer(t.comp); + + const bin, const op: ZigTag, const cast: enum { none, shift, usize } = switch (assign_rhs) { + .add_expr => |bin| .{ + bin, + if (t.typeHasWrappingOverflow(bin.qt)) .add_wrap_assign else .add_assign, + if (lhs_ptr and t.signedness(bin.rhs.qt(t.tree)) == .signed) .usize else .none, + }, + .sub_expr => |bin| .{ + bin, + if (t.typeHasWrappingOverflow(bin.qt)) .sub_wrap_assign else .sub_assign, + if (lhs_ptr and t.signedness(bin.rhs.qt(t.tree)) == .signed) .usize else .none, + }, + .mul_expr => |bin| .{ + bin, + if (t.typeHasWrappingOverflow(bin.qt)) .mul_wrap_assign else .mul_assign, + .none, + }, + .mod_expr => |bin| .{ bin, .mod_assign, .none }, + .div_expr => |bin| .{ bin, .div_assign, .none }, + .shl_expr => |bin| .{ bin, .shl_assign, .shift }, + .shr_expr => |bin| .{ bin, .shr_assign, .shift }, + .bit_and_expr => |bin| .{ bin, .bit_and_assign, .none }, + .bit_xor_expr => |bin| .{ bin, .bit_xor_assign, .none }, + .bit_or_expr => |bin| .{ bin, .bit_or_assign, .none }, + else => unreachable, + }; + + const lhs_node = blk: { + const old_dummy = t.compound_assign_dummy; + defer t.compound_assign_dummy = old_dummy; + t.compound_assign_dummy = lhs_dummy_opt orelse try t.transExpr(scope, assign.lhs, .used); + + break :blk try t.transExpr(scope, bin.lhs, .used); + }; + + const rhs_node = try t.transExprCoercing(scope, bin.rhs, .used); + const casted_rhs = switch (cast) { + .none => rhs_node, + .shift => try ZigTag.int_cast.create(t.arena, rhs_node), + .usize => try t.usizeCastForWrappingPtrArithmetic(rhs_node), + }; + return try t.createBinOpNode(op, lhs_node, casted_rhs); +} + +fn transIncDecExpr( + t: *Translator, + scope: *Scope, + un: Node.Unary, + position: enum { pre, post }, + kind: enum { inc, dec }, + used: ResultUsed, +) !ZigNode { + const is_wrapping = t.typeHasWrappingOverflow(un.qt); + const op: ZigTag = switch (kind) { + .inc => if (is_wrapping) .add_wrap_assign else .add_assign, + .dec => if (is_wrapping) .sub_wrap_assign else .sub_assign, + }; + + const one_literal = ZigTag.one_literal.init(); + if (used == .unused) { + const operand = try t.transExpr(scope, un.operand, .used); + return try t.createBinOpNode(op, operand, one_literal); + } + + var block_scope = try Scope.Block.init(t, scope, true); + defer block_scope.deinit(); + + const ref = try block_scope.reserveMangledName("ref"); + const operand = try t.transExprCoercing(&block_scope.base, un.operand, .used); + const operand_ref = try ZigTag.address_of.create(t.arena, operand); + const ref_decl = try ZigTag.var_simple.create(t.arena, .{ .name = ref, .init = operand_ref }); + try block_scope.statements.append(t.gpa, ref_decl); + + const ref_ident = try ZigTag.identifier.create(t.arena, ref); + const ref_deref = try ZigTag.deref.create(t.arena, ref_ident); + const effect = try t.createBinOpNode(op, ref_deref, one_literal); + + switch (position) { + .pre => { + try block_scope.statements.append(t.gpa, effect); + + const break_node = try ZigTag.break_val.create(t.arena, .{ + .label = block_scope.label, + .val = ref_deref, + }); + try block_scope.statements.append(t.gpa, break_node); + }, + .post => { + const tmp = try block_scope.reserveMangledName("tmp"); + const tmp_decl = try ZigTag.var_simple.create(t.arena, .{ .name = tmp, .init = ref_deref }); + try block_scope.statements.append(t.gpa, tmp_decl); + + try block_scope.statements.append(t.gpa, effect); + + const tmp_ident = try ZigTag.identifier.create(t.arena, tmp); + const break_node = try ZigTag.break_val.create(t.arena, .{ + .label = block_scope.label, + .val = tmp_ident, + }); + try block_scope.statements.append(t.gpa, break_node); + }, + } + + return try block_scope.complete(); +} + +fn transPtrDiffExpr(t: *Translator, scope: *Scope, bin: Node.Binary) TransError!ZigNode { + const lhs_uncasted = try t.transExpr(scope, bin.lhs, .used); + const rhs_uncasted = try t.transExpr(scope, bin.rhs, .used); + + const lhs = try ZigTag.int_from_ptr.create(t.arena, lhs_uncasted); + const rhs = try ZigTag.int_from_ptr.create(t.arena, rhs_uncasted); + + const sub_res = try t.createBinOpNode(.sub_wrap, lhs, rhs); + + // @divExact(@as(, @bitCast(@intFromPtr(lhs)) -% @intFromPtr(rhs)), @sizeOf()) + const ptrdiff_type = try t.transTypeIntWidthOf(bin.qt, true); + + const bitcast = try ZigTag.as.create(t.arena, .{ + .lhs = ptrdiff_type, + .rhs = try ZigTag.bit_cast.create(t.arena, sub_res), + }); + + // C standard requires that pointer subtraction operands are of the same type, + // otherwise it is undefined behavior. So we can assume the left and right + // sides are the same Type and arbitrarily choose left. + const lhs_ty = try t.transType(scope, bin.lhs.qt(t.tree), bin.lhs.tok(t.tree)); + const c_pointer = t.getContainer(lhs_ty).?; + + if (c_pointer.castTag(.c_pointer)) |c_pointer_payload| { + const sizeof = try ZigTag.sizeof.create(t.arena, c_pointer_payload.data.elem_type); + return ZigTag.div_exact.create(t.arena, .{ + .lhs = bitcast, + .rhs = sizeof, + }); + } else { + // This is an opaque/incomplete type. This subtraction exhibits Undefined Behavior by the C99 spec. + // However, allowing subtraction on `void *` and function pointers is a commonly used extension. + // So, just return the value in byte units, mirroring the behavior of this language extension as implemented by GCC and Clang. + return bitcast; + } +} + +/// Translate an arithmetic expression with a pointer operand and a signed-integer operand. +/// Zig requires a usize argument for pointer arithmetic, so we intCast to isize and then +/// bitcast to usize; pointer wraparound makes the math work. +/// Zig pointer addition is not commutative (unlike C); the pointer operand needs to be on the left. +/// The + operator in C is not a sequence point so it should be safe to switch the order if necessary. +fn transPointerArithmeticSignedOp(t: *Translator, scope: *Scope, bin: Node.Binary, op_id: ZigTag) TransError!ZigNode { + std.debug.assert(op_id == .add or op_id == .sub); + + const lhs_qt = bin.lhs.qt(t.tree); + const swap_operands = op_id == .add and t.signedness(lhs_qt) == .signed; + + const swizzled_lhs = if (swap_operands) bin.rhs else bin.lhs; + const swizzled_rhs = if (swap_operands) bin.lhs else bin.rhs; + + const lhs_node = try t.transExpr(scope, swizzled_lhs, .used); + const rhs_node = try t.transExpr(scope, swizzled_rhs, .used); + + const bitcast_node = try t.usizeCastForWrappingPtrArithmetic(rhs_node); + + return t.createBinOpNode(op_id, lhs_node, bitcast_node); +} + +fn transMemberAccess( + t: *Translator, + scope: *Scope, + kind: enum { normal, ptr }, + member_access: Node.MemberAccess, + opt_base: ?ZigNode, +) TransError!ZigNode { + const base_info = switch (kind) { + .normal => member_access.base.qt(t.tree), + .ptr => member_access.base.qt(t.tree).childType(t.comp), + }; + const record = base_info.getRecord(t.comp).?; + const field = record.fields[member_access.member_index]; + const field_name = if (field.name_tok == 0) t.anonymous_record_field_names.get(.{ + .parent = base_info.base(t.comp).qt, + .field = field.qt, + }).? else field.name.lookup(t.comp); + const base_node = opt_base orelse try t.transExpr(scope, member_access.base, .used); + const lhs = switch (kind) { + .normal => base_node, + .ptr => try ZigTag.deref.create(t.arena, base_node), + }; + const field_access = try ZigTag.field_access.create(t.arena, .{ + .lhs = lhs, + .field_name = field_name, + }); + + // Flexible array members are translated as member functions. + if (member_access.member_index == record.fields.len - 1 or base_info.base(t.comp).type == .@"union") { + if (field.qt.get(t.comp, .array)) |array_ty| { + if (array_ty.len == .incomplete or (array_ty.len == .fixed and array_ty.len.fixed == 0)) { + return ZigTag.call.create(t.arena, .{ .lhs = field_access, .args = &.{} }); + } + } + } + + return field_access; +} + +fn transArrayAccess(t: *Translator, scope: *Scope, array_access: Node.ArrayAccess, opt_base: ?ZigNode) TransError!ZigNode { + // Unwrap the base statement if it's an array decayed to a bare pointer type + // so that we index the array itself + const base = base: { + const base = array_access.base.get(t.tree); + if (base != .cast) break :base array_access.base; + if (base.cast.kind != .array_to_pointer) break :base array_access.base; + break :base base.cast.operand; + }; + + const base_node = opt_base orelse try t.transExpr(scope, base, .used); + const index = index: { + const index = try t.transExpr(scope, array_access.index, .used); + const index_qt = array_access.index.qt(t.tree); + const maybe_bigger_than_usize = switch (index_qt.base(t.comp).type) { + .bool => { + break :index try ZigTag.int_from_bool.create(t.arena, index); + }, + .int => |int| switch (int) { + .long_long, .ulong_long, .int128, .uint128 => true, + else => false, + }, + .bit_int => |bit_int| bit_int.bits > t.comp.target.ptrBitWidth(), + else => unreachable, + }; + + const is_nonnegative_int_literal = if (t.tree.value_map.get(array_access.index)) |val| + val.compare(.gte, .zero, t.comp) + else + false; + const is_signed = t.signedness(index_qt) == .signed; + + if (is_signed and !is_nonnegative_int_literal) { + // First cast to `isize` to get proper sign extension and + // then @bitCast to `usize` to satisfy the compiler. + const index_isize = try ZigTag.as.create(t.arena, .{ + .lhs = try ZigTag.type.create(t.arena, "isize"), + .rhs = try ZigTag.int_cast.create(t.arena, index), + }); + break :index try ZigTag.bit_cast.create(t.arena, index_isize); + } + + if (maybe_bigger_than_usize) { + break :index try ZigTag.int_cast.create(t.arena, index); + } + break :index index; + }; + + return ZigTag.array_access.create(t.arena, .{ + .lhs = base_node, + .rhs = index, + }); +} + +fn transOffsetof(t: *Translator, scope: *Scope, arg: Node.Index) TransError!ZigNode { + // Translate __builtin_offsetof(T, designator) as + // @intFromPtr(&(@as(*allowzero T, @ptrFromInt(0)).designator)) + const member = try t.transMemberDesignator(scope, arg); + const address = try ZigTag.address_of.create(t.arena, member); + return ZigTag.int_from_ptr.create(t.arena, address); +} + +fn transMemberDesignator(t: *Translator, scope: *Scope, arg: Node.Index) TransError!ZigNode { + switch (arg.get(t.tree)) { + .default_init_expr => |default| { + const elem_node = try t.transType(scope, default.qt, default.last_tok); + const ptr_ty = try ZigTag.single_pointer.create(t.arena, .{ + .elem_type = elem_node, + .is_allowzero = true, + .is_const = false, + .is_volatile = false, + }); + const zero = try ZigTag.ptr_from_int.create(t.arena, ZigTag.zero_literal.init()); + return ZigTag.as.create(t.arena, .{ .lhs = ptr_ty, .rhs = zero }); + }, + .array_access_expr => |access| { + const base = try t.transMemberDesignator(scope, access.base); + return t.transArrayAccess(scope, access, base); + }, + .member_access_expr => |access| { + const base = try t.transMemberDesignator(scope, access.base); + return t.transMemberAccess(scope, .normal, access, base); + }, + .cast => |cast| { + assert(cast.kind == .array_to_pointer); + return t.transMemberDesignator(scope, cast.operand); + }, + else => unreachable, + } +} + +fn transBuiltinCall( + t: *Translator, + scope: *Scope, + call: Node.BuiltinCall, + used: ResultUsed, +) TransError!ZigNode { + const builtin_name = t.tree.tokSlice(call.builtin_tok); + if (std.mem.eql(u8, builtin_name, "__builtin_offsetof")) { + const res = try t.transOffsetof(scope, call.args[0]); + return t.maybeSuppressResult(used, res); + } + + const builtin = builtins.map.get(builtin_name) orelse + return t.fail(error.UnsupportedTranslation, call.builtin_tok, "TODO implement function '{s}' in std.zig.c_builtins", .{builtin_name}); + + if (builtin.tag) |tag| switch (tag) { + .byte_swap, .ceil, .cos, .sin, .exp, .exp2, .exp10, .abs, .log, .log2, .log10, .round, .sqrt, .trunc, .floor => { + assert(call.args.len == 1); + const arg = try t.transExprCoercing(scope, call.args[0], .used); + const arg_ty = try t.transType(scope, call.args[0].qt(t.tree), call.args[0].tok(t.tree)); + const coerced = try ZigTag.as.create(t.arena, .{ .lhs = arg_ty, .rhs = arg }); + + const ptr = try t.arena.create(ast.Payload.UnOp); + ptr.* = .{ .base = .{ .tag = tag }, .data = coerced }; + return t.maybeSuppressResult(used, ZigNode.initPayload(&ptr.base)); + }, + .@"unreachable" => return ZigTag.@"unreachable".init(), + else => unreachable, + }; + + const arg_nodes = try t.arena.alloc(ZigNode, call.args.len); + for (call.args, arg_nodes) |c_arg, *zig_arg| { + zig_arg.* = try t.transExprCoercing(scope, c_arg, .used); + } + + const builtin_identifier = try ZigTag.identifier.create(t.arena, "__builtin"); + const field_access = try ZigTag.field_access.create(t.arena, .{ + .lhs = builtin_identifier, + .field_name = builtin.name, + }); + + const res = try ZigTag.call.create(t.arena, .{ + .lhs = field_access, + .args = arg_nodes, + }); + if (call.qt.is(t.comp, .void)) return res; + return t.maybeSuppressResult(used, res); +} + +fn transCall( + t: *Translator, + scope: *Scope, + call: Node.Call, + used: ResultUsed, +) TransError!ZigNode { + const raw_fn_expr = try t.transExpr(scope, call.callee, .used); + const fn_expr = blk: { + loop: switch (call.callee.get(t.tree)) { + .paren_expr => |paren_expr| { + continue :loop paren_expr.operand.get(t.tree); + }, + .decl_ref_expr => |decl_ref| { + if (decl_ref.qt.is(t.comp, .func)) break :blk raw_fn_expr; + }, + .cast => |cast| { + if (cast.kind == .function_to_pointer) { + continue :loop cast.operand.get(t.tree); + } + }, + .deref_expr, .addr_of_expr => |un| { + continue :loop un.operand.get(t.tree); + }, + .generic_expr => |generic| { + continue :loop generic.chosen.get(t.tree); + }, + .generic_association_expr => |generic| { + continue :loop generic.expr.get(t.tree); + }, + .generic_default_expr => |generic| { + continue :loop generic.expr.get(t.tree); + }, + else => {}, + } + break :blk try ZigTag.unwrap.create(t.arena, raw_fn_expr); + }; + + const callee_qt = call.callee.qt(t.tree); + const maybe_ptr_ty = callee_qt.get(t.comp, .pointer); + const func_qt = if (maybe_ptr_ty) |ptr| ptr.child else callee_qt; + const func_ty = func_qt.get(t.comp, .func).?; + + const arg_nodes = try t.arena.alloc(ZigNode, call.args.len); + for (call.args, arg_nodes, 0..) |c_arg, *zig_arg, i| { + if (i < func_ty.params.len) { + zig_arg.* = try t.transExprCoercing(scope, c_arg, .used); + + if (zig_arg.isBoolRes() and !func_ty.params[i].qt.is(t.comp, .bool)) { + // In C the result type of a boolean expression is int. If this result is passed as + // an argument to a function whose parameter is also int, there is no cast. Therefore + // in Zig we'll need to cast it from bool to u1 (which will safely coerce to c_int). + zig_arg.* = try ZigTag.int_from_bool.create(t.arena, zig_arg.*); + } + } else { + zig_arg.* = try t.transExpr(scope, c_arg, .used); + + if (zig_arg.isBoolRes()) { + // Same as above but now we don't have a result type. + const u1_node = try ZigTag.int_from_bool.create(t.arena, zig_arg.*); + const c_int_node = try ZigTag.type.create(t.arena, "c_int"); + zig_arg.* = try ZigTag.as.create(t.arena, .{ .lhs = c_int_node, .rhs = u1_node }); + } + } + } + + const res = try ZigTag.call.create(t.arena, .{ + .lhs = fn_expr, + .args = arg_nodes, + }); + if (call.qt.is(t.comp, .void)) return res; + return t.maybeSuppressResult(used, res); +} + +const SuppressCast = enum { with_as, no_as }; + +fn transIntLiteral( + t: *Translator, + scope: *Scope, + literal_index: Node.Index, + used: ResultUsed, + suppress_as: SuppressCast, +) TransError!ZigNode { + const val = t.tree.value_map.get(literal_index).?; + const int_lit_node = try t.createIntNode(val); + if (suppress_as == .no_as) { + return t.maybeSuppressResult(used, int_lit_node); + } + + // Integer literals in C have types, and this can matter for several reasons. + // For example, this is valid C: + // unsigned char y = 256; + // How this gets evaluated is the 256 is an integer, which gets truncated to signed char, then bit-casted + // to unsigned char, resulting in 0. In order for this to work, we have to emit this zig code: + // var y = @as(u8, @bitCast(@as(i8, @truncate(@as(c_int, 256))))); + + // @as(T, x) + const ty_node = try t.transType(scope, literal_index.qt(t.tree), literal_index.tok(t.tree)); + const as = try ZigTag.as.create(t.arena, .{ .lhs = ty_node, .rhs = int_lit_node }); + return t.maybeSuppressResult(used, as); +} + +fn transCharLiteral( + t: *Translator, + scope: *Scope, + literal_index: Node.Index, + used: ResultUsed, + suppress_as: SuppressCast, +) TransError!ZigNode { + const val = t.tree.value_map.get(literal_index).?; + const char_literal = literal_index.get(t.tree).char_literal; + const narrow = char_literal.kind == .ascii or char_literal.kind == .utf8; + + // C has a somewhat obscure feature called multi-character character constant + // e.g. 'abcd' + const int_value = val.toInt(u32, t.comp).?; + const int_lit_node = if (char_literal.kind == .ascii and int_value > 255) + try t.createNumberNode(int_value, .int) + else + try t.createCharLiteralNode(narrow, int_value); + + if (suppress_as == .no_as) { + return t.maybeSuppressResult(used, int_lit_node); + } + + // See comment in `transIntLiteral` for why this code is here. + // @as(T, x) + const as_node = try ZigTag.as.create(t.arena, .{ + .lhs = try t.transType(scope, char_literal.qt, char_literal.literal_tok), + .rhs = int_lit_node, + }); + return t.maybeSuppressResult(used, as_node); +} + +fn transFloatLiteral( + t: *Translator, + scope: *Scope, + literal_index: Node.Index, + used: ResultUsed, + suppress_as: SuppressCast, +) TransError!ZigNode { + const val = t.tree.value_map.get(literal_index).?; + const float_literal = literal_index.get(t.tree).float_literal; + + var allocating: std.Io.Writer.Allocating = .init(t.gpa); + defer allocating.deinit(); + _ = val.print(float_literal.qt, t.comp, &allocating.writer) catch return error.OutOfMemory; + + const float_lit_node = try ZigTag.float_literal.create(t.arena, try t.arena.dupe(u8, allocating.written())); + if (suppress_as == .no_as) { + return t.maybeSuppressResult(used, float_lit_node); + } + + const as_node = try ZigTag.as.create(t.arena, .{ + .lhs = try t.transType(scope, float_literal.qt, float_literal.literal_tok), + .rhs = float_lit_node, + }); + return t.maybeSuppressResult(used, as_node); +} + +fn transStringLiteral( + t: *Translator, + scope: *Scope, + expr: Node.Index, + literal: Node.CharLiteral, +) TransError!ZigNode { + switch (literal.kind) { + .ascii, .utf8 => return t.transNarrowStringLiteral(expr, literal), + .utf16, .utf32, .wide => { + const name = try std.fmt.allocPrint(t.arena, "{s}_string_{d}", .{ @tagName(literal.kind), t.getMangle() }); + + const array_type = try t.transTypeInit(scope, literal.qt, expr, literal.literal_tok); + const lit_array = try t.transStringLiteralInitializer(expr, literal, array_type); + const decl = try ZigTag.var_simple.create(t.arena, .{ .name = name, .init = lit_array }); + try scope.appendNode(decl); + return ZigTag.identifier.create(t.arena, name); + }, + } +} + +fn transNarrowStringLiteral( + t: *Translator, + expr: Node.Index, + literal: Node.CharLiteral, +) TransError!ZigNode { + const val = t.tree.value_map.get(expr).?; + + const bytes = t.comp.interner.get(val.ref()).bytes; + var allocating: std.Io.Writer.Allocating = try .initCapacity(t.gpa, bytes.len); + defer allocating.deinit(); + + aro.Value.printString(bytes, literal.qt, t.comp, &allocating.writer) catch return error.OutOfMemory; + + return ZigTag.string_literal.create(t.arena, try t.arena.dupe(u8, allocating.written())); +} + +/// Translate a string literal that is initializing an array. In general narrow string +/// literals become `"".*` or `""[0..].*` if they need truncation. +/// Wide string literals become an array of integers. zero-fillers pad out the array to +/// the appropriate length, if necessary. +fn transStringLiteralInitializer( + t: *Translator, + expr: Node.Index, + literal: Node.CharLiteral, + array_type: ZigNode, +) TransError!ZigNode { + assert(array_type.tag() == .array_type or array_type.tag() == .null_sentinel_array_type); + + const is_narrow = literal.kind == .ascii or literal.kind == .utf8; + + // The length of the string literal excluding the sentinel. + const str_length = literal.qt.arrayLen(t.comp).? - 1; + + const payload = (array_type.castTag(.array_type) orelse array_type.castTag(.null_sentinel_array_type).?).data; + const array_size = payload.len; + const elem_type = payload.elem_type; + + if (array_size == 0) return ZigTag.empty_array.create(t.arena, array_type); + + const num_inits = @min(str_length, array_size); + if (num_inits == 0) { + return ZigTag.array_filler.create(t.arena, .{ + .type = elem_type, + .filler = ZigTag.zero_literal.init(), + .count = array_size, + }); + } + + const init_node = if (is_narrow) blk: { + // "string literal".* or string literal"[0..num_inits].* + var str = try t.transNarrowStringLiteral(expr, literal); + if (str_length != array_size) str = try ZigTag.string_slice.create(t.arena, .{ .string = str, .end = num_inits }); + break :blk try ZigTag.deref.create(t.arena, str); + } else blk: { + const size = literal.qt.childType(t.comp).sizeof(t.comp); + + const val = t.tree.value_map.get(expr).?; + const bytes = t.comp.interner.get(val.ref()).bytes; + + const init_list = try t.arena.alloc(ZigNode, @intCast(num_inits)); + for (init_list, 0..) |*item, i| { + const codepoint = switch (size) { + 2 => @as(*const u16, @ptrCast(@alignCast(bytes.ptr + i * 2))).*, + 4 => @as(*const u32, @ptrCast(@alignCast(bytes.ptr + i * 4))).*, + else => unreachable, + }; + item.* = try t.createCharLiteralNode(false, codepoint); + } + const init_args: ast.Payload.Array.ArrayTypeInfo = .{ .len = num_inits, .elem_type = elem_type }; + const init_array_type = if (array_type.tag() == .array_type) + try ZigTag.array_type.create(t.arena, init_args) + else + try ZigTag.null_sentinel_array_type.create(t.arena, init_args); + break :blk try ZigTag.array_init.create(t.arena, .{ + .cond = init_array_type, + .cases = init_list, + }); + }; + + if (num_inits == array_size) return init_node; + assert(array_size > str_length); // If array_size <= str_length, `num_inits == array_size` and we've already returned. + + const filler_node = try ZigTag.array_filler.create(t.arena, .{ + .type = elem_type, + .filler = ZigTag.zero_literal.init(), + .count = array_size - str_length, + }); + return ZigTag.array_cat.create(t.arena, .{ .lhs = init_node, .rhs = filler_node }); +} + +fn transCompoundLiteral( + t: *Translator, + scope: *Scope, + literal: Node.CompoundLiteral, + used: ResultUsed, +) TransError!ZigNode { + if (used == .unused) { + return t.transExpr(scope, literal.initializer, .unused); + } + + // TODO taking a reference to a compound literal should result in a mutable + // pointer (unless the literal is const). + + const initializer = try t.transExprCoercing(scope, literal.initializer, .used); + const ty = try t.transType(scope, literal.qt, literal.l_paren_tok); + if (!literal.thread_local and literal.storage_class != .static) { + // In the simple case a compound literal can be translated + // simply as `@as(type, initializer)`. + return ZigTag.as.create(t.arena, .{ .lhs = ty, .rhs = initializer }); + } + + // Otherwise static or thread local compound literals are translated as + // a reference to a variable wrapped in a struct. + + var block_scope = try Scope.Block.init(t, scope, true); + defer block_scope.deinit(); + + const tmp = try block_scope.reserveMangledName("tmp"); + const wrapped_name = "compound_literal"; + + // const tmp = struct { var compound_literal = initializer }; + const temp_decl = try ZigTag.var_decl.create(t.arena, .{ + .is_pub = false, + .is_const = literal.qt.@"const", + .is_extern = false, + .is_export = false, + .is_threadlocal = literal.thread_local, + .linksection_string = null, + .alignment = null, + .name = wrapped_name, + .type = ty, + .init = initializer, + }); + const wrapped = try ZigTag.wrapped_local.create(t.arena, .{ .name = tmp, .init = temp_decl }); + try block_scope.statements.append(t.gpa, wrapped); + + // break :blk tmp.compound_literal + const static_tmp_ident = try ZigTag.identifier.create(t.arena, tmp); + const field_access = try ZigTag.field_access.create(t.arena, .{ + .lhs = static_tmp_ident, + .field_name = wrapped_name, + }); + const break_node = try ZigTag.break_val.create(t.arena, .{ + .label = block_scope.label, + .val = field_access, + }); + try block_scope.statements.append(t.gpa, break_node); + + return block_scope.complete(); +} + +fn transDefaultInit( + t: *Translator, + scope: *Scope, + default_init: Node.DefaultInit, + used: ResultUsed, + suppress_as: SuppressCast, +) TransError!ZigNode { + assert(used == .used); + const type_node = try t.transType(scope, default_init.qt, default_init.last_tok); + return try t.createZeroValueNode(default_init.qt, type_node, suppress_as); +} + +fn transArrayInit( + t: *Translator, + scope: *Scope, + array_init: Node.ContainerInit, + used: ResultUsed, +) TransError!ZigNode { + assert(used == .used); + const array_item_qt = array_init.container_qt.childType(t.comp); + const array_item_type = try t.transType(scope, array_item_qt, array_init.l_brace_tok); + var maybe_lhs: ?ZigNode = null; + var val_list: std.ArrayListUnmanaged(ZigNode) = .empty; + defer val_list.deinit(t.gpa); + var i: usize = 0; + while (i < array_init.items.len) { + const rhs = switch (array_init.items[i].get(t.tree)) { + .array_filler_expr => |array_filler| blk: { + const node = try ZigTag.array_filler.create(t.arena, .{ + .type = array_item_type, + .filler = try t.createZeroValueNode(array_item_qt, array_item_type, .no_as), + .count = @intCast(array_filler.count), + }); + i += 1; + break :blk node; + }, + else => blk: { + defer val_list.clearRetainingCapacity(); + while (i < array_init.items.len) : (i += 1) { + if (array_init.items[i].get(t.tree) == .array_filler_expr) break; + const expr = try t.transExprCoercing(scope, array_init.items[i], .used); + try val_list.append(t.gpa, expr); + } + const array_type = try ZigTag.array_type.create(t.arena, .{ + .elem_type = array_item_type, + .len = val_list.items.len, + }); + const array_init_node = try ZigTag.array_init.create(t.arena, .{ + .cond = array_type, + .cases = try t.arena.dupe(ZigNode, val_list.items), + }); + break :blk array_init_node; + }, + }; + maybe_lhs = if (maybe_lhs) |lhs| blk: { + const cat = try ZigTag.array_cat.create(t.arena, .{ + .lhs = lhs, + .rhs = rhs, + }); + break :blk cat; + } else rhs; + } + return maybe_lhs orelse try ZigTag.container_init_dot.create(t.arena, &.{}); +} + +fn transUnionInit( + t: *Translator, + scope: *Scope, + union_init: Node.UnionInit, + used: ResultUsed, +) TransError!ZigNode { + assert(used == .used); + const init_expr = union_init.initializer orelse + return ZigTag.undefined_literal.init(); + + if (init_expr.get(t.tree) == .default_init_expr) { + return try t.transExpr(scope, init_expr, used); + } + + const union_type = try t.transType(scope, union_init.union_qt, union_init.l_brace_tok); + + const union_base = union_init.union_qt.base(t.comp); + const field = union_base.type.@"union".fields[union_init.field_index]; + const field_name = if (field.name_tok == 0) t.anonymous_record_field_names.get(.{ + .parent = union_base.qt, + .field = field.qt, + }).? else field.name.lookup(t.comp); + + const field_init = try t.arena.create(ast.Payload.ContainerInit.Initializer); + field_init.* = .{ + .name = field_name, + .value = try t.transExprCoercing(scope, init_expr, .used), + }; + const container_init = try ZigTag.container_init.create(t.arena, .{ + .lhs = union_type, + .inits = field_init[0..1], + }); + return container_init; +} + +fn transStructInit( + t: *Translator, + scope: *Scope, + struct_init: Node.ContainerInit, + used: ResultUsed, +) TransError!ZigNode { + assert(used == .used); + const struct_type = try t.transType(scope, struct_init.container_qt, struct_init.l_brace_tok); + const field_inits = try t.arena.alloc(ast.Payload.ContainerInit.Initializer, struct_init.items.len); + + const struct_base = struct_init.container_qt.base(t.comp); + for ( + field_inits, + struct_init.items, + struct_base.type.@"struct".fields, + ) |*init, field_expr, field| { + const field_name = if (field.name_tok == 0) t.anonymous_record_field_names.get(.{ + .parent = struct_base.qt, + .field = field.qt, + }).? else field.name.lookup(t.comp); + init.* = .{ + .name = field_name, + .value = try t.transExprCoercing(scope, field_expr, .used), + }; + } + + const container_init = try ZigTag.container_init.create(t.arena, .{ + .lhs = struct_type, + .inits = field_inits, + }); + return container_init; +} + +fn transTypeInfo( + t: *Translator, + scope: *Scope, + op: ZigTag, + typeinfo: Node.TypeInfo, +) TransError!ZigNode { + const operand = operand: { + if (typeinfo.expr) |expr| { + const operand = try t.transExpr(scope, expr, .used); + break :operand try ZigTag.typeof.create(t.arena, operand); + } + break :operand try t.transType(scope, typeinfo.operand_qt, typeinfo.op_tok); + }; + + const payload = try t.arena.create(ast.Payload.UnOp); + payload.* = .{ + .base = .{ .tag = op }, + .data = operand, + }; + return ZigNode.initPayload(&payload.base); +} + +fn transStmtExpr( + t: *Translator, + scope: *Scope, + stmt_expr: Node.Unary, + used: ResultUsed, +) TransError!ZigNode { + const compound_stmt = stmt_expr.operand.get(t.tree).compound_stmt; + if (used == .unused) { + return t.transCompoundStmt(scope, compound_stmt); + } + var block_scope = try Scope.Block.init(t, scope, true); + defer block_scope.deinit(); + + for (compound_stmt.body[0 .. compound_stmt.body.len - 1]) |stmt| { + const result = try t.transStmt(&block_scope.base, stmt); + switch (result.tag()) { + .declaration, .empty_block => {}, + else => try block_scope.statements.append(t.gpa, result), + } + } + + const last_result = try t.transExpr(&block_scope.base, compound_stmt.body[compound_stmt.body.len - 1], .used); + switch (last_result.tag()) { + .declaration, .empty_block => {}, + else => { + const break_node = try ZigTag.break_val.create(t.arena, .{ + .label = block_scope.label, + .val = last_result, + }); + try block_scope.statements.append(t.gpa, break_node); + }, + } + return block_scope.complete(); +} + +fn transConvertvectorExpr( + t: *Translator, + scope: *Scope, + convertvector: Node.Convertvector, +) TransError!ZigNode { + var block_scope = try Scope.Block.init(t, scope, true); + defer block_scope.deinit(); + + const src_expr_node = try t.transExpr(&block_scope.base, convertvector.operand, .used); + const tmp = try block_scope.reserveMangledName("tmp"); + const tmp_decl = try ZigTag.var_simple.create(t.arena, .{ .name = tmp, .init = src_expr_node }); + try block_scope.statements.append(t.gpa, tmp_decl); + const tmp_ident = try ZigTag.identifier.create(t.arena, tmp); + + const dest_type_node = try t.transType(&block_scope.base, convertvector.dest_qt, convertvector.builtin_tok); + const dest_vec_ty = convertvector.dest_qt.get(t.comp, .vector).?; + const src_vec_ty = convertvector.operand.qt(t.tree).get(t.comp, .vector).?; + + const src_elem_sk = src_vec_ty.elem.scalarKind(t.comp); + const dest_elem_sk = convertvector.dest_qt.childType(t.comp).scalarKind(t.comp); + + const items = try t.arena.alloc(ZigNode, dest_vec_ty.len); + for (items, 0..dest_vec_ty.len) |*item, i| { + const value = try ZigTag.array_access.create(t.arena, .{ + .lhs = tmp_ident, + .rhs = try t.createNumberNode(i, .int), + }); + + if (src_elem_sk == .float and dest_elem_sk == .float) { + item.* = try ZigTag.float_cast.create(t.arena, value); + } else if (src_elem_sk == .float) { + item.* = try ZigTag.int_from_float.create(t.arena, value); + } else if (dest_elem_sk == .float) { + item.* = try ZigTag.float_from_int.create(t.arena, value); + } else { + item.* = try t.transIntCast(value, src_vec_ty.elem, dest_vec_ty.elem); + } + } + + const vec_init = try ZigTag.array_init.create(t.arena, .{ + .cond = dest_type_node, + .cases = items, + }); + const break_node = try ZigTag.break_val.create(t.arena, .{ + .label = block_scope.label, + .val = vec_init, + }); + try block_scope.statements.append(t.gpa, break_node); + + return block_scope.complete(); +} + +fn transShufflevectorExpr( + t: *Translator, + scope: *Scope, + shufflevector: Node.Shufflevector, +) TransError!ZigNode { + if (shufflevector.indexes.len == 0) { + return t.fail(error.UnsupportedTranslation, shufflevector.builtin_tok, "@shuffle needs at least 1 index", .{}); + } + + const a = try t.transExpr(scope, shufflevector.lhs, .used); + const b = try t.transExpr(scope, shufflevector.rhs, .used); + + // First two arguments to __builtin_shufflevector must be the same type + const vector_child_type = try t.vectorTypeInfo(a, "child"); + const vector_len = try t.vectorTypeInfo(a, "len"); + const shuffle_mask = blk: { + const mask_len = shufflevector.indexes.len; + + const mask_type = try ZigTag.vector.create(t.arena, .{ + .lhs = try t.createNumberNode(mask_len, .int), + .rhs = try ZigTag.type.create(t.arena, "i32"), + }); + + const init_list = try t.arena.alloc(ZigNode, mask_len); + for (init_list, shufflevector.indexes) |*init, index| { + const index_expr = try t.transExprCoercing(scope, index, .used); + const converted_index = try t.createHelperCallNode(.shuffleVectorIndex, &.{ index_expr, vector_len }); + init.* = converted_index; + } + + break :blk try ZigTag.array_init.create(t.arena, .{ + .cond = mask_type, + .cases = init_list, + }); + }; + + return ZigTag.shuffle.create(t.arena, .{ + .element_type = vector_child_type, + .a = a, + .b = b, + .mask_vector = shuffle_mask, + }); +} + +// ===================== +// Node creation helpers +// ===================== + +fn createZeroValueNode( + t: *Translator, + qt: QualType, + type_node: ZigNode, + suppress_as: SuppressCast, +) !ZigNode { + switch (qt.base(t.comp).type) { + .bool => return ZigTag.false_literal.init(), + .int, .bit_int, .float => { + const zero_literal = ZigTag.zero_literal.init(); + return switch (suppress_as) { + .with_as => try t.createBinOpNode(.as, type_node, zero_literal), + .no_as => zero_literal, + }; + }, + .pointer => { + const null_literal = ZigTag.null_literal.init(); + return switch (suppress_as) { + .with_as => try t.createBinOpNode(.as, type_node, null_literal), + .no_as => null_literal, + }; + }, + else => {}, + } + return try ZigTag.std_mem_zeroes.create(t.arena, type_node); +} + +fn createIntNode(t: *Translator, int: aro.Value) !ZigNode { + var space: aro.Interner.Tag.Int.BigIntSpace = undefined; + var big = t.comp.interner.get(int.ref()).toBigInt(&space); + const is_negative = !big.positive; + big.positive = true; + + const str = big.toStringAlloc(t.arena, 10, .lower) catch |err| switch (err) { + error.OutOfMemory => return error.OutOfMemory, + }; + const res = try ZigTag.integer_literal.create(t.arena, str); + if (is_negative) return ZigTag.negate.create(t.arena, res); + return res; +} + +fn createNumberNode(t: *Translator, num: anytype, num_kind: enum { int, float }) !ZigNode { + const fmt_s = switch (@typeInfo(@TypeOf(num))) { + .int, .comptime_int => "{d}", + else => "{s}", + }; + const str = try std.fmt.allocPrint(t.arena, fmt_s, .{num}); + if (num_kind == .float) + return ZigTag.float_literal.create(t.arena, str) + else + return ZigTag.integer_literal.create(t.arena, str); +} + +fn createCharLiteralNode(t: *Translator, narrow: bool, val: u32) TransError!ZigNode { + return ZigTag.char_literal.create(t.arena, if (narrow) + try std.fmt.allocPrint(t.arena, "'{f}'", .{std.zig.fmtChar(@intCast(val))}) + else + try std.fmt.allocPrint(t.arena, "'\\u{{{x}}}'", .{val})); +} + +fn createBinOpNode( + t: *Translator, + op: ZigTag, + lhs: ZigNode, + rhs: ZigNode, +) !ZigNode { + const payload = try t.arena.create(ast.Payload.BinOp); + payload.* = .{ + .base = .{ .tag = op }, + .data = .{ + .lhs = lhs, + .rhs = rhs, + }, + }; + return ZigNode.initPayload(&payload.base); +} + +pub fn createHelperCallNode(t: *Translator, name: std.meta.DeclEnum(std.zig.c_translation.helpers), args_opt: ?[]const ZigNode) !ZigNode { + if (args_opt) |args| { + return ZigTag.helper_call.create(t.arena, .{ + .name = @tagName(name), + .args = try t.arena.dupe(ZigNode, args), + }); + } else { + return ZigTag.helper_ref.create(t.arena, @tagName(name)); + } +} + +/// Cast a signed integer node to a usize, for use in pointer arithmetic. Negative numbers +/// will become very large positive numbers but that is ok since we only use this in +/// pointer arithmetic expressions, where wraparound will ensure we get the correct value. +/// node -> @as(usize, @bitCast(@as(isize, @intCast(node)))) +fn usizeCastForWrappingPtrArithmetic(t: *Translator, node: ZigNode) TransError!ZigNode { + const intcast_node = try ZigTag.as.create(t.arena, .{ + .lhs = try ZigTag.type.create(t.arena, "isize"), + .rhs = try ZigTag.int_cast.create(t.arena, node), + }); + + return ZigTag.as.create(t.arena, .{ + .lhs = try ZigTag.type.create(t.arena, "usize"), + .rhs = try ZigTag.bit_cast.create(t.arena, intcast_node), + }); +} + +/// @typeInfo(@TypeOf(vec_node)).vector. +fn vectorTypeInfo(t: *Translator, vec_node: ZigNode, field: []const u8) TransError!ZigNode { + const typeof_call = try ZigTag.typeof.create(t.arena, vec_node); + const typeinfo_call = try ZigTag.typeinfo.create(t.arena, typeof_call); + const vector_type_info = try ZigTag.field_access.create(t.arena, .{ .lhs = typeinfo_call, .field_name = "vector" }); + return ZigTag.field_access.create(t.arena, .{ .lhs = vector_type_info, .field_name = field }); +} + +/// Build a getter function for a flexible array field in a C record +/// e.g. `T items[]` or `T items[0]`. The generated function returns a [*c] pointer +/// to the flexible array with the correct const and volatile qualifiers +fn createFlexibleMemberFn( + t: *Translator, + member_name: []const u8, + field_name: []const u8, +) Error!ZigNode { + const self_param_name = "self"; + const self_param = try ZigTag.identifier.create(t.arena, self_param_name); + const self_type = try ZigTag.typeof.create(t.arena, self_param); + + const fn_params = try t.arena.alloc(ast.Payload.Param, 1); + fn_params[0] = .{ + .name = self_param_name, + .type = ZigTag.@"anytype".init(), + .is_noalias = false, + }; + + // @typeInfo(@TypeOf(self.*.)).pointer.child + const dereffed = try ZigTag.deref.create(t.arena, self_param); + const field_access = try ZigTag.field_access.create(t.arena, .{ .lhs = dereffed, .field_name = field_name }); + const type_of = try ZigTag.typeof.create(t.arena, field_access); + const type_info = try ZigTag.typeinfo.create(t.arena, type_of); + const array_info = try ZigTag.field_access.create(t.arena, .{ .lhs = type_info, .field_name = "array" }); + const child_info = try ZigTag.field_access.create(t.arena, .{ .lhs = array_info, .field_name = "child" }); + + const return_type = try t.createHelperCallNode(.FlexibleArrayType, &.{ self_type, child_info }); + + // return @ptrCast(&self.*.); + const address_of = try ZigTag.address_of.create(t.arena, field_access); + const casted = try ZigTag.ptr_cast.create(t.arena, address_of); + const return_stmt = try ZigTag.@"return".create(t.arena, casted); + const body = try ZigTag.block_single.create(t.arena, return_stmt); + + return ZigTag.func.create(t.arena, .{ + .is_pub = true, + .is_extern = false, + .is_export = false, + .is_inline = false, + .is_var_args = false, + .name = member_name, + .linksection_string = null, + .explicit_callconv = null, + .params = fn_params, + .return_type = return_type, + .body = body, + .alignment = null, + }); +} + +// ================= +// Macro translation +// ================= + +fn transMacros(t: *Translator) !void { + var tok_list = std.array_list.Managed(CToken).init(t.gpa); + defer tok_list.deinit(); + + var pattern_list = try PatternList.init(t.gpa); + defer pattern_list.deinit(t.gpa); + + for (t.pp.defines.keys(), t.pp.defines.values()) |name, macro| { + if (macro.is_builtin) continue; + if (t.global_scope.containsNow(name)) { + continue; + } + + tok_list.items.len = 0; + try tok_list.ensureUnusedCapacity(macro.tokens.len); + for (macro.tokens) |tok| { + switch (tok.id) { + .invalid => continue, + .whitespace => continue, + .comment => continue, + .macro_ws => continue, + else => {}, + } + tok_list.appendAssumeCapacity(tok); + } + + if (macro.is_func) { + const ms: PatternList.MacroSlicer = .{ + .tokens = tok_list.items, + .source = t.comp.getSource(macro.loc.id).buf, + .params = @intCast(macro.params.len), + }; + if (try pattern_list.match(ms)) |impl| { + const decl = try ZigTag.pub_var_simple.create(t.arena, .{ + .name = name, + .init = try t.createHelperCallNode(impl, null), + }); + try t.addTopLevelDecl(name, decl); + continue; + } + } + + if (t.checkTranslatableMacro(tok_list.items, macro.params)) |err| { + switch (err) { + .undefined_identifier => |ident| try t.failDeclExtra(&t.global_scope.base, macro.loc, name, "unable to translate macro: undefined identifier `{s}`", .{ident}), + .invalid_arg_usage => |ident| try t.failDeclExtra(&t.global_scope.base, macro.loc, name, "unable to translate macro: untranslatable usage of arg `{s}`", .{ident}), + } + continue; + } + + var macro_translator: MacroTranslator = .{ + .t = t, + .tokens = tok_list.items, + .source = t.comp.getSource(macro.loc.id).buf, + .name = name, + .macro = macro, + }; + + const res = if (macro.is_func) + macro_translator.transFnMacro() + else + macro_translator.transMacro(); + res catch |err| switch (err) { + error.ParseError => continue, + error.OutOfMemory => |e| return e, + }; + } +} + +const MacroTranslateError = union(enum) { + undefined_identifier: []const u8, + invalid_arg_usage: []const u8, +}; + +fn checkTranslatableMacro(t: *Translator, tokens: []const CToken, params: []const []const u8) ?MacroTranslateError { + var last_is_type_kw = false; + var i: usize = 0; + while (i < tokens.len) : (i += 1) { + const token = tokens[i]; + switch (token.id) { + .period, .arrow => i += 1, // skip next token since field identifiers can be unknown + .keyword_struct, .keyword_union, .keyword_enum => if (!last_is_type_kw) { + last_is_type_kw = true; + continue; + }, + .macro_param, .macro_param_no_expand => { + if (last_is_type_kw) { + return .{ .invalid_arg_usage = params[token.end] }; + } + }, + .identifier, .extended_identifier => { + const identifier = t.pp.tokSlice(token); + if (!t.global_scope.contains(identifier) and !builtins.map.has(identifier)) { + return .{ .undefined_identifier = identifier }; + } + }, + else => {}, + } + last_is_type_kw = false; + } + return null; +} + +fn getContainer(t: *Translator, node: ZigNode) ?ZigNode { + switch (node.tag()) { + .@"union", + .@"struct", + .address_of, + .bit_not, + .not, + .optional_type, + .negate, + .negate_wrap, + .array_type, + .c_pointer, + .single_pointer, + => return node, + + .identifier => { + const ident = node.castTag(.identifier).?; + if (t.global_scope.sym_table.get(ident.data)) |value| { + if (value.castTag(.var_decl)) |var_decl| + return t.getContainer(var_decl.data.init.?); + if (value.castTag(.var_simple) orelse value.castTag(.pub_var_simple)) |var_decl| + return t.getContainer(var_decl.data.init); + } + }, + + .field_access => { + const field_access = node.castTag(.field_access).?; + + if (t.getContainerTypeOf(field_access.data.lhs)) |ty_node| { + if (ty_node.castTag(.@"struct") orelse ty_node.castTag(.@"union")) |container| { + for (container.data.fields) |field| { + if (mem.eql(u8, field.name, field_access.data.field_name)) { + return t.getContainer(field.type); + } + } + } + } + }, + + else => {}, + } + return null; +} + +fn getContainerTypeOf(t: *Translator, ref: ZigNode) ?ZigNode { + if (ref.castTag(.identifier)) |ident| { + if (t.global_scope.sym_table.get(ident.data)) |value| { + if (value.castTag(.var_decl)) |var_decl| { + return t.getContainer(var_decl.data.type); + } + } + } else if (ref.castTag(.field_access)) |field_access| { + if (t.getContainerTypeOf(field_access.data.lhs)) |ty_node| { + if (ty_node.castTag(.@"struct") orelse ty_node.castTag(.@"union")) |container| { + for (container.data.fields) |field| { + if (mem.eql(u8, field.name, field_access.data.field_name)) { + return t.getContainer(field.type); + } + } + } else return ty_node; + } + } + return null; +} + +pub fn getFnProto(t: *Translator, ref: ZigNode) ?*ast.Payload.Func { + const init = if (ref.castTag(.var_decl)) |v| + v.data.init orelse return null + else if (ref.castTag(.var_simple) orelse ref.castTag(.pub_var_simple)) |v| + v.data.init + else + return null; + if (t.getContainerTypeOf(init)) |ty_node| { + if (ty_node.castTag(.optional_type)) |prefix| { + if (prefix.data.castTag(.single_pointer)) |sp| { + if (sp.data.elem_type.castTag(.func)) |fn_proto| { + return fn_proto; + } + } + } + } + return null; +} diff --git a/lib/compiler/aro_translate_c/ast.zig b/lib/compiler/translate-c/ast.zig similarity index 80% rename from lib/compiler/aro_translate_c/ast.zig rename to lib/compiler/translate-c/ast.zig index b1786a5fd4de..264a23906f5d 100644 --- a/lib/compiler/aro_translate_c/ast.zig +++ b/lib/compiler/translate-c/ast.zig @@ -20,6 +20,7 @@ pub const Node = extern union { return_void, zero_literal, one_literal, + @"unreachable", void_type, noreturn_type, @"anytype", @@ -35,7 +36,6 @@ pub const Node = extern union { /// "string"[0..end] string_slice, identifier, - fn_identifier, @"if", /// if (!operand) break; if_not_break, @@ -54,24 +54,20 @@ pub const Node = extern union { call, var_decl, /// const name = struct { init } - static_local_var, - /// const ExternLocal_name = struct { init } - extern_local_var, - /// const ExternLocal_name = struct { init } - extern_local_fn, + wrapped_local, /// var name = init.* mut_str, func, warning, @"struct", @"union", + @"opaque", @"comptime", @"defer", array_init, tuple, container_init, container_init_dot, - helpers_cast, /// _ = operand; discard, @@ -116,18 +112,12 @@ pub const Node = extern union { ellipsis3, assign, - /// @import("std").zig.c_builtins. - import_c_builtin, /// @intCast(operand) int_cast, /// @constCast(operand) const_cast, /// @volatileCast(operand) volatile_cast, - /// @import("std").zig.c_translation.promoteIntLiteral(value, type, base) - helpers_promoteIntLiteral, - /// @import("std").zig.c_translation.signedRemainder(lhs, rhs) - signed_remainder, /// @divTrunc(lhs, rhs) div_trunc, /// @intFromBool(operand) @@ -163,8 +153,41 @@ pub const Node = extern union { /// @extern(ty, .{ .name = n }) builtin_extern, - /// @import("std").zig.c_translation.MacroArithmetic.(lhs, rhs) - macro_arithmetic, + /// @byteSwap(operand) + byte_swap, + /// @ceil(operand) + ceil, + /// @cos(operand) + cos, + /// @sin(operand) + sin, + /// @exp(operand) + exp, + /// @exp2(operand) + exp2, + /// @exp10(operand) + exp10, + /// @abs(operand) + abs, + /// @log(operand) + log, + /// @log2(operand) + log2, + /// @log10(operand) + log10, + /// @round(operand) + round, + /// @sqrt(operand) + sqrt, + /// @trunc(operand) + trunc, + /// @floor(operand) + floor, + + /// __helpers.(argshelper_call) + helper_call, + /// __helpers. + helper_ref, asm_simple, @@ -194,14 +217,6 @@ pub const Node = extern union { array_type, null_sentinel_array_type, - /// @import("std").zig.c_translation.sizeof(operand) - helpers_sizeof, - /// @import("std").zig.c_translation.FlexibleArrayType(lhs, rhs) - helpers_flexible_array_type, - /// @import("std").zig.c_translation.shuffleVectorIndex(lhs, rhs) - helpers_shuffle_vector_index, - /// @import("std").zig.c_translation.Macro. - helpers_macro, /// @Vector(lhs, rhs) vector, /// @import("std").mem.zeroes(operand) @@ -224,11 +239,14 @@ pub const Node = extern union { /// pub inline fn name(params) return_type body pub_inline_fn, - /// [0]type{} + /// array_type{} empty_array, /// [1]type{val} ** count array_filler, + /// comptime { if (!(lhs)) @compileError(rhs); } + static_assert, + pub const last_no_payload_tag = Tag.@"break"; pub const no_payload_count = @intFromEnum(last_no_payload_tag) + 1; @@ -249,6 +267,7 @@ pub const Node = extern union { .@"anytype", .@"continue", .@"break", + .@"unreachable", => @compileError("Type Tag " ++ @tagName(t) ++ " has no payload"), .std_mem_zeroes, @@ -270,7 +289,6 @@ pub const Node = extern union { .if_not_break, .switch_else, .block_single, - .helpers_sizeof, .int_from_bool, .sizeof, .alignof, @@ -288,6 +306,21 @@ pub const Node = extern union { .const_cast, .volatile_cast, .vector_zero_init, + .byte_swap, + .ceil, + .cos, + .sin, + .exp, + .exp2, + .exp10, + .abs, + .log, + .log2, + .log10, + .round, + .sqrt, + .trunc, + .floor, => Payload.UnOp, .add, @@ -325,19 +358,16 @@ pub const Node = extern union { .bit_xor, .bit_xor_assign, .div_trunc, - .signed_remainder, .as, .array_cat, .ellipsis3, .assign, .array_access, .std_mem_zeroinit, - .helpers_flexible_array_type, - .helpers_shuffle_vector_index, .vector, .div_exact, .offset_of, - .helpers_cast, + .static_assert, => Payload.BinOp, .integer_literal, @@ -346,11 +376,8 @@ pub const Node = extern union { .char_literal, .enum_literal, .identifier, - .fn_identifier, .warning, .type, - .helpers_macro, - .import_c_builtin, => Payload.Value, .discard => Payload.Discard, .@"if" => Payload.If, @@ -360,22 +387,15 @@ pub const Node = extern union { .call => Payload.Call, .var_decl => Payload.VarDecl, .func => Payload.Func, - .@"struct", .@"union" => Payload.Record, + .@"struct", .@"union", .@"opaque" => Payload.Container, .tuple => Payload.TupleInit, .container_init => Payload.ContainerInit, .container_init_dot => Payload.ContainerInitDot, - .helpers_promoteIntLiteral => Payload.PromoteIntLiteral, .block => Payload.Block, .c_pointer, .single_pointer => Payload.Pointer, .array_type, .null_sentinel_array_type => Payload.Array, .arg_redecl, .alias, .fail_decl => Payload.ArgRedecl, - .var_simple, - .pub_var_simple, - .static_local_var, - .extern_local_var, - .extern_local_fn, - .mut_str, - => Payload.SimpleVarDecl, + .var_simple, .pub_var_simple, .wrapped_local, .mut_str => Payload.SimpleVarDecl, .enum_constant => Payload.EnumConstant, .array_filler => Payload.ArrayFiller, .pub_inline_fn => Payload.PubInlineFn, @@ -383,7 +403,8 @@ pub const Node = extern union { .string_slice => Payload.StringSlice, .shuffle => Payload.Shuffle, .builtin_extern => Payload.Extern, - .macro_arithmetic => Payload.MacroArithmetic, + .helper_call => Payload.HelperCall, + .helper_ref => Payload.HelperRef, }; } @@ -402,13 +423,13 @@ pub const Node = extern union { } pub fn Data(comptime t: Tag) type { - return @FieldType(t.Type(), "data"); + return std.meta.fieldInfo(t.Type(), .data).type; } }; pub fn tag(self: Node) Tag { if (self.tag_if_small_enough < Tag.no_payload_count) { - return @as(Tag, @enumFromInt(@as(std.meta.Tag(Tag), @intCast(self.tag_if_small_enough)))); + return @enumFromInt(@as(std.meta.Tag(Tag), @intCast(self.tag_if_small_enough))); } else { return self.ptr_otherwise.tag; } @@ -459,6 +480,24 @@ pub const Node = extern union { } return false; } + + pub fn isBoolRes(res: Node) bool { + switch (res.tag()) { + .@"or", + .@"and", + .equal, + .not_equal, + .less_than, + .less_than_equal, + .greater_than, + .greater_than_equal, + .not, + .false_literal, + .true_literal, + => return true, + else => return false, + } + } }; pub const Payload = struct { @@ -573,10 +612,13 @@ pub const Payload = struct { x86_fastcall, x86_thiscall, x86_vectorcall, + x86_regcall, aarch64_vfabi, + aarch64_sve_pcs, arm_aapcs, arm_aapcs_vfp, m68k_rtd, + riscv_vector, }; }; @@ -586,13 +628,12 @@ pub const Payload = struct { type: Node, }; - pub const Record = struct { + pub const Container = struct { base: Payload, data: struct { layout: enum { @"packed", @"extern", none }, fields: []Field, - functions: []Node, - variables: []Node, + decls: []Node, }, pub const Field = struct { @@ -645,7 +686,7 @@ pub const Payload = struct { pub const ArrayTypeInfo = struct { elem_type: Node, - len: usize, + len: u64, }; }; @@ -655,6 +696,7 @@ pub const Payload = struct { elem_type: Node, is_const: bool, is_volatile: bool, + is_allowzero: bool, }, }; @@ -689,7 +731,7 @@ pub const Payload = struct { data: struct { type: Node, filler: Node, - count: usize, + count: u64, }, }; @@ -711,20 +753,11 @@ pub const Payload = struct { }, }; - pub const PromoteIntLiteral = struct { - base: Payload, - data: struct { - value: Node, - type: Node, - base: Node, - }, - }; - pub const StringSlice = struct { base: Payload, data: struct { string: Node, - end: usize, + end: u64, }, }; @@ -746,22 +779,24 @@ pub const Payload = struct { }, }; - pub const MacroArithmetic = struct { + pub const HelperCall = struct { base: Payload, data: struct { - op: Operator, - lhs: Node, - rhs: Node, + name: []const u8, + args: []const Node, }, + }; - pub const Operator = enum { div, rem }; + pub const HelperRef = struct { + base: Payload, + data: []const u8, }; }; /// Converts the nodes into a Zig Ast. /// Caller must free the source slice. pub fn render(gpa: Allocator, nodes: []const Node) !std.zig.Ast { - var ctx = Context{ + var ctx: Context = .{ .gpa = gpa, .buf = std.array_list.Managed(u8).init(gpa), }; @@ -771,7 +806,7 @@ pub fn render(gpa: Allocator, nodes: []const Node) !std.zig.Ast { defer ctx.tokens.deinit(gpa); // Estimate that each top level node has 10 child nodes. - const estimated_node_count = nodes.len * 10; + const estimated_node_count = nodes.len * 10 + 1; // +1 for the .root node try ctx.nodes.ensureTotalCapacity(gpa, estimated_node_count); // Estimate that each each node has 2 tokens. const estimated_tokens_count = estimated_node_count * 2; @@ -791,21 +826,23 @@ pub fn render(gpa: Allocator, nodes: []const Node) !std.zig.Ast { defer result.deinit(); for (nodes) |node| { - const res = try renderNode(&ctx, node); - if (node.tag() == .warning) continue; + const res = (try renderNodeOpt(&ctx, node)) orelse continue; try result.append(res); } break :blk try ctx.listToSpan(result.items); }; - ctx.nodes.items(.data)[0] = .{ .extra_range = root_members }; + ctx.nodes.items(.data)[0] = .{ .extra_range = .{ + .start = root_members.start, + .end = root_members.end, + } }; try ctx.tokens.append(gpa, .{ .tag = .eof, .start = @as(u32, @intCast(ctx.buf.items.len)), }); - return std.zig.Ast{ + return .{ .source = try ctx.buf.toOwnedSliceSentinel(0), .tokens = ctx.tokens.toOwnedSlice(), .nodes = ctx.nodes.toOwnedSlice(), @@ -816,12 +853,9 @@ pub fn render(gpa: Allocator, nodes: []const Node) !std.zig.Ast { } const NodeIndex = std.zig.Ast.Node.Index; -const NodeOptionalIndex = std.zig.Ast.Node.OptionalIndex; const NodeSubRange = std.zig.Ast.Node.SubRange; const TokenIndex = std.zig.Ast.TokenIndex; -const TokenOptionalIndex = std.zig.Ast.OptionalTokenIndex; const TokenTag = std.zig.Token.Tag; -const ExtraIndex = std.zig.Ast.ExtraIndex; const Context = struct { gpa: Allocator, @@ -832,11 +866,11 @@ const Context = struct { fn addTokenFmt(c: *Context, tag: TokenTag, comptime format: []const u8, args: anytype) Allocator.Error!TokenIndex { const start_index = c.buf.items.len; - try c.buf.writer().print(format ++ " ", args); + try c.buf.print(format ++ " ", args); try c.tokens.append(c.gpa, .{ .tag = tag, - .start = @as(u32, @intCast(start_index)), + .start = @intCast(start_index), }); return @intCast(c.tokens.len - 1); @@ -849,12 +883,12 @@ const Context = struct { fn addIdentifier(c: *Context, bytes: []const u8) Allocator.Error!TokenIndex { if (std.zig.primitives.isPrimitive(bytes)) return c.addTokenFmt(.identifier, "@\"{s}\"", .{bytes}); - return c.addTokenFmt(.identifier, "{f}", .{std.zig.fmtIdFlags(bytes, .{ .allow_primitive = true })}); + return c.addTokenFmt(.identifier, "{f}", .{std.zig.fmtId(bytes)}); } fn listToSpan(c: *Context, list: []const NodeIndex) Allocator.Error!NodeSubRange { try c.extra_data.appendSlice(c.gpa, @ptrCast(list)); - return NodeSubRange{ + return .{ .start = @enumFromInt(c.extra_data.items.len - list.len), .end = @enumFromInt(c.extra_data.items.len), }; @@ -869,59 +903,79 @@ const Context = struct { fn addExtra(c: *Context, extra: anytype) Allocator.Error!std.zig.Ast.ExtraIndex { const fields = std.meta.fields(@TypeOf(extra)); try c.extra_data.ensureUnusedCapacity(c.gpa, fields.len); - const result: ExtraIndex = @enumFromInt(c.extra_data.items.len); + const result: std.zig.Ast.ExtraIndex = @enumFromInt(c.extra_data.items.len); inline for (fields) |field| { - switch (field.type) { + const data: u32 = switch (field.type) { NodeIndex, - NodeOptionalIndex, + std.zig.Ast.Node.OptionalIndex, + std.zig.Ast.OptionalTokenIndex, + std.zig.Ast.ExtraIndex, + => @intFromEnum(@field(extra, field.name)), TokenIndex, - TokenOptionalIndex, - ExtraIndex, - => c.extra_data.appendAssumeCapacity(@intFromEnum(@field(extra, field.name))), + => @field(extra, field.name), else => @compileError("unexpected field type"), - } + }; + c.extra_data.appendAssumeCapacity(data); } return result; } }; -fn renderNodes(c: *Context, nodes: []const Node) Allocator.Error!NodeSubRange { - var result = std.array_list.Managed(NodeIndex).init(c.gpa); - defer result.deinit(); - - for (nodes) |node| { - const res = try renderNode(c, node); - if (node.tag() == .warning) continue; - try result.append(res); - } - - return try c.listToSpan(result.items); -} - -fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { +fn renderNodeOpt(c: *Context, node: Node) Allocator.Error!?NodeIndex { switch (node.tag()) { - .declaration => unreachable, .warning => { const payload = node.castTag(.warning).?.data; - try c.buf.append('\n'); try c.buf.appendSlice(payload); try c.buf.append('\n'); - return @enumFromInt(0); - }, - .helpers_cast => { - const payload = node.castTag(.helpers_cast).?.data; - const import_node = try renderStdImport(c, &.{ "zig", "c_translation", "cast" }); - return renderCall(c, import_node, &.{ payload.lhs, payload.rhs }); + return null; }, - .helpers_promoteIntLiteral => { - const payload = node.castTag(.helpers_promoteIntLiteral).?.data; - const import_node = try renderStdImport(c, &.{ "zig", "c_translation", "promoteIntLiteral" }); - return renderCall(c, import_node, &.{ payload.type, payload.value, payload.base }); + .discard => { + const payload = node.castTag(.discard).?.data; + if (payload.should_skip) return null; + + return try renderNode(c, node); }, - .helpers_sizeof => { - const payload = node.castTag(.helpers_sizeof).?.data; - const import_node = try renderStdImport(c, &.{ "zig", "c_translation", "sizeof" }); - return renderCall(c, import_node, &.{payload}); + else => return try renderNode(c, node), + } +} + +fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { + switch (node.tag()) { + .declaration => unreachable, + .warning => unreachable, + .discard => { + const payload = node.castTag(.discard).?.data; + std.debug.assert(!payload.should_skip); + + const lhs = try c.addNode(.{ + .tag = .identifier, + .main_token = try c.addToken(.identifier, "_"), + .data = undefined, + }); + const main_token = try c.addToken(.equal, "="); + if (payload.value.tag() == .identifier) { + // Render as `_ = &foo;` to avoid tripping "pointless discard" and "local variable never mutated" errors. + var addr_of_pl: Payload.UnOp = .{ + .base = .{ .tag = .address_of }, + .data = payload.value, + }; + const addr_of: Node = .{ .ptr_otherwise = &addr_of_pl.base }; + return try c.addNode(.{ + .tag = .assign, + .main_token = main_token, + .data = .{ .node_and_node = .{ + lhs, try renderNode(c, addr_of), + } }, + }); + } else { + return try c.addNode(.{ + .tag = .assign, + .main_token = main_token, + .data = .{ .node_and_node = .{ + lhs, try renderNode(c, payload.value), + } }, + }); + } }, .std_mem_zeroes => { const payload = node.castTag(.std_mem_zeroes).?.data; @@ -933,31 +987,13 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { const import_node = try renderStdImport(c, &.{ "mem", "zeroInit" }); return renderCall(c, import_node, &.{ payload.lhs, payload.rhs }); }, - .helpers_flexible_array_type => { - const payload = node.castTag(.helpers_flexible_array_type).?.data; - const import_node = try renderStdImport(c, &.{ "zig", "c_translation", "FlexibleArrayType" }); - return renderCall(c, import_node, &.{ payload.lhs, payload.rhs }); - }, - .helpers_shuffle_vector_index => { - const payload = node.castTag(.helpers_shuffle_vector_index).?.data; - const import_node = try renderStdImport(c, &.{ "zig", "c_translation", "shuffleVectorIndex" }); - return renderCall(c, import_node, &.{ payload.lhs, payload.rhs }); - }, .vector => { const payload = node.castTag(.vector).?.data; return renderBuiltinCall(c, "@Vector", &.{ payload.lhs, payload.rhs }); }, .call => { const payload = node.castTag(.call).?.data; - // Cosmetic: avoids an unnecesary address_of on most function calls. - const lhs = if (payload.lhs.tag() == .fn_identifier) - try c.addNode(.{ - .tag = .identifier, - .main_token = try c.addIdentifier(payload.lhs.castTag(.fn_identifier).?.data), - .data = undefined, - }) - else - try renderNodeGrouped(c, payload.lhs); + const lhs = try renderNodeGrouped(c, payload.lhs); return renderCall(c, lhs, payload.args); }, .null_literal => return c.addNode(.{ @@ -990,6 +1026,11 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { .main_token = try c.addToken(.number_literal, "1"), .data = undefined, }), + .@"unreachable" => return c.addNode(.{ + .tag = .unreachable_literal, + .main_token = try c.addToken(.keyword_unreachable, "unreachable"), + .data = undefined, + }), .void_type => return c.addNode(.{ .tag = .identifier, .main_token = try c.addToken(.identifier, "void"), @@ -1003,7 +1044,9 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { .@"continue" => return c.addNode(.{ .tag = .@"continue", .main_token = try c.addToken(.keyword_continue, "continue"), - .data = .{ .opt_token_and_opt_node = .{ .none, .none } }, + .data = .{ .opt_token_and_opt_node = .{ + .none, .none, + } }, }), .return_void => return c.addNode(.{ .tag = .@"return", @@ -1013,7 +1056,9 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { .@"break" => return c.addNode(.{ .tag = .@"break", .main_token = try c.addToken(.keyword_break, "break"), - .data = .{ .opt_token_and_opt_node = .{ .none, .none } }, + .data = .{ .opt_token_and_opt_node = .{ + .none, .none, + } }, }), .break_val => { const payload = node.castTag(.break_val).?.data; @@ -1021,13 +1066,12 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { const break_label = if (payload.label) |some| blk: { _ = try c.addToken(.colon, ":"); break :blk try c.addIdentifier(some); - } else null; + } else 0; return c.addNode(.{ .tag = .@"break", .main_token = tok, .data = .{ .opt_token_and_opt_node = .{ - .fromOptional(break_label), - (try renderNode(c, payload.val)).toOptional(), + .fromToken(break_label), (try renderNode(c, payload.val)).toOptional(), } }, }); }, @@ -1044,7 +1088,9 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { return c.addNode(.{ .tag = .@"comptime", .main_token = try c.addToken(.keyword_comptime, "comptime"), - .data = .{ .node = try renderNode(c, payload) }, + .data = .{ + .node = try renderNode(c, payload), + }, }); }, .@"defer" => { @@ -1052,7 +1098,9 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { return c.addNode(.{ .tag = .@"defer", .main_token = try c.addToken(.keyword_defer, "defer"), - .data = .{ .node = try renderNode(c, payload) }, + .data = .{ + .node = try renderNode(c, payload), + }, }); }, .asm_simple => { @@ -1084,23 +1132,6 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { .data = undefined, }); }, - .fn_identifier => { - // C semantics are that a function identifier has address - // value (implicit in stage1, explicit in stage2), except in - // the context of an address_of, which is handled there. - const payload = node.castTag(.fn_identifier).?.data; - const tok = try c.addToken(.ampersand, "&"); - const arg = try c.addNode(.{ - .tag = .identifier, - .main_token = try c.addIdentifier(payload), - .data = undefined, - }); - return c.addNode(.{ - .tag = .address_of, - .main_token = tok, - .data = .{ .node = arg }, - }); - }, .float_literal => { const payload = node.castTag(.float_literal).?.data; return c.addNode(.{ @@ -1142,25 +1173,6 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { .data = undefined, }); }, - .helpers_macro => { - const payload = node.castTag(.helpers_macro).?.data; - const chain = [_][]const u8{ - "zig", - "c_translation", - "Macros", - payload, - }; - return renderStdImport(c, &chain); - }, - .import_c_builtin => { - const payload = node.castTag(.import_c_builtin).?.data; - const chain = [_][]const u8{ - "zig", - "c_builtins", - payload, - }; - return renderStdImport(c, &chain); - }, .string_slice => { const payload = node.castTag(.string_slice).?.data; @@ -1183,8 +1195,7 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { .tag = .slice, .main_token = l_bracket, .data = .{ .node_and_extra = .{ - string, - try c.addExtra(std.zig.Ast.Node.Slice{ + string, try c.addExtra(std.zig.Ast.Node.Slice{ .start = start, .end = end, }), @@ -1211,17 +1222,21 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { const compile_error = try c.addNode(.{ .tag = .builtin_call_two, .main_token = compile_error_tok, - .data = .{ .opt_node_and_opt_node = .{ err_msg.toOptional(), .none } }, + .data = .{ .opt_node_and_opt_node = .{ + err_msg.toOptional(), .none, + } }, }); _ = try c.addToken(.semicolon, ";"); return c.addNode(.{ .tag = .simple_var_decl, .main_token = const_tok, - .data = .{ .opt_node_and_opt_node = .{ - .none, - compile_error.toOptional(), - } }, + .data = .{ + .opt_node_and_opt_node = .{ + .none, // Type expression + compile_error.toOptional(), // Init expression + }, + }, }); }, .pub_var_simple, .var_simple => { @@ -1237,47 +1252,16 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { return c.addNode(.{ .tag = .simple_var_decl, .main_token = const_tok, - .data = .{ .opt_node_and_opt_node = .{ - .none, - init.toOptional(), - } }, - }); - }, - .static_local_var => { - const payload = node.castTag(.static_local_var).?.data; - - const const_tok = try c.addToken(.keyword_const, "const"); - _ = try c.addIdentifier(payload.name); - _ = try c.addToken(.equal, "="); - - const kind_tok = try c.addToken(.keyword_struct, "struct"); - _ = try c.addToken(.l_brace, "{"); - - const container_def = try c.addNode(.{ - .tag = .container_decl_two_trailing, - .main_token = kind_tok, - .data = .{ .opt_node_and_opt_node = .{ - (try renderNode(c, payload.init)).toOptional(), - .none, - } }, - }); - _ = try c.addToken(.r_brace, "}"); - _ = try c.addToken(.semicolon, ";"); - - return c.addNode(.{ - .tag = .simple_var_decl, - .main_token = const_tok, - .data = .{ .opt_node_and_opt_node = .{ - .none, - container_def.toOptional(), - } }, + .data = .{ + .opt_node_and_opt_node = .{ + .none, // Type expression + init.toOptional(), // Init expression + }, + }, }); }, - .extern_local_var, .extern_local_fn => { - const payload = if (node.tag() == .extern_local_var) - node.castTag(.extern_local_var).?.data - else - node.castTag(.extern_local_fn).?.data; + .wrapped_local => { + const payload = node.castTag(.wrapped_local).?.data; const const_tok = try c.addToken(.keyword_const, "const"); _ = try c.addIdentifier(payload.name); @@ -1290,8 +1274,7 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { .tag = .container_decl_two_trailing, .main_token = kind_tok, .data = .{ .opt_node_and_opt_node = .{ - (try renderNode(c, payload.init)).toOptional(), - .none, + (try renderNode(c, payload.init)).toOptional(), .none, } }, }); _ = try c.addToken(.r_brace, "}"); @@ -1300,10 +1283,12 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { return c.addNode(.{ .tag = .simple_var_decl, .main_token = const_tok, - .data = .{ .opt_node_and_opt_node = .{ - .none, - container_def.toOptional(), - } }, + .data = .{ + .opt_node_and_opt_node = .{ + .none, // Type expression + container_def.toOptional(), // Init expression + }, + }, }); }, .mut_str => { @@ -1315,7 +1300,9 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { const deref = try c.addNode(.{ .tag = .deref, - .data = .{ .node = try renderNodeGrouped(c, payload.init) }, + .data = .{ + .node = try renderNodeGrouped(c, payload.init), + }, .main_token = try c.addToken(.period_asterisk, ".*"), }); _ = try c.addToken(.semicolon, ";"); @@ -1323,10 +1310,12 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { return c.addNode(.{ .tag = .simple_var_decl, .main_token = var_tok, - .data = .{ .opt_node_and_opt_node = .{ - .none, - deref.toOptional(), - } }, + .data = .{ + .opt_node_and_opt_node = .{ + .none, // Type expression + deref.toOptional(), // Init expression + }, + }, }); }, .var_decl => return renderVar(c, node), @@ -1350,10 +1339,12 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { return c.addNode(.{ .tag = .simple_var_decl, .main_token = mut_tok, - .data = .{ .opt_node_and_opt_node = .{ - .none, - init.toOptional(), - } }, + .data = .{ + .opt_node_and_opt_node = .{ + .none, // Type expression + init.toOptional(), // Init expression + }, + }, }); }, .int_cast => { @@ -1368,11 +1359,6 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { const payload = node.castTag(.volatile_cast).?.data; return renderBuiltinCall(c, "@volatileCast", &.{payload}); }, - .signed_remainder => { - const payload = node.castTag(.signed_remainder).?.data; - const import_node = try renderStdImport(c, &.{ "zig", "c_translation", "signedRemainder" }); - return renderCall(c, import_node, &.{ payload.lhs, payload.rhs }); - }, .div_trunc => { const payload = node.castTag(.div_trunc).?.data; return renderBuiltinCall(c, "@divTrunc", &.{ payload.lhs, payload.rhs }); @@ -1458,11 +1444,24 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { .{ .ptr_otherwise = &info_payload.base }, }); }, - .macro_arithmetic => { - const payload = node.castTag(.macro_arithmetic).?.data; - const op = @tagName(payload.op); - const import_node = try renderStdImport(c, &.{ "zig", "c_translation", "MacroArithmetic", op }); - return renderCall(c, import_node, &.{ payload.lhs, payload.rhs }); + .helper_call => { + const payload = node.castTag(.helper_call).?.data; + const helpers_tok = try c.addNode(.{ + .tag = .identifier, + .main_token = try c.addIdentifier("__helpers"), + .data = undefined, + }); + const func = try renderFieldAccess(c, helpers_tok, payload.name); + return renderCall(c, func, payload.args); + }, + .helper_ref => { + const payload = node.castTag(.helper_ref).?.data; + const helpers_tok = try c.addNode(.{ + .tag = .identifier, + .main_token = try c.addIdentifier("__helpers"), + .data = undefined, + }); + return renderFieldAccess(c, helpers_tok, payload); }, .alignof => { const payload = node.castTag(.alignof).?.data; @@ -1476,6 +1475,66 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { const payload = node.castTag(.typeinfo).?.data; return renderBuiltinCall(c, "@typeInfo", &.{payload}); }, + .byte_swap => { + const payload = node.castTag(.byte_swap).?.data; + return renderBuiltinCall(c, "@byteSwap", &.{payload}); + }, + .ceil => { + const payload = node.castTag(.ceil).?.data; + return renderBuiltinCall(c, "@ceil", &.{payload}); + }, + .cos => { + const payload = node.castTag(.cos).?.data; + return renderBuiltinCall(c, "@cos", &.{payload}); + }, + .sin => { + const payload = node.castTag(.sin).?.data; + return renderBuiltinCall(c, "@sin", &.{payload}); + }, + .exp => { + const payload = node.castTag(.exp).?.data; + return renderBuiltinCall(c, "@exp", &.{payload}); + }, + .exp2 => { + const payload = node.castTag(.exp2).?.data; + return renderBuiltinCall(c, "@exp2", &.{payload}); + }, + .exp10 => { + const payload = node.castTag(.exp10).?.data; + return renderBuiltinCall(c, "@exp10", &.{payload}); + }, + .abs => { + const payload = node.castTag(.abs).?.data; + return renderBuiltinCall(c, "@abs", &.{payload}); + }, + .log => { + const payload = node.castTag(.log).?.data; + return renderBuiltinCall(c, "@log", &.{payload}); + }, + .log2 => { + const payload = node.castTag(.log2).?.data; + return renderBuiltinCall(c, "@log2", &.{payload}); + }, + .log10 => { + const payload = node.castTag(.log10).?.data; + return renderBuiltinCall(c, "@log10", &.{payload}); + }, + .round => { + const payload = node.castTag(.round).?.data; + return renderBuiltinCall(c, "@round", &.{payload}); + }, + .sqrt => { + const payload = node.castTag(.sqrt).?.data; + return renderBuiltinCall(c, "@sqrt", &.{payload}); + }, + .trunc => { + const payload = node.castTag(.trunc).?.data; + return renderBuiltinCall(c, "@trunc", &.{payload}); + }, + .floor => { + const payload = node.castTag(.floor).?.data; + return renderBuiltinCall(c, "@floor", &.{payload}); + }, .negate => return renderPrefixOp(c, node, .negation, .minus, "-"), .negate_wrap => return renderPrefixOp(c, node, .negation_wrap, .minus_percent, "-%"), .bit_not => return renderPrefixOp(c, node, .bit_not, .tilde, "~"), @@ -1485,18 +1544,13 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { const payload = node.castTag(.address_of).?.data; const ampersand = try c.addToken(.ampersand, "&"); - const base = if (payload.tag() == .fn_identifier) - try c.addNode(.{ - .tag = .identifier, - .main_token = try c.addIdentifier(payload.castTag(.fn_identifier).?.data), - .data = undefined, - }) - else - try renderNodeGrouped(c, payload); + const base = try renderNodeGrouped(c, payload); return c.addNode(.{ .tag = .address_of, .main_token = ampersand, - .data = .{ .node = base }, + .data = .{ + .node = base, + }, }); }, .deref => { @@ -1506,7 +1560,9 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { return c.addNode(.{ .tag = .deref, .main_token = deref_tok, - .data = .{ .node = operand }, + .data = .{ + .node = operand, + }, }); }, .unwrap => { @@ -1518,8 +1574,7 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { .tag = .unwrap_optional, .main_token = period, .data = .{ .node_and_token = .{ - operand, - question_mark, + operand, question_mark, } }, }); }, @@ -1537,15 +1592,18 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { }; if (payload.is_const) _ = try c.addToken(.keyword_const, "const"); if (payload.is_volatile) _ = try c.addToken(.keyword_volatile, "volatile"); + if (payload.is_allowzero) _ = try c.addToken(.keyword_allowzero, "allowzero"); const elem_type = try renderNodeGrouped(c, payload.elem_type); return c.addNode(.{ .tag = .ptr_type_aligned, .main_token = main_token, - .data = .{ .opt_node_and_node = .{ - .none, - elem_type, - } }, + .data = .{ + .opt_node_and_node = .{ + .none, // Align node + elem_type, + }, + }, }); }, .add => return renderBinOpGrouped(c, node, .add, .plus, "+"), @@ -1592,8 +1650,7 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { .tag = .block_two, .main_token = l_brace, .data = .{ .opt_node_and_opt_node = .{ - .none, - .none, + .none, .none, } }, }); }, @@ -1601,7 +1658,16 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { const payload = node.castTag(.block_single).?.data; const l_brace = try c.addToken(.l_brace, "{"); - const stmt = try renderNode(c, payload); + const stmt = (try renderNodeOpt(c, payload)) orelse { + _ = try c.addToken(.r_brace, "}"); + return c.addNode(.{ + .tag = .block_two, + .main_token = l_brace, + .data = .{ .opt_node_and_opt_node = .{ + .none, .none, + } }, + }); + }; try addSemicolonIfNeeded(c, payload); _ = try c.addToken(.r_brace, "}"); @@ -1609,8 +1675,7 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { .tag = .block_two_semicolon, .main_token = l_brace, .data = .{ .opt_node_and_opt_node = .{ - stmt.toOptional(), - .none, + stmt.toOptional(), .none, } }, }); }, @@ -1625,8 +1690,7 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { var stmts = std.array_list.Managed(NodeIndex).init(c.gpa); defer stmts.deinit(); for (payload.stmts) |stmt| { - const res = try renderNode(c, stmt); - if (@intFromEnum(res) == 0) continue; + const res = (try renderNodeOpt(c, stmt)) orelse continue; try addSemicolonIfNeeded(c, stmt); try stmts.append(res); } @@ -1642,42 +1706,6 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { }, .func => return renderFunc(c, node), .pub_inline_fn => return renderMacroFunc(c, node), - .discard => { - const payload = node.castTag(.discard).?.data; - if (payload.should_skip) return @enumFromInt(0); - - const lhs = try c.addNode(.{ - .tag = .identifier, - .main_token = try c.addToken(.identifier, "_"), - .data = undefined, - }); - const main_token = try c.addToken(.equal, "="); - if (payload.value.tag() == .identifier) { - // Render as `_ = &foo;` to avoid tripping "pointless discard" and "local variable never mutated" errors. - var addr_of_pl: Payload.UnOp = .{ - .base = .{ .tag = .address_of }, - .data = payload.value, - }; - const addr_of: Node = .{ .ptr_otherwise = &addr_of_pl.base }; - return c.addNode(.{ - .tag = .assign, - .main_token = main_token, - .data = .{ .node_and_node = .{ - lhs, - try renderNode(c, addr_of), - } }, - }); - } else { - return c.addNode(.{ - .tag = .assign, - .main_token = main_token, - .data = .{ .node_and_node = .{ - lhs, - try renderNode(c, payload.value), - } }, - }); - } - }, .@"while" => { const payload = node.castTag(.@"while").?.data; const while_tok = try c.addToken(.keyword_while, "while"); @@ -1685,7 +1713,7 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { const cond = try renderNode(c, payload.cond); _ = try c.addToken(.r_paren, ")"); - const cont_expr = if (payload.cont_expr) |some| blk: { + const cont_expr_opt = if (payload.cont_expr) |some| blk: { _ = try c.addToken(.colon, ":"); _ = try c.addToken(.l_paren, "("); const res = try renderNode(c, some); @@ -1694,27 +1722,26 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { } else null; const body = try renderNode(c, payload.body); - if (cont_expr == null) { - return c.addNode(.{ - .tag = .while_simple, - .main_token = while_tok, - .data = .{ .node_and_node = .{ - cond, - body, - } }, - }); - } else { + if (cont_expr_opt) |cont_expr| { return c.addNode(.{ .tag = .while_cont, .main_token = while_tok, .data = .{ .node_and_extra = .{ cond, try c.addExtra(std.zig.Ast.Node.WhileCont{ - .cont_expr = cont_expr.?, + .cont_expr = cont_expr, .then_expr = body, }), } }, }); + } else { + return c.addNode(.{ + .tag = .while_simple, + .main_token = while_tok, + .data = .{ .node_and_node = .{ + cond, body, + } }, + }); } }, .while_true => { @@ -1733,8 +1760,7 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { .tag = .while_simple, .main_token = while_tok, .data = .{ .node_and_node = .{ - cond, - body, + cond, body, } }, }); }, @@ -1750,8 +1776,7 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { .tag = .if_simple, .main_token = if_tok, .data = .{ .node_and_node = .{ - cond, - then_expr, + cond, then_expr, } }, }); _ = try c.addToken(.keyword_else, "else"); @@ -1776,15 +1801,16 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { const cond = try c.addNode(.{ .tag = .bool_not, .main_token = try c.addToken(.bang, "!"), - .data = .{ .node = try renderNodeGrouped(c, payload) }, + .data = .{ + .node = try renderNodeGrouped(c, payload), + }, }); _ = try c.addToken(.r_paren, ")"); const then_expr = try c.addNode(.{ .tag = .@"break", .main_token = try c.addToken(.keyword_break, "break"), .data = .{ .opt_token_and_opt_node = .{ - .none, - .none, + .none, .none, } }, }); @@ -1792,8 +1818,7 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { .tag = .if_simple, .main_token = if_tok, .data = .{ .node_and_node = .{ - cond, - then_expr, + cond, then_expr, } }, }); }, @@ -1817,7 +1842,8 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { .tag = .switch_comma, .main_token = switch_tok, .data = .{ .node_and_extra = .{ - cond, try c.addExtra(NodeSubRange{ + cond, + try c.addExtra(NodeSubRange{ .start = span.start, .end = span.end, }), @@ -1831,8 +1857,7 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { .tag = .switch_case_one, .main_token = try c.addToken(.equal_angle_bracket_right, "=>"), .data = .{ .opt_node_and_node = .{ - .none, - try renderNode(c, payload), + .none, try renderNode(c, payload), } }, }); }, @@ -1840,9 +1865,10 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { const payload = node.castTag(.switch_prong).?.data; var items = try c.gpa.alloc(NodeIndex, payload.cases.len); defer c.gpa.free(items); - for (payload.cases, items, 0..) |case, *item, i| { + + for (payload.cases, 0..) |item, i| { if (i != 0) _ = try c.addToken(.comma, ","); - item.* = try renderNode(c, case); + items[i] = try renderNode(c, item); } _ = try c.addToken(.r_brace, "}"); if (items.len < 2) { @@ -1850,20 +1876,16 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { .tag = .switch_case_one, .main_token = try c.addToken(.equal_angle_bracket_right, "=>"), .data = .{ .opt_node_and_node = .{ - if (items.len == 0) .none else items[0].toOptional(), + if (payload.cases.len == 1) items[0].toOptional() else .none, try renderNode(c, payload.cond), } }, }); } else { - const span = try c.listToSpan(items); return c.addNode(.{ .tag = .switch_case, .main_token = try c.addToken(.equal_angle_bracket_right, "=>"), .data = .{ .extra_and_node = .{ - try c.addExtra(NodeSubRange{ - .start = span.start, - .end = span.end, - }), + try c.addExtra(try c.listToSpan(items)), try renderNode(c, payload.cond), } }, }); @@ -1878,8 +1900,7 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { .tag = .container_decl_two, .main_token = opaque_tok, .data = .{ .opt_node_and_opt_node = .{ - .none, - .none, + .none, .none, } }, }); }, @@ -1893,8 +1914,7 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { .tag = .array_access, .main_token = l_bracket, .data = .{ .node_and_node = .{ - lhs, - index_expr, + lhs, index_expr, } }, }); }, @@ -1918,8 +1938,7 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { .tag = .array_init_one, .main_token = l_brace, .data = .{ .node_and_node = .{ - type_expr, - val, + type_expr, val, } }, }); return c.addNode(.{ @@ -1938,7 +1957,7 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { .empty_array => { const payload = node.castTag(.empty_array).?.data; - const type_expr = try renderArrayType(c, 0, payload); + const type_expr = try renderNode(c, payload); return renderArrayInit(c, type_expr, &.{}); }, .array_init => { @@ -1955,7 +1974,7 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { const lhs = try renderNodeGrouped(c, payload.lhs); return renderFieldAccess(c, lhs, payload.field_name); }, - .@"struct", .@"union" => return renderRecord(c, node), + .@"struct", .@"union", .@"opaque" => return renderContainer(c, node), .enum_constant => { const payload = node.castTag(.enum_constant).?.data; @@ -1963,7 +1982,7 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { const const_tok = try c.addToken(.keyword_const, "const"); _ = try c.addIdentifier(payload.name); - const type_node = if (payload.type) |enum_const_type| blk: { + const type_node_opt = if (payload.type) |enum_const_type| blk: { _ = try c.addToken(.colon, ":"); break :blk try renderNode(c, enum_const_type); } else null; @@ -1977,7 +1996,7 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { .tag = .simple_var_decl, .main_token = const_tok, .data = .{ .opt_node_and_opt_node = .{ - .fromOptional(type_node), + .fromOptional(type_node_opt), init_node.toOptional(), } }, }); @@ -1988,6 +2007,7 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { const l_brace = try c.addToken(.l_brace, "{"); var inits = try c.gpa.alloc(NodeIndex, payload.len); defer c.gpa.free(inits); + for (payload, 0..) |init, i| { if (i != 0) _ = try c.addToken(.comma, ","); inits[i] = try renderNode(c, init); @@ -1998,16 +2018,15 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { .tag = .array_init_dot_two, .main_token = l_brace, .data = .{ .opt_node_and_opt_node = .{ - if (inits.len < 1) .none else inits[0].toOptional(), - if (inits.len < 2) .none else inits[1].toOptional(), + if (inits.len >= 1) inits[0].toOptional() else .none, + if (inits.len >= 2) inits[1].toOptional() else .none, } }, }); } else { - const span = try c.listToSpan(inits); return c.addNode(.{ .tag = .array_init_dot, .main_token = l_brace, - .data = .{ .extra_range = span }, + .data = .{ .extra_range = try c.listToSpan(inits) }, }); } }, @@ -2017,6 +2036,7 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { const l_brace = try c.addToken(.l_brace, "{"); var inits = try c.gpa.alloc(NodeIndex, payload.len); defer c.gpa.free(inits); + for (payload, 0..) |init, i| { _ = try c.addToken(.period, "."); _ = try c.addIdentifier(init.name); @@ -2031,16 +2051,15 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { .tag = .struct_init_dot_two_comma, .main_token = l_brace, .data = .{ .opt_node_and_opt_node = .{ - if (inits.len < 1) .none else inits[0].toOptional(), - if (inits.len < 2) .none else inits[1].toOptional(), + if (inits.len >= 1) inits[0].toOptional() else .none, + if (inits.len >= 2) inits[1].toOptional() else .none, } }, }); } else { - const span = try c.listToSpan(inits); return c.addNode(.{ .tag = .struct_init_dot_comma, .main_token = l_brace, - .data = .{ .extra_range = span }, + .data = .{ .extra_range = try c.listToSpan(inits) }, }); } }, @@ -2051,6 +2070,7 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { const l_brace = try c.addToken(.l_brace, "{"); var inits = try c.gpa.alloc(NodeIndex, payload.inits.len); defer c.gpa.free(inits); + for (payload.inits, 0..) |init, i| { _ = try c.addToken(.period, "."); _ = try c.addIdentifier(init.name); @@ -2060,58 +2080,107 @@ fn renderNode(c: *Context, node: Node) Allocator.Error!NodeIndex { } _ = try c.addToken(.r_brace, "}"); - return switch (payload.inits.len) { - 0 => c.addNode(.{ + switch (inits.len) { + 0 => return c.addNode(.{ .tag = .struct_init_one, .main_token = l_brace, .data = .{ .node_and_opt_node = .{ - lhs, - .none, + lhs, .none, } }, }), - 1 => c.addNode(.{ + 1 => return c.addNode(.{ .tag = .struct_init_one_comma, .main_token = l_brace, .data = .{ .node_and_opt_node = .{ + lhs, inits[0].toOptional(), + } }, + }), + else => return c.addNode(.{ + .tag = .struct_init_comma, + .main_token = l_brace, + .data = .{ .node_and_extra = .{ lhs, - inits[0].toOptional(), + try c.addExtra(try c.listToSpan(inits)), } }, }), - else => blk: { - const span = try c.listToSpan(inits); - break :blk c.addNode(.{ - .tag = .struct_init_comma, - .main_token = l_brace, - .data = .{ .node_and_extra = .{ - lhs, try c.addExtra(NodeSubRange{ - .start = span.start, - .end = span.end, - }), - } }, - }); + } + }, + .static_assert => { + const payload = node.castTag(.static_assert).?.data; + const comptime_tok = try c.addToken(.keyword_comptime, "comptime"); + const l_brace = try c.addToken(.l_brace, "{"); + + const if_tok = try c.addToken(.keyword_if, "if"); + _ = try c.addToken(.l_paren, "("); + const cond = try c.addNode(.{ + .tag = .bool_not, + .main_token = try c.addToken(.bang, "!"), + .data = .{ + .node = try renderNodeGrouped(c, payload.lhs), }, - }; + }); + _ = try c.addToken(.r_paren, ")"); + + const compile_error_tok = try c.addToken(.builtin, "@compileError"); + _ = try c.addToken(.l_paren, "("); + const err_msg = try renderNode(c, payload.rhs); + _ = try c.addToken(.r_paren, ")"); + const compile_error = try c.addNode(.{ + .tag = .builtin_call_two, + .main_token = compile_error_tok, + .data = .{ .opt_node_and_opt_node = .{ + err_msg.toOptional(), .none, + } }, + }); + + const if_node = try c.addNode(.{ + .tag = .if_simple, + .main_token = if_tok, + .data = .{ .node_and_node = .{ + cond, compile_error, + } }, + }); + _ = try c.addToken(.semicolon, ";"); + _ = try c.addToken(.r_brace, "}"); + const block_node = try c.addNode(.{ + .tag = .block_two_semicolon, + .main_token = l_brace, + .data = .{ .opt_node_and_opt_node = .{ + if_node.toOptional(), .none, + } }, + }); + + return c.addNode(.{ + .tag = .@"comptime", + .main_token = comptime_tok, + .data = .{ + .node = block_node, + }, + }); }, .@"anytype" => unreachable, // Handled in renderParams } } -fn renderRecord(c: *Context, node: Node) !NodeIndex { - const payload = @as(*Payload.Record, @alignCast(@fieldParentPtr("base", node.ptr_otherwise))).data; +fn renderContainer(c: *Context, node: Node) !NodeIndex { + const payload = @as(*Payload.Container, @alignCast(@fieldParentPtr("base", node.ptr_otherwise))).data; if (payload.layout == .@"packed") _ = try c.addToken(.keyword_packed, "packed") else if (payload.layout == .@"extern") _ = try c.addToken(.keyword_extern, "extern"); const kind_tok = if (node.tag() == .@"struct") try c.addToken(.keyword_struct, "struct") + else if (node.tag() == .@"union") + try c.addToken(.keyword_union, "union") + else if (node.tag() == .@"opaque") + try c.addToken(.keyword_opaque, "opaque") else - try c.addToken(.keyword_union, "union"); + unreachable; _ = try c.addToken(.l_brace, "{"); - const num_vars = payload.variables.len; - const num_funcs = payload.functions.len; - const total_members = payload.fields.len + num_vars + num_funcs; + const num_decls = payload.decls.len; + const total_members = payload.fields.len + num_decls; const members = try c.gpa.alloc(NodeIndex, total_members); defer c.gpa.free(members); @@ -2120,7 +2189,7 @@ fn renderRecord(c: *Context, node: Node) !NodeIndex { _ = try c.addToken(.colon, ":"); const type_expr = try renderNode(c, field.type); - const align_expr = if (field.alignment) |alignment| blk: { + const align_expr_opt = if (field.alignment) |alignment| blk: { _ = try c.addToken(.keyword_align, "align"); _ = try c.addToken(.l_paren, "("); const align_expr = try c.addNode(.{ @@ -2132,43 +2201,53 @@ fn renderRecord(c: *Context, node: Node) !NodeIndex { break :blk align_expr; } else null; - const value_expr = if (field.default_value) |value| blk: { + const value_expr_opt = if (field.default_value) |value| blk: { _ = try c.addToken(.equal, "="); break :blk try renderNode(c, value); } else null; - members[i] = try c.addNode(if (align_expr == null) .{ - .tag = .container_field_init, - .main_token = name_tok, - .data = .{ .node_and_opt_node = .{ - type_expr, - .fromOptional(value_expr), - } }, - } else if (value_expr == null) .{ - .tag = .container_field_align, - .main_token = name_tok, - .data = .{ .node_and_node = .{ - type_expr, - align_expr.?, - } }, - } else .{ - .tag = .container_field, - .main_token = name_tok, - .data = .{ .node_and_extra = .{ - type_expr, try c.addExtra(std.zig.Ast.Node.ContainerField{ - .align_expr = align_expr.?, - .value_expr = value_expr.?, - }), - } }, - }); + if (align_expr_opt) |align_expr| { + if (value_expr_opt) |value_expr| { + members[i] = try c.addNode(.{ + .tag = .container_field, + .main_token = name_tok, + .data = .{ .node_and_extra = .{ + type_expr, + try c.addExtra(std.zig.Ast.Node.ContainerField{ + .align_expr = align_expr, + .value_expr = value_expr, + }), + } }, + }); + } else { + members[i] = try c.addNode(.{ + .tag = .container_field_align, + .main_token = name_tok, + .data = .{ .node_and_node = .{ + type_expr, + align_expr, + } }, + }); + } + } else { + members[i] = try c.addNode(.{ + .tag = .container_field_init, + .main_token = name_tok, + .data = .{ .node_and_opt_node = .{ + type_expr, + .fromOptional(value_expr_opt), + } }, + }); + } _ = try c.addToken(.comma, ","); } - for (payload.variables, 0..) |variable, i| { - members[payload.fields.len + i] = try renderNode(c, variable); - } - for (payload.functions, 0..) |function, i| { - members[payload.fields.len + num_vars + i] = try renderNode(c, function); + for (members[payload.fields.len..], payload.decls) |*member, decl| { + member.* = try renderNode(c, decl); } + const trailing = switch (c.tokens.items(.tag)[c.tokens.len - 1]) { + .comma, .semicolon => true, + else => false, + }; _ = try c.addToken(.r_brace, "}"); if (total_members == 0) { @@ -2176,23 +2255,22 @@ fn renderRecord(c: *Context, node: Node) !NodeIndex { .tag = .container_decl_two, .main_token = kind_tok, .data = .{ .opt_node_and_opt_node = .{ - .none, - .none, + .none, .none, } }, }); } else if (total_members <= 2) { return c.addNode(.{ - .tag = if (num_funcs == 0) .container_decl_two_trailing else .container_decl_two, + .tag = if (trailing) .container_decl_two_trailing else .container_decl_two, .main_token = kind_tok, .data = .{ .opt_node_and_opt_node = .{ - if (members.len < 1) .none else members[0].toOptional(), - if (members.len < 2) .none else members[1].toOptional(), + if (members.len >= 1) members[0].toOptional() else .none, + if (members.len >= 2) members[1].toOptional() else .none, } }, }); } else { const span = try c.listToSpan(members); return c.addNode(.{ - .tag = if (num_funcs == 0) .container_decl_trailing else .container_decl, + .tag = if (trailing) .container_decl_trailing else .container_decl, .main_token = kind_tok, .data = .{ .extra_range = span }, }); @@ -2204,8 +2282,7 @@ fn renderFieldAccess(c: *Context, lhs: NodeIndex, field_name: []const u8) !NodeI .tag = .field_access, .main_token = try c.addToken(.period, "."), .data = .{ .node_and_token = .{ - lhs, - try c.addTokenFmt(.identifier, "{f}", .{std.zig.fmtIdFlags(field_name, .{ .allow_primitive = true })}), + lhs, try c.addTokenFmt(.identifier, "{f}", .{std.zig.fmtIdFlags(field_name, .{ .allow_primitive = true })}), } }, }); } @@ -2214,6 +2291,7 @@ fn renderArrayInit(c: *Context, lhs: NodeIndex, inits: []const Node) !NodeIndex const l_brace = try c.addToken(.l_brace, "{"); var rendered = try c.gpa.alloc(NodeIndex, inits.len); defer c.gpa.free(rendered); + for (inits, 0..) |init, i| { rendered[i] = try renderNode(c, init); _ = try c.addToken(.comma, ","); @@ -2224,35 +2302,28 @@ fn renderArrayInit(c: *Context, lhs: NodeIndex, inits: []const Node) !NodeIndex .tag = .struct_init_one, .main_token = l_brace, .data = .{ .node_and_opt_node = .{ - lhs, - .none, + lhs, .none, } }, }), 1 => return c.addNode(.{ .tag = .array_init_one_comma, .main_token = l_brace, .data = .{ .node_and_node = .{ + lhs, rendered[0], + } }, + }), + else => return c.addNode(.{ + .tag = .array_init_comma, + .main_token = l_brace, + .data = .{ .node_and_extra = .{ lhs, - rendered[0], + try c.addExtra(try c.listToSpan(rendered)), } }, }), - else => { - const span = try c.listToSpan(rendered); - return c.addNode(.{ - .tag = .array_init_comma, - .main_token = l_brace, - .data = .{ .node_and_extra = .{ - lhs, try c.addExtra(NodeSubRange{ - .start = span.start, - .end = span.end, - }), - } }, - }); - }, } } -fn renderArrayType(c: *Context, len: usize, elem_type: Node) !NodeIndex { +fn renderArrayType(c: *Context, len: u64, elem_type: Node) !NodeIndex { const l_bracket = try c.addToken(.l_bracket, "["); const len_expr = try c.addNode(.{ .tag = .number_literal, @@ -2265,13 +2336,12 @@ fn renderArrayType(c: *Context, len: usize, elem_type: Node) !NodeIndex { .tag = .array_type, .main_token = l_bracket, .data = .{ .node_and_node = .{ - len_expr, - elem_type_expr, + len_expr, elem_type_expr, } }, }); } -fn renderNullSentinelArrayType(c: *Context, len: usize, elem_type: Node) !NodeIndex { +fn renderNullSentinelArrayType(c: *Context, len: u64, elem_type: Node) !NodeIndex { const l_bracket = try c.addToken(.l_bracket, "["); const len_expr = try c.addNode(.{ .tag = .number_literal, @@ -2304,7 +2374,7 @@ fn renderNullSentinelArrayType(c: *Context, len: usize, elem_type: Node) !NodeIn fn addSemicolonIfNeeded(c: *Context, node: Node) !void { switch (node.tag()) { .warning => unreachable, - .var_decl, .var_simple, .arg_redecl, .alias, .block, .empty_block, .block_single, .@"switch", .static_local_var, .extern_local_var, .extern_local_fn, .mut_str => {}, + .var_decl, .var_simple, .arg_redecl, .alias, .block, .empty_block, .block_single, .@"switch", .wrapped_local, .mut_str => {}, .while_true => { const payload = node.castTag(.while_true).?.data; return addSemicolonIfNotBlock(c, payload); @@ -2344,7 +2414,6 @@ fn renderNodeGrouped(c: *Context, node: Node) !NodeIndex { .noreturn_type, .@"anytype", .div_trunc, - .signed_remainder, .int_cast, .const_cast, .volatile_cast, @@ -2362,11 +2431,6 @@ fn renderNodeGrouped(c: *Context, node: Node) !NodeIndex { .typeof, .typeinfo, .vector, - .helpers_sizeof, - .helpers_cast, - .helpers_promoteIntLiteral, - .helpers_shuffle_vector_index, - .helpers_flexible_array_type, .std_mem_zeroinit, .integer_literal, .float_literal, @@ -2375,7 +2439,6 @@ fn renderNodeGrouped(c: *Context, node: Node) !NodeIndex { .char_literal, .enum_literal, .identifier, - .fn_identifier, .field_access, .ptr_cast, .type, @@ -2399,17 +2462,32 @@ fn renderNodeGrouped(c: *Context, node: Node) !NodeIndex { .offset_of, .shuffle, .builtin_extern, - .static_local_var, - .extern_local_var, - .extern_local_fn, + .wrapped_local, .mut_str, - .macro_arithmetic, + .helper_call, + .helper_ref, + .byte_swap, + .ceil, + .cos, + .sin, + .exp, + .exp2, + .exp10, + .abs, + .log, + .log2, + .log10, + .round, + .sqrt, + .trunc, + .floor, => { // no grouping needed return renderNode(c, node); }, .opaque_literal, + .@"opaque", .empty_array, .block_single, .add, @@ -2492,8 +2570,8 @@ fn renderNodeGrouped(c: *Context, node: Node) !NodeIndex { .bit_or_assign, .bit_xor_assign, .assign, - .helpers_macro, - .import_c_builtin, + .static_assert, + .@"unreachable", => { // these should never appear in places where grouping might be needed. unreachable; @@ -2506,7 +2584,9 @@ fn renderPrefixOp(c: *Context, node: Node, tag: std.zig.Ast.Node.Tag, tok_tag: T return c.addNode(.{ .tag = tag, .main_token = try c.addToken(tok_tag, bytes), - .data = .{ .node = try renderNodeGrouped(c, payload) }, + .data = .{ + .node = try renderNodeGrouped(c, payload), + }, }); } @@ -2517,8 +2597,7 @@ fn renderBinOpGrouped(c: *Context, node: Node, tag: std.zig.Ast.Node.Tag, tok_ta .tag = tag, .main_token = try c.addToken(tok_tag, bytes), .data = .{ .node_and_node = .{ - lhs, - try renderNodeGrouped(c, payload.rhs), + lhs, try renderNodeGrouped(c, payload.rhs), } }, }); } @@ -2530,8 +2609,7 @@ fn renderBinOp(c: *Context, node: Node, tag: std.zig.Ast.Node.Tag, tok_tag: Toke .tag = tag, .main_token = try c.addToken(tok_tag, bytes), .data = .{ .node_and_node = .{ - lhs, - try renderNode(c, payload.rhs), + lhs, try renderNode(c, payload.rhs), } }, }); } @@ -2550,7 +2628,9 @@ fn renderStdImport(c: *Context, parts: []const []const u8) !NodeIndex { const import_node = try c.addNode(.{ .tag = .builtin_call_two, .main_token = import_tok, - .data = .{ .opt_node_and_opt_node = .{ std_node.toOptional(), .none } }, + .data = .{ .opt_node_and_opt_node = .{ + std_node.toOptional(), .none, + } }, }); var access_chain = import_node; @@ -2566,16 +2646,17 @@ fn renderCall(c: *Context, lhs: NodeIndex, args: []const Node) !NodeIndex { 0 => try c.addNode(.{ .tag = .call_one, .main_token = lparen, - .data = .{ .node_and_opt_node = .{ lhs, .none } }, + .data = .{ .node_and_opt_node = .{ + lhs, .none, + } }, + }), + 1 => try c.addNode(.{ + .tag = .call_one, + .main_token = lparen, + .data = .{ .node_and_opt_node = .{ + lhs, (try renderNode(c, args[0])).toOptional(), + } }, }), - 1 => blk: { - const arg = try renderNode(c, args[0]); - break :blk try c.addNode(.{ - .tag = .call_one, - .main_token = lparen, - .data = .{ .node_and_opt_node = .{ lhs, arg.toOptional() } }, - }); - }, else => blk: { var rendered = try c.gpa.alloc(NodeIndex, args.len); defer c.gpa.free(rendered); @@ -2589,8 +2670,10 @@ fn renderCall(c: *Context, lhs: NodeIndex, args: []const Node) !NodeIndex { .tag = .call, .main_token = lparen, .data = .{ .node_and_extra = .{ - lhs, - try c.addExtra(NodeSubRange{ .start = span.start, .end = span.end }), + lhs, try c.addExtra(NodeSubRange{ + .start = span.start, + .end = span.end, + }), } }, }); }, @@ -2602,10 +2685,10 @@ fn renderCall(c: *Context, lhs: NodeIndex, args: []const Node) !NodeIndex { fn renderBuiltinCall(c: *Context, builtin: []const u8, args: []const Node) !NodeIndex { const builtin_tok = try c.addToken(.builtin, builtin); _ = try c.addToken(.l_paren, "("); - var arg_1: NodeIndex = undefined; - var arg_2: NodeIndex = undefined; - var arg_3: NodeIndex = undefined; - var arg_4: NodeIndex = undefined; + var arg_1: ?NodeIndex = null; + var arg_2: ?NodeIndex = null; + var arg_3: ?NodeIndex = null; + var arg_4: ?NodeIndex = null; switch (args.len) { 0 => {}, 1 => { @@ -2634,18 +2717,20 @@ fn renderBuiltinCall(c: *Context, builtin: []const u8, args: []const Node) !Node .tag = .builtin_call_two, .main_token = builtin_tok, .data = .{ .opt_node_and_opt_node = .{ - if (args.len < 1) .none else arg_1.toOptional(), - if (args.len < 2) .none else arg_2.toOptional(), + .fromOptional(arg_1), .fromOptional(arg_2), } }, }); } else { std.debug.assert(args.len == 4); - const params = try c.listToSpan(&.{ arg_1, arg_2, arg_3, arg_4 }); + const params = try c.listToSpan(&.{ arg_1.?, arg_2.?, arg_3.?, arg_4.? }); return c.addNode(.{ .tag = .builtin_call, .main_token = builtin_tok, - .data = .{ .extra_range = params }, + .data = .{ .extra_range = .{ + .start = params.start, + .end = params.end, + } }, }); } } @@ -2664,7 +2749,7 @@ fn renderVar(c: *Context, node: Node) !NodeIndex { _ = try c.addToken(.colon, ":"); const type_node = try renderNode(c, payload.type); - const align_node = if (payload.alignment) |some| blk: { + const align_node_opt = if (payload.alignment) |some| blk: { _ = try c.addToken(.keyword_align, "align"); _ = try c.addToken(.l_paren, "("); const res = try c.addNode(.{ @@ -2676,7 +2761,7 @@ fn renderVar(c: *Context, node: Node) !NodeIndex { break :blk res; } else null; - const section_node = if (payload.linksection_string) |some| blk: { + const section_node_opt = if (payload.linksection_string) |some| blk: { _ = try c.addToken(.keyword_linksection, "linksection"); _ = try c.addToken(.l_paren, "("); const res = try c.addNode(.{ @@ -2688,49 +2773,51 @@ fn renderVar(c: *Context, node: Node) !NodeIndex { break :blk res; } else null; - const init_node = if (payload.init) |some| blk: { + const init_node_opt = if (payload.init) |some| blk: { _ = try c.addToken(.equal, "="); break :blk try renderNode(c, some); } else null; _ = try c.addToken(.semicolon, ";"); - if (section_node == null) { - if (align_node == null) { - return c.addNode(.{ - .tag = .simple_var_decl, - .main_token = mut_tok, - .data = .{ .opt_node_and_opt_node = .{ - type_node.toOptional(), - .fromOptional(init_node), - } }, - }); - } else { - return c.addNode(.{ - .tag = .local_var_decl, - .main_token = mut_tok, - .data = .{ .extra_and_opt_node = .{ - try c.addExtra(std.zig.Ast.Node.LocalVarDecl{ - .type_node = type_node, - .align_node = align_node.?, - }), - .fromOptional(init_node), - } }, - }); - } - } else { + if (section_node_opt) |section_node| { return c.addNode(.{ .tag = .global_var_decl, .main_token = mut_tok, .data = .{ .extra_and_opt_node = .{ try c.addExtra(std.zig.Ast.Node.GlobalVarDecl{ .type_node = type_node.toOptional(), - .align_node = .fromOptional(align_node), - .section_node = .fromOptional(section_node), + .align_node = .fromOptional(align_node_opt), + .section_node = section_node.toOptional(), .addrspace_node = .none, }), - .fromOptional(init_node), + .fromOptional(init_node_opt), } }, }); + } else { + if (align_node_opt) |align_node| { + return c.addNode(.{ + .tag = .local_var_decl, + .main_token = mut_tok, + .data = .{ .extra_and_opt_node = .{ + try c.addExtra(std.zig.Ast.Node.LocalVarDecl{ + .type_node = type_node, + .align_node = align_node, + }), + .fromOptional(init_node_opt), + } }, + }); + } else { + return c.addNode(.{ + .tag = .simple_var_decl, + .main_token = mut_tok, + .data = .{ + .opt_node_and_opt_node = .{ + type_node.toOptional(), // Type expression + .fromOptional(init_node_opt), // Init expression + }, + }, + }); + } } } @@ -2748,7 +2835,7 @@ fn renderFunc(c: *Context, node: Node) !NodeIndex { var span: NodeSubRange = undefined; if (params.items.len > 1) span = try c.listToSpan(params.items); - const align_expr = if (payload.alignment) |some| blk: { + const align_expr_opt = if (payload.alignment) |some| blk: { _ = try c.addToken(.keyword_align, "align"); _ = try c.addToken(.l_paren, "("); const res = try c.addNode(.{ @@ -2760,7 +2847,7 @@ fn renderFunc(c: *Context, node: Node) !NodeIndex { break :blk res; } else null; - const section_expr = if (payload.linksection_string) |some| blk: { + const section_expr_opt = if (payload.linksection_string) |some| blk: { _ = try c.addToken(.keyword_linksection, "linksection"); _ = try c.addToken(.l_paren, "("); const res = try c.addNode(.{ @@ -2772,7 +2859,7 @@ fn renderFunc(c: *Context, node: Node) !NodeIndex { break :blk res; } else null; - const callconv_expr = if (payload.explicit_callconv) |some| blk: { + const callconv_expr_opt = if (payload.explicit_callconv) |some| blk: { _ = try c.addToken(.keyword_callconv, "callconv"); _ = try c.addToken(.l_paren, "("); const cc_node = switch (some) { @@ -2790,10 +2877,13 @@ fn renderFunc(c: *Context, node: Node) !NodeIndex { .x86_fastcall, .x86_thiscall, .x86_vectorcall, + .x86_regcall, .aarch64_vfabi, + .aarch64_sve_pcs, .arm_aapcs, .arm_aapcs_vfp, .m68k_rtd, + .riscv_vector, => cc_node: { // .{ .foo = .{} } _ = try c.addToken(.period, "."); @@ -2805,19 +2895,17 @@ fn renderFunc(c: *Context, node: Node) !NodeIndex { const inner_lbrace = try c.addToken(.l_brace, "{"); _ = try c.addToken(.r_brace, "}"); _ = try c.addToken(.r_brace, "}"); - const inner_node = try c.addNode(.{ - .tag = .struct_init_dot_two, - .main_token = inner_lbrace, - .data = .{ .opt_node_and_opt_node = .{ - .none, - .none, - } }, - }); break :cc_node try c.addNode(.{ .tag = .struct_init_dot_two, .main_token = outer_lbrace, .data = .{ .opt_node_and_opt_node = .{ - inner_node.toOptional(), + (try c.addNode(.{ + .tag = .struct_init_dot_two, + .main_token = inner_lbrace, + .data = .{ .opt_node_and_opt_node = .{ + .none, .none, + } }, + })).toOptional(), .none, } }, }); @@ -2830,13 +2918,13 @@ fn renderFunc(c: *Context, node: Node) !NodeIndex { const return_type_expr = try renderNode(c, payload.return_type); const fn_proto = try blk: { - if (align_expr == null and section_expr == null and callconv_expr == null) { + if (align_expr_opt == null and section_expr_opt == null and callconv_expr_opt == null) { if (params.items.len < 2) break :blk c.addNode(.{ .tag = .fn_proto_simple, .main_token = fn_token, .data = .{ .opt_node_and_opt_node = .{ - if (params.items.len == 0) .none else params.items[0].toOptional(), + if (params.items.len == 1) params.items[0].toOptional() else .none, return_type_expr.toOptional(), } }, }) @@ -2845,10 +2933,7 @@ fn renderFunc(c: *Context, node: Node) !NodeIndex { .tag = .fn_proto_multi, .main_token = fn_token, .data = .{ .extra_and_opt_node = .{ - try c.addExtra(NodeSubRange{ - .start = span.start, - .end = span.end, - }), + try c.addExtra(span), return_type_expr.toOptional(), } }, }); @@ -2860,11 +2945,11 @@ fn renderFunc(c: *Context, node: Node) !NodeIndex { .data = .{ .extra_and_opt_node = .{ try c.addExtra(std.zig.Ast.Node.FnProtoOne{ - .param = if (params.items.len == 0) .none else params.items[0].toOptional(), - .align_expr = .fromOptional(align_expr), + .param = if (params.items.len == 1) params.items[0].toOptional() else .none, + .align_expr = .fromOptional(align_expr_opt), .addrspace_expr = .none, // TODO - .section_expr = .fromOptional(section_expr), - .callconv_expr = .fromOptional(callconv_expr), + .section_expr = .fromOptional(section_expr_opt), + .callconv_expr = .fromOptional(callconv_expr_opt), }), return_type_expr.toOptional(), }, @@ -2879,10 +2964,10 @@ fn renderFunc(c: *Context, node: Node) !NodeIndex { try c.addExtra(std.zig.Ast.Node.FnProto{ .params_start = span.start, .params_end = span.end, - .align_expr = .fromOptional(align_expr), + .align_expr = .fromOptional(align_expr_opt), .addrspace_expr = .none, // TODO - .section_expr = .fromOptional(section_expr), - .callconv_expr = .fromOptional(callconv_expr), + .section_expr = .fromOptional(section_expr_opt), + .callconv_expr = .fromOptional(callconv_expr_opt), }), return_type_expr.toOptional(), }, @@ -2901,8 +2986,7 @@ fn renderFunc(c: *Context, node: Node) !NodeIndex { .tag = .fn_decl, .main_token = fn_token, .data = .{ .node_and_node = .{ - fn_proto, - body, + fn_proto, body, } }, }); } @@ -2916,6 +3000,8 @@ fn renderMacroFunc(c: *Context, node: Node) !NodeIndex { const params = try renderParams(c, payload.params, false); defer params.deinit(); + var span: NodeSubRange = undefined; + if (params.items.len > 1) span = try c.listToSpan(params.items); const return_type_expr = try renderNodeGrouped(c, payload.return_type); @@ -2925,20 +3011,16 @@ fn renderMacroFunc(c: *Context, node: Node) !NodeIndex { .tag = .fn_proto_simple, .main_token = fn_token, .data = .{ .opt_node_and_opt_node = .{ - if (params.items.len == 0) .none else params.items[0].toOptional(), + if (params.items.len == 1) params.items[0].toOptional() else .none, return_type_expr.toOptional(), } }, }); } else { - const span: NodeSubRange = try c.listToSpan(params.items); break :blk try c.addNode(.{ .tag = .fn_proto_multi, .main_token = fn_token, .data = .{ .extra_and_opt_node = .{ - try c.addExtra(std.zig.Ast.Node.SubRange{ - .start = span.start, - .end = span.end, - }), + try c.addExtra(span), return_type_expr.toOptional(), } }, }); @@ -2948,15 +3030,14 @@ fn renderMacroFunc(c: *Context, node: Node) !NodeIndex { .tag = .fn_decl, .main_token = fn_token, .data = .{ .node_and_node = .{ - fn_proto, - try renderNode(c, payload.body), + fn_proto, try renderNode(c, payload.body), } }, }); } fn renderParams(c: *Context, params: []Payload.Param, is_var_args: bool) !std.array_list.Managed(NodeIndex) { _ = try c.addToken(.l_paren, "("); - var rendered = try std.array_list.Managed(NodeIndex).initCapacity(c.gpa, params.len); + var rendered = try std.array_list.Managed(NodeIndex).initCapacity(c.gpa, @max(params.len, 1)); errdefer rendered.deinit(); for (params, 0..) |param, i| { diff --git a/lib/compiler/translate-c/builtins.zig b/lib/compiler/translate-c/builtins.zig new file mode 100644 index 000000000000..cc385f8007a3 --- /dev/null +++ b/lib/compiler/translate-c/builtins.zig @@ -0,0 +1,76 @@ +const std = @import("std"); + +const ast = @import("ast.zig"); + +/// All builtins need to have a source so that macros can reference them +/// but for some it is possible to directly call an equivalent Zig builtin +/// which is preferrable. +pub const Builtin = struct { + /// The name of the builtin in `c_builtins.zig`. + name: []const u8, + tag: ?ast.Node.Tag = null, +}; + +pub const map = std.StaticStringMap(Builtin).initComptime([_]struct { []const u8, Builtin }{ + .{ "__builtin_abs", .{ .name = "abs" } }, + .{ "__builtin_assume", .{ .name = "assume" } }, + .{ "__builtin_bswap16", .{ .name = "bswap16", .tag = .byte_swap } }, + .{ "__builtin_bswap32", .{ .name = "bswap32", .tag = .byte_swap } }, + .{ "__builtin_bswap64", .{ .name = "bswap64", .tag = .byte_swap } }, + .{ "__builtin_ceilf", .{ .name = "ceilf", .tag = .ceil } }, + .{ "__builtin_ceil", .{ .name = "ceil", .tag = .ceil } }, + .{ "__builtin_clz", .{ .name = "clz" } }, + .{ "__builtin_constant_p", .{ .name = "constant_p" } }, + .{ "__builtin_cosf", .{ .name = "cosf", .tag = .cos } }, + .{ "__builtin_cos", .{ .name = "cos", .tag = .cos } }, + .{ "__builtin_ctz", .{ .name = "ctz" } }, + .{ "__builtin_exp2f", .{ .name = "exp2f", .tag = .exp2 } }, + .{ "__builtin_exp2", .{ .name = "exp2", .tag = .exp2 } }, + .{ "__builtin_expf", .{ .name = "expf", .tag = .exp } }, + .{ "__builtin_exp", .{ .name = "exp", .tag = .exp } }, + .{ "__builtin_expect", .{ .name = "expect" } }, + .{ "__builtin_fabsf", .{ .name = "fabsf", .tag = .abs } }, + .{ "__builtin_fabs", .{ .name = "fabs", .tag = .abs } }, + .{ "__builtin_floorf", .{ .name = "floorf", .tag = .floor } }, + .{ "__builtin_floor", .{ .name = "floor", .tag = .floor } }, + .{ "__builtin_huge_valf", .{ .name = "huge_valf" } }, + .{ "__builtin_inff", .{ .name = "inff" } }, + .{ "__builtin_isinf_sign", .{ .name = "isinf_sign" } }, + .{ "__builtin_isinf", .{ .name = "isinf" } }, + .{ "__builtin_isnan", .{ .name = "isnan" } }, + .{ "__builtin_labs", .{ .name = "labs" } }, + .{ "__builtin_llabs", .{ .name = "llabs" } }, + .{ "__builtin_log10f", .{ .name = "log10f", .tag = .log10 } }, + .{ "__builtin_log10", .{ .name = "log10", .tag = .log10 } }, + .{ "__builtin_log2f", .{ .name = "log2f", .tag = .log2 } }, + .{ "__builtin_log2", .{ .name = "log2", .tag = .log2 } }, + .{ "__builtin_logf", .{ .name = "logf", .tag = .log } }, + .{ "__builtin_log", .{ .name = "log", .tag = .log } }, + .{ "__builtin___memcpy_chk", .{ .name = "memcpy_chk" } }, + .{ "__builtin_memcpy", .{ .name = "memcpy" } }, + .{ "__builtin___memset_chk", .{ .name = "memset_chk" } }, + .{ "__builtin_memset", .{ .name = "memset" } }, + .{ "__builtin_mul_overflow", .{ .name = "mul_overflow" } }, + .{ "__builtin_nanf", .{ .name = "nanf" } }, + .{ "__builtin_object_size", .{ .name = "object_size" } }, + .{ "__builtin_popcount", .{ .name = "popcount" } }, + .{ "__builtin_roundf", .{ .name = "roundf", .tag = .round } }, + .{ "__builtin_round", .{ .name = "round", .tag = .round } }, + .{ "__builtin_signbitf", .{ .name = "signbitf" } }, + .{ "__builtin_signbit", .{ .name = "signbit" } }, + .{ "__builtin_sinf", .{ .name = "sinf", .tag = .sin } }, + .{ "__builtin_sin", .{ .name = "sin", .tag = .sin } }, + .{ "__builtin_sqrtf", .{ .name = "sqrtf", .tag = .sqrt } }, + .{ "__builtin_sqrt", .{ .name = "sqrt", .tag = .sqrt } }, + .{ "__builtin_strcmp", .{ .name = "strcmp" } }, + .{ "__builtin_strlen", .{ .name = "strlen" } }, + .{ "__builtin_truncf", .{ .name = "truncf", .tag = .trunc } }, + .{ "__builtin_trunc", .{ .name = "trunc", .tag = .trunc } }, + .{ "__builtin_unreachable", .{ .name = "unreachable", .tag = .@"unreachable" } }, + .{ "__has_builtin", .{ .name = "has_builtin" } }, + + // __builtin_alloca_with_align is not currently implemented. + // It is used in a run and a translate test to ensure that non-implemented + // builtins are correctly demoted. If you implement __builtin_alloca_with_align, + // please update the tests to use a different non-implemented builtin. +}); diff --git a/lib/compiler/translate-c/helpers.zig b/lib/compiler/translate-c/helpers.zig new file mode 100644 index 000000000000..db19cf75b8de --- /dev/null +++ b/lib/compiler/translate-c/helpers.zig @@ -0,0 +1,327 @@ +const std = @import("std"); +const builtin = @import("builtin"); +const testing = std.testing; +const math = std.math; + +const helpers = @import("helpers"); + +const cast = helpers.cast; + +test cast { + var i = @as(i64, 10); + + try testing.expect(cast(*u8, 16) == @as(*u8, @ptrFromInt(16))); + try testing.expect(cast(*u64, &i).* == @as(u64, 10)); + try testing.expect(cast(*i64, @as(?*align(1) i64, &i)) == &i); + + try testing.expect(cast(?*u8, 2) == @as(*u8, @ptrFromInt(2))); + try testing.expect(cast(?*i64, @as(*align(1) i64, &i)) == &i); + try testing.expect(cast(?*i64, @as(?*align(1) i64, &i)) == &i); + + try testing.expectEqual(@as(u32, 4), cast(u32, @as(*u32, @ptrFromInt(4)))); + try testing.expectEqual(@as(u32, 4), cast(u32, @as(?*u32, @ptrFromInt(4)))); + try testing.expectEqual(@as(u32, 10), cast(u32, @as(u64, 10))); + + try testing.expectEqual(@as(i32, @bitCast(@as(u32, 0x8000_0000))), cast(i32, @as(u32, 0x8000_0000))); + + try testing.expectEqual(@as(*u8, @ptrFromInt(2)), cast(*u8, @as(*const u8, @ptrFromInt(2)))); + try testing.expectEqual(@as(*u8, @ptrFromInt(2)), cast(*u8, @as(*volatile u8, @ptrFromInt(2)))); + + try testing.expectEqual(@as(?*anyopaque, @ptrFromInt(2)), cast(?*anyopaque, @as(*u8, @ptrFromInt(2)))); + + var foo: c_int = -1; + _ = &foo; + try testing.expect(cast(*anyopaque, -1) == @as(*anyopaque, @ptrFromInt(@as(usize, @bitCast(@as(isize, -1)))))); + try testing.expect(cast(*anyopaque, foo) == @as(*anyopaque, @ptrFromInt(@as(usize, @bitCast(@as(isize, -1)))))); + try testing.expect(cast(?*anyopaque, -1) == @as(?*anyopaque, @ptrFromInt(@as(usize, @bitCast(@as(isize, -1)))))); + try testing.expect(cast(?*anyopaque, foo) == @as(?*anyopaque, @ptrFromInt(@as(usize, @bitCast(@as(isize, -1)))))); + + const FnPtr = ?*align(1) const fn (*anyopaque) void; + try testing.expect(cast(FnPtr, 0) == @as(FnPtr, @ptrFromInt(@as(usize, 0)))); + try testing.expect(cast(FnPtr, foo) == @as(FnPtr, @ptrFromInt(@as(usize, @bitCast(@as(isize, -1)))))); + + const complexFunction = struct { + fn f(_: ?*anyopaque, _: c_uint, _: ?*const fn (?*anyopaque) callconv(.c) c_uint, _: ?*anyopaque, _: c_uint, _: [*c]c_uint) callconv(.c) usize { + return 0; + } + }.f; + + const SDL_FunctionPointer = ?*const fn () callconv(.c) void; + const fn_ptr = cast(SDL_FunctionPointer, complexFunction); + try testing.expect(fn_ptr != null); +} + +const sizeof = helpers.sizeof; + +test sizeof { + const S = extern struct { a: u32 }; + + const ptr_size = @sizeOf(*anyopaque); + + try testing.expect(sizeof(u32) == 4); + try testing.expect(sizeof(@as(u32, 2)) == 4); + try testing.expect(sizeof(2) == @sizeOf(c_int)); + + try testing.expect(sizeof(2.0) == @sizeOf(f64)); + + try testing.expect(sizeof(S) == 4); + + try testing.expect(sizeof([_]u32{ 4, 5, 6 }) == 12); + try testing.expect(sizeof([3]u32) == 12); + try testing.expect(sizeof([3:0]u32) == 16); + try testing.expect(sizeof(&[_]u32{ 4, 5, 6 }) == ptr_size); + + try testing.expect(sizeof(*u32) == ptr_size); + try testing.expect(sizeof([*]u32) == ptr_size); + try testing.expect(sizeof([*c]u32) == ptr_size); + try testing.expect(sizeof(?*u32) == ptr_size); + try testing.expect(sizeof(?[*]u32) == ptr_size); + try testing.expect(sizeof(*anyopaque) == ptr_size); + try testing.expect(sizeof(*void) == ptr_size); + try testing.expect(sizeof(null) == ptr_size); + + try testing.expect(sizeof("foobar") == 7); + try testing.expect(sizeof(&[_:0]u16{ 'f', 'o', 'o', 'b', 'a', 'r' }) == 14); + try testing.expect(sizeof(*const [4:0]u8) == 5); + try testing.expect(sizeof(*[4:0]u8) == ptr_size); + try testing.expect(sizeof([*]const [4:0]u8) == ptr_size); + try testing.expect(sizeof(*const *const [4:0]u8) == ptr_size); + try testing.expect(sizeof(*const [4]u8) == ptr_size); + + if (false) { // TODO + try testing.expect(sizeof(&sizeof) == @sizeOf(@TypeOf(&sizeof))); + try testing.expect(sizeof(sizeof) == 1); + } + + try testing.expect(sizeof(void) == 1); + try testing.expect(sizeof(anyopaque) == 1); +} + +const promoteIntLiteral = helpers.promoteIntLiteral; + +test promoteIntLiteral { + const signed_hex = promoteIntLiteral(c_int, math.maxInt(c_int) + 1, .hex); + try testing.expectEqual(c_uint, @TypeOf(signed_hex)); + + if (math.maxInt(c_longlong) == math.maxInt(c_int)) return; + + const signed_decimal = promoteIntLiteral(c_int, math.maxInt(c_int) + 1, .decimal); + const unsigned = promoteIntLiteral(c_uint, math.maxInt(c_uint) + 1, .hex); + + if (math.maxInt(c_long) > math.maxInt(c_int)) { + try testing.expectEqual(c_long, @TypeOf(signed_decimal)); + try testing.expectEqual(c_ulong, @TypeOf(unsigned)); + } else { + try testing.expectEqual(c_longlong, @TypeOf(signed_decimal)); + try testing.expectEqual(c_ulonglong, @TypeOf(unsigned)); + } +} + +const shuffleVectorIndex = helpers.shuffleVectorIndex; + +test shuffleVectorIndex { + const vector_len: usize = 4; + + _ = shuffleVectorIndex(-1, vector_len); + + try testing.expect(shuffleVectorIndex(0, vector_len) == 0); + try testing.expect(shuffleVectorIndex(1, vector_len) == 1); + try testing.expect(shuffleVectorIndex(2, vector_len) == 2); + try testing.expect(shuffleVectorIndex(3, vector_len) == 3); + + try testing.expect(shuffleVectorIndex(4, vector_len) == -1); + try testing.expect(shuffleVectorIndex(5, vector_len) == -2); + try testing.expect(shuffleVectorIndex(6, vector_len) == -3); + try testing.expect(shuffleVectorIndex(7, vector_len) == -4); +} + +const FlexibleArrayType = helpers.FlexibleArrayType; + +test FlexibleArrayType { + const Container = extern struct { + size: usize, + }; + + try testing.expectEqual(FlexibleArrayType(*Container, c_int), [*c]c_int); + try testing.expectEqual(FlexibleArrayType(*const Container, c_int), [*c]const c_int); + try testing.expectEqual(FlexibleArrayType(*volatile Container, c_int), [*c]volatile c_int); + try testing.expectEqual(FlexibleArrayType(*const volatile Container, c_int), [*c]const volatile c_int); +} + +const signedRemainder = helpers.signedRemainder; + +test signedRemainder { + // TODO add test + return error.SkipZigTest; +} + +const ArithmeticConversion = helpers.ArithmeticConversion; + +test ArithmeticConversion { + // Promotions not necessarily the same for other platforms + if (builtin.target.cpu.arch != .x86_64 or builtin.target.os.tag != .linux) return error.SkipZigTest; + + const Test = struct { + /// Order of operands should not matter for arithmetic conversions + fn checkPromotion(comptime A: type, comptime B: type, comptime Expected: type) !void { + try std.testing.expect(ArithmeticConversion(A, B) == Expected); + try std.testing.expect(ArithmeticConversion(B, A) == Expected); + } + }; + + try Test.checkPromotion(c_longdouble, c_int, c_longdouble); + try Test.checkPromotion(c_int, f64, f64); + try Test.checkPromotion(f32, bool, f32); + + try Test.checkPromotion(bool, c_short, c_int); + try Test.checkPromotion(c_int, c_int, c_int); + try Test.checkPromotion(c_short, c_int, c_int); + + try Test.checkPromotion(c_int, c_long, c_long); + + try Test.checkPromotion(c_ulonglong, c_uint, c_ulonglong); + + try Test.checkPromotion(c_uint, c_int, c_uint); + + try Test.checkPromotion(c_uint, c_long, c_long); + + try Test.checkPromotion(c_ulong, c_longlong, c_ulonglong); + + // stdint.h + try Test.checkPromotion(u8, i8, c_int); + try Test.checkPromotion(u16, i16, c_int); + try Test.checkPromotion(i32, c_int, c_int); + try Test.checkPromotion(u32, c_int, c_uint); + try Test.checkPromotion(i64, c_int, c_long); + try Test.checkPromotion(u64, c_int, c_ulong); + try Test.checkPromotion(isize, c_int, c_long); + try Test.checkPromotion(usize, c_int, c_ulong); +} + +const F_SUFFIX = helpers.F_SUFFIX; + +test F_SUFFIX { + try testing.expect(@TypeOf(F_SUFFIX(1)) == f32); +} + +const U_SUFFIX = helpers.U_SUFFIX; + +test U_SUFFIX { + try testing.expect(@TypeOf(U_SUFFIX(1)) == c_uint); + if (math.maxInt(c_ulong) > math.maxInt(c_uint)) { + try testing.expect(@TypeOf(U_SUFFIX(math.maxInt(c_uint) + 1)) == c_ulong); + } + if (math.maxInt(c_ulonglong) > math.maxInt(c_ulong)) { + try testing.expect(@TypeOf(U_SUFFIX(math.maxInt(c_ulong) + 1)) == c_ulonglong); + } +} + +const L_SUFFIX = helpers.L_SUFFIX; + +test L_SUFFIX { + try testing.expect(@TypeOf(L_SUFFIX(1)) == c_long); + if (math.maxInt(c_long) > math.maxInt(c_int)) { + try testing.expect(@TypeOf(L_SUFFIX(math.maxInt(c_int) + 1)) == c_long); + } + if (math.maxInt(c_longlong) > math.maxInt(c_long)) { + try testing.expect(@TypeOf(L_SUFFIX(math.maxInt(c_long) + 1)) == c_longlong); + } +} +const UL_SUFFIX = helpers.UL_SUFFIX; + +test UL_SUFFIX { + try testing.expect(@TypeOf(UL_SUFFIX(1)) == c_ulong); + if (math.maxInt(c_ulonglong) > math.maxInt(c_ulong)) { + try testing.expect(@TypeOf(UL_SUFFIX(math.maxInt(c_ulong) + 1)) == c_ulonglong); + } +} +const LL_SUFFIX = helpers.LL_SUFFIX; + +test LL_SUFFIX { + try testing.expect(@TypeOf(LL_SUFFIX(1)) == c_longlong); +} +const ULL_SUFFIX = helpers.ULL_SUFFIX; + +test ULL_SUFFIX { + try testing.expect(@TypeOf(ULL_SUFFIX(1)) == c_ulonglong); +} + +test "Extended C ABI casting" { + if (math.maxInt(c_long) > math.maxInt(c_char)) { + try testing.expect(@TypeOf(L_SUFFIX(@as(c_char, math.maxInt(c_char) - 1))) == c_long); // c_char + } + if (math.maxInt(c_long) > math.maxInt(c_short)) { + try testing.expect(@TypeOf(L_SUFFIX(@as(c_short, math.maxInt(c_short) - 1))) == c_long); // c_short + } + + if (math.maxInt(c_long) > math.maxInt(c_ushort)) { + try testing.expect(@TypeOf(L_SUFFIX(@as(c_ushort, math.maxInt(c_ushort) - 1))) == c_long); //c_ushort + } + + if (math.maxInt(c_long) > math.maxInt(c_int)) { + try testing.expect(@TypeOf(L_SUFFIX(@as(c_int, math.maxInt(c_int) - 1))) == c_long); // c_int + } + + if (math.maxInt(c_long) > math.maxInt(c_uint)) { + try testing.expect(@TypeOf(L_SUFFIX(@as(c_uint, math.maxInt(c_uint) - 1))) == c_long); // c_uint + try testing.expect(@TypeOf(L_SUFFIX(math.maxInt(c_uint) + 1)) == c_long); // comptime_int -> c_long + } + + if (math.maxInt(c_longlong) > math.maxInt(c_long)) { + try testing.expect(@TypeOf(L_SUFFIX(@as(c_long, math.maxInt(c_long) - 1))) == c_long); // c_long + try testing.expect(@TypeOf(L_SUFFIX(math.maxInt(c_long) + 1)) == c_longlong); // comptime_int -> c_longlong + } +} + +const WL_CONTAINER_OF = helpers.WL_CONTAINER_OF; + +test WL_CONTAINER_OF { + const S = struct { + a: u32 = 0, + b: u32 = 0, + }; + const x = S{}; + const y = S{}; + const ptr = WL_CONTAINER_OF(&x.b, &y, "b"); + try testing.expectEqual(&x, ptr); +} + +const CAST_OR_CALL = helpers.CAST_OR_CALL; + +test "CAST_OR_CALL casting" { + const arg: c_int = 1000; + const casted = CAST_OR_CALL(u8, arg); + try testing.expectEqual(cast(u8, arg), casted); + + const S = struct { + x: u32 = 0, + }; + var s: S = .{}; + const casted_ptr = CAST_OR_CALL(*u8, &s); + try testing.expectEqual(cast(*u8, &s), casted_ptr); +} + +test "CAST_OR_CALL calling" { + const Helper = struct { + var last_val: bool = false; + fn returnsVoid(val: bool) void { + last_val = val; + } + fn returnsBool(f: f32) bool { + return f > 0; + } + fn identity(self: c_uint) c_uint { + return self; + } + }; + + CAST_OR_CALL(Helper.returnsVoid, true); + try testing.expectEqual(true, Helper.last_val); + CAST_OR_CALL(Helper.returnsVoid, false); + try testing.expectEqual(false, Helper.last_val); + + try testing.expectEqual(Helper.returnsBool(1), CAST_OR_CALL(Helper.returnsBool, @as(f32, 1))); + try testing.expectEqual(Helper.returnsBool(-1), CAST_OR_CALL(Helper.returnsBool, @as(f32, -1))); + + try testing.expectEqual(Helper.identity(@as(c_uint, 100)), CAST_OR_CALL(Helper.identity, @as(c_uint, 100))); +} diff --git a/lib/compiler/translate-c/main.zig b/lib/compiler/translate-c/main.zig new file mode 100644 index 000000000000..bf887de49427 --- /dev/null +++ b/lib/compiler/translate-c/main.zig @@ -0,0 +1,220 @@ +const std = @import("std"); +const assert = std.debug.assert; +const mem = std.mem; +const process = std.process; +const aro = @import("aro"); +const Translator = @import("Translator.zig"); + +const fast_exit = @import("builtin").mode != .Debug; + +var general_purpose_allocator: std.heap.GeneralPurposeAllocator(.{}) = .init; + +pub fn main() u8 { + const gpa = general_purpose_allocator.allocator(); + defer _ = general_purpose_allocator.deinit(); + + var arena_instance = std.heap.ArenaAllocator.init(std.heap.page_allocator); + defer arena_instance.deinit(); + const arena = arena_instance.allocator(); + + const args = process.argsAlloc(arena) catch { + std.debug.print("ran out of memory allocating arguments\n", .{}); + if (fast_exit) process.exit(1); + return 1; + }; + + var stderr_buf: [1024]u8 = undefined; + var stderr = std.fs.File.stderr().writer(&stderr_buf); + var diagnostics: aro.Diagnostics = .{ + .output = .{ .to_writer = .{ + .color = .detect(stderr.file), + .writer = &stderr.interface, + } }, + }; + + var comp = aro.Compilation.initDefault(gpa, arena, &diagnostics, std.fs.cwd()) catch |err| switch (err) { + error.OutOfMemory => { + std.debug.print("ran out of memory initializing C compilation\n", .{}); + if (fast_exit) process.exit(1); + return 1; + }, + }; + defer comp.deinit(); + + var driver: aro.Driver = .{ .comp = &comp, .diagnostics = &diagnostics, .aro_name = "aro" }; + defer driver.deinit(); + + var toolchain: aro.Toolchain = .{ .driver = &driver, .filesystem = .{ .real = comp.cwd } }; + defer toolchain.deinit(); + + translate(&driver, &toolchain, args) catch |err| switch (err) { + error.OutOfMemory => { + std.debug.print("ran out of memory translating\n", .{}); + if (fast_exit) process.exit(1); + return 1; + }, + error.FatalError => { + if (fast_exit) process.exit(1); + return 1; + }, + error.WriteFailed => { + std.debug.print("unable to write to stdout\n", .{}); + if (fast_exit) process.exit(1); + return 1; + }, + }; + if (fast_exit) process.exit(@intFromBool(comp.diagnostics.errors != 0)); + return @intFromBool(comp.diagnostics.errors != 0); +} + +pub const usage = + \\Usage {s}: [options] file [CC options] + \\ + \\Options: + \\ --help Print this message + \\ --version Print translate-c version + \\ -fmodule-libs Import libraries as modules + \\ -fno-module-libs (default) Install libraries next to output file + \\ + \\ +; + +fn translate(d: *aro.Driver, tc: *aro.Toolchain, args: [][:0]u8) !void { + const gpa = d.comp.gpa; + + const aro_args = args: { + var i: usize = 0; + for (args) |arg| { + args[i] = arg; + if (mem.eql(u8, arg, "--help")) { + var stdout_buf: [512]u8 = undefined; + var stdout = std.fs.File.stdout().writer(&stdout_buf); + try stdout.interface.print(usage, .{args[0]}); + try stdout.interface.flush(); + return; + } else if (mem.eql(u8, arg, "--version")) { + var stdout_buf: [512]u8 = undefined; + var stdout = std.fs.File.stdout().writer(&stdout_buf); + // TODO add version + try stdout.interface.writeAll("0.0.0-dev\n"); + try stdout.interface.flush(); + return; + } else { + i += 1; + } + } + break :args args[0..i]; + }; + const user_macros = macros: { + var macro_buf: std.ArrayListUnmanaged(u8) = .empty; + defer macro_buf.deinit(gpa); + + var discard_buf: [256]u8 = undefined; + var discarding: std.io.Writer.Discarding = .init(&discard_buf); + assert(!try d.parseArgs(&discarding.writer, ¯o_buf, aro_args)); + if (macro_buf.items.len > std.math.maxInt(u32)) { + return d.fatal("user provided macro source exceeded max size", .{}); + } + + const content = try macro_buf.toOwnedSlice(gpa); + errdefer gpa.free(content); + + break :macros try d.comp.addSourceFromOwnedBuffer("", content, .user); + }; + + if (d.inputs.items.len != 1) { + return d.fatal("expected exactly one input file", .{}); + } + const source = d.inputs.items[0]; + + tc.discover() catch |er| switch (er) { + error.OutOfMemory => return error.OutOfMemory, + error.TooManyMultilibs => return d.fatal("found more than one multilib with the same priority", .{}), + }; + tc.defineSystemIncludes() catch |er| switch (er) { + error.OutOfMemory => return error.OutOfMemory, + error.AroIncludeNotFound => return d.fatal("unable to find Aro builtin headers", .{}), + }; + + const builtin_macros = d.comp.generateBuiltinMacros(.include_system_defines) catch |err| switch (err) { + error.FileTooBig => return d.fatal("builtin macro source exceeded max size", .{}), + else => |e| return e, + }; + + var pp = try aro.Preprocessor.initDefault(d.comp); + defer pp.deinit(); + + var name_buf: [std.fs.max_name_bytes]u8 = undefined; + // Omit the source file from the dep file so that it can be tracked separately. + // In the Zig compiler we want to omit it from the cache hash since it will + // be written to a tmp file then renamed into place, meaning the path will be + // wrong as soon as the work is done. + var opt_dep_file = try d.initDepFile(source, &name_buf, true); + defer if (opt_dep_file) |*dep_file| dep_file.deinit(gpa); + + if (opt_dep_file) |*dep_file| pp.dep_file = dep_file; + + try pp.preprocessSources(&.{ source, builtin_macros, user_macros }); + + var c_tree = try pp.parse(); + defer c_tree.deinit(); + + if (d.diagnostics.errors != 0) { + if (fast_exit) process.exit(1); + return error.FatalError; + } + + var out_buf: [4096]u8 = undefined; + if (opt_dep_file) |dep_file| { + const dep_file_name = try d.getDepFileName(source, out_buf[0..std.fs.max_name_bytes]); + + const file = if (dep_file_name) |path| + d.comp.cwd.createFile(path, .{}) catch |er| + return d.fatal("unable to create dependency file '{s}': {s}", .{ path, aro.Driver.errorDescription(er) }) + else + std.fs.File.stdout(); + defer if (dep_file_name != null) file.close(); + + var file_writer = file.writer(&out_buf); + dep_file.write(&file_writer.interface) catch + return d.fatal("unable to write dependency file: {s}", .{aro.Driver.errorDescription(file_writer.err.?)}); + } + + const rendered_zig = try Translator.translate(.{ + .gpa = gpa, + .comp = d.comp, + .pp = &pp, + .tree = &c_tree, + }); + defer gpa.free(rendered_zig); + + var close_out_file = false; + var out_file_path: []const u8 = ""; + var out_file: std.fs.File = .stdout(); + defer if (close_out_file) out_file.close(); + + if (d.output_name) |path| blk: { + if (std.mem.eql(u8, path, "-")) break :blk; + if (std.fs.path.dirname(path)) |dirname| { + std.fs.cwd().makePath(dirname) catch |err| + return d.fatal("failed to create path to '{s}': {s}", .{ path, aro.Driver.errorDescription(err) }); + } + out_file = std.fs.cwd().createFile(path, .{}) catch |err| { + return d.fatal("failed to create output file '{s}': {s}", .{ path, aro.Driver.errorDescription(err) }); + }; + close_out_file = true; + out_file_path = path; + } + + var out_writer = out_file.writer(&.{}); + out_writer.interface.writeAll(rendered_zig) catch + return d.fatal("failed to write result to '{s}': {s}", .{ out_file_path, aro.Driver.errorDescription(out_writer.err.?) }); + + if (fast_exit) process.exit(0); +} + +test { + _ = Translator; + _ = @import("helpers.zig"); + _ = @import("PatternList.zig"); +} diff --git a/lib/std/Build/Cache.zig b/lib/std/Build/Cache.zig index c10afa200a16..e105ca202755 100644 --- a/lib/std/Build/Cache.zig +++ b/lib/std/Build/Cache.zig @@ -459,9 +459,9 @@ pub const Manifest = struct { } } - pub fn addDepFile(self: *Manifest, dir: fs.Dir, dep_file_basename: []const u8) !void { + pub fn addDepFile(self: *Manifest, dir: fs.Dir, dep_file_sub_path: []const u8) !void { assert(self.manifest_file == null); - return self.addDepFileMaybePost(dir, dep_file_basename); + return self.addDepFileMaybePost(dir, dep_file_sub_path); } pub const HitError = error{ @@ -1049,14 +1049,14 @@ pub const Manifest = struct { self.hash.hasher.update(&new_file.bin_digest); } - pub fn addDepFilePost(self: *Manifest, dir: fs.Dir, dep_file_basename: []const u8) !void { + pub fn addDepFilePost(self: *Manifest, dir: fs.Dir, dep_file_sub_path: []const u8) !void { assert(self.manifest_file != null); - return self.addDepFileMaybePost(dir, dep_file_basename); + return self.addDepFileMaybePost(dir, dep_file_sub_path); } - fn addDepFileMaybePost(self: *Manifest, dir: fs.Dir, dep_file_basename: []const u8) !void { + fn addDepFileMaybePost(self: *Manifest, dir: fs.Dir, dep_file_sub_path: []const u8) !void { const gpa = self.cache.gpa; - const dep_file_contents = try dir.readFileAlloc(gpa, dep_file_basename, manifest_file_size_max); + const dep_file_contents = try dir.readFileAlloc(gpa, dep_file_sub_path, manifest_file_size_max); defer gpa.free(dep_file_contents); var error_buf: std.ArrayListUnmanaged(u8) = .empty; @@ -1083,7 +1083,7 @@ pub const Manifest = struct { }, else => |err| { try err.printError(gpa, &error_buf); - log.err("failed parsing {s}: {s}", .{ dep_file_basename, error_buf.items }); + log.err("failed parsing {s}: {s}", .{ dep_file_sub_path, error_buf.items }); return error.InvalidDepFile; }, } diff --git a/lib/std/zig.zig b/lib/std/zig.zig index cbb01b2b3828..f323add88580 100644 --- a/lib/std/zig.zig +++ b/lib/std/zig.zig @@ -36,9 +36,10 @@ pub const ParsedCharLiteral = string_literal.ParsedCharLiteral; pub const parseCharLiteral = string_literal.parseCharLiteral; pub const parseNumberLiteral = number_literal.parseNumberLiteral; -// Files needed by translate-c. -pub const c_builtins = @import("zig/c_builtins.zig"); -pub const c_translation = @import("zig/c_translation.zig"); +pub const c_translation = struct { + pub const builtins = @import("zig/c_translation/builtins.zig"); + pub const helpers = @import("zig/c_translation/helpers.zig"); +}; pub const SrcHasher = std.crypto.hash.Blake3; pub const SrcHash = [16]u8; diff --git a/lib/std/zig/c_translation.zig b/lib/std/zig/c_translation.zig deleted file mode 100644 index be0019c596bd..000000000000 --- a/lib/std/zig/c_translation.zig +++ /dev/null @@ -1,699 +0,0 @@ -const std = @import("std"); -const builtin = @import("builtin"); -const testing = std.testing; -const math = std.math; -const mem = std.mem; - -/// Given a type and value, cast the value to the type as c would. -pub fn cast(comptime DestType: type, target: anytype) DestType { - // this function should behave like transCCast in translate-c, except it's for macros - const SourceType = @TypeOf(target); - switch (@typeInfo(DestType)) { - .@"fn" => return castToPtr(*const DestType, SourceType, target), - .pointer => return castToPtr(DestType, SourceType, target), - .optional => |dest_opt| { - if (@typeInfo(dest_opt.child) == .pointer) { - return castToPtr(DestType, SourceType, target); - } else if (@typeInfo(dest_opt.child) == .@"fn") { - return castToPtr(?*const dest_opt.child, SourceType, target); - } - }, - .int => { - switch (@typeInfo(SourceType)) { - .pointer => { - return castInt(DestType, @intFromPtr(target)); - }, - .optional => |opt| { - if (@typeInfo(opt.child) == .pointer) { - return castInt(DestType, @intFromPtr(target)); - } - }, - .int => { - return castInt(DestType, target); - }, - .@"fn" => { - return castInt(DestType, @intFromPtr(&target)); - }, - .bool => { - return @intFromBool(target); - }, - else => {}, - } - }, - .float => { - switch (@typeInfo(SourceType)) { - .int => return @as(DestType, @floatFromInt(target)), - .float => return @as(DestType, @floatCast(target)), - .bool => return @as(DestType, @floatFromInt(@intFromBool(target))), - else => {}, - } - }, - .@"union" => |info| { - inline for (info.fields) |field| { - if (field.type == SourceType) return @unionInit(DestType, field.name, target); - } - @compileError("cast to union type '" ++ @typeName(DestType) ++ "' from type '" ++ @typeName(SourceType) ++ "' which is not present in union"); - }, - .bool => return cast(usize, target) != 0, - else => {}, - } - return @as(DestType, target); -} - -fn castInt(comptime DestType: type, target: anytype) DestType { - const dest = @typeInfo(DestType).int; - const source = @typeInfo(@TypeOf(target)).int; - - if (dest.bits < source.bits) - return @as(DestType, @bitCast(@as(std.meta.Int(source.signedness, dest.bits), @truncate(target)))) - else - return @as(DestType, @bitCast(@as(std.meta.Int(source.signedness, dest.bits), target))); -} - -fn castPtr(comptime DestType: type, target: anytype) DestType { - return @ptrCast(@alignCast(@constCast(@volatileCast(target)))); -} - -fn castToPtr(comptime DestType: type, comptime SourceType: type, target: anytype) DestType { - switch (@typeInfo(SourceType)) { - .int => { - return @as(DestType, @ptrFromInt(castInt(usize, target))); - }, - .comptime_int => { - if (target < 0) - return @as(DestType, @ptrFromInt(@as(usize, @bitCast(@as(isize, @intCast(target)))))) - else - return @as(DestType, @ptrFromInt(@as(usize, @intCast(target)))); - }, - .pointer => { - return castPtr(DestType, target); - }, - .@"fn" => { - return castPtr(DestType, &target); - }, - .optional => |target_opt| { - if (@typeInfo(target_opt.child) == .pointer) { - return castPtr(DestType, target); - } - }, - else => {}, - } - return @as(DestType, target); -} - -fn ptrInfo(comptime PtrType: type) std.builtin.Type.Pointer { - return switch (@typeInfo(PtrType)) { - .optional => |opt_info| @typeInfo(opt_info.child).pointer, - .pointer => |ptr_info| ptr_info, - else => unreachable, - }; -} - -test "cast" { - var i = @as(i64, 10); - - try testing.expect(cast(*u8, 16) == @as(*u8, @ptrFromInt(16))); - try testing.expect(cast(*u64, &i).* == @as(u64, 10)); - try testing.expect(cast(*i64, @as(?*align(1) i64, &i)) == &i); - - try testing.expect(cast(?*u8, 2) == @as(*u8, @ptrFromInt(2))); - try testing.expect(cast(?*i64, @as(*align(1) i64, &i)) == &i); - try testing.expect(cast(?*i64, @as(?*align(1) i64, &i)) == &i); - - try testing.expectEqual(@as(u32, 4), cast(u32, @as(*u32, @ptrFromInt(4)))); - try testing.expectEqual(@as(u32, 4), cast(u32, @as(?*u32, @ptrFromInt(4)))); - try testing.expectEqual(@as(u32, 10), cast(u32, @as(u64, 10))); - - try testing.expectEqual(@as(i32, @bitCast(@as(u32, 0x8000_0000))), cast(i32, @as(u32, 0x8000_0000))); - - try testing.expectEqual(@as(*u8, @ptrFromInt(2)), cast(*u8, @as(*const u8, @ptrFromInt(2)))); - try testing.expectEqual(@as(*u8, @ptrFromInt(2)), cast(*u8, @as(*volatile u8, @ptrFromInt(2)))); - - try testing.expectEqual(@as(?*anyopaque, @ptrFromInt(2)), cast(?*anyopaque, @as(*u8, @ptrFromInt(2)))); - - var foo: c_int = -1; - _ = &foo; - try testing.expect(cast(*anyopaque, -1) == @as(*anyopaque, @ptrFromInt(@as(usize, @bitCast(@as(isize, -1)))))); - try testing.expect(cast(*anyopaque, foo) == @as(*anyopaque, @ptrFromInt(@as(usize, @bitCast(@as(isize, -1)))))); - try testing.expect(cast(?*anyopaque, -1) == @as(?*anyopaque, @ptrFromInt(@as(usize, @bitCast(@as(isize, -1)))))); - try testing.expect(cast(?*anyopaque, foo) == @as(?*anyopaque, @ptrFromInt(@as(usize, @bitCast(@as(isize, -1)))))); - - const FnPtr = ?*align(1) const fn (*anyopaque) void; - try testing.expect(cast(FnPtr, 0) == @as(FnPtr, @ptrFromInt(@as(usize, 0)))); - try testing.expect(cast(FnPtr, foo) == @as(FnPtr, @ptrFromInt(@as(usize, @bitCast(@as(isize, -1)))))); -} - -/// Given a value returns its size as C's sizeof operator would. -pub fn sizeof(target: anytype) usize { - const T: type = if (@TypeOf(target) == type) target else @TypeOf(target); - switch (@typeInfo(T)) { - .float, .int, .@"struct", .@"union", .array, .bool, .vector => return @sizeOf(T), - .@"fn" => { - // sizeof(main) in C returns 1 - return 1; - }, - .null => return @sizeOf(*anyopaque), - .void => { - // Note: sizeof(void) is 1 on clang/gcc and 0 on MSVC. - return 1; - }, - .@"opaque" => { - if (T == anyopaque) { - // Note: sizeof(void) is 1 on clang/gcc and 0 on MSVC. - return 1; - } else { - @compileError("Cannot use C sizeof on opaque type " ++ @typeName(T)); - } - }, - .optional => |opt| { - if (@typeInfo(opt.child) == .pointer) { - return sizeof(opt.child); - } else { - @compileError("Cannot use C sizeof on non-pointer optional " ++ @typeName(T)); - } - }, - .pointer => |ptr| { - if (ptr.size == .slice) { - @compileError("Cannot use C sizeof on slice type " ++ @typeName(T)); - } - // for strings, sizeof("a") returns 2. - // normal pointer decay scenarios from C are handled - // in the .array case above, but strings remain literals - // and are therefore always pointers, so they need to be - // specially handled here. - if (ptr.size == .one and ptr.is_const and @typeInfo(ptr.child) == .array) { - const array_info = @typeInfo(ptr.child).array; - if ((array_info.child == u8 or array_info.child == u16) and array_info.sentinel() == 0) { - // length of the string plus one for the null terminator. - return (array_info.len + 1) * @sizeOf(array_info.child); - } - } - // When zero sized pointers are removed, this case will no - // longer be reachable and can be deleted. - if (@sizeOf(T) == 0) { - return @sizeOf(*anyopaque); - } - return @sizeOf(T); - }, - .comptime_float => return @sizeOf(f64), // TODO c_double #3999 - .comptime_int => { - // TODO to get the correct result we have to translate - // `1073741824 * 4` as `int(1073741824) *% int(4)` since - // sizeof(1073741824 * 4) != sizeof(4294967296). - - // TODO test if target fits in int, long or long long - return @sizeOf(c_int); - }, - else => @compileError("std.meta.sizeof does not support type " ++ @typeName(T)), - } -} - -test "sizeof" { - const S = extern struct { a: u32 }; - - const ptr_size = @sizeOf(*anyopaque); - - try testing.expect(sizeof(u32) == 4); - try testing.expect(sizeof(@as(u32, 2)) == 4); - try testing.expect(sizeof(2) == @sizeOf(c_int)); - - try testing.expect(sizeof(2.0) == @sizeOf(f64)); - - try testing.expect(sizeof(S) == 4); - - try testing.expect(sizeof([_]u32{ 4, 5, 6 }) == 12); - try testing.expect(sizeof([3]u32) == 12); - try testing.expect(sizeof([3:0]u32) == 16); - try testing.expect(sizeof(&[_]u32{ 4, 5, 6 }) == ptr_size); - - try testing.expect(sizeof(*u32) == ptr_size); - try testing.expect(sizeof([*]u32) == ptr_size); - try testing.expect(sizeof([*c]u32) == ptr_size); - try testing.expect(sizeof(?*u32) == ptr_size); - try testing.expect(sizeof(?[*]u32) == ptr_size); - try testing.expect(sizeof(*anyopaque) == ptr_size); - try testing.expect(sizeof(*void) == ptr_size); - try testing.expect(sizeof(null) == ptr_size); - - try testing.expect(sizeof("foobar") == 7); - try testing.expect(sizeof(&[_:0]u16{ 'f', 'o', 'o', 'b', 'a', 'r' }) == 14); - try testing.expect(sizeof(*const [4:0]u8) == 5); - try testing.expect(sizeof(*[4:0]u8) == ptr_size); - try testing.expect(sizeof([*]const [4:0]u8) == ptr_size); - try testing.expect(sizeof(*const *const [4:0]u8) == ptr_size); - try testing.expect(sizeof(*const [4]u8) == ptr_size); - - if (false) { // TODO - try testing.expect(sizeof(&sizeof) == @sizeOf(@TypeOf(&sizeof))); - try testing.expect(sizeof(sizeof) == 1); - } - - try testing.expect(sizeof(void) == 1); - try testing.expect(sizeof(anyopaque) == 1); -} - -pub const CIntLiteralBase = enum { decimal, octal, hex }; - -fn PromoteIntLiteralReturnType(comptime SuffixType: type, comptime number: comptime_int, comptime base: CIntLiteralBase) type { - const signed_decimal = [_]type{ c_int, c_long, c_longlong, c_ulonglong }; - const signed_oct_hex = [_]type{ c_int, c_uint, c_long, c_ulong, c_longlong, c_ulonglong }; - const unsigned = [_]type{ c_uint, c_ulong, c_ulonglong }; - - const list: []const type = if (@typeInfo(SuffixType).int.signedness == .unsigned) - &unsigned - else if (base == .decimal) - &signed_decimal - else - &signed_oct_hex; - - var pos = mem.indexOfScalar(type, list, SuffixType).?; - - while (pos < list.len) : (pos += 1) { - if (number >= math.minInt(list[pos]) and number <= math.maxInt(list[pos])) { - return list[pos]; - } - } - @compileError("Integer literal is too large"); -} - -/// Promote the type of an integer literal until it fits as C would. -pub fn promoteIntLiteral( - comptime SuffixType: type, - comptime number: comptime_int, - comptime base: CIntLiteralBase, -) PromoteIntLiteralReturnType(SuffixType, number, base) { - return number; -} - -test "promoteIntLiteral" { - const signed_hex = promoteIntLiteral(c_int, math.maxInt(c_int) + 1, .hex); - try testing.expectEqual(c_uint, @TypeOf(signed_hex)); - - if (math.maxInt(c_longlong) == math.maxInt(c_int)) return; - - const signed_decimal = promoteIntLiteral(c_int, math.maxInt(c_int) + 1, .decimal); - const unsigned = promoteIntLiteral(c_uint, math.maxInt(c_uint) + 1, .hex); - - if (math.maxInt(c_long) > math.maxInt(c_int)) { - try testing.expectEqual(c_long, @TypeOf(signed_decimal)); - try testing.expectEqual(c_ulong, @TypeOf(unsigned)); - } else { - try testing.expectEqual(c_longlong, @TypeOf(signed_decimal)); - try testing.expectEqual(c_ulonglong, @TypeOf(unsigned)); - } -} - -/// Convert from clang __builtin_shufflevector index to Zig @shuffle index -/// clang requires __builtin_shufflevector index arguments to be integer constants. -/// negative values for `this_index` indicate "don't care". -/// clang enforces that `this_index` is less than the total number of vector elements -/// See https://ziglang.org/documentation/master/#shuffle -/// See https://clang.llvm.org/docs/LanguageExtensions.html#langext-builtin-shufflevector -pub fn shuffleVectorIndex(comptime this_index: c_int, comptime source_vector_len: usize) i32 { - const positive_index = std.math.cast(usize, this_index) orelse return undefined; - if (positive_index < source_vector_len) return @as(i32, @intCast(this_index)); - const b_index = positive_index - source_vector_len; - return ~@as(i32, @intCast(b_index)); -} - -test "shuffleVectorIndex" { - const vector_len: usize = 4; - - _ = shuffleVectorIndex(-1, vector_len); - - try testing.expect(shuffleVectorIndex(0, vector_len) == 0); - try testing.expect(shuffleVectorIndex(1, vector_len) == 1); - try testing.expect(shuffleVectorIndex(2, vector_len) == 2); - try testing.expect(shuffleVectorIndex(3, vector_len) == 3); - - try testing.expect(shuffleVectorIndex(4, vector_len) == -1); - try testing.expect(shuffleVectorIndex(5, vector_len) == -2); - try testing.expect(shuffleVectorIndex(6, vector_len) == -3); - try testing.expect(shuffleVectorIndex(7, vector_len) == -4); -} - -/// Constructs a [*c] pointer with the const and volatile annotations -/// from SelfType for pointing to a C flexible array of ElementType. -pub fn FlexibleArrayType(comptime SelfType: type, comptime ElementType: type) type { - switch (@typeInfo(SelfType)) { - .pointer => |ptr| { - return @Type(.{ .pointer = .{ - .size = .c, - .is_const = ptr.is_const, - .is_volatile = ptr.is_volatile, - .alignment = @alignOf(ElementType), - .address_space = .generic, - .child = ElementType, - .is_allowzero = true, - .sentinel_ptr = null, - } }); - }, - else => |info| @compileError("Invalid self type \"" ++ @tagName(info) ++ "\" for flexible array getter: " ++ @typeName(SelfType)), - } -} - -test "Flexible Array Type" { - const Container = extern struct { - size: usize, - }; - - try testing.expectEqual(FlexibleArrayType(*Container, c_int), [*c]c_int); - try testing.expectEqual(FlexibleArrayType(*const Container, c_int), [*c]const c_int); - try testing.expectEqual(FlexibleArrayType(*volatile Container, c_int), [*c]volatile c_int); - try testing.expectEqual(FlexibleArrayType(*const volatile Container, c_int), [*c]const volatile c_int); -} - -/// C `%` operator for signed integers -/// C standard states: "If the quotient a/b is representable, the expression (a/b)*b + a%b shall equal a" -/// The quotient is not representable if denominator is zero, or if numerator is the minimum integer for -/// the type and denominator is -1. C has undefined behavior for those two cases; this function has safety -/// checked undefined behavior -pub fn signedRemainder(numerator: anytype, denominator: anytype) @TypeOf(numerator, denominator) { - std.debug.assert(@typeInfo(@TypeOf(numerator, denominator)).int.signedness == .signed); - if (denominator > 0) return @rem(numerator, denominator); - return numerator - @divTrunc(numerator, denominator) * denominator; -} - -pub const Macros = struct { - pub fn U_SUFFIX(comptime n: comptime_int) @TypeOf(promoteIntLiteral(c_uint, n, .decimal)) { - return promoteIntLiteral(c_uint, n, .decimal); - } - - fn L_SUFFIX_ReturnType(comptime number: anytype) type { - switch (@typeInfo(@TypeOf(number))) { - .int, .comptime_int => return @TypeOf(promoteIntLiteral(c_long, number, .decimal)), - .float, .comptime_float => return c_longdouble, - else => @compileError("Invalid value for L suffix"), - } - } - pub fn L_SUFFIX(comptime number: anytype) L_SUFFIX_ReturnType(number) { - switch (@typeInfo(@TypeOf(number))) { - .int, .comptime_int => return promoteIntLiteral(c_long, number, .decimal), - .float, .comptime_float => @compileError("TODO: c_longdouble initialization from comptime_float not supported"), - else => @compileError("Invalid value for L suffix"), - } - } - - pub fn UL_SUFFIX(comptime n: comptime_int) @TypeOf(promoteIntLiteral(c_ulong, n, .decimal)) { - return promoteIntLiteral(c_ulong, n, .decimal); - } - - pub fn LL_SUFFIX(comptime n: comptime_int) @TypeOf(promoteIntLiteral(c_longlong, n, .decimal)) { - return promoteIntLiteral(c_longlong, n, .decimal); - } - - pub fn ULL_SUFFIX(comptime n: comptime_int) @TypeOf(promoteIntLiteral(c_ulonglong, n, .decimal)) { - return promoteIntLiteral(c_ulonglong, n, .decimal); - } - - pub fn F_SUFFIX(comptime f: comptime_float) f32 { - return @as(f32, f); - } - - pub fn WL_CONTAINER_OF(ptr: anytype, sample: anytype, comptime member: []const u8) @TypeOf(sample) { - return @fieldParentPtr(member, ptr); - } - - /// A 2-argument function-like macro defined as #define FOO(A, B) (A)(B) - /// could be either: cast B to A, or call A with the value B. - pub fn CAST_OR_CALL(a: anytype, b: anytype) switch (@typeInfo(@TypeOf(a))) { - .type => a, - .@"fn" => |fn_info| fn_info.return_type orelse void, - else => |info| @compileError("Unexpected argument type: " ++ @tagName(info)), - } { - switch (@typeInfo(@TypeOf(a))) { - .type => return cast(a, b), - .@"fn" => return a(b), - else => unreachable, // return type will be a compile error otherwise - } - } - - pub inline fn DISCARD(x: anytype) void { - _ = x; - } -}; - -/// Integer promotion described in C11 6.3.1.1.2 -fn PromotedIntType(comptime T: type) type { - return switch (T) { - bool, c_short => c_int, - c_ushort => if (@sizeOf(c_ushort) == @sizeOf(c_int)) c_uint else c_int, - c_int, c_uint, c_long, c_ulong, c_longlong, c_ulonglong => T, - else => switch (@typeInfo(T)) { - .comptime_int => @compileError("Cannot promote `" ++ @typeName(T) ++ "`; a fixed-size number type is required"), - // promote to c_int if it can represent all values of T - .int => |int_info| if (int_info.bits < @bitSizeOf(c_int)) - c_int - // otherwise, restore the original C type - else if (int_info.bits == @bitSizeOf(c_int)) - if (int_info.signedness == .unsigned) c_uint else c_int - else if (int_info.bits <= @bitSizeOf(c_long)) - if (int_info.signedness == .unsigned) c_ulong else c_long - else if (int_info.bits <= @bitSizeOf(c_longlong)) - if (int_info.signedness == .unsigned) c_ulonglong else c_longlong - else - @compileError("Cannot promote `" ++ @typeName(T) ++ "`; a C ABI type is required"), - else => @compileError("Attempted to promote invalid type `" ++ @typeName(T) ++ "`"), - }, - }; -} - -/// C11 6.3.1.1.1 -fn integerRank(comptime T: type) u8 { - return switch (T) { - bool => 0, - u8, i8 => 1, - c_short, c_ushort => 2, - c_int, c_uint => 3, - c_long, c_ulong => 4, - c_longlong, c_ulonglong => 5, - else => @compileError("integer rank not supported for `" ++ @typeName(T) ++ "`"), - }; -} - -fn ToUnsigned(comptime T: type) type { - return switch (T) { - c_int => c_uint, - c_long => c_ulong, - c_longlong => c_ulonglong, - else => @compileError("Cannot convert `" ++ @typeName(T) ++ "` to unsigned"), - }; -} - -/// "Usual arithmetic conversions" from C11 standard 6.3.1.8 -fn ArithmeticConversion(comptime A: type, comptime B: type) type { - if (A == c_longdouble or B == c_longdouble) return c_longdouble; - if (A == f80 or B == f80) return f80; - if (A == f64 or B == f64) return f64; - if (A == f32 or B == f32) return f32; - - const A_Promoted = PromotedIntType(A); - const B_Promoted = PromotedIntType(B); - comptime { - std.debug.assert(integerRank(A_Promoted) >= integerRank(c_int)); - std.debug.assert(integerRank(B_Promoted) >= integerRank(c_int)); - } - - if (A_Promoted == B_Promoted) return A_Promoted; - - const a_signed = @typeInfo(A_Promoted).int.signedness == .signed; - const b_signed = @typeInfo(B_Promoted).int.signedness == .signed; - - if (a_signed == b_signed) { - return if (integerRank(A_Promoted) > integerRank(B_Promoted)) A_Promoted else B_Promoted; - } - - const SignedType = if (a_signed) A_Promoted else B_Promoted; - const UnsignedType = if (!a_signed) A_Promoted else B_Promoted; - - if (integerRank(UnsignedType) >= integerRank(SignedType)) return UnsignedType; - - if (std.math.maxInt(SignedType) >= std.math.maxInt(UnsignedType)) return SignedType; - - return ToUnsigned(SignedType); -} - -test "ArithmeticConversion" { - // Promotions not necessarily the same for other platforms - if (builtin.target.cpu.arch != .x86_64 or builtin.target.os.tag != .linux) return error.SkipZigTest; - - const Test = struct { - /// Order of operands should not matter for arithmetic conversions - fn checkPromotion(comptime A: type, comptime B: type, comptime Expected: type) !void { - try std.testing.expect(ArithmeticConversion(A, B) == Expected); - try std.testing.expect(ArithmeticConversion(B, A) == Expected); - } - }; - - try Test.checkPromotion(c_longdouble, c_int, c_longdouble); - try Test.checkPromotion(c_int, f64, f64); - try Test.checkPromotion(f32, bool, f32); - - try Test.checkPromotion(bool, c_short, c_int); - try Test.checkPromotion(c_int, c_int, c_int); - try Test.checkPromotion(c_short, c_int, c_int); - - try Test.checkPromotion(c_int, c_long, c_long); - - try Test.checkPromotion(c_ulonglong, c_uint, c_ulonglong); - - try Test.checkPromotion(c_uint, c_int, c_uint); - - try Test.checkPromotion(c_uint, c_long, c_long); - - try Test.checkPromotion(c_ulong, c_longlong, c_ulonglong); - - // stdint.h - try Test.checkPromotion(u8, i8, c_int); - try Test.checkPromotion(u16, i16, c_int); - try Test.checkPromotion(i32, c_int, c_int); - try Test.checkPromotion(u32, c_int, c_uint); - try Test.checkPromotion(i64, c_int, c_long); - try Test.checkPromotion(u64, c_int, c_ulong); - try Test.checkPromotion(isize, c_int, c_long); - try Test.checkPromotion(usize, c_int, c_ulong); -} - -pub const MacroArithmetic = struct { - pub fn div(a: anytype, b: anytype) ArithmeticConversion(@TypeOf(a), @TypeOf(b)) { - const ResType = ArithmeticConversion(@TypeOf(a), @TypeOf(b)); - const a_casted = cast(ResType, a); - const b_casted = cast(ResType, b); - switch (@typeInfo(ResType)) { - .float => return a_casted / b_casted, - .int => return @divTrunc(a_casted, b_casted), - else => unreachable, - } - } - - pub fn rem(a: anytype, b: anytype) ArithmeticConversion(@TypeOf(a), @TypeOf(b)) { - const ResType = ArithmeticConversion(@TypeOf(a), @TypeOf(b)); - const a_casted = cast(ResType, a); - const b_casted = cast(ResType, b); - switch (@typeInfo(ResType)) { - .int => { - if (@typeInfo(ResType).int.signedness == .signed) { - return signedRemainder(a_casted, b_casted); - } else { - return a_casted % b_casted; - } - }, - else => unreachable, - } - } -}; - -test "Macro suffix functions" { - try testing.expect(@TypeOf(Macros.F_SUFFIX(1)) == f32); - - try testing.expect(@TypeOf(Macros.U_SUFFIX(1)) == c_uint); - if (math.maxInt(c_ulong) > math.maxInt(c_uint)) { - try testing.expect(@TypeOf(Macros.U_SUFFIX(math.maxInt(c_uint) + 1)) == c_ulong); - } - if (math.maxInt(c_ulonglong) > math.maxInt(c_ulong)) { - try testing.expect(@TypeOf(Macros.U_SUFFIX(math.maxInt(c_ulong) + 1)) == c_ulonglong); - } - - try testing.expect(@TypeOf(Macros.L_SUFFIX(1)) == c_long); - if (math.maxInt(c_long) > math.maxInt(c_int)) { - try testing.expect(@TypeOf(Macros.L_SUFFIX(math.maxInt(c_int) + 1)) == c_long); - } - if (math.maxInt(c_longlong) > math.maxInt(c_long)) { - try testing.expect(@TypeOf(Macros.L_SUFFIX(math.maxInt(c_long) + 1)) == c_longlong); - } - - try testing.expect(@TypeOf(Macros.UL_SUFFIX(1)) == c_ulong); - if (math.maxInt(c_ulonglong) > math.maxInt(c_ulong)) { - try testing.expect(@TypeOf(Macros.UL_SUFFIX(math.maxInt(c_ulong) + 1)) == c_ulonglong); - } - - try testing.expect(@TypeOf(Macros.LL_SUFFIX(1)) == c_longlong); - try testing.expect(@TypeOf(Macros.ULL_SUFFIX(1)) == c_ulonglong); -} - -test "WL_CONTAINER_OF" { - const S = struct { - a: u32 = 0, - b: u32 = 0, - }; - const x = S{}; - const y = S{}; - const ptr = Macros.WL_CONTAINER_OF(&x.b, &y, "b"); - try testing.expectEqual(&x, ptr); -} - -test "CAST_OR_CALL casting" { - const arg: c_int = 1000; - const casted = Macros.CAST_OR_CALL(u8, arg); - try testing.expectEqual(cast(u8, arg), casted); - - const S = struct { - x: u32 = 0, - }; - var s: S = .{}; - const casted_ptr = Macros.CAST_OR_CALL(*u8, &s); - try testing.expectEqual(cast(*u8, &s), casted_ptr); -} - -test "CAST_OR_CALL calling" { - const Helper = struct { - var last_val: bool = false; - fn returnsVoid(val: bool) void { - last_val = val; - } - fn returnsBool(f: f32) bool { - return f > 0; - } - fn identity(self: c_uint) c_uint { - return self; - } - }; - - Macros.CAST_OR_CALL(Helper.returnsVoid, true); - try testing.expectEqual(true, Helper.last_val); - Macros.CAST_OR_CALL(Helper.returnsVoid, false); - try testing.expectEqual(false, Helper.last_val); - - try testing.expectEqual(Helper.returnsBool(1), Macros.CAST_OR_CALL(Helper.returnsBool, @as(f32, 1))); - try testing.expectEqual(Helper.returnsBool(-1), Macros.CAST_OR_CALL(Helper.returnsBool, @as(f32, -1))); - - try testing.expectEqual(Helper.identity(@as(c_uint, 100)), Macros.CAST_OR_CALL(Helper.identity, @as(c_uint, 100))); -} - -test "Extended C ABI casting" { - if (math.maxInt(c_long) > math.maxInt(c_char)) { - try testing.expect(@TypeOf(Macros.L_SUFFIX(@as(c_char, math.maxInt(c_char) - 1))) == c_long); // c_char - } - if (math.maxInt(c_long) > math.maxInt(c_short)) { - try testing.expect(@TypeOf(Macros.L_SUFFIX(@as(c_short, math.maxInt(c_short) - 1))) == c_long); // c_short - } - - if (math.maxInt(c_long) > math.maxInt(c_ushort)) { - try testing.expect(@TypeOf(Macros.L_SUFFIX(@as(c_ushort, math.maxInt(c_ushort) - 1))) == c_long); //c_ushort - } - - if (math.maxInt(c_long) > math.maxInt(c_int)) { - try testing.expect(@TypeOf(Macros.L_SUFFIX(@as(c_int, math.maxInt(c_int) - 1))) == c_long); // c_int - } - - if (math.maxInt(c_long) > math.maxInt(c_uint)) { - try testing.expect(@TypeOf(Macros.L_SUFFIX(@as(c_uint, math.maxInt(c_uint) - 1))) == c_long); // c_uint - try testing.expect(@TypeOf(Macros.L_SUFFIX(math.maxInt(c_uint) + 1)) == c_long); // comptime_int -> c_long - } - - if (math.maxInt(c_longlong) > math.maxInt(c_long)) { - try testing.expect(@TypeOf(Macros.L_SUFFIX(@as(c_long, math.maxInt(c_long) - 1))) == c_long); // c_long - try testing.expect(@TypeOf(Macros.L_SUFFIX(math.maxInt(c_long) + 1)) == c_longlong); // comptime_int -> c_longlong - } -} - -// Function with complex signature for testing the SDL case -fn complexFunction(_: ?*anyopaque, _: c_uint, _: ?*const fn (?*anyopaque) callconv(.c) c_uint, _: ?*anyopaque, _: c_uint, _: [*c]c_uint) callconv(.c) usize { - return 0; -} - -test "function pointer casting" { - const SDL_FunctionPointer = ?*const fn () callconv(.c) void; - const fn_ptr = cast(SDL_FunctionPointer, complexFunction); - try testing.expect(fn_ptr != null); -} diff --git a/lib/std/zig/c_builtins.zig b/lib/std/zig/c_translation/builtins.zig similarity index 51% rename from lib/std/zig/c_builtins.zig rename to lib/std/zig/c_translation/builtins.zig index 2f6c2e8aa5d7..c704b65e2365 100644 --- a/lib/std/zig/c_builtins.zig +++ b/lib/std/zig/c_translation/builtins.zig @@ -1,182 +1,176 @@ const std = @import("std"); -pub inline fn __builtin_bswap16(val: u16) u16 { - return @byteSwap(val); +/// Standard C Library bug: The absolute value of the most negative integer remains negative. +pub inline fn abs(val: c_int) c_int { + return if (val == std.math.minInt(c_int)) val else @intCast(@abs(val)); } -pub inline fn __builtin_bswap32(val: u32) u32 { - return @byteSwap(val); + +pub inline fn assume(cond: bool) void { + if (!cond) unreachable; } -pub inline fn __builtin_bswap64(val: u64) u64 { + +pub inline fn bswap16(val: u16) u16 { return @byteSwap(val); } -pub inline fn __builtin_signbit(val: f64) c_int { - return @intFromBool(std.math.signbit(val)); +pub inline fn bswap32(val: u32) u32 { + return @byteSwap(val); } -pub inline fn __builtin_signbitf(val: f32) c_int { - return @intFromBool(std.math.signbit(val)); + +pub inline fn bswap64(val: u64) u64 { + return @byteSwap(val); } -pub inline fn __builtin_popcount(val: c_uint) c_int { - // popcount of a c_uint will never exceed the capacity of a c_int - @setRuntimeSafety(false); - return @as(c_int, @bitCast(@as(c_uint, @popCount(val)))); +pub inline fn ceilf(val: f32) f32 { + return @ceil(val); } -pub inline fn __builtin_ctz(val: c_uint) c_int { - // Returns the number of trailing 0-bits in val, starting at the least significant bit position. - // In C if `val` is 0, the result is undefined; in zig it's the number of bits in a c_uint - @setRuntimeSafety(false); - return @as(c_int, @bitCast(@as(c_uint, @ctz(val)))); + +pub inline fn ceil(val: f64) f64 { + return @ceil(val); } -pub inline fn __builtin_clz(val: c_uint) c_int { - // Returns the number of leading 0-bits in x, starting at the most significant bit position. - // In C if `val` is 0, the result is undefined; in zig it's the number of bits in a c_uint + +/// Returns the number of leading 0-bits in x, starting at the most significant bit position. +/// In C if `val` is 0, the result is undefined; in zig it's the number of bits in a c_uint +pub inline fn clz(val: c_uint) c_int { @setRuntimeSafety(false); return @as(c_int, @bitCast(@as(c_uint, @clz(val)))); } -pub inline fn __builtin_sqrt(val: f64) f64 { - return @sqrt(val); -} -pub inline fn __builtin_sqrtf(val: f32) f32 { - return @sqrt(val); +pub inline fn constant_p(expr: anytype) c_int { + _ = expr; + return @intFromBool(false); } -pub inline fn __builtin_sin(val: f64) f64 { - return @sin(val); -} -pub inline fn __builtin_sinf(val: f32) f32 { - return @sin(val); -} -pub inline fn __builtin_cos(val: f64) f64 { +pub inline fn cosf(val: f32) f32 { return @cos(val); } -pub inline fn __builtin_cosf(val: f32) f32 { + +pub inline fn cos(val: f64) f64 { return @cos(val); } -pub inline fn __builtin_exp(val: f64) f64 { - return @exp(val); -} -pub inline fn __builtin_expf(val: f32) f32 { - return @exp(val); +/// Returns the number of trailing 0-bits in val, starting at the least significant bit position. +/// In C if `val` is 0, the result is undefined; in zig it's the number of bits in a c_uint +pub inline fn ctz(val: c_uint) c_int { + @setRuntimeSafety(false); + return @as(c_int, @bitCast(@as(c_uint, @ctz(val)))); } -pub inline fn __builtin_exp2(val: f64) f64 { + +pub inline fn exp2f(val: f32) f32 { return @exp2(val); } -pub inline fn __builtin_exp2f(val: f32) f32 { + +pub inline fn exp2(val: f64) f64 { return @exp2(val); } -pub inline fn __builtin_log(val: f64) f64 { - return @log(val); -} -pub inline fn __builtin_logf(val: f32) f32 { - return @log(val); -} -pub inline fn __builtin_log2(val: f64) f64 { - return @log2(val); -} -pub inline fn __builtin_log2f(val: f32) f32 { - return @log2(val); -} -pub inline fn __builtin_log10(val: f64) f64 { - return @log10(val); -} -pub inline fn __builtin_log10f(val: f32) f32 { - return @log10(val); -} -// Standard C Library bug: The absolute value of the most negative integer remains negative. -pub inline fn __builtin_abs(val: c_int) c_int { - return if (val == std.math.minInt(c_int)) val else @intCast(@abs(val)); +pub inline fn expf(val: f32) f32 { + return @exp(val); } -pub inline fn __builtin_labs(val: c_long) c_long { - return if (val == std.math.minInt(c_long)) val else @intCast(@abs(val)); + +pub inline fn exp(val: f64) f64 { + return @exp(val); } -pub inline fn __builtin_llabs(val: c_longlong) c_longlong { - return if (val == std.math.minInt(c_longlong)) val else @intCast(@abs(val)); + +/// The return value of __builtin_expect is `expr`. `c` is the expected value +/// of `expr` and is used as a hint to the compiler in C. Here it is unused. +pub inline fn expect(expr: c_long, c: c_long) c_long { + _ = c; + return expr; } -pub inline fn __builtin_fabs(val: f64) f64 { + +pub inline fn fabsf(val: f32) f32 { return @abs(val); } -pub inline fn __builtin_fabsf(val: f32) f32 { + +pub inline fn fabs(val: f64) f64 { return @abs(val); } -pub inline fn __builtin_floor(val: f64) f64 { +pub inline fn floorf(val: f32) f32 { return @floor(val); } -pub inline fn __builtin_floorf(val: f32) f32 { + +pub inline fn floor(val: f64) f64 { return @floor(val); } -pub inline fn __builtin_ceil(val: f64) f64 { - return @ceil(val); + +pub inline fn has_builtin(func: anytype) c_int { + _ = func; + return @intFromBool(true); } -pub inline fn __builtin_ceilf(val: f32) f32 { - return @ceil(val); + +pub inline fn huge_valf() f32 { + return std.math.inf(f32); } -pub inline fn __builtin_trunc(val: f64) f64 { - return @trunc(val); + +pub inline fn inff() f32 { + return std.math.inf(f32); } -pub inline fn __builtin_truncf(val: f32) f32 { - return @trunc(val); + +/// Similar to isinf, except the return value is -1 for an argument of -Inf and 1 for an argument of +Inf. +pub inline fn isinf_sign(x: anytype) c_int { + if (!std.math.isInf(x)) return 0; + return if (std.math.isPositiveInf(x)) 1 else -1; } -pub inline fn __builtin_round(val: f64) f64 { - return @round(val); + +pub inline fn isinf(x: anytype) c_int { + return @intFromBool(std.math.isInf(x)); } -pub inline fn __builtin_roundf(val: f32) f32 { - return @round(val); + +pub inline fn isnan(x: anytype) c_int { + return @intFromBool(std.math.isNan(x)); } -pub inline fn __builtin_strlen(s: [*c]const u8) usize { - return std.mem.sliceTo(s, 0).len; +/// Standard C Library bug: The absolute value of the most negative integer remains negative. +pub inline fn labs(val: c_long) c_long { + return if (val == std.math.minInt(c_long)) val else @intCast(@abs(val)); } -pub inline fn __builtin_strcmp(s1: [*c]const u8, s2: [*c]const u8) c_int { - return switch (std.mem.orderZ(u8, s1, s2)) { - .lt => -1, - .eq => 0, - .gt => 1, - }; + +/// Standard C Library bug: The absolute value of the most negative integer remains negative. +pub inline fn llabs(val: c_longlong) c_longlong { + return if (val == std.math.minInt(c_longlong)) val else @intCast(@abs(val)); } -pub inline fn __builtin_object_size(ptr: ?*const anyopaque, ty: c_int) usize { - _ = ptr; - // clang semantics match gcc's: https://gcc.gnu.org/onlinedocs/gcc/Object-Size-Checking.html - // If it is not possible to determine which objects ptr points to at compile time, - // __builtin_object_size should return (size_t) -1 for type 0 or 1 and (size_t) 0 - // for type 2 or 3. - if (ty == 0 or ty == 1) return @as(usize, @bitCast(-@as(isize, 1))); - if (ty == 2 or ty == 3) return 0; - unreachable; +pub inline fn log10f(val: f32) f32 { + return @log10(val); } -pub inline fn __builtin___memset_chk( - dst: ?*anyopaque, - val: c_int, - len: usize, - remaining: usize, -) ?*anyopaque { - if (len > remaining) @panic("std.c.builtins.memset_chk called with len > remaining"); - return __builtin_memset(dst, val, len); +pub inline fn log10(val: f64) f64 { + return @log10(val); } -pub inline fn __builtin_memset(dst: ?*anyopaque, val: c_int, len: usize) ?*anyopaque { - const dst_cast = @as([*c]u8, @ptrCast(dst)); - @memset(dst_cast[0..len], @as(u8, @bitCast(@as(i8, @truncate(val))))); - return dst; +pub inline fn log2f(val: f32) f32 { + return @log2(val); } -pub inline fn __builtin___memcpy_chk( +pub inline fn log2(val: f64) f64 { + return @log2(val); +} + +pub inline fn logf(val: f32) f32 { + return @log(val); +} + +pub inline fn log(val: f64) f64 { + return @log(val); +} + +pub inline fn memcpy_chk( noalias dst: ?*anyopaque, noalias src: ?*const anyopaque, len: usize, remaining: usize, ) ?*anyopaque { - if (len > remaining) @panic("std.c.builtins.memcpy_chk called with len > remaining"); - return __builtin_memcpy(dst, src, len); + if (len > remaining) @panic("__builtin___memcpy_chk called with len > remaining"); + if (len > 0) @memcpy( + @as([*]u8, @ptrCast(dst.?))[0..len], + @as([*]const u8, @ptrCast(src.?)), + ); + return dst; } -pub inline fn __builtin_memcpy( +pub inline fn memcpy( noalias dst: ?*anyopaque, noalias src: ?*const anyopaque, len: usize, @@ -188,16 +182,33 @@ pub inline fn __builtin_memcpy( return dst; } -/// The return value of __builtin_expect is `expr`. `c` is the expected value -/// of `expr` and is used as a hint to the compiler in C. Here it is unused. -pub inline fn __builtin_expect(expr: c_long, c: c_long) c_long { - _ = c; - return expr; +pub inline fn memset_chk( + dst: ?*anyopaque, + val: c_int, + len: usize, + remaining: usize, +) ?*anyopaque { + if (len > remaining) @panic("__builtin___memset_chk called with len > remaining"); + const dst_cast = @as([*c]u8, @ptrCast(dst)); + @memset(dst_cast[0..len], @as(u8, @bitCast(@as(i8, @truncate(val))))); + return dst; +} + +pub inline fn memset(dst: ?*anyopaque, val: c_int, len: usize) ?*anyopaque { + const dst_cast = @as([*c]u8, @ptrCast(dst)); + @memset(dst_cast[0..len], @as(u8, @bitCast(@as(i8, @truncate(val))))); + return dst; +} + +pub fn mul_overflow(a: anytype, b: anytype, result: *@TypeOf(a, b)) c_int { + const res = @mulWithOverflow(a, b); + result.* = res[0]; + return res[1]; } /// returns a quiet NaN. Quiet NaNs have many representations; tagp is used to select one in an /// implementation-defined way. -/// This implementation is based on the description for __builtin_nan provided in the GCC docs at +/// This implementation is based on the description for nan provided in the GCC docs at /// https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#index-_005f_005fbuiltin_005fnan /// Comment is reproduced below: /// Since ISO C99 defines this function in terms of strtod, which we do not implement, a description @@ -210,59 +221,81 @@ pub inline fn __builtin_expect(expr: c_long, c: c_long) c_long { /// /// If tagp contains any non-numeric characters, the function returns a NaN whose significand is zero. /// If tagp is empty, the function returns a NaN whose significand is zero. -pub inline fn __builtin_nanf(tagp: []const u8) f32 { +pub inline fn nanf(tagp: []const u8) f32 { const parsed = std.fmt.parseUnsigned(c_ulong, tagp, 0) catch 0; const bits: u23 = @truncate(parsed); // single-precision float trailing significand is 23 bits return @bitCast(@as(u32, bits) | @as(u32, @bitCast(std.math.nan(f32)))); } -pub inline fn __builtin_huge_valf() f32 { - return std.math.inf(f32); +pub inline fn object_size(ptr: ?*const anyopaque, ty: c_int) usize { + _ = ptr; + // clang semantics match gcc's: https://gcc.gnu.org/onlinedocs/gcc/Object-Size-Checking.html + // If it is not possible to determine which objects ptr points to at compile time, + // object_size should return (size_t) -1 for type 0 or 1 and (size_t) 0 + // for type 2 or 3. + if (ty == 0 or ty == 1) return @as(usize, @bitCast(-@as(isize, 1))); + if (ty == 2 or ty == 3) return 0; + unreachable; } -pub inline fn __builtin_inff() f32 { - return std.math.inf(f32); +/// popcount of a c_uint will never exceed the capacity of a c_int +pub inline fn popcount(val: c_uint) c_int { + @setRuntimeSafety(false); + return @as(c_int, @bitCast(@as(c_uint, @popCount(val)))); } -pub inline fn __builtin_isnan(x: anytype) c_int { - return @intFromBool(std.math.isNan(x)); +pub inline fn roundf(val: f32) f32 { + return @round(val); } -pub inline fn __builtin_isinf(x: anytype) c_int { - return @intFromBool(std.math.isInf(x)); +pub inline fn round(val: f64) f64 { + return @round(val); } -/// Similar to isinf, except the return value is -1 for an argument of -Inf and 1 for an argument of +Inf. -pub inline fn __builtin_isinf_sign(x: anytype) c_int { - if (!std.math.isInf(x)) return 0; - return if (std.math.isPositiveInf(x)) 1 else -1; +pub inline fn signbitf(val: f32) c_int { + return @intFromBool(std.math.signbit(val)); } -pub inline fn __has_builtin(func: anytype) c_int { - _ = func; - return @intFromBool(true); +pub inline fn signbit(val: f64) c_int { + return @intFromBool(std.math.signbit(val)); } -pub inline fn __builtin_assume(cond: bool) void { - if (!cond) unreachable; +pub inline fn sinf(val: f32) f32 { + return @sin(val); } -pub inline fn __builtin_unreachable() noreturn { - unreachable; +pub inline fn sin(val: f64) f64 { + return @sin(val); } -pub inline fn __builtin_constant_p(expr: anytype) c_int { - _ = expr; - return @intFromBool(false); +pub inline fn sqrtf(val: f32) f32 { + return @sqrt(val); } -pub fn __builtin_mul_overflow(a: anytype, b: anytype, result: *@TypeOf(a, b)) c_int { - const res = @mulWithOverflow(a, b); - result.* = res[0]; - return res[1]; + +pub inline fn sqrt(val: f64) f64 { + return @sqrt(val); +} + +pub inline fn strcmp(s1: [*c]const u8, s2: [*c]const u8) c_int { + return switch (std.mem.orderZ(u8, s1, s2)) { + .lt => -1, + .eq => 0, + .gt => 1, + }; +} + +pub inline fn strlen(s: [*c]const u8) usize { + return std.mem.sliceTo(s, 0).len; +} + +pub inline fn truncf(val: f32) f32 { + return @trunc(val); +} + +pub inline fn trunc(val: f64) f64 { + return @trunc(val); } -// __builtin_alloca_with_align is not currently implemented. -// It is used in a run-translated-c test and a test-translate-c test to ensure that non-implemented -// builtins are correctly demoted. If you implement __builtin_alloca_with_align, please update the -// run-translated-c test and the test-translate-c test to use a different non-implemented builtin. -// pub inline fn __builtin_alloca_with_align(size: usize, alignment: usize) *anyopaque {} +pub inline fn @"unreachable"() noreturn { + unreachable; +} diff --git a/lib/std/zig/c_translation/helpers.zig b/lib/std/zig/c_translation/helpers.zig new file mode 100644 index 000000000000..5f6a5561df86 --- /dev/null +++ b/lib/std/zig/c_translation/helpers.zig @@ -0,0 +1,413 @@ +const std = @import("std"); + +/// "Usual arithmetic conversions" from C11 standard 6.3.1.8 +pub fn ArithmeticConversion(comptime A: type, comptime B: type) type { + if (A == c_longdouble or B == c_longdouble) return c_longdouble; + if (A == f80 or B == f80) return f80; + if (A == f64 or B == f64) return f64; + if (A == f32 or B == f32) return f32; + + const A_Promoted = PromotedIntType(A); + const B_Promoted = PromotedIntType(B); + comptime { + std.debug.assert(integerRank(A_Promoted) >= integerRank(c_int)); + std.debug.assert(integerRank(B_Promoted) >= integerRank(c_int)); + } + + if (A_Promoted == B_Promoted) return A_Promoted; + + const a_signed = @typeInfo(A_Promoted).int.signedness == .signed; + const b_signed = @typeInfo(B_Promoted).int.signedness == .signed; + + if (a_signed == b_signed) { + return if (integerRank(A_Promoted) > integerRank(B_Promoted)) A_Promoted else B_Promoted; + } + + const SignedType = if (a_signed) A_Promoted else B_Promoted; + const UnsignedType = if (!a_signed) A_Promoted else B_Promoted; + + if (integerRank(UnsignedType) >= integerRank(SignedType)) return UnsignedType; + + if (std.math.maxInt(SignedType) >= std.math.maxInt(UnsignedType)) return SignedType; + + return ToUnsigned(SignedType); +} + +/// Integer promotion described in C11 6.3.1.1.2 +fn PromotedIntType(comptime T: type) type { + return switch (T) { + bool, c_short => c_int, + c_ushort => if (@sizeOf(c_ushort) == @sizeOf(c_int)) c_uint else c_int, + c_int, c_uint, c_long, c_ulong, c_longlong, c_ulonglong => T, + else => switch (@typeInfo(T)) { + .comptime_int => @compileError("Cannot promote `" ++ @typeName(T) ++ "`; a fixed-size number type is required"), + // promote to c_int if it can represent all values of T + .int => |int_info| if (int_info.bits < @bitSizeOf(c_int)) + c_int + // otherwise, restore the original C type + else if (int_info.bits == @bitSizeOf(c_int)) + if (int_info.signedness == .unsigned) c_uint else c_int + else if (int_info.bits <= @bitSizeOf(c_long)) + if (int_info.signedness == .unsigned) c_ulong else c_long + else if (int_info.bits <= @bitSizeOf(c_longlong)) + if (int_info.signedness == .unsigned) c_ulonglong else c_longlong + else + @compileError("Cannot promote `" ++ @typeName(T) ++ "`; a C ABI type is required"), + else => @compileError("Attempted to promote invalid type `" ++ @typeName(T) ++ "`"), + }, + }; +} + +/// C11 6.3.1.1.1 +fn integerRank(comptime T: type) u8 { + return switch (T) { + bool => 0, + u8, i8 => 1, + c_short, c_ushort => 2, + c_int, c_uint => 3, + c_long, c_ulong => 4, + c_longlong, c_ulonglong => 5, + else => @compileError("integer rank not supported for `" ++ @typeName(T) ++ "`"), + }; +} + +fn ToUnsigned(comptime T: type) type { + return switch (T) { + c_int => c_uint, + c_long => c_ulong, + c_longlong => c_ulonglong, + else => @compileError("Cannot convert `" ++ @typeName(T) ++ "` to unsigned"), + }; +} + +/// Constructs a [*c] pointer with the const and volatile annotations +/// from SelfType for pointing to a C flexible array of ElementType. +pub fn FlexibleArrayType(comptime SelfType: type, comptime ElementType: type) type { + switch (@typeInfo(SelfType)) { + .pointer => |ptr| { + return @Type(.{ .pointer = .{ + .size = .c, + .is_const = ptr.is_const, + .is_volatile = ptr.is_volatile, + .alignment = @alignOf(ElementType), + .address_space = .generic, + .child = ElementType, + .is_allowzero = true, + .sentinel_ptr = null, + } }); + }, + else => |info| @compileError("Invalid self type \"" ++ @tagName(info) ++ "\" for flexible array getter: " ++ @typeName(SelfType)), + } +} + +/// Promote the type of an integer literal until it fits as C would. +pub fn promoteIntLiteral( + comptime SuffixType: type, + comptime number: comptime_int, + comptime base: CIntLiteralBase, +) PromoteIntLiteralReturnType(SuffixType, number, base) { + return number; +} + +const CIntLiteralBase = enum { decimal, octal, hex }; + +fn PromoteIntLiteralReturnType(comptime SuffixType: type, comptime number: comptime_int, comptime base: CIntLiteralBase) type { + const signed_decimal = [_]type{ c_int, c_long, c_longlong, c_ulonglong }; + const signed_oct_hex = [_]type{ c_int, c_uint, c_long, c_ulong, c_longlong, c_ulonglong }; + const unsigned = [_]type{ c_uint, c_ulong, c_ulonglong }; + + const list: []const type = if (@typeInfo(SuffixType).int.signedness == .unsigned) + &unsigned + else if (base == .decimal) + &signed_decimal + else + &signed_oct_hex; + + var pos = std.mem.indexOfScalar(type, list, SuffixType).?; + while (pos < list.len) : (pos += 1) { + if (number >= std.math.minInt(list[pos]) and number <= std.math.maxInt(list[pos])) { + return list[pos]; + } + } + + @compileError("Integer literal is too large"); +} + +/// Convert from clang __builtin_shufflevector index to Zig @shuffle index +/// clang requires __builtin_shufflevector index arguments to be integer constants. +/// negative values for `this_index` indicate "don't care". +/// clang enforces that `this_index` is less than the total number of vector elements +/// See https://ziglang.org/documentation/master/#shuffle +/// See https://clang.llvm.org/docs/LanguageExtensions.html#langext-builtin-shufflevector +pub fn shuffleVectorIndex(comptime this_index: c_int, comptime source_vector_len: usize) i32 { + const positive_index = std.math.cast(usize, this_index) orelse return undefined; + if (positive_index < source_vector_len) return @as(i32, @intCast(this_index)); + const b_index = positive_index - source_vector_len; + return ~@as(i32, @intCast(b_index)); +} + +/// C `%` operator for signed integers +/// C standard states: "If the quotient a/b is representable, the expression (a/b)*b + a%b shall equal a" +/// The quotient is not representable if denominator is zero, or if numerator is the minimum integer for +/// the type and denominator is -1. C has undefined behavior for those two cases; this function has safety +/// checked undefined behavior +pub fn signedRemainder(numerator: anytype, denominator: anytype) @TypeOf(numerator, denominator) { + std.debug.assert(@typeInfo(@TypeOf(numerator, denominator)).int.signedness == .signed); + if (denominator > 0) return @rem(numerator, denominator); + return numerator - @divTrunc(numerator, denominator) * denominator; +} + +/// Given a type and value, cast the value to the type as c would. +pub fn cast(comptime DestType: type, target: anytype) DestType { + // this function should behave like transCCast in translate-c, except it's for macros + const SourceType = @TypeOf(target); + switch (@typeInfo(DestType)) { + .@"fn" => return castToPtr(*const DestType, SourceType, target), + .pointer => return castToPtr(DestType, SourceType, target), + .optional => |dest_opt| { + if (@typeInfo(dest_opt.child) == .pointer) { + return castToPtr(DestType, SourceType, target); + } else if (@typeInfo(dest_opt.child) == .@"fn") { + return castToPtr(?*const dest_opt.child, SourceType, target); + } + }, + .int => { + switch (@typeInfo(SourceType)) { + .pointer => { + return castInt(DestType, @intFromPtr(target)); + }, + .optional => |opt| { + if (@typeInfo(opt.child) == .pointer) { + return castInt(DestType, @intFromPtr(target)); + } + }, + .int => { + return castInt(DestType, target); + }, + .@"fn" => { + return castInt(DestType, @intFromPtr(&target)); + }, + .bool => { + return @intFromBool(target); + }, + else => {}, + } + }, + .float => { + switch (@typeInfo(SourceType)) { + .int => return @as(DestType, @floatFromInt(target)), + .float => return @as(DestType, @floatCast(target)), + .bool => return @as(DestType, @floatFromInt(@intFromBool(target))), + else => {}, + } + }, + .@"union" => |info| { + inline for (info.fields) |field| { + if (field.type == SourceType) return @unionInit(DestType, field.name, target); + } + + @compileError("cast to union type '" ++ @typeName(DestType) ++ "' from type '" ++ @typeName(SourceType) ++ "' which is not present in union"); + }, + .bool => return cast(usize, target) != 0, + else => {}, + } + + return @as(DestType, target); +} + +fn castInt(comptime DestType: type, target: anytype) DestType { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; + + const Int = @Type(.{ .int = .{ .bits = dest.bits, .signedness = source.signedness } }); + + if (dest.bits < source.bits) + return @as(DestType, @bitCast(@as(Int, @truncate(target)))) + else + return @as(DestType, @bitCast(@as(Int, target))); +} + +fn castPtr(comptime DestType: type, target: anytype) DestType { + return @ptrCast(@alignCast(@constCast(@volatileCast(target)))); +} + +fn castToPtr(comptime DestType: type, comptime SourceType: type, target: anytype) DestType { + switch (@typeInfo(SourceType)) { + .int => { + return @as(DestType, @ptrFromInt(castInt(usize, target))); + }, + .comptime_int => { + if (target < 0) + return @as(DestType, @ptrFromInt(@as(usize, @bitCast(@as(isize, @intCast(target)))))) + else + return @as(DestType, @ptrFromInt(@as(usize, @intCast(target)))); + }, + .pointer => { + return castPtr(DestType, target); + }, + .@"fn" => { + return castPtr(DestType, &target); + }, + .optional => |target_opt| { + if (@typeInfo(target_opt.child) == .pointer) { + return castPtr(DestType, target); + } + }, + else => {}, + } + + return @as(DestType, target); +} + +/// Given a value returns its size as C's sizeof operator would. +pub fn sizeof(target: anytype) usize { + const T: type = if (@TypeOf(target) == type) target else @TypeOf(target); + switch (@typeInfo(T)) { + .float, .int, .@"struct", .@"union", .array, .bool, .vector => return @sizeOf(T), + .@"fn" => { + // sizeof(main) in C returns 1 + return 1; + }, + .null => return @sizeOf(*anyopaque), + .void => { + // Note: sizeof(void) is 1 on clang/gcc and 0 on MSVC. + return 1; + }, + .@"opaque" => { + if (T == anyopaque) { + // Note: sizeof(void) is 1 on clang/gcc and 0 on MSVC. + return 1; + } else { + @compileError("Cannot use C sizeof on opaque type " ++ @typeName(T)); + } + }, + .optional => |opt| { + if (@typeInfo(opt.child) == .pointer) { + return sizeof(opt.child); + } else { + @compileError("Cannot use C sizeof on non-pointer optional " ++ @typeName(T)); + } + }, + .pointer => |ptr| { + if (ptr.size == .slice) { + @compileError("Cannot use C sizeof on slice type " ++ @typeName(T)); + } + + // for strings, sizeof("a") returns 2. + // normal pointer decay scenarios from C are handled + // in the .array case above, but strings remain literals + // and are therefore always pointers, so they need to be + // specially handled here. + if (ptr.size == .one and ptr.is_const and @typeInfo(ptr.child) == .array) { + const array_info = @typeInfo(ptr.child).array; + if ((array_info.child == u8 or array_info.child == u16) and array_info.sentinel() == 0) { + // length of the string plus one for the null terminator. + return (array_info.len + 1) * @sizeOf(array_info.child); + } + } + + // When zero sized pointers are removed, this case will no + // longer be reachable and can be deleted. + if (@sizeOf(T) == 0) { + return @sizeOf(*anyopaque); + } + + return @sizeOf(T); + }, + .comptime_float => return @sizeOf(f64), // TODO c_double #3999 + .comptime_int => { + // TODO to get the correct result we have to translate + // `1073741824 * 4` as `int(1073741824) *% int(4)` since + // sizeof(1073741824 * 4) != sizeof(4294967296). + + // TODO test if target fits in int, long or long long + return @sizeOf(c_int); + }, + else => @compileError("__helpers.sizeof does not support type " ++ @typeName(T)), + } +} + +pub fn div(a: anytype, b: anytype) ArithmeticConversion(@TypeOf(a), @TypeOf(b)) { + const ResType = ArithmeticConversion(@TypeOf(a), @TypeOf(b)); + const a_casted = cast(ResType, a); + const b_casted = cast(ResType, b); + switch (@typeInfo(ResType)) { + .float => return a_casted / b_casted, + .int => return @divTrunc(a_casted, b_casted), + else => unreachable, + } +} + +pub fn rem(a: anytype, b: anytype) ArithmeticConversion(@TypeOf(a), @TypeOf(b)) { + const ResType = ArithmeticConversion(@TypeOf(a), @TypeOf(b)); + const a_casted = cast(ResType, a); + const b_casted = cast(ResType, b); + switch (@typeInfo(ResType)) { + .int => { + if (@typeInfo(ResType).int.signedness == .signed) { + return signedRemainder(a_casted, b_casted); + } else { + return a_casted % b_casted; + } + }, + else => unreachable, + } +} + +/// A 2-argument function-like macro defined as #define FOO(A, B) (A)(B) +/// could be either: cast B to A, or call A with the value B. +pub fn CAST_OR_CALL(a: anytype, b: anytype) switch (@typeInfo(@TypeOf(a))) { + .type => a, + .@"fn" => |fn_info| fn_info.return_type orelse void, + else => |info| @compileError("Unexpected argument type: " ++ @tagName(info)), +} { + switch (@typeInfo(@TypeOf(a))) { + .type => return cast(a, b), + .@"fn" => return a(b), + else => unreachable, // return type will be a compile error otherwise + } +} + +pub inline fn DISCARD(x: anytype) void { + _ = x; +} + +pub fn F_SUFFIX(comptime f: comptime_float) f32 { + return @as(f32, f); +} + +fn L_SUFFIX_ReturnType(comptime number: anytype) type { + switch (@typeInfo(@TypeOf(number))) { + .int, .comptime_int => return @TypeOf(promoteIntLiteral(c_long, number, .decimal)), + .float, .comptime_float => return c_longdouble, + else => @compileError("Invalid value for L suffix"), + } +} + +pub fn L_SUFFIX(comptime number: anytype) L_SUFFIX_ReturnType(number) { + switch (@typeInfo(@TypeOf(number))) { + .int, .comptime_int => return promoteIntLiteral(c_long, number, .decimal), + .float, .comptime_float => @compileError("TODO: c_longdouble initialization from comptime_float not supported"), + else => @compileError("Invalid value for L suffix"), + } +} + +pub fn LL_SUFFIX(comptime n: comptime_int) @TypeOf(promoteIntLiteral(c_longlong, n, .decimal)) { + return promoteIntLiteral(c_longlong, n, .decimal); +} + +pub fn U_SUFFIX(comptime n: comptime_int) @TypeOf(promoteIntLiteral(c_uint, n, .decimal)) { + return promoteIntLiteral(c_uint, n, .decimal); +} + +pub fn UL_SUFFIX(comptime n: comptime_int) @TypeOf(promoteIntLiteral(c_ulong, n, .decimal)) { + return promoteIntLiteral(c_ulong, n, .decimal); +} + +pub fn ULL_SUFFIX(comptime n: comptime_int) @TypeOf(promoteIntLiteral(c_ulonglong, n, .decimal)) { + return promoteIntLiteral(c_ulonglong, n, .decimal); +} + +pub fn WL_CONTAINER_OF(ptr: anytype, sample: anytype, comptime member: []const u8) @TypeOf(sample) { + return @fieldParentPtr(member, ptr); +} diff --git a/src/Compilation.zig b/src/Compilation.zig index f0c4dbf47376..56239e2fa4a0 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -5633,115 +5633,60 @@ pub const CImportResult = struct { }; /// Caller owns returned memory. -pub fn cImport(comp: *Compilation, c_src: []const u8, owner_mod: *Package.Module) !CImportResult { +pub fn cImport( + comp: *Compilation, + c_src: []const u8, + owner_mod: *Package.Module, + prog_node: std.Progress.Node, +) !CImportResult { dev.check(.translate_c_command); - const tracy_trace = trace(@src()); - defer tracy_trace.end(); - - const cimport_zig_basename = "cimport.zig"; + const cimport_basename = "cimport.h"; + const translated_basename = "cimport.zig"; var man = comp.obtainCObjectCacheManifest(owner_mod); defer man.deinit(); - man.hash.add(@as(u16, 0xb945)); // Random number to distinguish translate-c from compiling C objects + man.hash.add(@as(u16, 0x7dd9)); // Random number to distinguish translate-c from compiling C objects man.hash.addBytes(c_src); - man.hash.add(comp.config.c_frontend); - - // If the previous invocation resulted in clang errors, we will see a hit - // here with 0 files in the manifest, in which case it is actually a miss. - // We need to "unhit" in this case, to keep the digests matching. - const prev_hash_state = man.hash.peekBin(); - const actual_hit = hit: { - _ = try man.hit(); - if (man.files.entries.len == 0) { - man.unhit(prev_hash_state, 0); - break :hit false; - } - break :hit true; - }; - const digest = if (!actual_hit) digest: { + + const digest, const is_hit = if (try man.hit()) .{ man.finalBin(), true } else digest: { var arena_allocator = std.heap.ArenaAllocator.init(comp.gpa); defer arena_allocator.deinit(); const arena = arena_allocator.allocator(); - const tmp_digest = man.hash.peek(); - const tmp_dir_sub_path = try fs.path.join(arena, &[_][]const u8{ "o", &tmp_digest }); - var zig_cache_tmp_dir = try comp.dirs.local_cache.handle.makeOpenPath(tmp_dir_sub_path, .{}); - defer zig_cache_tmp_dir.close(); - const cimport_basename = "cimport.h"; - const out_h_path = try comp.dirs.local_cache.join(arena, &[_][]const u8{ - tmp_dir_sub_path, cimport_basename, - }); + const tmp_basename = std.fmt.hex(std.crypto.random.int(u64)); + const tmp_sub_path = "tmp" ++ fs.path.sep_str ++ tmp_basename; + const cache_dir = comp.dirs.local_cache.handle; + const out_h_sub_path = tmp_sub_path ++ fs.path.sep_str ++ cimport_basename; + + try cache_dir.makePath(tmp_sub_path); + + const out_h_path = try comp.dirs.local_cache.join(arena, &.{out_h_sub_path}); + const translated_path = try comp.dirs.local_cache.join(arena, &.{ tmp_sub_path, translated_basename }); const out_dep_path = try std.fmt.allocPrint(arena, "{s}.d", .{out_h_path}); - try zig_cache_tmp_dir.writeFile(.{ .sub_path = cimport_basename, .data = c_src }); - if (comp.verbose_cimport) { - log.info("C import source: {s}", .{out_h_path}); - } + if (comp.verbose_cimport) log.info("writing C import source to {s}", .{out_h_path}); + try cache_dir.writeFile(.{ .sub_path = out_h_sub_path, .data = c_src }); var argv = std.array_list.Managed([]const u8).init(comp.gpa); defer argv.deinit(); - - try argv.append(@tagName(comp.config.c_frontend)); // argv[0] is program name, actual args start at [1] try comp.addTranslateCCArgs(arena, &argv, .c, out_dep_path, owner_mod); + try argv.appendSlice(&.{ out_h_path, "-o", translated_path }); - try argv.append(out_h_path); - - if (comp.verbose_cc) { - dump_argv(argv.items); - } - var tree = switch (comp.config.c_frontend) { - .aro => tree: { - if (true) @panic("TODO"); - break :tree undefined; - }, - .clang => tree: { - if (!build_options.have_llvm) unreachable; - const translate_c = @import("translate_c.zig"); - - // Convert to null terminated args. - const new_argv_with_sentinel = try arena.alloc(?[*:0]const u8, argv.items.len + 1); - new_argv_with_sentinel[argv.items.len] = null; - const new_argv = new_argv_with_sentinel[0..argv.items.len :null]; - for (argv.items, 0..) |arg, i| { - new_argv[i] = try arena.dupeZ(u8, arg); - } - - const c_headers_dir_path_z = try comp.dirs.zig_lib.joinZ(arena, &.{"include"}); - var errors = std.zig.ErrorBundle.empty; - errdefer errors.deinit(comp.gpa); - break :tree translate_c.translate( - comp.gpa, - new_argv.ptr, - new_argv.ptr + new_argv.len, - &errors, - c_headers_dir_path_z, - ) catch |err| switch (err) { - error.OutOfMemory => return error.OutOfMemory, - error.SemanticAnalyzeFail => { - return CImportResult{ - .digest = undefined, - .cache_hit = actual_hit, - .errors = errors, - }; - }, - }; - }, - }; - defer tree.deinit(comp.gpa); - - if (comp.verbose_cimport) { - log.info("C import .d file: {s}", .{out_dep_path}); - } + if (comp.verbose_cc) dump_argv(argv.items); + var stdout: []u8 = undefined; + try @import("main.zig").translateC(comp.gpa, arena, argv.items, prog_node, &stdout); + if (comp.verbose_cimport and stdout.len != 0) log.info("unexpected stdout: {s}", .{stdout}); - const dep_basename = fs.path.basename(out_dep_path); - try man.addDepFilePost(zig_cache_tmp_dir, dep_basename); + const dep_sub_path = out_h_sub_path ++ ".d"; + if (comp.verbose_cimport) log.info("processing dep file at {s}", .{dep_sub_path}); + try man.addDepFilePost(cache_dir, dep_sub_path); switch (comp.cache_use) { .whole => |whole| if (whole.cache_manifest) |whole_cache_manifest| { whole.cache_manifest_mutex.lock(); defer whole.cache_manifest_mutex.unlock(); - try whole_cache_manifest.addDepFilePost(zig_cache_tmp_dir, dep_basename); + try whole_cache_manifest.addDepFilePost(cache_dir, dep_sub_path); }, .incremental, .none => {}, } @@ -5749,19 +5694,12 @@ pub fn cImport(comp: *Compilation, c_src: []const u8, owner_mod: *Package.Module const bin_digest = man.finalBin(); const hex_digest = Cache.binToHex(bin_digest); const o_sub_path = "o" ++ fs.path.sep_str ++ hex_digest; - var o_dir = try comp.dirs.local_cache.handle.makeOpenPath(o_sub_path, .{}); - defer o_dir.close(); - var out_zig_file = try o_dir.createFile(cimport_zig_basename, .{}); - defer out_zig_file.close(); + if (comp.verbose_cimport) log.info("renaming {s} to {s}", .{ tmp_sub_path, o_sub_path }); + try renameTmpIntoCache(comp.dirs.local_cache, tmp_sub_path, o_sub_path); - const formatted = try tree.renderAlloc(comp.gpa); - defer comp.gpa.free(formatted); - - try out_zig_file.writeAll(formatted); - - break :digest bin_digest; - } else man.finalBin(); + break :digest .{ bin_digest, false }; + }; if (man.have_exclusive_lock) { // Write the updated manifest. This is a no-op if the manifest is not dirty. Note that it is @@ -5773,9 +5711,9 @@ pub fn cImport(comp: *Compilation, c_src: []const u8, owner_mod: *Package.Module }; } - return CImportResult{ + return .{ .digest = digest, - .cache_hit = actual_hit, + .cache_hit = is_hit, .errors = std.zig.ErrorBundle.empty, }; } @@ -6727,51 +6665,63 @@ pub fn addTranslateCCArgs( out_dep_path: ?[]const u8, owner_mod: *Package.Module, ) !void { + const target = &owner_mod.resolved_target.result; + try argv.appendSlice(&.{ "-x", "c" }); - try comp.addCCArgs(arena, argv, ext, out_dep_path, owner_mod); - // This gives us access to preprocessing entities, presumably at the cost of performance. - try argv.appendSlice(&.{ "-Xclang", "-detailed-preprocessing-record" }); + + const resource_path = try comp.dirs.zig_lib.join(arena, &.{"compiler/aro/include"}); + try argv.appendSlice(&.{ "-isystem", resource_path }); + + try comp.addCommonCCArgs(arena, argv, ext, out_dep_path, owner_mod, .aro); + + try argv.appendSlice(&[_][]const u8{ "-target", try target.zigTriple(arena) }); + + const mcpu = mcpu: { + var buf: std.ArrayListUnmanaged(u8) = .empty; + defer buf.deinit(comp.gpa); + + try buf.print(comp.gpa, "-mcpu={s}", .{target.cpu.model.name}); + + // TODO better serialization https://github.com/ziglang/zig/issues/4584 + const all_features_list = target.cpu.arch.allFeaturesList(); + try argv.ensureUnusedCapacity(all_features_list.len * 4); + for (all_features_list, 0..) |feature, index_usize| { + const index = @as(std.Target.Cpu.Feature.Set.Index, @intCast(index_usize)); + const is_enabled = target.cpu.features.isEnabled(index); + + const plus_or_minus = "-+"[@intFromBool(is_enabled)]; + try buf.print(comp.gpa, "{c}{s}", .{ plus_or_minus, feature.name }); + } + break :mcpu try buf.toOwnedSlice(arena); + }; + try argv.append(mcpu); + + try argv.appendSlice(comp.global_cc_argv); + try argv.appendSlice(owner_mod.cc_argv); } /// Add common C compiler args between translate-c and C object compilation. -pub fn addCCArgs( +fn addCommonCCArgs( comp: *const Compilation, arena: Allocator, argv: *std.array_list.Managed([]const u8), ext: FileExt, out_dep_path: ?[]const u8, mod: *Package.Module, + c_frontend: Config.CFrontend, ) !void { const target = &mod.resolved_target.result; + const is_clang = c_frontend == .clang; - // As of Clang 16.x, it will by default read extra flags from /etc/clang. - // I'm sure the person who implemented this means well, but they have a lot - // to learn about abstractions and where the appropriate boundaries between - // them are. The road to hell is paved with good intentions. Fortunately it - // can be disabled. - try argv.append("--no-default-config"); - - // We don't ever put `-fcolor-diagnostics` or `-fno-color-diagnostics` because in passthrough mode - // we want Clang to infer it, and in normal mode we always want it off, which will be true since - // clang will detect stderr as a pipe rather than a terminal. - if (!comp.clang_passthrough_mode and ext.clangSupportsDiagnostics()) { - // Make stderr more easily parseable. - try argv.append("-fno-caret-diagnostics"); - } - - // We never want clang to invoke the system assembler for anything. So we would want - // this option always enabled. However, it only matters for some targets. To avoid - // "unused parameter" warnings, and to keep CLI spam to a minimum, we only put this - // flag on the command line if it is necessary. - if (target_util.clangMightShellOutForAssembly(target)) { - try argv.append("-integrated-as"); + if (target_util.supports_fpic(target)) { + // PIE needs to go before PIC because Clang interprets `-fno-PIE` to imply `-fno-PIC`, which + // we don't necessarily want. + try argv.append(if (comp.config.pie) "-fPIE" else "-fno-PIE"); + try argv.append(if (mod.pic) "-fPIC" else "-fno-PIC"); } - const llvm_triple = try @import("codegen/llvm.zig").targetTriple(arena, target); - try argv.appendSlice(&[_][]const u8{ "-target", llvm_triple }); - switch (target.os.tag) { - .ios, .macos, .tvos, .watchos => |os| { + .ios, .macos, .tvos, .watchos => |os| if (is_clang) { try argv.ensureUnusedCapacity(2); // Pass the proper -m-version-min argument for darwin. const ver = target.os.version_range.semver.min; @@ -6795,38 +6745,6 @@ pub fn addCCArgs( else => {}, } - if (target.cpu.arch.isArm()) { - try argv.append(if (target.cpu.arch.isThumb()) "-mthumb" else "-mno-thumb"); - } - - if (target_util.llvmMachineAbi(target)) |mabi| { - // Clang's integrated Arm assembler doesn't support `-mabi` yet... - // Clang's FreeBSD driver doesn't support `-mabi` on PPC64 (ELFv2 is used anyway). - if (!(target.cpu.arch.isArm() and (ext == .assembly or ext == .assembly_with_cpp)) and - !(target.cpu.arch.isPowerPC64() and target.os.tag == .freebsd)) - { - try argv.append(try std.fmt.allocPrint(arena, "-mabi={s}", .{mabi})); - } - } - - // We might want to support -mfloat-abi=softfp for Arm and CSKY here in the future. - if (target_util.clangSupportsFloatAbiArg(target)) { - const fabi = @tagName(target.abi.float()); - - try argv.append(switch (target.cpu.arch) { - // For whatever reason, Clang doesn't support `-mfloat-abi` for s390x. - .s390x => try std.fmt.allocPrint(arena, "-m{s}-float", .{fabi}), - else => try std.fmt.allocPrint(arena, "-mfloat-abi={s}", .{fabi}), - }); - } - - if (target_util.supports_fpic(target)) { - // PIE needs to go before PIC because Clang interprets `-fno-PIE` to imply `-fno-PIC`, which - // we don't necessarily want. - try argv.append(if (comp.config.pie) "-fPIE" else "-fno-PIE"); - try argv.append(if (mod.pic) "-fPIC" else "-fno-PIC"); - } - if (comp.mingw_unicode_entry_point) { try argv.append("-municode"); } @@ -6867,45 +6785,6 @@ pub fn addCCArgs( if (ext != .assembly) { try argv.append(if (target.os.tag == .freestanding) "-ffreestanding" else "-fhosted"); - if (target_util.clangSupportsNoImplicitFloatArg(target) and target.abi.float() == .soft) { - try argv.append("-mno-implicit-float"); - } - - if (target_util.hasRedZone(target)) { - try argv.append(if (mod.red_zone) "-mred-zone" else "-mno-red-zone"); - } - - try argv.append(if (mod.omit_frame_pointer) "-fomit-frame-pointer" else "-fno-omit-frame-pointer"); - - const ssp_buf_size = mod.stack_protector; - if (ssp_buf_size != 0) { - try argv.appendSlice(&[_][]const u8{ - "-fstack-protector-strong", - "--param", - try std.fmt.allocPrint(arena, "ssp-buffer-size={d}", .{ssp_buf_size}), - }); - } else { - try argv.append("-fno-stack-protector"); - } - - try argv.append(if (mod.no_builtin) "-fno-builtin" else "-fbuiltin"); - - try argv.append(if (comp.function_sections) "-ffunction-sections" else "-fno-function-sections"); - try argv.append(if (comp.data_sections) "-fdata-sections" else "-fno-data-sections"); - - switch (mod.unwind_tables) { - .none => { - try argv.append("-fno-unwind-tables"); - try argv.append("-fno-asynchronous-unwind-tables"); - }, - .sync => { - // Need to override Clang's convoluted default logic. - try argv.append("-fno-asynchronous-unwind-tables"); - try argv.append("-funwind-tables"); - }, - .async => try argv.append("-fasynchronous-unwind-tables"), - } - try argv.append("-nostdinc"); if (ext == .cpp or ext == .hpp) { @@ -7022,20 +6901,182 @@ pub fn addCCArgs( .mm, .hmm, => { - try argv.append("-fno-spell-checking"); + if (is_clang) { + try argv.append("-fno-spell-checking"); - if (target.os.tag == .windows and target.abi.isGnu()) { - // windows.h has files such as pshpack1.h which do #pragma packing, - // triggering a clang warning. So for this target, we disable this warning. - try argv.append("-Wno-pragma-pack"); + if (target.os.tag == .windows and target.abi.isGnu()) { + // windows.h has files such as pshpack1.h which do #pragma packing, + // triggering a clang warning. So for this target, we disable this warning. + try argv.append("-Wno-pragma-pack"); + } + + if (mod.optimize_mode != .Debug) { + try argv.append("-Werror=date-time"); + } } + }, + else => {}, + } + + // Only compiled files support these flags. + switch (ext) { + .c, + .h, + .cpp, + .hpp, + .m, + .hm, + .mm, + .hmm, + .ll, + .bc, + => { + if (is_clang) { + var san_arg: std.ArrayListUnmanaged(u8) = .empty; + const prefix = "-fsanitize="; + if (mod.sanitize_c != .off) { + if (san_arg.items.len == 0) try san_arg.appendSlice(arena, prefix); + try san_arg.appendSlice(arena, "undefined,"); + } + if (mod.sanitize_thread) { + if (san_arg.items.len == 0) try san_arg.appendSlice(arena, prefix); + try san_arg.appendSlice(arena, "thread,"); + } + if (mod.fuzz) { + if (san_arg.items.len == 0) try san_arg.appendSlice(arena, prefix); + try san_arg.appendSlice(arena, "fuzzer-no-link,"); + } + // Chop off the trailing comma and append to argv. + if (san_arg.pop()) |_| { + try argv.append(san_arg.items); + + switch (mod.sanitize_c) { + .off => {}, + .trap => { + try argv.append("-fsanitize-trap=undefined"); + }, + .full => { + // This check requires implementing the Itanium C++ ABI. + // We would make it `-fsanitize-trap=vptr`, however this check requires + // a full runtime due to the type hashing involved. + try argv.append("-fno-sanitize=vptr"); + + // It is very common, and well-defined, for a pointer on one side of a C ABI + // to have a different but compatible element type. Examples include: + // `char*` vs `uint8_t*` on a system with 8-bit bytes + // `const char*` vs `char*` + // `char*` vs `unsigned char*` + // Without this flag, Clang would invoke UBSAN when such an extern + // function was called. + try argv.append("-fno-sanitize=function"); + + // This is necessary because, by default, Clang instructs LLVM to embed + // a COFF link dependency on `libclang_rt.ubsan_standalone.a` when the + // UBSan runtime is used. + if (target.os.tag == .windows) { + try argv.append("-fno-rtlib-defaultlib"); + } + }, + } + } - if (mod.optimize_mode != .Debug) { - try argv.append("-Werror=date-time"); + if (comp.config.san_cov_trace_pc_guard) { + try argv.append("-fsanitize-coverage=trace-pc-guard"); + } + } + + switch (mod.optimize_mode) { + .Debug => { + // Clang has -Og for compatibility with GCC, but currently it is just equivalent + // to -O1. Besides potentially impairing debugging, -O1/-Og significantly + // increases compile times. + try argv.append("-O0"); + }, + .ReleaseSafe => { + // See the comment in the BuildModeFastRelease case for why we pass -O2 rather + // than -O3 here. + try argv.append("-O2"); + }, + .ReleaseFast => { + // Here we pass -O2 rather than -O3 because, although we do the equivalent of + // -O3 in Zig code, the justification for the difference here is that Zig + // has better detection and prevention of undefined behavior, so -O3 is safer for + // Zig code than it is for C code. Also, C programmers are used to their code + // running in -O2 and thus the -O3 path has been tested less. + try argv.append("-O2"); + }, + .ReleaseSmall => { + try argv.append("-Os"); + }, } }, else => {}, } +} + +/// Add common C compiler args and Clang specific args. +pub fn addCCArgs( + comp: *const Compilation, + arena: Allocator, + argv: *std.array_list.Managed([]const u8), + ext: FileExt, + out_dep_path: ?[]const u8, + mod: *Package.Module, +) !void { + const target = &mod.resolved_target.result; + + // As of Clang 16.x, it will by default read extra flags from /etc/clang. + // I'm sure the person who implemented this means well, but they have a lot + // to learn about abstractions and where the appropriate boundaries between + // them are. The road to hell is paved with good intentions. Fortunately it + // can be disabled. + try argv.append("--no-default-config"); + + // We don't ever put `-fcolor-diagnostics` or `-fno-color-diagnostics` because in passthrough mode + // we want Clang to infer it, and in normal mode we always want it off, which will be true since + // clang will detect stderr as a pipe rather than a terminal. + if (!comp.clang_passthrough_mode and ext.clangSupportsDiagnostics()) { + // Make stderr more easily parseable. + try argv.append("-fno-caret-diagnostics"); + } + + // We never want clang to invoke the system assembler for anything. So we would want + // this option always enabled. However, it only matters for some targets. To avoid + // "unused parameter" warnings, and to keep CLI spam to a minimum, we only put this + // flag on the command line if it is necessary. + if (target_util.clangMightShellOutForAssembly(target)) { + try argv.append("-integrated-as"); + } + + const llvm_triple = try @import("codegen/llvm.zig").targetTriple(arena, target); + try argv.appendSlice(&[_][]const u8{ "-target", llvm_triple }); + + if (target.cpu.arch.isArm()) { + try argv.append(if (target.cpu.arch.isThumb()) "-mthumb" else "-mno-thumb"); + } + + if (target_util.llvmMachineAbi(target)) |mabi| { + // Clang's integrated Arm assembler doesn't support `-mabi` yet... + // Clang's FreeBSD driver doesn't support `-mabi` on PPC64 (ELFv2 is used anyway). + if (!(target.cpu.arch.isArm() and (ext == .assembly or ext == .assembly_with_cpp)) and + !(target.cpu.arch.isPowerPC64() and target.os.tag == .freebsd)) + { + try argv.append(try std.fmt.allocPrint(arena, "-mabi={s}", .{mabi})); + } + } + + // We might want to support -mfloat-abi=softfp for Arm and CSKY here in the future. + if (target_util.clangSupportsFloatAbiArg(target)) { + const fabi = @tagName(target.abi.float()); + + try argv.append(switch (target.cpu.arch) { + // For whatever reason, Clang doesn't support `-mfloat-abi` for s390x. + .s390x => try std.fmt.allocPrint(arena, "-m{s}-float", .{fabi}), + else => try std.fmt.allocPrint(arena, "-mfloat-abi={s}", .{fabi}), + }); + } + + try comp.addCommonCCArgs(arena, argv, ext, out_dep_path, mod, comp.config.c_frontend); // Only assembly files support these flags. switch (ext) { @@ -7111,6 +7152,50 @@ pub fn addCCArgs( else => {}, } + // Non-preprocessed assembly files don't support these flags. + if (ext != .assembly) { + try argv.append(if (target.os.tag == .freestanding) "-ffreestanding" else "-fhosted"); + + if (target_util.clangSupportsNoImplicitFloatArg(target) and target.abi.float() == .soft) { + try argv.append("-mno-implicit-float"); + } + + if (target_util.hasRedZone(target)) { + try argv.append(if (mod.red_zone) "-mred-zone" else "-mno-red-zone"); + } + + try argv.append(if (mod.omit_frame_pointer) "-fomit-frame-pointer" else "-fno-omit-frame-pointer"); + + const ssp_buf_size = mod.stack_protector; + if (ssp_buf_size != 0) { + try argv.appendSlice(&[_][]const u8{ + "-fstack-protector-strong", + "--param", + try std.fmt.allocPrint(arena, "ssp-buffer-size={d}", .{ssp_buf_size}), + }); + } else { + try argv.append("-fno-stack-protector"); + } + + try argv.append(if (mod.no_builtin) "-fno-builtin" else "-fbuiltin"); + + try argv.append(if (comp.function_sections) "-ffunction-sections" else "-fno-function-sections"); + try argv.append(if (comp.data_sections) "-fdata-sections" else "-fno-data-sections"); + + switch (mod.unwind_tables) { + .none => { + try argv.append("-fno-unwind-tables"); + try argv.append("-fno-asynchronous-unwind-tables"); + }, + .sync => { + // Need to override Clang's convoluted default logic. + try argv.append("-fno-asynchronous-unwind-tables"); + try argv.append("-funwind-tables"); + }, + .async => try argv.append("-fasynchronous-unwind-tables"), + } + } + // Only compiled files support these flags. switch (ext) { .c, @@ -7155,85 +7240,6 @@ pub fn addCCArgs( argv.appendAssumeCapacity(arg); } } - - { - var san_arg: std.ArrayListUnmanaged(u8) = .empty; - const prefix = "-fsanitize="; - if (mod.sanitize_c != .off) { - if (san_arg.items.len == 0) try san_arg.appendSlice(arena, prefix); - try san_arg.appendSlice(arena, "undefined,"); - } - if (mod.sanitize_thread) { - if (san_arg.items.len == 0) try san_arg.appendSlice(arena, prefix); - try san_arg.appendSlice(arena, "thread,"); - } - if (mod.fuzz) { - if (san_arg.items.len == 0) try san_arg.appendSlice(arena, prefix); - try san_arg.appendSlice(arena, "fuzzer-no-link,"); - } - // Chop off the trailing comma and append to argv. - if (san_arg.pop()) |_| { - try argv.append(san_arg.items); - - switch (mod.sanitize_c) { - .off => {}, - .trap => { - try argv.append("-fsanitize-trap=undefined"); - }, - .full => { - // This check requires implementing the Itanium C++ ABI. - // We would make it `-fsanitize-trap=vptr`, however this check requires - // a full runtime due to the type hashing involved. - try argv.append("-fno-sanitize=vptr"); - - // It is very common, and well-defined, for a pointer on one side of a C ABI - // to have a different but compatible element type. Examples include: - // `char*` vs `uint8_t*` on a system with 8-bit bytes - // `const char*` vs `char*` - // `char*` vs `unsigned char*` - // Without this flag, Clang would invoke UBSAN when such an extern - // function was called. - try argv.append("-fno-sanitize=function"); - - // This is necessary because, by default, Clang instructs LLVM to embed - // a COFF link dependency on `libclang_rt.ubsan_standalone.a` when the - // UBSan runtime is used. - if (target.os.tag == .windows) { - try argv.append("-fno-rtlib-defaultlib"); - } - }, - } - } - - if (comp.config.san_cov_trace_pc_guard) { - try argv.append("-fsanitize-coverage=trace-pc-guard"); - } - } - - switch (mod.optimize_mode) { - .Debug => { - // Clang has -Og for compatibility with GCC, but currently it is just equivalent - // to -O1. Besides potentially impairing debugging, -O1/-Og significantly - // increases compile times. - try argv.append("-O0"); - }, - .ReleaseSafe => { - // See the comment in the BuildModeFastRelease case for why we pass -O2 rather - // than -O3 here. - try argv.append("-O2"); - }, - .ReleaseFast => { - // Here we pass -O2 rather than -O3 because, although we do the equivalent of - // -O3 in Zig code, the justification for the difference here is that Zig - // has better detection and prevention of undefined behavior, so -O3 is safer for - // Zig code than it is for C code. Also, C programmers are used to their code - // running in -O2 and thus the -O3 path has been tested less. - try argv.append("-O2"); - }, - .ReleaseSmall => { - try argv.append("-Os"); - }, - } }, else => {}, } diff --git a/src/InternPool.zig b/src/InternPool.zig index 5f108e32249c..e8cb7f97c945 100644 --- a/src/InternPool.zig +++ b/src/InternPool.zig @@ -6914,10 +6914,7 @@ pub fn deactivate(ip: *const InternPool) void { /// For debugger access only. const debug_state = struct { - const enable = switch (builtin.zig_backend) { - else => false, - .stage2_x86_64 => !builtin.strip_debug_info, - }; + const enable = false; const enable_checks = enable and !builtin.single_threaded; threadlocal var intern_pool: ?*const InternPool = null; }; diff --git a/src/Sema.zig b/src/Sema.zig index 4d05441a8369..2bf508226ac1 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -5706,10 +5706,6 @@ fn zirCImport(sema: *Sema, parent_block: *Block, inst: Zir.Inst.Index) CompileEr const extra = sema.code.extraData(Zir.Inst.Block, pl_node.payload_index); const body = sema.code.bodySlice(extra.end, extra.data.body_len); - // we check this here to avoid undefined symbols - if (!build_options.have_llvm) - return sema.fail(parent_block, src, "C import unavailable; Zig compiler built without LLVM extensions", .{}); - var c_import_buf = std.array_list.Managed(u8).init(gpa); defer c_import_buf.deinit(); @@ -5734,8 +5730,11 @@ fn zirCImport(sema: *Sema, parent_block: *Block, inst: Zir.Inst.Index) CompileEr _ = try sema.analyzeInlineBody(&child_block, body, inst); - var c_import_res = comp.cImport(c_import_buf.items, parent_block.ownerModule()) catch |err| - return sema.fail(&child_block, src, "C import failed: {s}", .{@errorName(err)}); + const prog_node = zcu.cur_sema_prog_node.start("@cImport", 0); + defer prog_node.end(); + + var c_import_res = comp.cImport(c_import_buf.items, parent_block.ownerModule(), prog_node) catch |err| + return sema.fail(&child_block, src, "C import failed: {t}", .{err}); defer c_import_res.deinit(gpa); if (c_import_res.errors.errorMessageCount() != 0) { diff --git a/src/Zcu.zig b/src/Zcu.zig index 53da90a9c22b..e5f467586ba7 100644 --- a/src/Zcu.zig +++ b/src/Zcu.zig @@ -32,7 +32,6 @@ const Sema = @import("Sema.zig"); const target_util = @import("target.zig"); const build_options = @import("build_options"); const isUpDir = @import("introspect.zig").isUpDir; -const clang = @import("clang.zig"); const InternPool = @import("InternPool.zig"); const Alignment = InternPool.Alignment; const AnalUnit = InternPool.AnalUnit; diff --git a/src/clang.zig b/src/clang.zig deleted file mode 100644 index 8b3a7db6d276..000000000000 --- a/src/clang.zig +++ /dev/null @@ -1,2261 +0,0 @@ -const std = @import("std"); -pub const builtin = @import("builtin"); - -pub const SourceLocation = extern struct { - ID: c_uint, - - pub const eq = ZigClangSourceLocation_eq; - extern fn ZigClangSourceLocation_eq(a: SourceLocation, b: SourceLocation) bool; -}; - -pub const QualType = extern struct { - ptr: ?*anyopaque, - - pub const getCanonicalType = ZigClangQualType_getCanonicalType; - extern fn ZigClangQualType_getCanonicalType(QualType) QualType; - - pub const getTypePtr = ZigClangQualType_getTypePtr; - extern fn ZigClangQualType_getTypePtr(QualType) *const Type; - - pub const getTypeClass = ZigClangQualType_getTypeClass; - extern fn ZigClangQualType_getTypeClass(QualType) TypeClass; - - pub const addConst = ZigClangQualType_addConst; - extern fn ZigClangQualType_addConst(*QualType) void; - - pub const eq = ZigClangQualType_eq; - extern fn ZigClangQualType_eq(QualType, arg1: QualType) bool; - - pub const isConstQualified = ZigClangQualType_isConstQualified; - extern fn ZigClangQualType_isConstQualified(QualType) bool; - - pub const isVolatileQualified = ZigClangQualType_isVolatileQualified; - extern fn ZigClangQualType_isVolatileQualified(QualType) bool; - - pub const isRestrictQualified = ZigClangQualType_isRestrictQualified; - extern fn ZigClangQualType_isRestrictQualified(QualType) bool; -}; - -pub const APValueLValueBase = extern struct { - Ptr: ?*anyopaque, - CallIndex: c_uint, - Version: c_uint, - - pub const dyn_cast_Expr = ZigClangAPValueLValueBase_dyn_cast_Expr; - extern fn ZigClangAPValueLValueBase_dyn_cast_Expr(APValueLValueBase) ?*const Expr; -}; - -pub const APValueKind = enum(c_int) { - None, - Indeterminate, - Int, - Float, - FixedPoint, - ComplexInt, - ComplexFloat, - LValue, - Vector, - Array, - Struct, - Union, - MemberPointer, - AddrLabelDiff, -}; - -pub const APValue = extern struct { - Kind: APValueKind align(if (builtin.cpu.arch == .x86 and builtin.os.tag != .windows) 4 else 8), - Data: if (builtin.cpu.arch == .x86 and builtin.os.tag != .windows) [44]u8 else [52]u8, - - pub const getKind = ZigClangAPValue_getKind; - extern fn ZigClangAPValue_getKind(*const APValue) APValueKind; - - pub const getInt = ZigClangAPValue_getInt; - extern fn ZigClangAPValue_getInt(*const APValue) *const APSInt; - - pub const getArrayInitializedElts = ZigClangAPValue_getArrayInitializedElts; - extern fn ZigClangAPValue_getArrayInitializedElts(*const APValue) c_uint; - - pub const getArraySize = ZigClangAPValue_getArraySize; - extern fn ZigClangAPValue_getArraySize(*const APValue) c_uint; - - pub const getLValueBase = ZigClangAPValue_getLValueBase; - extern fn ZigClangAPValue_getLValueBase(*const APValue) APValueLValueBase; -}; - -pub const ExprEvalResult = extern struct { - HasSideEffects: bool, - HasUndefinedBehavior: bool, - SmallVectorImpl: ?*anyopaque, - Val: APValue, -}; - -pub const AbstractConditionalOperator = opaque { - pub const getCond = ZigClangAbstractConditionalOperator_getCond; - extern fn ZigClangAbstractConditionalOperator_getCond(*const AbstractConditionalOperator) *const Expr; - - pub const getTrueExpr = ZigClangAbstractConditionalOperator_getTrueExpr; - extern fn ZigClangAbstractConditionalOperator_getTrueExpr(*const AbstractConditionalOperator) *const Expr; - - pub const getFalseExpr = ZigClangAbstractConditionalOperator_getFalseExpr; - extern fn ZigClangAbstractConditionalOperator_getFalseExpr(*const AbstractConditionalOperator) *const Expr; -}; - -pub const APFloat = opaque { - pub const toString = ZigClangAPFloat_toString; - extern fn ZigClangAPFloat_toString(*const APFloat, precision: c_uint, maxPadding: c_uint, truncateZero: bool) [*:0]const u8; -}; - -pub const APFloatBaseSemantics = enum(c_int) { - IEEEhalf, - BFloat, - IEEEsingle, - IEEEdouble, - IEEEquad, - PPCDoubleDouble, - PPCDoubleDoubleLegacy, - Float8E5M2, - Float8E5M2FNUZ, - Float8E4M3, - Float8E4M3FN, - Float8E4M3FNUZ, - Float8E4M3B11FNUZ, - Float8E3M4, - FloatTF32, - Float8E8M0FNU, - Float6E3M2FN, - Float6E2M3FN, - Float4E2M1FN, - x87DoubleExtended, -}; - -pub const APInt = opaque { - pub const free = ZigClangAPInt_free; - extern fn ZigClangAPInt_free(*const APInt) void; - - pub fn getLimitedValue(self: *const APInt, comptime T: type) T { - return @as(T, @truncate(ZigClangAPInt_getLimitedValue(self, std.math.maxInt(T)))); - } - extern fn ZigClangAPInt_getLimitedValue(*const APInt, limit: u64) u64; -}; - -pub const APSInt = opaque { - pub const isSigned = ZigClangAPSInt_isSigned; - extern fn ZigClangAPSInt_isSigned(*const APSInt) bool; - - pub const isNegative = ZigClangAPSInt_isNegative; - extern fn ZigClangAPSInt_isNegative(*const APSInt) bool; - - pub const negate = ZigClangAPSInt_negate; - extern fn ZigClangAPSInt_negate(*const APSInt) *const APSInt; - - pub const free = ZigClangAPSInt_free; - extern fn ZigClangAPSInt_free(*const APSInt) void; - - pub const getRawData = ZigClangAPSInt_getRawData; - extern fn ZigClangAPSInt_getRawData(*const APSInt) [*:0]const u64; - - pub const getNumWords = ZigClangAPSInt_getNumWords; - extern fn ZigClangAPSInt_getNumWords(*const APSInt) c_uint; - - pub const lessThanEqual = ZigClangAPSInt_lessThanEqual; - extern fn ZigClangAPSInt_lessThanEqual(*const APSInt, rhs: u64) bool; -}; - -pub const ASTContext = opaque { - pub const getPointerType = ZigClangASTContext_getPointerType; - extern fn ZigClangASTContext_getPointerType(*const ASTContext, T: QualType) QualType; -}; - -pub const ASTUnit = opaque { - pub const delete = ZigClangASTUnit_delete; - extern fn ZigClangASTUnit_delete(*ASTUnit) void; - - pub const getASTContext = ZigClangASTUnit_getASTContext; - extern fn ZigClangASTUnit_getASTContext(*ASTUnit) *ASTContext; - - pub const getSourceManager = ZigClangASTUnit_getSourceManager; - extern fn ZigClangASTUnit_getSourceManager(*ASTUnit) *SourceManager; - - pub const visitLocalTopLevelDecls = ZigClangASTUnit_visitLocalTopLevelDecls; - extern fn ZigClangASTUnit_visitLocalTopLevelDecls( - *ASTUnit, - context: ?*anyopaque, - Fn: ?*const fn (?*anyopaque, *const Decl) callconv(.c) bool, - ) bool; - - pub const getLocalPreprocessingEntities_begin = ZigClangASTUnit_getLocalPreprocessingEntities_begin; - extern fn ZigClangASTUnit_getLocalPreprocessingEntities_begin(*ASTUnit) PreprocessingRecord.iterator; - - pub const getLocalPreprocessingEntities_end = ZigClangASTUnit_getLocalPreprocessingEntities_end; - extern fn ZigClangASTUnit_getLocalPreprocessingEntities_end(*ASTUnit) PreprocessingRecord.iterator; -}; - -pub const ArraySubscriptExpr = opaque { - pub const getBase = ZigClangArraySubscriptExpr_getBase; - extern fn ZigClangArraySubscriptExpr_getBase(*const ArraySubscriptExpr) *const Expr; - - pub const getIdx = ZigClangArraySubscriptExpr_getIdx; - extern fn ZigClangArraySubscriptExpr_getIdx(*const ArraySubscriptExpr) *const Expr; -}; - -pub const ArrayType = opaque { - pub const getElementType = ZigClangArrayType_getElementType; - extern fn ZigClangArrayType_getElementType(*const ArrayType) QualType; -}; - -pub const ASTRecordLayout = opaque { - pub const getFieldOffset = ZigClangASTRecordLayout_getFieldOffset; - extern fn ZigClangASTRecordLayout_getFieldOffset(*const ASTRecordLayout, c_uint) u64; - - pub const getAlignment = ZigClangASTRecordLayout_getAlignment; - extern fn ZigClangASTRecordLayout_getAlignment(*const ASTRecordLayout) i64; -}; - -pub const AttributedType = opaque { - pub const getEquivalentType = ZigClangAttributedType_getEquivalentType; - extern fn ZigClangAttributedType_getEquivalentType(*const AttributedType) QualType; -}; - -pub const BinaryOperator = opaque { - pub const getOpcode = ZigClangBinaryOperator_getOpcode; - extern fn ZigClangBinaryOperator_getOpcode(*const BinaryOperator) BO; - - pub const getBeginLoc = ZigClangBinaryOperator_getBeginLoc; - extern fn ZigClangBinaryOperator_getBeginLoc(*const BinaryOperator) SourceLocation; - - pub const getLHS = ZigClangBinaryOperator_getLHS; - extern fn ZigClangBinaryOperator_getLHS(*const BinaryOperator) *const Expr; - - pub const getRHS = ZigClangBinaryOperator_getRHS; - extern fn ZigClangBinaryOperator_getRHS(*const BinaryOperator) *const Expr; - - pub const getType = ZigClangBinaryOperator_getType; - extern fn ZigClangBinaryOperator_getType(*const BinaryOperator) QualType; -}; - -pub const BinaryConditionalOperator = opaque {}; - -pub const BreakStmt = opaque {}; - -pub const BuiltinType = opaque { - pub const getKind = ZigClangBuiltinType_getKind; - extern fn ZigClangBuiltinType_getKind(*const BuiltinType) BuiltinTypeKind; -}; - -pub const CStyleCastExpr = opaque { - pub const getBeginLoc = ZigClangCStyleCastExpr_getBeginLoc; - extern fn ZigClangCStyleCastExpr_getBeginLoc(*const CStyleCastExpr) SourceLocation; - - pub const getSubExpr = ZigClangCStyleCastExpr_getSubExpr; - extern fn ZigClangCStyleCastExpr_getSubExpr(*const CStyleCastExpr) *const Expr; - - pub const getType = ZigClangCStyleCastExpr_getType; - extern fn ZigClangCStyleCastExpr_getType(*const CStyleCastExpr) QualType; -}; - -pub const CallExpr = opaque { - pub const getCallee = ZigClangCallExpr_getCallee; - extern fn ZigClangCallExpr_getCallee(*const CallExpr) *const Expr; - - pub const getNumArgs = ZigClangCallExpr_getNumArgs; - extern fn ZigClangCallExpr_getNumArgs(*const CallExpr) c_uint; - - pub const getArgs = ZigClangCallExpr_getArgs; - extern fn ZigClangCallExpr_getArgs(*const CallExpr) [*]const *const Expr; -}; - -pub const CaseStmt = opaque { - pub const getLHS = ZigClangCaseStmt_getLHS; - extern fn ZigClangCaseStmt_getLHS(*const CaseStmt) *const Expr; - - pub const getRHS = ZigClangCaseStmt_getRHS; - extern fn ZigClangCaseStmt_getRHS(*const CaseStmt) ?*const Expr; - - pub const getBeginLoc = ZigClangCaseStmt_getBeginLoc; - extern fn ZigClangCaseStmt_getBeginLoc(*const CaseStmt) SourceLocation; - - pub const getSubStmt = ZigClangCaseStmt_getSubStmt; - extern fn ZigClangCaseStmt_getSubStmt(*const CaseStmt) *const Stmt; -}; - -pub const CastExpr = opaque { - pub const getCastKind = ZigClangCastExpr_getCastKind; - extern fn ZigClangCastExpr_getCastKind(*const CastExpr) CK; - - pub const getTargetFieldForToUnionCast = ZigClangCastExpr_getTargetFieldForToUnionCast; - extern fn ZigClangCastExpr_getTargetFieldForToUnionCast(*const CastExpr, QualType, QualType) ?*const FieldDecl; -}; - -pub const CharacterLiteral = opaque { - pub const getBeginLoc = ZigClangCharacterLiteral_getBeginLoc; - extern fn ZigClangCharacterLiteral_getBeginLoc(*const CharacterLiteral) SourceLocation; - - pub const getKind = ZigClangCharacterLiteral_getKind; - extern fn ZigClangCharacterLiteral_getKind(*const CharacterLiteral) CharacterLiteralKind; - - pub const getValue = ZigClangCharacterLiteral_getValue; - extern fn ZigClangCharacterLiteral_getValue(*const CharacterLiteral) c_uint; -}; - -pub const ChooseExpr = opaque { - pub const getChosenSubExpr = ZigClangChooseExpr_getChosenSubExpr; - extern fn ZigClangChooseExpr_getChosenSubExpr(*const ChooseExpr) *const Expr; -}; - -pub const CompoundAssignOperator = opaque { - pub const getType = ZigClangCompoundAssignOperator_getType; - extern fn ZigClangCompoundAssignOperator_getType(*const CompoundAssignOperator) QualType; - - pub const getComputationLHSType = ZigClangCompoundAssignOperator_getComputationLHSType; - extern fn ZigClangCompoundAssignOperator_getComputationLHSType(*const CompoundAssignOperator) QualType; - - pub const getComputationResultType = ZigClangCompoundAssignOperator_getComputationResultType; - extern fn ZigClangCompoundAssignOperator_getComputationResultType(*const CompoundAssignOperator) QualType; - - pub const getBeginLoc = ZigClangCompoundAssignOperator_getBeginLoc; - extern fn ZigClangCompoundAssignOperator_getBeginLoc(*const CompoundAssignOperator) SourceLocation; - - pub const getOpcode = ZigClangCompoundAssignOperator_getOpcode; - extern fn ZigClangCompoundAssignOperator_getOpcode(*const CompoundAssignOperator) BO; - - pub const getLHS = ZigClangCompoundAssignOperator_getLHS; - extern fn ZigClangCompoundAssignOperator_getLHS(*const CompoundAssignOperator) *const Expr; - - pub const getRHS = ZigClangCompoundAssignOperator_getRHS; - extern fn ZigClangCompoundAssignOperator_getRHS(*const CompoundAssignOperator) *const Expr; -}; - -pub const CompoundLiteralExpr = opaque { - pub const getInitializer = ZigClangCompoundLiteralExpr_getInitializer; - extern fn ZigClangCompoundLiteralExpr_getInitializer(*const CompoundLiteralExpr) *const Expr; -}; - -pub const CompoundStmt = opaque { - pub const body_begin = ZigClangCompoundStmt_body_begin; - extern fn ZigClangCompoundStmt_body_begin(*const CompoundStmt) ConstBodyIterator; - - pub const body_end = ZigClangCompoundStmt_body_end; - extern fn ZigClangCompoundStmt_body_end(*const CompoundStmt) ConstBodyIterator; - - pub const ConstBodyIterator = [*]const *Stmt; -}; - -pub const ConditionalOperator = opaque {}; - -pub const ConstantArrayType = opaque { - pub const getElementType = ZigClangConstantArrayType_getElementType; - extern fn ZigClangConstantArrayType_getElementType(*const ConstantArrayType) QualType; - - pub const getSize = ZigClangConstantArrayType_getSize; - extern fn ZigClangConstantArrayType_getSize(*const ConstantArrayType, **const APInt) void; -}; - -pub const ConstantExpr = opaque {}; - -pub const ContinueStmt = opaque {}; - -pub const ConvertVectorExpr = opaque { - pub const getSrcExpr = ZigClangConvertVectorExpr_getSrcExpr; - extern fn ZigClangConvertVectorExpr_getSrcExpr(*const ConvertVectorExpr) *const Expr; - - pub const getTypeSourceInfo_getType = ZigClangConvertVectorExpr_getTypeSourceInfo_getType; - extern fn ZigClangConvertVectorExpr_getTypeSourceInfo_getType(*const ConvertVectorExpr) QualType; -}; - -pub const DecayedType = opaque { - pub const getDecayedType = ZigClangDecayedType_getDecayedType; - extern fn ZigClangDecayedType_getDecayedType(*const DecayedType) QualType; -}; - -pub const Decl = opaque { - pub const getLocation = ZigClangDecl_getLocation; - extern fn ZigClangDecl_getLocation(*const Decl) SourceLocation; - - pub const castToNamedDecl = ZigClangDecl_castToNamedDecl; - extern fn ZigClangDecl_castToNamedDecl(decl: *const Decl) ?*const NamedDecl; - - pub const getKind = ZigClangDecl_getKind; - extern fn ZigClangDecl_getKind(decl: *const Decl) DeclKind; - - pub const getDeclKindName = ZigClangDecl_getDeclKindName; - extern fn ZigClangDecl_getDeclKindName(decl: *const Decl) [*:0]const u8; -}; - -pub const DeclRefExpr = opaque { - pub const getDecl = ZigClangDeclRefExpr_getDecl; - extern fn ZigClangDeclRefExpr_getDecl(*const DeclRefExpr) *const ValueDecl; - - pub const getFoundDecl = ZigClangDeclRefExpr_getFoundDecl; - extern fn ZigClangDeclRefExpr_getFoundDecl(*const DeclRefExpr) *const NamedDecl; -}; - -pub const DeclStmt = opaque { - pub const decl_begin = ZigClangDeclStmt_decl_begin; - extern fn ZigClangDeclStmt_decl_begin(*const DeclStmt) const_decl_iterator; - - pub const decl_end = ZigClangDeclStmt_decl_end; - extern fn ZigClangDeclStmt_decl_end(*const DeclStmt) const_decl_iterator; - - pub const const_decl_iterator = [*]const *Decl; -}; - -pub const DefaultStmt = opaque { - pub const getSubStmt = ZigClangDefaultStmt_getSubStmt; - extern fn ZigClangDefaultStmt_getSubStmt(*const DefaultStmt) *const Stmt; -}; - -pub const DiagnosticOptions = opaque {}; - -pub const DiagnosticsEngine = opaque {}; - -pub const DoStmt = opaque { - pub const getCond = ZigClangDoStmt_getCond; - extern fn ZigClangDoStmt_getCond(*const DoStmt) *const Expr; - - pub const getBody = ZigClangDoStmt_getBody; - extern fn ZigClangDoStmt_getBody(*const DoStmt) *const Stmt; -}; - -pub const ElaboratedType = opaque { - pub const getNamedType = ZigClangElaboratedType_getNamedType; - extern fn ZigClangElaboratedType_getNamedType(*const ElaboratedType) QualType; -}; - -pub const EnumConstantDecl = opaque { - pub const getInitVal = ZigClangEnumConstantDecl_getInitVal; - extern fn ZigClangEnumConstantDecl_getInitVal(*const EnumConstantDecl) *const APSInt; -}; - -pub const EnumDecl = opaque { - pub const getCanonicalDecl = ZigClangEnumDecl_getCanonicalDecl; - extern fn ZigClangEnumDecl_getCanonicalDecl(*const EnumDecl) ?*const TagDecl; - - pub const getIntegerType = ZigClangEnumDecl_getIntegerType; - extern fn ZigClangEnumDecl_getIntegerType(*const EnumDecl) QualType; - - pub const getDefinition = ZigClangEnumDecl_getDefinition; - extern fn ZigClangEnumDecl_getDefinition(*const EnumDecl) ?*const EnumDecl; - - pub const getLocation = ZigClangEnumDecl_getLocation; - extern fn ZigClangEnumDecl_getLocation(*const EnumDecl) SourceLocation; - - pub const enumerator_begin = ZigClangEnumDecl_enumerator_begin; - extern fn ZigClangEnumDecl_enumerator_begin(*const EnumDecl) enumerator_iterator; - - pub const enumerator_end = ZigClangEnumDecl_enumerator_end; - extern fn ZigClangEnumDecl_enumerator_end(*const EnumDecl) enumerator_iterator; - - pub const enumerator_iterator = extern struct { - ptr: *anyopaque, - - pub const next = ZigClangEnumDecl_enumerator_iterator_next; - extern fn ZigClangEnumDecl_enumerator_iterator_next(enumerator_iterator) enumerator_iterator; - - pub const deref = ZigClangEnumDecl_enumerator_iterator_deref; - extern fn ZigClangEnumDecl_enumerator_iterator_deref(enumerator_iterator) *const EnumConstantDecl; - - pub const neq = ZigClangEnumDecl_enumerator_iterator_neq; - extern fn ZigClangEnumDecl_enumerator_iterator_neq(enumerator_iterator, enumerator_iterator) bool; - }; -}; - -pub const EnumType = opaque { - pub const getDecl = ZigClangEnumType_getDecl; - extern fn ZigClangEnumType_getDecl(*const EnumType) *const EnumDecl; -}; - -pub const Expr = opaque { - pub const getStmtClass = ZigClangExpr_getStmtClass; - extern fn ZigClangExpr_getStmtClass(*const Expr) StmtClass; - - pub const getType = ZigClangExpr_getType; - extern fn ZigClangExpr_getType(*const Expr) QualType; - - pub const getBeginLoc = ZigClangExpr_getBeginLoc; - extern fn ZigClangExpr_getBeginLoc(*const Expr) SourceLocation; - - pub const evaluateAsConstantExpr = ZigClangExpr_EvaluateAsConstantExpr; - extern fn ZigClangExpr_EvaluateAsConstantExpr(*const Expr, *ExprEvalResult, Expr_ConstantExprKind, *const ASTContext) bool; - - pub const castToStringLiteral = ZigClangExpr_castToStringLiteral; - extern fn ZigClangExpr_castToStringLiteral(*const Expr) ?*const StringLiteral; -}; - -pub const FieldDecl = opaque { - pub const getCanonicalDecl = ZigClangFieldDecl_getCanonicalDecl; - extern fn ZigClangFieldDecl_getCanonicalDecl(*const FieldDecl) ?*const FieldDecl; - - pub const getAlignedAttribute = ZigClangFieldDecl_getAlignedAttribute; - extern fn ZigClangFieldDecl_getAlignedAttribute(*const FieldDecl, *const ASTContext) c_uint; - - pub const getPackedAttribute = ZigClangFieldDecl_getPackedAttribute; - extern fn ZigClangFieldDecl_getPackedAttribute(*const FieldDecl) bool; - - pub const isAnonymousStructOrUnion = ZigClangFieldDecl_isAnonymousStructOrUnion; - extern fn ZigClangFieldDecl_isAnonymousStructOrUnion(*const FieldDecl) bool; - - pub const isBitField = ZigClangFieldDecl_isBitField; - extern fn ZigClangFieldDecl_isBitField(*const FieldDecl) bool; - - pub const getType = ZigClangFieldDecl_getType; - extern fn ZigClangFieldDecl_getType(*const FieldDecl) QualType; - - pub const getLocation = ZigClangFieldDecl_getLocation; - extern fn ZigClangFieldDecl_getLocation(*const FieldDecl) SourceLocation; - - pub const getParent = ZigClangFieldDecl_getParent; - extern fn ZigClangFieldDecl_getParent(*const FieldDecl) ?*const RecordDecl; - - pub const getFieldIndex = ZigClangFieldDecl_getFieldIndex; - extern fn ZigClangFieldDecl_getFieldIndex(*const FieldDecl) c_uint; -}; - -pub const FileID = opaque {}; - -pub const FloatingLiteral = opaque { - pub const getValueAsApproximateDouble = ZigClangFloatingLiteral_getValueAsApproximateDouble; - extern fn ZigClangFloatingLiteral_getValueAsApproximateDouble(*const FloatingLiteral) f64; - - pub const getValueAsApproximateQuadBits = ZigClangFloatingLiteral_getValueAsApproximateQuadBits; - extern fn ZigClangFloatingLiteral_getValueAsApproximateQuadBits(*const FloatingLiteral, low: *u64, high: *u64) void; - - pub const getBeginLoc = ZigClangFloatingLiteral_getBeginLoc; - extern fn ZigClangFloatingLiteral_getBeginLoc(*const FloatingLiteral) SourceLocation; - - pub const getRawSemantics = ZigClangFloatingLiteral_getRawSemantics; - extern fn ZigClangFloatingLiteral_getRawSemantics(*const FloatingLiteral) APFloatBaseSemantics; -}; - -pub const ForStmt = opaque { - pub const getInit = ZigClangForStmt_getInit; - extern fn ZigClangForStmt_getInit(*const ForStmt) ?*const Stmt; - - pub const getCond = ZigClangForStmt_getCond; - extern fn ZigClangForStmt_getCond(*const ForStmt) ?*const Expr; - - pub const getInc = ZigClangForStmt_getInc; - extern fn ZigClangForStmt_getInc(*const ForStmt) ?*const Expr; - - pub const getBody = ZigClangForStmt_getBody; - extern fn ZigClangForStmt_getBody(*const ForStmt) *const Stmt; -}; - -pub const FullSourceLoc = opaque {}; - -pub const FunctionDecl = opaque { - pub const getType = ZigClangFunctionDecl_getType; - extern fn ZigClangFunctionDecl_getType(*const FunctionDecl) QualType; - - pub const getLocation = ZigClangFunctionDecl_getLocation; - extern fn ZigClangFunctionDecl_getLocation(*const FunctionDecl) SourceLocation; - - pub const hasBody = ZigClangFunctionDecl_hasBody; - extern fn ZigClangFunctionDecl_hasBody(*const FunctionDecl) bool; - - pub const getStorageClass = ZigClangFunctionDecl_getStorageClass; - extern fn ZigClangFunctionDecl_getStorageClass(*const FunctionDecl) StorageClass; - - pub const getParamDecl = ZigClangFunctionDecl_getParamDecl; - extern fn ZigClangFunctionDecl_getParamDecl(*const FunctionDecl, i: c_uint) *const ParmVarDecl; - - pub const getBody = ZigClangFunctionDecl_getBody; - extern fn ZigClangFunctionDecl_getBody(*const FunctionDecl) *const Stmt; - - pub const doesDeclarationForceExternallyVisibleDefinition = ZigClangFunctionDecl_doesDeclarationForceExternallyVisibleDefinition; - extern fn ZigClangFunctionDecl_doesDeclarationForceExternallyVisibleDefinition(*const FunctionDecl) bool; - - pub const isThisDeclarationADefinition = ZigClangFunctionDecl_isThisDeclarationADefinition; - extern fn ZigClangFunctionDecl_isThisDeclarationADefinition(*const FunctionDecl) bool; - - pub const doesThisDeclarationHaveABody = ZigClangFunctionDecl_doesThisDeclarationHaveABody; - extern fn ZigClangFunctionDecl_doesThisDeclarationHaveABody(*const FunctionDecl) bool; - - pub const isInlineSpecified = ZigClangFunctionDecl_isInlineSpecified; - extern fn ZigClangFunctionDecl_isInlineSpecified(*const FunctionDecl) bool; - - pub const hasAlwaysInlineAttr = ZigClangFunctionDecl_hasAlwaysInlineAttr; - extern fn ZigClangFunctionDecl_hasAlwaysInlineAttr(*const FunctionDecl) bool; - - pub const isDefined = ZigClangFunctionDecl_isDefined; - extern fn ZigClangFunctionDecl_isDefined(*const FunctionDecl) bool; - - pub const getDefinition = ZigClangFunctionDecl_getDefinition; - extern fn ZigClangFunctionDecl_getDefinition(*const FunctionDecl) ?*const FunctionDecl; - - pub const getSectionAttribute = ZigClangFunctionDecl_getSectionAttribute; - extern fn ZigClangFunctionDecl_getSectionAttribute(*const FunctionDecl, len: *usize) ?[*]const u8; - - pub const getCanonicalDecl = ZigClangFunctionDecl_getCanonicalDecl; - extern fn ZigClangFunctionDecl_getCanonicalDecl(*const FunctionDecl) ?*const FunctionDecl; - - pub const getAlignedAttribute = ZigClangFunctionDecl_getAlignedAttribute; - extern fn ZigClangFunctionDecl_getAlignedAttribute(*const FunctionDecl, *const ASTContext) c_uint; -}; - -pub const FunctionProtoType = opaque { - pub const isVariadic = ZigClangFunctionProtoType_isVariadic; - extern fn ZigClangFunctionProtoType_isVariadic(*const FunctionProtoType) bool; - - pub const getNumParams = ZigClangFunctionProtoType_getNumParams; - extern fn ZigClangFunctionProtoType_getNumParams(*const FunctionProtoType) c_uint; - - pub const getParamType = ZigClangFunctionProtoType_getParamType; - extern fn ZigClangFunctionProtoType_getParamType(*const FunctionProtoType, i: c_uint) QualType; - - pub const getReturnType = ZigClangFunctionProtoType_getReturnType; - extern fn ZigClangFunctionProtoType_getReturnType(*const FunctionProtoType) QualType; -}; - -pub const FunctionType = opaque { - pub const getNoReturnAttr = ZigClangFunctionType_getNoReturnAttr; - extern fn ZigClangFunctionType_getNoReturnAttr(*const FunctionType) bool; - - pub const getCallConv = ZigClangFunctionType_getCallConv; - extern fn ZigClangFunctionType_getCallConv(*const FunctionType) CallingConv; - - pub const getReturnType = ZigClangFunctionType_getReturnType; - extern fn ZigClangFunctionType_getReturnType(*const FunctionType) QualType; -}; - -pub const GenericSelectionExpr = opaque { - pub const getResultExpr = ZigClangGenericSelectionExpr_getResultExpr; - extern fn ZigClangGenericSelectionExpr_getResultExpr(*const GenericSelectionExpr) *const Expr; -}; - -pub const IfStmt = opaque { - pub const getThen = ZigClangIfStmt_getThen; - extern fn ZigClangIfStmt_getThen(*const IfStmt) *const Stmt; - - pub const getElse = ZigClangIfStmt_getElse; - extern fn ZigClangIfStmt_getElse(*const IfStmt) ?*const Stmt; - - pub const getCond = ZigClangIfStmt_getCond; - extern fn ZigClangIfStmt_getCond(*const IfStmt) *const Stmt; -}; - -pub const ImplicitCastExpr = opaque { - pub const getBeginLoc = ZigClangImplicitCastExpr_getBeginLoc; - extern fn ZigClangImplicitCastExpr_getBeginLoc(*const ImplicitCastExpr) SourceLocation; - - pub const getCastKind = ZigClangImplicitCastExpr_getCastKind; - extern fn ZigClangImplicitCastExpr_getCastKind(*const ImplicitCastExpr) CK; - - pub const getSubExpr = ZigClangImplicitCastExpr_getSubExpr; - extern fn ZigClangImplicitCastExpr_getSubExpr(*const ImplicitCastExpr) *const Expr; -}; - -pub const IncompleteArrayType = opaque { - pub const getElementType = ZigClangIncompleteArrayType_getElementType; - extern fn ZigClangIncompleteArrayType_getElementType(*const IncompleteArrayType) QualType; -}; - -pub const IntegerLiteral = opaque { - pub const EvaluateAsInt = ZigClangIntegerLiteral_EvaluateAsInt; - extern fn ZigClangIntegerLiteral_EvaluateAsInt(*const IntegerLiteral, *ExprEvalResult, *const ASTContext) bool; - - pub const getBeginLoc = ZigClangIntegerLiteral_getBeginLoc; - extern fn ZigClangIntegerLiteral_getBeginLoc(*const IntegerLiteral) SourceLocation; - - pub const getSignum = ZigClangIntegerLiteral_getSignum; - extern fn ZigClangIntegerLiteral_getSignum(*const IntegerLiteral, *c_int, *const ASTContext) bool; -}; - -/// This is just used as a namespace for a static method on clang's Lexer class; we don't directly -/// deal with Lexer objects -pub const Lexer = struct { - pub const getLocForEndOfToken = ZigClangLexer_getLocForEndOfToken; - extern fn ZigClangLexer_getLocForEndOfToken(SourceLocation, *const SourceManager, *const ASTUnit) SourceLocation; -}; - -pub const MacroDefinitionRecord = opaque { - pub const getName_getNameStart = ZigClangMacroDefinitionRecord_getName_getNameStart; - extern fn ZigClangMacroDefinitionRecord_getName_getNameStart(*const MacroDefinitionRecord) [*:0]const u8; - - pub const getSourceRange_getBegin = ZigClangMacroDefinitionRecord_getSourceRange_getBegin; - extern fn ZigClangMacroDefinitionRecord_getSourceRange_getBegin(*const MacroDefinitionRecord) SourceLocation; - - pub const getSourceRange_getEnd = ZigClangMacroDefinitionRecord_getSourceRange_getEnd; - extern fn ZigClangMacroDefinitionRecord_getSourceRange_getEnd(*const MacroDefinitionRecord) SourceLocation; -}; - -pub const MacroQualifiedType = opaque { - pub const getModifiedType = ZigClangMacroQualifiedType_getModifiedType; - extern fn ZigClangMacroQualifiedType_getModifiedType(*const MacroQualifiedType) QualType; -}; - -pub const TypeOfType = opaque { - pub const getUnmodifiedType = ZigClangTypeOfType_getUnmodifiedType; - extern fn ZigClangTypeOfType_getUnmodifiedType(*const TypeOfType) QualType; -}; - -pub const TypeOfExprType = opaque { - pub const getUnderlyingExpr = ZigClangTypeOfExprType_getUnderlyingExpr; - extern fn ZigClangTypeOfExprType_getUnderlyingExpr(*const TypeOfExprType) *const Expr; -}; - -pub const OffsetOfNode = opaque { - pub const getKind = ZigClangOffsetOfNode_getKind; - extern fn ZigClangOffsetOfNode_getKind(*const OffsetOfNode) OffsetOfNode_Kind; - - pub const getArrayExprIndex = ZigClangOffsetOfNode_getArrayExprIndex; - extern fn ZigClangOffsetOfNode_getArrayExprIndex(*const OffsetOfNode) c_uint; - - pub const getField = ZigClangOffsetOfNode_getField; - extern fn ZigClangOffsetOfNode_getField(*const OffsetOfNode) *FieldDecl; -}; - -pub const OffsetOfExpr = opaque { - pub const getNumComponents = ZigClangOffsetOfExpr_getNumComponents; - extern fn ZigClangOffsetOfExpr_getNumComponents(*const OffsetOfExpr) c_uint; - - pub const getNumExpressions = ZigClangOffsetOfExpr_getNumExpressions; - extern fn ZigClangOffsetOfExpr_getNumExpressions(*const OffsetOfExpr) c_uint; - - pub const getIndexExpr = ZigClangOffsetOfExpr_getIndexExpr; - extern fn ZigClangOffsetOfExpr_getIndexExpr(*const OffsetOfExpr, idx: c_uint) *const Expr; - - pub const getComponent = ZigClangOffsetOfExpr_getComponent; - extern fn ZigClangOffsetOfExpr_getComponent(*const OffsetOfExpr, idx: c_uint) *const OffsetOfNode; - - pub const getBeginLoc = ZigClangOffsetOfExpr_getBeginLoc; - extern fn ZigClangOffsetOfExpr_getBeginLoc(*const OffsetOfExpr) SourceLocation; -}; - -pub const MemberExpr = opaque { - pub const getBase = ZigClangMemberExpr_getBase; - extern fn ZigClangMemberExpr_getBase(*const MemberExpr) *const Expr; - - pub const isArrow = ZigClangMemberExpr_isArrow; - extern fn ZigClangMemberExpr_isArrow(*const MemberExpr) bool; - - pub const getMemberDecl = ZigClangMemberExpr_getMemberDecl; - extern fn ZigClangMemberExpr_getMemberDecl(*const MemberExpr) *const ValueDecl; -}; - -pub const NamedDecl = opaque { - pub const getName_bytes_begin = ZigClangNamedDecl_getName_bytes_begin; - extern fn ZigClangNamedDecl_getName_bytes_begin(decl: *const NamedDecl) [*:0]const u8; -}; - -pub const None = opaque {}; - -pub const OpaqueValueExpr = opaque { - pub const getSourceExpr = ZigClangOpaqueValueExpr_getSourceExpr; - extern fn ZigClangOpaqueValueExpr_getSourceExpr(*const OpaqueValueExpr) ?*const Expr; -}; - -pub const PCHContainerOperations = opaque {}; - -pub const ParenExpr = opaque { - pub const getSubExpr = ZigClangParenExpr_getSubExpr; - extern fn ZigClangParenExpr_getSubExpr(*const ParenExpr) *const Expr; -}; - -pub const ParenType = opaque { - pub const getInnerType = ZigClangParenType_getInnerType; - extern fn ZigClangParenType_getInnerType(*const ParenType) QualType; -}; - -pub const ParmVarDecl = opaque { - pub const getOriginalType = ZigClangParmVarDecl_getOriginalType; - extern fn ZigClangParmVarDecl_getOriginalType(*const ParmVarDecl) QualType; -}; - -pub const PointerType = opaque {}; - -pub const PredefinedExpr = opaque { - pub const getFunctionName = ZigClangPredefinedExpr_getFunctionName; - extern fn ZigClangPredefinedExpr_getFunctionName(*const PredefinedExpr) *const StringLiteral; -}; - -pub const PreprocessedEntity = opaque { - pub const getKind = ZigClangPreprocessedEntity_getKind; - extern fn ZigClangPreprocessedEntity_getKind(*const PreprocessedEntity) PreprocessedEntity_EntityKind; -}; - -pub const PreprocessingRecord = opaque { - pub const iterator = extern struct { - I: c_int, - Self: *PreprocessingRecord, - - pub const deref = ZigClangPreprocessingRecord_iterator_deref; - extern fn ZigClangPreprocessingRecord_iterator_deref(iterator) *PreprocessedEntity; - }; -}; - -pub const RecordDecl = opaque { - pub const getCanonicalDecl = ZigClangRecordDecl_getCanonicalDecl; - extern fn ZigClangRecordDecl_getCanonicalDecl(*const RecordDecl) ?*const TagDecl; - - pub const isUnion = ZigClangRecordDecl_isUnion; - extern fn ZigClangRecordDecl_isUnion(*const RecordDecl) bool; - - pub const isStruct = ZigClangRecordDecl_isStruct; - extern fn ZigClangRecordDecl_isStruct(*const RecordDecl) bool; - - pub const isAnonymousStructOrUnion = ZigClangRecordDecl_isAnonymousStructOrUnion; - extern fn ZigClangRecordDecl_isAnonymousStructOrUnion(record_decl: ?*const RecordDecl) bool; - - pub const getPackedAttribute = ZigClangRecordDecl_getPackedAttribute; - extern fn ZigClangRecordDecl_getPackedAttribute(*const RecordDecl) bool; - - pub const getDefinition = ZigClangRecordDecl_getDefinition; - extern fn ZigClangRecordDecl_getDefinition(*const RecordDecl) ?*const RecordDecl; - - pub const getLocation = ZigClangRecordDecl_getLocation; - extern fn ZigClangRecordDecl_getLocation(*const RecordDecl) SourceLocation; - - pub const getASTRecordLayout = ZigClangRecordDecl_getASTRecordLayout; - extern fn ZigClangRecordDecl_getASTRecordLayout(*const RecordDecl, *const ASTContext) *const ASTRecordLayout; - - pub const field_begin = ZigClangRecordDecl_field_begin; - extern fn ZigClangRecordDecl_field_begin(*const RecordDecl) field_iterator; - - pub const field_end = ZigClangRecordDecl_field_end; - extern fn ZigClangRecordDecl_field_end(*const RecordDecl) field_iterator; - - pub const field_iterator = extern struct { - ptr: *anyopaque, - - pub const next = ZigClangRecordDecl_field_iterator_next; - extern fn ZigClangRecordDecl_field_iterator_next(field_iterator) field_iterator; - - pub const deref = ZigClangRecordDecl_field_iterator_deref; - extern fn ZigClangRecordDecl_field_iterator_deref(field_iterator) *const FieldDecl; - - pub const neq = ZigClangRecordDecl_field_iterator_neq; - extern fn ZigClangRecordDecl_field_iterator_neq(field_iterator, field_iterator) bool; - }; -}; - -pub const RecordType = opaque { - pub const getDecl = ZigClangRecordType_getDecl; - extern fn ZigClangRecordType_getDecl(*const RecordType) *const RecordDecl; -}; - -pub const ReturnStmt = opaque { - pub const getRetValue = ZigClangReturnStmt_getRetValue; - extern fn ZigClangReturnStmt_getRetValue(*const ReturnStmt) ?*const Expr; -}; - -pub const ShuffleVectorExpr = opaque { - pub const getNumSubExprs = ZigClangShuffleVectorExpr_getNumSubExprs; - extern fn ZigClangShuffleVectorExpr_getNumSubExprs(*const ShuffleVectorExpr) c_uint; - - pub const getExpr = ZigClangShuffleVectorExpr_getExpr; - extern fn ZigClangShuffleVectorExpr_getExpr(*const ShuffleVectorExpr, c_uint) *const Expr; -}; - -pub const SourceManager = opaque { - pub const getSpellingLoc = ZigClangSourceManager_getSpellingLoc; - extern fn ZigClangSourceManager_getSpellingLoc(*const SourceManager, Loc: SourceLocation) SourceLocation; - - pub const getFilename = ZigClangSourceManager_getFilename; - extern fn ZigClangSourceManager_getFilename(*const SourceManager, SpellingLoc: SourceLocation) ?[*:0]const u8; - - pub const getSpellingLineNumber = ZigClangSourceManager_getSpellingLineNumber; - extern fn ZigClangSourceManager_getSpellingLineNumber(*const SourceManager, Loc: SourceLocation) c_uint; - - pub const getSpellingColumnNumber = ZigClangSourceManager_getSpellingColumnNumber; - extern fn ZigClangSourceManager_getSpellingColumnNumber(*const SourceManager, Loc: SourceLocation) c_uint; - - pub const getCharacterData = ZigClangSourceManager_getCharacterData; - extern fn ZigClangSourceManager_getCharacterData(*const SourceManager, SL: SourceLocation) [*:0]const u8; -}; - -pub const SourceRange = opaque {}; - -pub const Stmt = opaque { - pub const getBeginLoc = ZigClangStmt_getBeginLoc; - extern fn ZigClangStmt_getBeginLoc(*const Stmt) SourceLocation; - - pub const getStmtClass = ZigClangStmt_getStmtClass; - extern fn ZigClangStmt_getStmtClass(*const Stmt) StmtClass; - - pub const classof_Expr = ZigClangStmt_classof_Expr; - extern fn ZigClangStmt_classof_Expr(*const Stmt) bool; -}; - -pub const StmtExpr = opaque { - pub const getSubStmt = ZigClangStmtExpr_getSubStmt; - extern fn ZigClangStmtExpr_getSubStmt(*const StmtExpr) *const CompoundStmt; -}; - -pub const StringLiteral = opaque { - pub const getKind = ZigClangStringLiteral_getKind; - extern fn ZigClangStringLiteral_getKind(*const StringLiteral) CharacterLiteralKind; - - pub const getCodeUnit = ZigClangStringLiteral_getCodeUnit; - extern fn ZigClangStringLiteral_getCodeUnit(*const StringLiteral, usize) u32; - - pub const getLength = ZigClangStringLiteral_getLength; - extern fn ZigClangStringLiteral_getLength(*const StringLiteral) c_uint; - - pub const getCharByteWidth = ZigClangStringLiteral_getCharByteWidth; - extern fn ZigClangStringLiteral_getCharByteWidth(*const StringLiteral) c_uint; - - pub const getString_bytes_begin_size = ZigClangStringLiteral_getString_bytes_begin_size; - extern fn ZigClangStringLiteral_getString_bytes_begin_size(*const StringLiteral, *usize) [*]const u8; -}; - -pub const StringRef = opaque {}; - -pub const SwitchStmt = opaque { - pub const getConditionVariableDeclStmt = ZigClangSwitchStmt_getConditionVariableDeclStmt; - extern fn ZigClangSwitchStmt_getConditionVariableDeclStmt(*const SwitchStmt) ?*const DeclStmt; - - pub const getCond = ZigClangSwitchStmt_getCond; - extern fn ZigClangSwitchStmt_getCond(*const SwitchStmt) *const Expr; - - pub const getBody = ZigClangSwitchStmt_getBody; - extern fn ZigClangSwitchStmt_getBody(*const SwitchStmt) *const Stmt; - - pub const isAllEnumCasesCovered = ZigClangSwitchStmt_isAllEnumCasesCovered; - extern fn ZigClangSwitchStmt_isAllEnumCasesCovered(*const SwitchStmt) bool; -}; - -pub const TagDecl = opaque { - pub const isThisDeclarationADefinition = ZigClangTagDecl_isThisDeclarationADefinition; - extern fn ZigClangTagDecl_isThisDeclarationADefinition(*const TagDecl) bool; -}; - -pub const Type = opaque { - pub const getTypeClass = ZigClangType_getTypeClass; - extern fn ZigClangType_getTypeClass(*const Type) TypeClass; - - pub const getPointeeType = ZigClangType_getPointeeType; - extern fn ZigClangType_getPointeeType(*const Type) QualType; - - pub const isVoidType = ZigClangType_isVoidType; - extern fn ZigClangType_isVoidType(*const Type) bool; - - pub const isConstantArrayType = ZigClangType_isConstantArrayType; - extern fn ZigClangType_isConstantArrayType(*const Type) bool; - - pub const isRecordType = ZigClangType_isRecordType; - extern fn ZigClangType_isRecordType(*const Type) bool; - - pub const isVectorType = ZigClangType_isVectorType; - extern fn ZigClangType_isVectorType(*const Type) bool; - - pub const isIncompleteOrZeroLengthArrayType = ZigClangType_isIncompleteOrZeroLengthArrayType; - extern fn ZigClangType_isIncompleteOrZeroLengthArrayType(*const Type, *const ASTContext) bool; - - pub const isArrayType = ZigClangType_isArrayType; - extern fn ZigClangType_isArrayType(*const Type) bool; - - pub const isBooleanType = ZigClangType_isBooleanType; - extern fn ZigClangType_isBooleanType(*const Type) bool; - - pub const getTypeClassName = ZigClangType_getTypeClassName; - extern fn ZigClangType_getTypeClassName(*const Type) [*:0]const u8; - - pub const getAsArrayTypeUnsafe = ZigClangType_getAsArrayTypeUnsafe; - extern fn ZigClangType_getAsArrayTypeUnsafe(*const Type) *const ArrayType; - - pub const getAsRecordType = ZigClangType_getAsRecordType; - extern fn ZigClangType_getAsRecordType(*const Type) ?*const RecordType; - - pub const getAsUnionType = ZigClangType_getAsUnionType; - extern fn ZigClangType_getAsUnionType(*const Type) ?*const RecordType; -}; - -pub const TypedefNameDecl = opaque { - pub const getUnderlyingType = ZigClangTypedefNameDecl_getUnderlyingType; - extern fn ZigClangTypedefNameDecl_getUnderlyingType(*const TypedefNameDecl) QualType; - - pub const getCanonicalDecl = ZigClangTypedefNameDecl_getCanonicalDecl; - extern fn ZigClangTypedefNameDecl_getCanonicalDecl(*const TypedefNameDecl) ?*const TypedefNameDecl; - - pub const getLocation = ZigClangTypedefNameDecl_getLocation; - extern fn ZigClangTypedefNameDecl_getLocation(*const TypedefNameDecl) SourceLocation; -}; - -pub const FileScopeAsmDecl = opaque { - pub const getAsmString = ZigClangFileScopeAsmDecl_getAsmString; - extern fn ZigClangFileScopeAsmDecl_getAsmString(*const FileScopeAsmDecl) *const StringLiteral; -}; - -pub const TypedefType = opaque { - pub const getDecl = ZigClangTypedefType_getDecl; - extern fn ZigClangTypedefType_getDecl(*const TypedefType) *const TypedefNameDecl; -}; - -pub const UnaryExprOrTypeTraitExpr = opaque { - pub const getTypeOfArgument = ZigClangUnaryExprOrTypeTraitExpr_getTypeOfArgument; - extern fn ZigClangUnaryExprOrTypeTraitExpr_getTypeOfArgument(*const UnaryExprOrTypeTraitExpr) QualType; - - pub const getBeginLoc = ZigClangUnaryExprOrTypeTraitExpr_getBeginLoc; - extern fn ZigClangUnaryExprOrTypeTraitExpr_getBeginLoc(*const UnaryExprOrTypeTraitExpr) SourceLocation; - - pub const getKind = ZigClangUnaryExprOrTypeTraitExpr_getKind; - extern fn ZigClangUnaryExprOrTypeTraitExpr_getKind(*const UnaryExprOrTypeTraitExpr) UnaryExprOrTypeTrait_Kind; -}; - -pub const UnaryOperator = opaque { - pub const getOpcode = ZigClangUnaryOperator_getOpcode; - extern fn ZigClangUnaryOperator_getOpcode(*const UnaryOperator) UO; - - pub const getType = ZigClangUnaryOperator_getType; - extern fn ZigClangUnaryOperator_getType(*const UnaryOperator) QualType; - - pub const getSubExpr = ZigClangUnaryOperator_getSubExpr; - extern fn ZigClangUnaryOperator_getSubExpr(*const UnaryOperator) *const Expr; - - pub const getBeginLoc = ZigClangUnaryOperator_getBeginLoc; - extern fn ZigClangUnaryOperator_getBeginLoc(*const UnaryOperator) SourceLocation; -}; - -pub const ValueDecl = opaque { - pub const getType = ZigClangValueDecl_getType; - extern fn ZigClangValueDecl_getType(*const ValueDecl) QualType; -}; - -pub const VarDecl = opaque { - pub const getLocation = ZigClangVarDecl_getLocation; - extern fn ZigClangVarDecl_getLocation(*const VarDecl) SourceLocation; - - pub const hasInit = ZigClangVarDecl_hasInit; - extern fn ZigClangVarDecl_hasInit(*const VarDecl) bool; - - pub const getStorageClass = ZigClangVarDecl_getStorageClass; - extern fn ZigClangVarDecl_getStorageClass(*const VarDecl) StorageClass; - - pub const getType = ZigClangVarDecl_getType; - extern fn ZigClangVarDecl_getType(*const VarDecl) QualType; - - pub const getInit = ZigClangVarDecl_getInit; - extern fn ZigClangVarDecl_getInit(*const VarDecl) ?*const Expr; - - pub const getTLSKind = ZigClangVarDecl_getTLSKind; - extern fn ZigClangVarDecl_getTLSKind(*const VarDecl) VarDecl_TLSKind; - - pub const getCanonicalDecl = ZigClangVarDecl_getCanonicalDecl; - extern fn ZigClangVarDecl_getCanonicalDecl(*const VarDecl) ?*const VarDecl; - - pub const getSectionAttribute = ZigClangVarDecl_getSectionAttribute; - extern fn ZigClangVarDecl_getSectionAttribute(*const VarDecl, len: *usize) ?[*]const u8; - - pub const getAlignedAttribute = ZigClangVarDecl_getAlignedAttribute; - extern fn ZigClangVarDecl_getAlignedAttribute(*const VarDecl, *const ASTContext) c_uint; - - pub const getPackedAttribute = ZigClangVarDecl_getPackedAttribute; - extern fn ZigClangVarDecl_getPackedAttribute(*const VarDecl) bool; - - pub const getCleanupAttribute = ZigClangVarDecl_getCleanupAttribute; - extern fn ZigClangVarDecl_getCleanupAttribute(*const VarDecl) ?*const FunctionDecl; - - pub const getTypeSourceInfo_getType = ZigClangVarDecl_getTypeSourceInfo_getType; - extern fn ZigClangVarDecl_getTypeSourceInfo_getType(*const VarDecl) QualType; - - pub const isStaticLocal = ZigClangVarDecl_isStaticLocal; - extern fn ZigClangVarDecl_isStaticLocal(*const VarDecl) bool; -}; - -pub const VectorType = opaque { - pub const getElementType = ZigClangVectorType_getElementType; - extern fn ZigClangVectorType_getElementType(*const VectorType) QualType; - - pub const getNumElements = ZigClangVectorType_getNumElements; - extern fn ZigClangVectorType_getNumElements(*const VectorType) c_uint; -}; - -pub const WhileStmt = opaque { - pub const getCond = ZigClangWhileStmt_getCond; - extern fn ZigClangWhileStmt_getCond(*const WhileStmt) *const Expr; - - pub const getBody = ZigClangWhileStmt_getBody; - extern fn ZigClangWhileStmt_getBody(*const WhileStmt) *const Stmt; -}; - -pub const InitListExpr = opaque { - pub const getInit = ZigClangInitListExpr_getInit; - extern fn ZigClangInitListExpr_getInit(*const InitListExpr, i: c_uint) *const Expr; - - pub const getArrayFiller = ZigClangInitListExpr_getArrayFiller; - extern fn ZigClangInitListExpr_getArrayFiller(*const InitListExpr) *const Expr; - - pub const hasArrayFiller = ZigClangInitListExpr_hasArrayFiller; - extern fn ZigClangInitListExpr_hasArrayFiller(*const InitListExpr) bool; - - pub const isStringLiteralInit = ZigClangInitListExpr_isStringLiteralInit; - extern fn ZigClangInitListExpr_isStringLiteralInit(*const InitListExpr) bool; - - pub const getNumInits = ZigClangInitListExpr_getNumInits; - extern fn ZigClangInitListExpr_getNumInits(*const InitListExpr) c_uint; - - pub const getInitializedFieldInUnion = ZigClangInitListExpr_getInitializedFieldInUnion; - extern fn ZigClangInitListExpr_getInitializedFieldInUnion(*const InitListExpr) ?*FieldDecl; -}; - -pub const BO = enum(c_int) { - PtrMemD, - PtrMemI, - Mul, - Div, - Rem, - Add, - Sub, - Shl, - Shr, - Cmp, - LT, - GT, - LE, - GE, - EQ, - NE, - And, - Xor, - Or, - LAnd, - LOr, - Assign, - MulAssign, - DivAssign, - RemAssign, - AddAssign, - SubAssign, - ShlAssign, - ShrAssign, - AndAssign, - XorAssign, - OrAssign, - Comma, -}; - -pub const UO = enum(c_int) { - PostInc, - PostDec, - PreInc, - PreDec, - AddrOf, - Deref, - Plus, - Minus, - Not, - LNot, - Real, - Imag, - Extension, - Coawait, -}; - -pub const TypeClass = enum(c_int) { - Adjusted, - Decayed, - ConstantArray, - ArrayParameter, - DependentSizedArray, - IncompleteArray, - VariableArray, - Atomic, - Attributed, - BTFTagAttributed, - BitInt, - BlockPointer, - CountAttributed, - Builtin, - Complex, - Decltype, - Auto, - DeducedTemplateSpecialization, - DependentAddressSpace, - DependentBitInt, - DependentName, - DependentSizedExtVector, - DependentTemplateSpecialization, - DependentVector, - Elaborated, - FunctionNoProto, - FunctionProto, - HLSLAttributedResource, - InjectedClassName, - MacroQualified, - ConstantMatrix, - DependentSizedMatrix, - MemberPointer, - ObjCObjectPointer, - ObjCObject, - ObjCInterface, - ObjCTypeParam, - PackExpansion, - PackIndexing, - Paren, - Pipe, - Pointer, - LValueReference, - RValueReference, - SubstTemplateTypeParmPack, - SubstTemplateTypeParm, - Enum, - Record, - TemplateSpecialization, - TemplateTypeParm, - TypeOfExpr, - TypeOf, - Typedef, - UnaryTransform, - UnresolvedUsing, - Using, - Vector, - ExtVector, -}; - -const StmtClass = enum(c_int) { - NoStmtClass, - WhileStmtClass, - LabelStmtClass, - VAArgExprClass, - UnaryOperatorClass, - UnaryExprOrTypeTraitExprClass, - TypoExprClass, - TypeTraitExprClass, - SubstNonTypeTemplateParmPackExprClass, - SubstNonTypeTemplateParmExprClass, - StringLiteralClass, - StmtExprClass, - SourceLocExprClass, - SizeOfPackExprClass, - ShuffleVectorExprClass, - SYCLUniqueStableNameExprClass, - RequiresExprClass, - RecoveryExprClass, - PseudoObjectExprClass, - PredefinedExprClass, - ParenListExprClass, - ParenExprClass, - PackIndexingExprClass, - PackExpansionExprClass, - UnresolvedMemberExprClass, - UnresolvedLookupExprClass, - OpenACCAsteriskSizeExprClass, - OpaqueValueExprClass, - OffsetOfExprClass, - ObjCSubscriptRefExprClass, - ObjCStringLiteralClass, - ObjCSelectorExprClass, - ObjCProtocolExprClass, - ObjCPropertyRefExprClass, - ObjCMessageExprClass, - ObjCIvarRefExprClass, - ObjCIsaExprClass, - ObjCIndirectCopyRestoreExprClass, - ObjCEncodeExprClass, - ObjCDictionaryLiteralClass, - ObjCBoxedExprClass, - ObjCBoolLiteralExprClass, - ObjCAvailabilityCheckExprClass, - ObjCArrayLiteralClass, - OMPIteratorExprClass, - OMPArrayShapingExprClass, - NoInitExprClass, - MemberExprClass, - MatrixSubscriptExprClass, - MaterializeTemporaryExprClass, - MSPropertySubscriptExprClass, - MSPropertyRefExprClass, - LambdaExprClass, - IntegerLiteralClass, - InitListExprClass, - ImplicitValueInitExprClass, - ImaginaryLiteralClass, - HLSLOutArgExprClass, - GenericSelectionExprClass, - GNUNullExprClass, - FunctionParmPackExprClass, - ExprWithCleanupsClass, - ConstantExprClass, - FloatingLiteralClass, - FixedPointLiteralClass, - ExtVectorElementExprClass, - ExpressionTraitExprClass, - EmbedExprClass, - DesignatedInitUpdateExprClass, - DesignatedInitExprClass, - DependentScopeDeclRefExprClass, - DependentCoawaitExprClass, - DeclRefExprClass, - CoyieldExprClass, - CoawaitExprClass, - ConvertVectorExprClass, - ConceptSpecializationExprClass, - CompoundLiteralExprClass, - ChooseExprClass, - CharacterLiteralClass, - ImplicitCastExprClass, - ObjCBridgedCastExprClass, - CXXStaticCastExprClass, - CXXReinterpretCastExprClass, - CXXDynamicCastExprClass, - CXXConstCastExprClass, - CXXAddrspaceCastExprClass, - CXXFunctionalCastExprClass, - CStyleCastExprClass, - BuiltinBitCastExprClass, - CallExprClass, - UserDefinedLiteralClass, - CXXOperatorCallExprClass, - CXXMemberCallExprClass, - CUDAKernelCallExprClass, - CXXUuidofExprClass, - CXXUnresolvedConstructExprClass, - CXXTypeidExprClass, - CXXThrowExprClass, - CXXThisExprClass, - CXXStdInitializerListExprClass, - CXXScalarValueInitExprClass, - CXXRewrittenBinaryOperatorClass, - CXXPseudoDestructorExprClass, - CXXParenListInitExprClass, - CXXNullPtrLiteralExprClass, - CXXNoexceptExprClass, - CXXNewExprClass, - CXXInheritedCtorInitExprClass, - CXXFoldExprClass, - CXXDependentScopeMemberExprClass, - CXXDeleteExprClass, - CXXDefaultInitExprClass, - CXXDefaultArgExprClass, - CXXConstructExprClass, - CXXTemporaryObjectExprClass, - CXXBoolLiteralExprClass, - CXXBindTemporaryExprClass, - BlockExprClass, - BinaryOperatorClass, - CompoundAssignOperatorClass, - AtomicExprClass, - AsTypeExprClass, - ArrayTypeTraitExprClass, - ArraySubscriptExprClass, - ArraySectionExprClass, - ArrayInitLoopExprClass, - ArrayInitIndexExprClass, - AddrLabelExprClass, - ConditionalOperatorClass, - BinaryConditionalOperatorClass, - AttributedStmtClass, - SwitchStmtClass, - DefaultStmtClass, - CaseStmtClass, - SYCLKernelCallStmtClass, - SEHTryStmtClass, - SEHLeaveStmtClass, - SEHFinallyStmtClass, - SEHExceptStmtClass, - ReturnStmtClass, - OpenACCWaitConstructClass, - OpenACCUpdateConstructClass, - OpenACCShutdownConstructClass, - OpenACCSetConstructClass, - OpenACCInitConstructClass, - OpenACCExitDataConstructClass, - OpenACCEnterDataConstructClass, - OpenACCLoopConstructClass, - OpenACCHostDataConstructClass, - OpenACCDataConstructClass, - OpenACCComputeConstructClass, - OpenACCCombinedConstructClass, - ObjCForCollectionStmtClass, - ObjCAutoreleasePoolStmtClass, - ObjCAtTryStmtClass, - ObjCAtThrowStmtClass, - ObjCAtSynchronizedStmtClass, - ObjCAtFinallyStmtClass, - ObjCAtCatchStmtClass, - OMPTeamsDirectiveClass, - OMPTaskyieldDirectiveClass, - OMPTaskwaitDirectiveClass, - OMPTaskgroupDirectiveClass, - OMPTaskDirectiveClass, - OMPTargetUpdateDirectiveClass, - OMPTargetTeamsDirectiveClass, - OMPTargetParallelForDirectiveClass, - OMPTargetParallelDirectiveClass, - OMPTargetExitDataDirectiveClass, - OMPTargetEnterDataDirectiveClass, - OMPTargetDirectiveClass, - OMPTargetDataDirectiveClass, - OMPSingleDirectiveClass, - OMPSectionsDirectiveClass, - OMPSectionDirectiveClass, - OMPScopeDirectiveClass, - OMPScanDirectiveClass, - OMPParallelSectionsDirectiveClass, - OMPParallelMasterDirectiveClass, - OMPParallelMaskedDirectiveClass, - OMPParallelDirectiveClass, - OMPOrderedDirectiveClass, - OMPMetaDirectiveClass, - OMPMasterDirectiveClass, - OMPMaskedDirectiveClass, - OMPUnrollDirectiveClass, - OMPTileDirectiveClass, - OMPReverseDirectiveClass, - OMPInterchangeDirectiveClass, - OMPTeamsGenericLoopDirectiveClass, - OMPTeamsDistributeSimdDirectiveClass, - OMPTeamsDistributeParallelForSimdDirectiveClass, - OMPTeamsDistributeParallelForDirectiveClass, - OMPTeamsDistributeDirectiveClass, - OMPTaskLoopSimdDirectiveClass, - OMPTaskLoopDirectiveClass, - OMPTargetTeamsGenericLoopDirectiveClass, - OMPTargetTeamsDistributeSimdDirectiveClass, - OMPTargetTeamsDistributeParallelForSimdDirectiveClass, - OMPTargetTeamsDistributeParallelForDirectiveClass, - OMPTargetTeamsDistributeDirectiveClass, - OMPTargetSimdDirectiveClass, - OMPTargetParallelGenericLoopDirectiveClass, - OMPTargetParallelForSimdDirectiveClass, - OMPSimdDirectiveClass, - OMPParallelMasterTaskLoopSimdDirectiveClass, - OMPParallelMasterTaskLoopDirectiveClass, - OMPParallelMaskedTaskLoopSimdDirectiveClass, - OMPParallelMaskedTaskLoopDirectiveClass, - OMPParallelGenericLoopDirectiveClass, - OMPParallelForSimdDirectiveClass, - OMPParallelForDirectiveClass, - OMPMasterTaskLoopSimdDirectiveClass, - OMPMasterTaskLoopDirectiveClass, - OMPMaskedTaskLoopSimdDirectiveClass, - OMPMaskedTaskLoopDirectiveClass, - OMPGenericLoopDirectiveClass, - OMPForSimdDirectiveClass, - OMPForDirectiveClass, - OMPDistributeSimdDirectiveClass, - OMPDistributeParallelForSimdDirectiveClass, - OMPDistributeParallelForDirectiveClass, - OMPDistributeDirectiveClass, - OMPInteropDirectiveClass, - OMPFlushDirectiveClass, - OMPErrorDirectiveClass, - OMPDispatchDirectiveClass, - OMPDepobjDirectiveClass, - OMPCriticalDirectiveClass, - OMPCancellationPointDirectiveClass, - OMPCancelDirectiveClass, - OMPBarrierDirectiveClass, - OMPAtomicDirectiveClass, - OMPAssumeDirectiveClass, - OMPCanonicalLoopClass, - NullStmtClass, - MSDependentExistsStmtClass, - IndirectGotoStmtClass, - IfStmtClass, - GotoStmtClass, - ForStmtClass, - DoStmtClass, - DeclStmtClass, - CoroutineBodyStmtClass, - CoreturnStmtClass, - ContinueStmtClass, - CompoundStmtClass, - CapturedStmtClass, - CXXTryStmtClass, - CXXForRangeStmtClass, - CXXCatchStmtClass, - BreakStmtClass, - MSAsmStmtClass, - GCCAsmStmtClass, -}; - -pub const CK = enum(c_int) { - Dependent, - BitCast, - LValueBitCast, - LValueToRValueBitCast, - LValueToRValue, - NoOp, - BaseToDerived, - DerivedToBase, - UncheckedDerivedToBase, - Dynamic, - ToUnion, - ArrayToPointerDecay, - FunctionToPointerDecay, - NullToPointer, - NullToMemberPointer, - BaseToDerivedMemberPointer, - DerivedToBaseMemberPointer, - MemberPointerToBoolean, - ReinterpretMemberPointer, - UserDefinedConversion, - ConstructorConversion, - IntegralToPointer, - PointerToIntegral, - PointerToBoolean, - ToVoid, - MatrixCast, - VectorSplat, - IntegralCast, - IntegralToBoolean, - IntegralToFloating, - FloatingToFixedPoint, - FixedPofloatFromInting, - FixedPointCast, - FixedPointToIntegral, - IntegralToFixedPoint, - FixedPointToBoolean, - FloatingToIntegral, - FloatingToBoolean, - BooleanToSignedIntegral, - FloatingCast, - CPointerToObjCPointerCast, - BlockPointerToObjCPointerCast, - AnyPointerToBlockPointerCast, - ObjCObjectLValueCast, - FloatingRealToComplex, - FloatingComplexToReal, - FloatingComplexToBoolean, - FloatingComplexCast, - FloatingComplexToIntegralComplex, - IntegralRealToComplex, - IntegralComplexToReal, - IntegralComplexToBoolean, - IntegralComplexCast, - IntegralComplexToFloatingComplex, - ARCProduceObject, - ARCConsumeObject, - ARCReclaimReturnedObject, - ARCExtendBlockObject, - AtomicToNonAtomic, - NonAtomicToAtomic, - CopyAndAutoreleaseBlockObject, - BuiltinFnToFnPtr, - ZeroToOCLOpaqueType, - AddressSpaceConversion, - IntToOCLSampler, -}; - -pub const DeclKind = enum(c_int) { - TranslationUnit, - TopLevelStmt, - RequiresExprBody, - OutlinedFunction, - LinkageSpec, - ExternCContext, - Export, - Captured, - Block, - StaticAssert, - PragmaDetectMismatch, - PragmaComment, - ObjCPropertyImpl, - OMPThreadPrivate, - OMPRequires, - OMPAllocate, - ObjCMethod, - ObjCProtocol, - ObjCInterface, - ObjCImplementation, - ObjCCategoryImpl, - ObjCCategory, - Namespace, - HLSLBuffer, - OMPDeclareReduction, - OMPDeclareMapper, - UnresolvedUsingValue, - UnnamedGlobalConstant, - TemplateParamObject, - MSGuid, - IndirectField, - EnumConstant, - Function, - CXXMethod, - CXXDestructor, - CXXConversion, - CXXConstructor, - CXXDeductionGuide, - Var, - VarTemplateSpecialization, - VarTemplatePartialSpecialization, - ParmVar, - OMPCapturedExpr, - ImplicitParam, - Decomposition, - NonTypeTemplateParm, - MSProperty, - Field, - ObjCIvar, - ObjCAtDefsField, - Binding, - UsingShadow, - ConstructorUsingShadow, - UsingPack, - UsingDirective, - UnresolvedUsingIfExists, - Record, - CXXRecord, - ClassTemplateSpecialization, - ClassTemplatePartialSpecialization, - Enum, - UnresolvedUsingTypename, - Typedef, - TypeAlias, - ObjCTypeParam, - TemplateTypeParm, - TemplateTemplateParm, - VarTemplate, - TypeAliasTemplate, - FunctionTemplate, - ClassTemplate, - Concept, - BuiltinTemplate, - ObjCProperty, - ObjCCompatibleAlias, - NamespaceAlias, - Label, - UsingEnum, - Using, - LifetimeExtendedTemporary, - Import, - ImplicitConceptSpecialization, - FriendTemplate, - Friend, - FileScopeAsm, - Empty, - AccessSpec, -}; - -pub const BuiltinTypeKind = enum(c_int) { - OCLImage1dRO, - OCLImage1dArrayRO, - OCLImage1dBufferRO, - OCLImage2dRO, - OCLImage2dArrayRO, - OCLImage2dDepthRO, - OCLImage2dArrayDepthRO, - OCLImage2dMSAARO, - OCLImage2dArrayMSAARO, - OCLImage2dMSAADepthRO, - OCLImage2dArrayMSAADepthRO, - OCLImage3dRO, - OCLImage1dWO, - OCLImage1dArrayWO, - OCLImage1dBufferWO, - OCLImage2dWO, - OCLImage2dArrayWO, - OCLImage2dDepthWO, - OCLImage2dArrayDepthWO, - OCLImage2dMSAAWO, - OCLImage2dArrayMSAAWO, - OCLImage2dMSAADepthWO, - OCLImage2dArrayMSAADepthWO, - OCLImage3dWO, - OCLImage1dRW, - OCLImage1dArrayRW, - OCLImage1dBufferRW, - OCLImage2dRW, - OCLImage2dArrayRW, - OCLImage2dDepthRW, - OCLImage2dArrayDepthRW, - OCLImage2dMSAARW, - OCLImage2dArrayMSAARW, - OCLImage2dMSAADepthRW, - OCLImage2dArrayMSAADepthRW, - OCLImage3dRW, - OCLIntelSubgroupAVCMcePayload, - OCLIntelSubgroupAVCImePayload, - OCLIntelSubgroupAVCRefPayload, - OCLIntelSubgroupAVCSicPayload, - OCLIntelSubgroupAVCMceResult, - OCLIntelSubgroupAVCImeResult, - OCLIntelSubgroupAVCRefResult, - OCLIntelSubgroupAVCSicResult, - OCLIntelSubgroupAVCImeResultSingleReferenceStreamout, - OCLIntelSubgroupAVCImeResultDualReferenceStreamout, - OCLIntelSubgroupAVCImeSingleReferenceStreamin, - OCLIntelSubgroupAVCImeDualReferenceStreamin, - SveInt8, - SveInt16, - SveInt32, - SveInt64, - SveUint8, - SveUint16, - SveUint32, - SveUint64, - SveFloat16, - SveFloat32, - SveFloat64, - SveBFloat16, - SveMFloat8, - SveInt8x2, - SveInt16x2, - SveInt32x2, - SveInt64x2, - SveUint8x2, - SveUint16x2, - SveUint32x2, - SveUint64x2, - SveFloat16x2, - SveFloat32x2, - SveFloat64x2, - SveBFloat16x2, - SveMFloat8x2, - SveInt8x3, - SveInt16x3, - SveInt32x3, - SveInt64x3, - SveUint8x3, - SveUint16x3, - SveUint32x3, - SveUint64x3, - SveFloat16x3, - SveFloat32x3, - SveFloat64x3, - SveBFloat16x3, - SveMFloat8x3, - SveInt8x4, - SveInt16x4, - SveInt32x4, - SveInt64x4, - SveUint8x4, - SveUint16x4, - SveUint32x4, - SveUint64x4, - SveFloat16x4, - SveFloat32x4, - SveFloat64x4, - SveBFloat16x4, - SveMFloat8x4, - SveBool, - SveBoolx2, - SveBoolx4, - SveCount, - MFloat8, - VectorQuad, - VectorPair, - RvvInt8mf8, - RvvInt8mf4, - RvvInt8mf2, - RvvInt8m1, - RvvInt8m2, - RvvInt8m4, - RvvInt8m8, - RvvUint8mf8, - RvvUint8mf4, - RvvUint8mf2, - RvvUint8m1, - RvvUint8m2, - RvvUint8m4, - RvvUint8m8, - RvvInt16mf4, - RvvInt16mf2, - RvvInt16m1, - RvvInt16m2, - RvvInt16m4, - RvvInt16m8, - RvvUint16mf4, - RvvUint16mf2, - RvvUint16m1, - RvvUint16m2, - RvvUint16m4, - RvvUint16m8, - RvvInt32mf2, - RvvInt32m1, - RvvInt32m2, - RvvInt32m4, - RvvInt32m8, - RvvUint32mf2, - RvvUint32m1, - RvvUint32m2, - RvvUint32m4, - RvvUint32m8, - RvvInt64m1, - RvvInt64m2, - RvvInt64m4, - RvvInt64m8, - RvvUint64m1, - RvvUint64m2, - RvvUint64m4, - RvvUint64m8, - RvvFloat16mf4, - RvvFloat16mf2, - RvvFloat16m1, - RvvFloat16m2, - RvvFloat16m4, - RvvFloat16m8, - RvvBFloat16mf4, - RvvBFloat16mf2, - RvvBFloat16m1, - RvvBFloat16m2, - RvvBFloat16m4, - RvvBFloat16m8, - RvvFloat32mf2, - RvvFloat32m1, - RvvFloat32m2, - RvvFloat32m4, - RvvFloat32m8, - RvvFloat64m1, - RvvFloat64m2, - RvvFloat64m4, - RvvFloat64m8, - RvvBool1, - RvvBool2, - RvvBool4, - RvvBool8, - RvvBool16, - RvvBool32, - RvvBool64, - RvvInt8mf8x2, - RvvInt8mf8x3, - RvvInt8mf8x4, - RvvInt8mf8x5, - RvvInt8mf8x6, - RvvInt8mf8x7, - RvvInt8mf8x8, - RvvInt8mf4x2, - RvvInt8mf4x3, - RvvInt8mf4x4, - RvvInt8mf4x5, - RvvInt8mf4x6, - RvvInt8mf4x7, - RvvInt8mf4x8, - RvvInt8mf2x2, - RvvInt8mf2x3, - RvvInt8mf2x4, - RvvInt8mf2x5, - RvvInt8mf2x6, - RvvInt8mf2x7, - RvvInt8mf2x8, - RvvInt8m1x2, - RvvInt8m1x3, - RvvInt8m1x4, - RvvInt8m1x5, - RvvInt8m1x6, - RvvInt8m1x7, - RvvInt8m1x8, - RvvInt8m2x2, - RvvInt8m2x3, - RvvInt8m2x4, - RvvInt8m4x2, - RvvUint8mf8x2, - RvvUint8mf8x3, - RvvUint8mf8x4, - RvvUint8mf8x5, - RvvUint8mf8x6, - RvvUint8mf8x7, - RvvUint8mf8x8, - RvvUint8mf4x2, - RvvUint8mf4x3, - RvvUint8mf4x4, - RvvUint8mf4x5, - RvvUint8mf4x6, - RvvUint8mf4x7, - RvvUint8mf4x8, - RvvUint8mf2x2, - RvvUint8mf2x3, - RvvUint8mf2x4, - RvvUint8mf2x5, - RvvUint8mf2x6, - RvvUint8mf2x7, - RvvUint8mf2x8, - RvvUint8m1x2, - RvvUint8m1x3, - RvvUint8m1x4, - RvvUint8m1x5, - RvvUint8m1x6, - RvvUint8m1x7, - RvvUint8m1x8, - RvvUint8m2x2, - RvvUint8m2x3, - RvvUint8m2x4, - RvvUint8m4x2, - RvvInt16mf4x2, - RvvInt16mf4x3, - RvvInt16mf4x4, - RvvInt16mf4x5, - RvvInt16mf4x6, - RvvInt16mf4x7, - RvvInt16mf4x8, - RvvInt16mf2x2, - RvvInt16mf2x3, - RvvInt16mf2x4, - RvvInt16mf2x5, - RvvInt16mf2x6, - RvvInt16mf2x7, - RvvInt16mf2x8, - RvvInt16m1x2, - RvvInt16m1x3, - RvvInt16m1x4, - RvvInt16m1x5, - RvvInt16m1x6, - RvvInt16m1x7, - RvvInt16m1x8, - RvvInt16m2x2, - RvvInt16m2x3, - RvvInt16m2x4, - RvvInt16m4x2, - RvvUint16mf4x2, - RvvUint16mf4x3, - RvvUint16mf4x4, - RvvUint16mf4x5, - RvvUint16mf4x6, - RvvUint16mf4x7, - RvvUint16mf4x8, - RvvUint16mf2x2, - RvvUint16mf2x3, - RvvUint16mf2x4, - RvvUint16mf2x5, - RvvUint16mf2x6, - RvvUint16mf2x7, - RvvUint16mf2x8, - RvvUint16m1x2, - RvvUint16m1x3, - RvvUint16m1x4, - RvvUint16m1x5, - RvvUint16m1x6, - RvvUint16m1x7, - RvvUint16m1x8, - RvvUint16m2x2, - RvvUint16m2x3, - RvvUint16m2x4, - RvvUint16m4x2, - RvvInt32mf2x2, - RvvInt32mf2x3, - RvvInt32mf2x4, - RvvInt32mf2x5, - RvvInt32mf2x6, - RvvInt32mf2x7, - RvvInt32mf2x8, - RvvInt32m1x2, - RvvInt32m1x3, - RvvInt32m1x4, - RvvInt32m1x5, - RvvInt32m1x6, - RvvInt32m1x7, - RvvInt32m1x8, - RvvInt32m2x2, - RvvInt32m2x3, - RvvInt32m2x4, - RvvInt32m4x2, - RvvUint32mf2x2, - RvvUint32mf2x3, - RvvUint32mf2x4, - RvvUint32mf2x5, - RvvUint32mf2x6, - RvvUint32mf2x7, - RvvUint32mf2x8, - RvvUint32m1x2, - RvvUint32m1x3, - RvvUint32m1x4, - RvvUint32m1x5, - RvvUint32m1x6, - RvvUint32m1x7, - RvvUint32m1x8, - RvvUint32m2x2, - RvvUint32m2x3, - RvvUint32m2x4, - RvvUint32m4x2, - RvvInt64m1x2, - RvvInt64m1x3, - RvvInt64m1x4, - RvvInt64m1x5, - RvvInt64m1x6, - RvvInt64m1x7, - RvvInt64m1x8, - RvvInt64m2x2, - RvvInt64m2x3, - RvvInt64m2x4, - RvvInt64m4x2, - RvvUint64m1x2, - RvvUint64m1x3, - RvvUint64m1x4, - RvvUint64m1x5, - RvvUint64m1x6, - RvvUint64m1x7, - RvvUint64m1x8, - RvvUint64m2x2, - RvvUint64m2x3, - RvvUint64m2x4, - RvvUint64m4x2, - RvvFloat16mf4x2, - RvvFloat16mf4x3, - RvvFloat16mf4x4, - RvvFloat16mf4x5, - RvvFloat16mf4x6, - RvvFloat16mf4x7, - RvvFloat16mf4x8, - RvvFloat16mf2x2, - RvvFloat16mf2x3, - RvvFloat16mf2x4, - RvvFloat16mf2x5, - RvvFloat16mf2x6, - RvvFloat16mf2x7, - RvvFloat16mf2x8, - RvvFloat16m1x2, - RvvFloat16m1x3, - RvvFloat16m1x4, - RvvFloat16m1x5, - RvvFloat16m1x6, - RvvFloat16m1x7, - RvvFloat16m1x8, - RvvFloat16m2x2, - RvvFloat16m2x3, - RvvFloat16m2x4, - RvvFloat16m4x2, - RvvFloat32mf2x2, - RvvFloat32mf2x3, - RvvFloat32mf2x4, - RvvFloat32mf2x5, - RvvFloat32mf2x6, - RvvFloat32mf2x7, - RvvFloat32mf2x8, - RvvFloat32m1x2, - RvvFloat32m1x3, - RvvFloat32m1x4, - RvvFloat32m1x5, - RvvFloat32m1x6, - RvvFloat32m1x7, - RvvFloat32m1x8, - RvvFloat32m2x2, - RvvFloat32m2x3, - RvvFloat32m2x4, - RvvFloat32m4x2, - RvvFloat64m1x2, - RvvFloat64m1x3, - RvvFloat64m1x4, - RvvFloat64m1x5, - RvvFloat64m1x6, - RvvFloat64m1x7, - RvvFloat64m1x8, - RvvFloat64m2x2, - RvvFloat64m2x3, - RvvFloat64m2x4, - RvvFloat64m4x2, - RvvBFloat16mf4x2, - RvvBFloat16mf4x3, - RvvBFloat16mf4x4, - RvvBFloat16mf4x5, - RvvBFloat16mf4x6, - RvvBFloat16mf4x7, - RvvBFloat16mf4x8, - RvvBFloat16mf2x2, - RvvBFloat16mf2x3, - RvvBFloat16mf2x4, - RvvBFloat16mf2x5, - RvvBFloat16mf2x6, - RvvBFloat16mf2x7, - RvvBFloat16mf2x8, - RvvBFloat16m1x2, - RvvBFloat16m1x3, - RvvBFloat16m1x4, - RvvBFloat16m1x5, - RvvBFloat16m1x6, - RvvBFloat16m1x7, - RvvBFloat16m1x8, - RvvBFloat16m2x2, - RvvBFloat16m2x3, - RvvBFloat16m2x4, - RvvBFloat16m4x2, - WasmExternRef, - AMDGPUBufferRsrc, - AMDGPUNamedWorkgroupBarrier, - HLSLResource, - Void, - Bool, - Char_U, - UChar, - WChar_U, - Char8, - Char16, - Char32, - UShort, - UInt, - ULong, - ULongLong, - UInt128, - Char_S, - SChar, - WChar_S, - Short, - Int, - Long, - LongLong, - Int128, - ShortAccum, - Accum, - LongAccum, - UShortAccum, - UAccum, - ULongAccum, - ShortFract, - Fract, - LongFract, - UShortFract, - UFract, - ULongFract, - SatShortAccum, - SatAccum, - SatLongAccum, - SatUShortAccum, - SatUAccum, - SatULongAccum, - SatShortFract, - SatFract, - SatLongFract, - SatUShortFract, - SatUFract, - SatULongFract, - Half, - Float, - Double, - LongDouble, - Float16, - BFloat16, - Float128, - Ibm128, - NullPtr, - ObjCId, - ObjCClass, - ObjCSel, - OCLSampler, - OCLEvent, - OCLClkEvent, - OCLQueue, - OCLReserveID, - Dependent, - Overload, - BoundMember, - UnresolvedTemplate, - PseudoObject, - UnknownAny, - BuiltinFn, - ARCUnbridgedCast, - IncompleteMatrixIdx, - OMPArraySection, - OMPArrayShaping, - OMPIterator, -}; - -pub const CallingConv = enum(c_int) { - C, - X86StdCall, - X86FastCall, - X86ThisCall, - X86VectorCall, - X86Pascal, - Win64, - X86_64SysV, - X86RegCall, - AAPCS, - AAPCS_VFP, - IntelOclBicc, - SpirFunction, - OpenCLKernel, - Swift, - SwiftAsync, - PreserveMost, - PreserveAll, - AArch64VectorCall, - AArch64SVEPCS, - AMDGPUKernelCall, - M68kRTD, - PreserveNone, - RISCVVectorCall, -}; - -pub const StorageClass = enum(c_int) { - None, - Extern, - Static, - PrivateExtern, - Auto, - Register, -}; - -pub const APFloat_roundingMode = enum(i8) { - TowardZero = 0, - NearestTiesToEven = 1, - TowardPositive = 2, - TowardNegative = 3, - NearestTiesToAway = 4, - Dynamic = 7, - Invalid = -1, -}; - -pub const CharacterLiteralKind = enum(c_int) { - Ascii, - Wide, - UTF8, - UTF16, - UTF32, -}; - -pub const VarDecl_TLSKind = enum(c_int) { - None, - Static, - Dynamic, -}; - -pub const ElaboratedTypeKeyword = enum(c_int) { - Struct, - Interface, - Union, - Class, - Enum, - Typename, - None, -}; - -pub const PreprocessedEntity_EntityKind = enum(c_int) { - InvalidKind, - MacroExpansionKind, - MacroDefinitionKind, - InclusionDirectiveKind, -}; - -pub const Expr_ConstantExprKind = enum(c_int) { - Normal, - NonClassTemplateArgument, - ClassTemplateArgument, - ImmediateInvocation, -}; - -pub const UnaryExprOrTypeTrait_Kind = enum(c_int) { - SizeOf, - DataSizeOf, - AlignOf, - PreferredAlignOf, - PtrAuthTypeDiscriminator, - VecStep, - OpenMPRequiredSimdAlign, -}; - -pub const OffsetOfNode_Kind = enum(c_int) { - Array, - Field, - Identifier, - Base, -}; - -pub const ErrorMsg = extern struct { - filename_ptr: ?[*]const u8, - filename_len: usize, - msg_ptr: [*]const u8, - msg_len: usize, - // valid until the ASTUnit is freed - source: ?[*:0]const u8, - // 0 based - line: c_uint, - // 0 based - column: c_uint, - // byte offset into source - offset: c_uint, - - pub const delete = ZigClangErrorMsg_delete; - extern fn ZigClangErrorMsg_delete(ptr: [*]ErrorMsg, len: usize) void; -}; - -pub const LoadFromCommandLine = ZigClangLoadFromCommandLine; -extern fn ZigClangLoadFromCommandLine( - args_begin: [*]?[*:0]const u8, - args_end: [*]?[*:0]const u8, - errors_ptr: *[*]ErrorMsg, - errors_len: *usize, - resources_path: [*:0]const u8, -) ?*ASTUnit; - -pub const isLLVMUsingSeparateLibcxx = ZigClangIsLLVMUsingSeparateLibcxx; -extern fn ZigClangIsLLVMUsingSeparateLibcxx() bool; diff --git a/src/libs/mingw.zig b/src/libs/mingw.zig index 612a5a0db66d..f66434b1cf91 100644 --- a/src/libs/mingw.zig +++ b/src/libs/mingw.zig @@ -296,7 +296,11 @@ pub fn buildImportLib(comp: *Compilation, lib_name: []const u8) !void { }); const aro = @import("aro"); - var aro_comp = aro.Compilation.init(gpa, std.fs.cwd()); + var diagnostics: aro.Diagnostics = .{ + .output = .{ .to_list = .{ .arena = .init(gpa) } }, + }; + defer diagnostics.deinit(); + var aro_comp = aro.Compilation.init(gpa, arena, &diagnostics, std.fs.cwd()); defer aro_comp.deinit(); aro_comp.target = target.*; @@ -317,17 +321,22 @@ pub fn buildImportLib(comp: *Compilation, lib_name: []const u8) !void { const builtin_macros = try aro_comp.generateBuiltinMacros(.include_system_defines); const def_file_source = try aro_comp.addSourceFromPath(def_file_path); - var pp = aro.Preprocessor.init(&aro_comp); + var pp = aro.Preprocessor.init(&aro_comp, .{ .provided = 0 }); defer pp.deinit(); pp.linemarkers = .none; pp.preserve_whitespace = true; try pp.preprocessSources(&.{ def_file_source, builtin_macros }); - for (aro_comp.diagnostics.list.items) |diagnostic| { - if (diagnostic.kind == .@"fatal error" or diagnostic.kind == .@"error") { - aro.Diagnostics.render(&aro_comp, std.io.tty.detectConfig(std.fs.File.stderr())); - return error.AroPreprocessorFailed; + if (aro_comp.diagnostics.output.to_list.messages.items.len != 0) { + var buffer: [64]u8 = undefined; + const w = std.debug.lockStderrWriter(&buffer); + defer std.debug.unlockStderrWriter(); + for (aro_comp.diagnostics.output.to_list.messages.items) |msg| { + if (msg.kind == .@"fatal error" or msg.kind == .@"error") { + msg.write(w, .detect(std.fs.File.stderr()), true) catch {}; + return error.AroPreprocessorFailed; + } } } @@ -335,7 +344,10 @@ pub fn buildImportLib(comp: *Compilation, lib_name: []const u8) !void { // new scope to ensure definition file is written before passing the path to WriteImportLibrary const def_final_file = try o_dir.createFile(final_def_basename, .{ .truncate = true }); defer def_final_file.close(); - try pp.prettyPrintTokens(def_final_file.deprecatedWriter(), .result_only); + var buffer: [1024]u8 = undefined; + var file_writer = def_final_file.writer(&buffer); + try pp.prettyPrintTokens(&file_writer.interface, .result_only); + try file_writer.interface.flush(); } const lib_final_path = try std.fs.path.join(gpa, &.{ "o", &digest, final_lib_basename }); diff --git a/src/main.zig b/src/main.zig index ea80e8556cf7..0cb2ab9bec60 100644 --- a/src/main.zig +++ b/src/main.zig @@ -204,17 +204,6 @@ pub fn main() anyerror!void { return mainArgs(gpa, arena, args); } -/// Check that LLVM and Clang have been linked properly so that they are using the same -/// libc++ and can safely share objects with pointers to static variables in libc++ -fn verifyLibcxxCorrectlyLinked() void { - if (build_options.have_llvm and ZigClangIsLLVMUsingSeparateLibcxx()) { - fatal( - \\Zig was built/linked incorrectly: LLVM and Clang have separate copies of libc++ - \\ If you are dynamically linking LLVM, make sure you dynamically link libc++ too - , .{}); - } -} - fn mainArgs(gpa: Allocator, arena: Allocator, args: []const []const u8) !void { const tr = tracy.trace(@src()); defer tr.end(); @@ -350,13 +339,9 @@ fn mainArgs(gpa: Allocator, arena: Allocator, args: []const []const u8) !void { } else if (mem.eql(u8, cmd, "version")) { dev.check(.version_command); try fs.File.stdout().writeAll(build_options.version ++ "\n"); - // Check libc++ linkage to make sure Zig was built correctly, but only - // for "env" and "version" to avoid affecting the startup time for - // build-critical commands (check takes about ~10 μs) - return verifyLibcxxCorrectlyLinked(); + return; } else if (mem.eql(u8, cmd, "env")) { dev.check(.env_command); - verifyLibcxxCorrectlyLinked(); var stdout_writer = fs.File.stdout().writer(&stdout_buffer); try @import("print_env.zig").cmdEnv( arena, @@ -4545,179 +4530,64 @@ fn cmdTranslateC( prog_node: std.Progress.Node, ) !void { dev.check(.translate_c_command); + _ = file_system_inputs; + _ = fancy_output; - const color: Color = .auto; assert(comp.c_source_files.len == 1); const c_source_file = comp.c_source_files[0]; - const translated_zig_basename = try std.fmt.allocPrint(arena, "{s}.zig", .{comp.root_name}); - - var man: Cache.Manifest = comp.obtainCObjectCacheManifest(comp.root_mod); - man.want_shared_lock = false; - defer man.deinit(); + var zig_cache_tmp_dir = try comp.dirs.local_cache.handle.makeOpenPath("tmp", .{}); + defer zig_cache_tmp_dir.close(); - man.hash.add(@as(u16, 0xb945)); // Random number to distinguish translate-c from compiling C objects - man.hash.add(comp.config.c_frontend); - Compilation.cache_helpers.hashCSource(&man, c_source_file) catch |err| { - fatal("unable to process '{s}': {s}", .{ c_source_file.src_path, @errorName(err) }); + const ext = Compilation.classifyFileExt(c_source_file.src_path); + const out_dep_path: ?[]const u8 = blk: { + if (comp.disable_c_depfile) break :blk null; + const c_src_basename = fs.path.basename(c_source_file.src_path); + const dep_basename = try std.fmt.allocPrint(arena, "{s}.d", .{c_src_basename}); + const out_dep_path = try comp.tmpFilePath(arena, dep_basename); + break :blk out_dep_path; }; - if (fancy_output) |p| p.cache_hit = true; - const bin_digest, const hex_digest = if (try man.hit()) digest: { - if (file_system_inputs) |buf| try man.populateFileSystemInputs(buf); - const bin_digest = man.finalBin(); - const hex_digest = Cache.binToHex(bin_digest); - break :digest .{ bin_digest, hex_digest }; - } else digest: { - if (fancy_output) |p| p.cache_hit = false; - var argv = std.array_list.Managed([]const u8).init(arena); - switch (comp.config.c_frontend) { - .aro => {}, - .clang => { - // argv[0] is program name, actual args start at [1] - try argv.append(@tagName(comp.config.c_frontend)); - }, - } - - var zig_cache_tmp_dir = try comp.dirs.local_cache.handle.makeOpenPath("tmp", .{}); - defer zig_cache_tmp_dir.close(); - - const ext = Compilation.classifyFileExt(c_source_file.src_path); - const out_dep_path: ?[]const u8 = blk: { - if (comp.config.c_frontend == .aro or comp.disable_c_depfile or !ext.clangSupportsDepFile()) - break :blk null; - - const c_src_basename = fs.path.basename(c_source_file.src_path); - const dep_basename = try std.fmt.allocPrint(arena, "{s}.d", .{c_src_basename}); - const out_dep_path = try comp.tmpFilePath(arena, dep_basename); - break :blk out_dep_path; - }; - - // TODO - if (comp.config.c_frontend != .aro) - try comp.addTranslateCCArgs(arena, &argv, ext, out_dep_path, comp.root_mod); - try argv.append(c_source_file.src_path); - - if (comp.verbose_cc) { - Compilation.dump_argv(argv.items); - } - - const Result = union(enum) { - success: []const u8, - error_bundle: std.zig.ErrorBundle, + var argv = std.array_list.Managed([]const u8).init(arena); + try comp.addTranslateCCArgs(arena, &argv, ext, out_dep_path, comp.root_mod); + try argv.append(c_source_file.src_path); + if (comp.verbose_cc) Compilation.dump_argv(argv.items); + + try translateC(comp.gpa, arena, argv.items, prog_node, null); + + if (out_dep_path) |dep_file_path| { + const dep_basename = fs.path.basename(dep_file_path); + // Add the files depended on to the cache system. + //man.addDepFilePost(zig_cache_tmp_dir, dep_basename) catch |err| switch (err) { + // error.FileNotFound => { + // // Clang didn't emit the dep file; nothing to add to the manifest. + // break :add_deps; + // }, + // else => |e| return e, + //}; + // Just to save disk space, we delete the file because it is never needed again. + zig_cache_tmp_dir.deleteFile(dep_basename) catch |err| { + warn("failed to delete '{s}': {t}", .{ dep_file_path, err }); }; + } - const result: Result = switch (comp.config.c_frontend) { - .aro => f: { - var stdout: []u8 = undefined; - try jitCmd(comp.gpa, arena, argv.items, .{ - .cmd_name = "aro_translate_c", - .root_src_path = "aro_translate_c.zig", - .depend_on_aro = true, - .capture = &stdout, - .progress_node = prog_node, - }); - break :f .{ .success = stdout }; - }, - .clang => f: { - if (!build_options.have_llvm) unreachable; - const translate_c = @import("translate_c.zig"); - - // Convert to null terminated args. - const clang_args_len = argv.items.len + c_source_file.extra_flags.len; - const new_argv_with_sentinel = try arena.alloc(?[*:0]const u8, clang_args_len + 1); - new_argv_with_sentinel[clang_args_len] = null; - const new_argv = new_argv_with_sentinel[0..clang_args_len :null]; - for (argv.items, 0..) |arg, i| { - new_argv[i] = try arena.dupeZ(u8, arg); - } - for (c_source_file.extra_flags, 0..) |arg, i| { - new_argv[argv.items.len + i] = try arena.dupeZ(u8, arg); - } - - const c_headers_dir_path_z = try comp.dirs.zig_lib.joinZ(arena, &.{"include"}); - var errors = std.zig.ErrorBundle.empty; - var tree = translate_c.translate( - comp.gpa, - new_argv.ptr, - new_argv.ptr + new_argv.len, - &errors, - c_headers_dir_path_z, - ) catch |err| switch (err) { - error.OutOfMemory => return error.OutOfMemory, - error.SemanticAnalyzeFail => break :f .{ .error_bundle = errors }, - }; - defer tree.deinit(comp.gpa); - break :f .{ .success = try tree.renderAlloc(arena) }; - }, - }; - - if (out_dep_path) |dep_file_path| add_deps: { - const dep_basename = fs.path.basename(dep_file_path); - // Add the files depended on to the cache system. - man.addDepFilePost(zig_cache_tmp_dir, dep_basename) catch |err| switch (err) { - error.FileNotFound => { - // Clang didn't emit the dep file; nothing to add to the manifest. - break :add_deps; - }, - else => |e| return e, - }; - // Just to save disk space, we delete the file because it is never needed again. - zig_cache_tmp_dir.deleteFile(dep_basename) catch |err| { - warn("failed to delete '{s}': {s}", .{ dep_file_path, @errorName(err) }); - }; - } - - const formatted = switch (result) { - .success => |formatted| formatted, - .error_bundle => |eb| { - if (file_system_inputs) |buf| try man.populateFileSystemInputs(buf); - if (fancy_output) |p| { - p.errors = eb; - return; - } else { - eb.renderToStdErr(color.renderOptions()); - process.exit(1); - } - }, - }; - - const bin_digest = man.finalBin(); - const hex_digest = Cache.binToHex(bin_digest); - - const o_sub_path = try fs.path.join(arena, &[_][]const u8{ "o", &hex_digest }); - - var o_dir = try comp.dirs.local_cache.handle.makeOpenPath(o_sub_path, .{}); - defer o_dir.close(); - - var zig_file = try o_dir.createFile(translated_zig_basename, .{}); - defer zig_file.close(); - - try zig_file.writeAll(formatted); - - man.writeManifest() catch |err| warn("failed to write cache manifest: {t}", .{err}); - - if (file_system_inputs) |buf| try man.populateFileSystemInputs(buf); - - break :digest .{ bin_digest, hex_digest }; - }; + return cleanExit(); +} - if (fancy_output) |p| { - p.digest = bin_digest; - p.errors = std.zig.ErrorBundle.empty; - } else { - const out_zig_path = try fs.path.join(arena, &.{ "o", &hex_digest, translated_zig_basename }); - const zig_file = comp.dirs.local_cache.handle.openFile(out_zig_path, .{}) catch |err| { - const path = comp.dirs.local_cache.path orelse "."; - fatal("unable to open cached translated zig file '{s}{s}{s}': {s}", .{ path, fs.path.sep_str, out_zig_path, @errorName(err) }); - }; - defer zig_file.close(); - var stdout_writer = fs.File.stdout().writer(&stdout_buffer); - var file_reader = zig_file.reader(&.{}); - _ = try stdout_writer.interface.sendFileAll(&file_reader, .unlimited); - try stdout_writer.interface.flush(); - return cleanExit(); - } +pub fn translateC( + gpa: Allocator, + arena: Allocator, + argv: []const []const u8, + prog_node: std.Progress.Node, + capture: ?*[]u8, +) !void { + try jitCmd(gpa, arena, argv, .{ + .cmd_name = "translate-c", + .root_src_path = "translate-c/main.zig", + .depend_on_aro = true, + .progress_node = prog_node, + .capture = capture, + }); } const usage_init = @@ -5676,12 +5546,13 @@ fn jitCmd( child_argv.appendSliceAssumeCapacity(args); if (process.can_execv and options.capture == null) { + if (EnvVar.ZIG_DEBUG_CMD.isSet()) { + const cmd = try std.mem.join(arena, " ", child_argv.items); + std.debug.print("{s}\n", .{cmd}); + } const err = process.execv(gpa, child_argv.items); const cmd = try std.mem.join(arena, " ", child_argv.items); - fatal("the following command failed to execve with '{s}':\n{s}", .{ - @errorName(err), - cmd, - }); + fatal("the following command failed to execve with '{t}':\n{s}", .{ err, cmd }); } if (!process.can_spawn) { diff --git a/src/translate_c.zig b/src/translate_c.zig deleted file mode 100644 index d481643e3589..000000000000 --- a/src/translate_c.zig +++ /dev/null @@ -1,6681 +0,0 @@ -const std = @import("std"); -const testing = std.testing; -const assert = std.debug.assert; -const mem = std.mem; -const math = std.math; -const meta = std.meta; -const clang = @import("clang.zig"); -const aro = @import("aro"); -const CToken = aro.Tokenizer.Token; -const Node = ast.Node; -const Tag = Node.Tag; -const common = @import("aro_translate_c"); -const ast = common.ast; -const Error = common.Error; -const MacroProcessingError = common.MacroProcessingError; -const TypeError = common.TypeError; -const TransError = common.TransError; -const SymbolTable = common.SymbolTable; -const AliasList = common.AliasList; -const ResultUsed = common.ResultUsed; -const Scope = common.ScopeExtra(Context, clang.QualType); -const PatternList = common.PatternList; -const MacroSlicer = common.MacroSlicer; - -pub const Context = struct { - gpa: mem.Allocator, - arena: mem.Allocator, - source_manager: *clang.SourceManager, - decl_table: std.AutoArrayHashMapUnmanaged(usize, []const u8) = .empty, - alias_list: AliasList, - global_scope: *Scope.Root, - clang_context: *clang.ASTContext, - mangle_count: u32 = 0, - /// Table of record decls that have been demoted to opaques. - opaque_demotes: std.AutoHashMapUnmanaged(usize, void) = .empty, - /// Table of unnamed enums and records that are child types of typedefs. - unnamed_typedefs: std.AutoHashMapUnmanaged(usize, []const u8) = .empty, - /// Needed to decide if we are parsing a typename - typedefs: std.StringArrayHashMapUnmanaged(void) = .empty, - - /// This one is different than the root scope's name table. This contains - /// a list of names that we found by visiting all the top level decls without - /// translating them. The other maps are updated as we translate; this one is updated - /// up front in a pre-processing step. - global_names: std.StringArrayHashMapUnmanaged(void) = .empty, - - /// This is similar to `global_names`, but contains names which we would - /// *like* to use, but do not strictly *have* to if they are unavailable. - /// These are relevant to types, which ideally we would name like - /// 'struct_foo' with an alias 'foo', but if either of those names is taken, - /// may be mangled. - /// This is distinct from `global_names` so we can detect at a type - /// declaration whether or not the name is available. - weak_global_names: std.StringArrayHashMapUnmanaged(void) = .empty, - - pattern_list: PatternList, - - fn getMangle(c: *Context) u32 { - c.mangle_count += 1; - return c.mangle_count; - } - - /// Convert a null-terminated C string to a slice allocated in the arena - fn str(c: *Context, s: [*:0]const u8) ![]u8 { - return c.arena.dupe(u8, mem.sliceTo(s, 0)); - } - - /// Convert a clang source location to a file:line:column string - fn locStr(c: *Context, loc: clang.SourceLocation) ![]u8 { - const spelling_loc = c.source_manager.getSpellingLoc(loc); - const filename_c = c.source_manager.getFilename(spelling_loc); - const filename = if (filename_c) |s| try c.str(s) else @as([]const u8, "(no file)"); - - const line = c.source_manager.getSpellingLineNumber(spelling_loc); - const column = c.source_manager.getSpellingColumnNumber(spelling_loc); - return std.fmt.allocPrint(c.arena, "{s}:{d}:{d}", .{ filename, line, column }); - } -}; - -pub fn translate( - gpa: mem.Allocator, - args_begin: [*]?[*:0]const u8, - args_end: [*]?[*:0]const u8, - errors: *std.zig.ErrorBundle, - resources_path: [*:0]const u8, -) !std.zig.Ast { - var clang_errors: []clang.ErrorMsg = &.{}; - - const ast_unit = clang.LoadFromCommandLine( - args_begin, - args_end, - &clang_errors.ptr, - &clang_errors.len, - resources_path, - ) orelse { - defer clang.ErrorMsg.delete(clang_errors.ptr, clang_errors.len); - - var bundle: std.zig.ErrorBundle.Wip = undefined; - try bundle.init(gpa); - defer bundle.deinit(); - - for (clang_errors) |c_error| { - const line = line: { - const source = c_error.source orelse break :line 0; - var start = c_error.offset; - while (start > 0) : (start -= 1) { - if (source[start - 1] == '\n') break; - } - var end = c_error.offset; - while (true) : (end += 1) { - if (source[end] == 0) break; - if (source[end] == '\n') break; - } - break :line try bundle.addString(source[start..end]); - }; - - try bundle.addRootErrorMessage(.{ - .msg = try bundle.addString(c_error.msg_ptr[0..c_error.msg_len]), - .src_loc = if (c_error.filename_ptr) |filename_ptr| try bundle.addSourceLocation(.{ - .src_path = try bundle.addString(filename_ptr[0..c_error.filename_len]), - .span_start = c_error.offset, - .span_main = c_error.offset, - .span_end = c_error.offset + 1, - .line = c_error.line, - .column = c_error.column, - .source_line = line, - }) else .none, - }); - } - errors.* = try bundle.toOwnedBundle(""); - - return error.SemanticAnalyzeFail; - }; - defer ast_unit.delete(); - - // For memory that has the same lifetime as the Ast that we return - // from this function. - var arena_allocator = std.heap.ArenaAllocator.init(gpa); - defer arena_allocator.deinit(); - const arena = arena_allocator.allocator(); - - var context = Context{ - .gpa = gpa, - .arena = arena, - .source_manager = ast_unit.getSourceManager(), - .alias_list = AliasList.init(gpa), - .global_scope = try arena.create(Scope.Root), - .clang_context = ast_unit.getASTContext(), - .pattern_list = try PatternList.init(gpa), - }; - context.global_scope.* = Scope.Root.init(&context); - defer { - context.decl_table.deinit(gpa); - context.alias_list.deinit(); - context.global_names.deinit(gpa); - context.opaque_demotes.deinit(gpa); - context.unnamed_typedefs.deinit(gpa); - context.typedefs.deinit(gpa); - context.global_scope.deinit(); - context.pattern_list.deinit(gpa); - } - - @setEvalBranchQuota(2000); - inline for (@typeInfo(std.zig.c_builtins).@"struct".decls) |decl| { - const builtin = try Tag.pub_var_simple.create(arena, .{ - .name = decl.name, - .init = try Tag.import_c_builtin.create(arena, decl.name), - }); - try addTopLevelDecl(&context, decl.name, builtin); - } - - try prepopulateGlobalNameTable(ast_unit, &context); - - if (!ast_unit.visitLocalTopLevelDecls(&context, declVisitorC)) { - return error.OutOfMemory; - } - - try transPreprocessorEntities(&context, ast_unit); - - for (context.alias_list.items) |alias| { - const node = try Tag.alias.create(arena, .{ .actual = alias.alias, .mangled = alias.name }); - try addTopLevelDecl(&context, alias.alias, node); - } - - return ast.render(gpa, context.global_scope.nodes.items); -} - -/// Determines whether macro is of the form: `#define FOO FOO` (Possibly with trailing tokens) -/// Macros of this form will not be translated. -fn isSelfDefinedMacro(unit: *const clang.ASTUnit, c: *const Context, macro: *const clang.MacroDefinitionRecord) !bool { - const source = try getMacroText(unit, c, macro); - var tokenizer: aro.Tokenizer = .{ - .buf = source, - .source = .unused, - .langopts = .{}, - }; - const name_tok = tokenizer.nextNoWS(); - const name = source[name_tok.start..name_tok.end]; - - const first_tok = tokenizer.nextNoWS(); - // We do not just check for `.Identifier` below because keyword tokens are preferentially matched first by - // the tokenizer. - // In other words we would miss `#define inline inline` (`inline` is a valid c89 identifier) - if (first_tok.id == .eof) return false; - return mem.eql(u8, name, source[first_tok.start..first_tok.end]); -} - -fn prepopulateGlobalNameTable(ast_unit: *clang.ASTUnit, c: *Context) !void { - if (!ast_unit.visitLocalTopLevelDecls(c, declVisitorNamesOnlyC)) { - return error.OutOfMemory; - } - - // TODO if we see #undef, delete it from the table - var it = ast_unit.getLocalPreprocessingEntities_begin(); - const it_end = ast_unit.getLocalPreprocessingEntities_end(); - - while (it.I != it_end.I) : (it.I += 1) { - const entity = it.deref(); - switch (entity.getKind()) { - .MacroDefinitionKind => { - const macro = @as(*clang.MacroDefinitionRecord, @ptrCast(entity)); - const raw_name = macro.getName_getNameStart(); - const name = try c.str(raw_name); - - if (!try isSelfDefinedMacro(ast_unit, c, macro)) { - try c.global_names.put(c.gpa, name, {}); - } - }, - else => {}, - } - } -} - -fn declVisitorNamesOnlyC(context: ?*anyopaque, decl: *const clang.Decl) callconv(.c) bool { - const c: *Context = @ptrCast(@alignCast(context)); - declVisitorNamesOnly(c, decl) catch return false; - return true; -} - -fn declVisitorC(context: ?*anyopaque, decl: *const clang.Decl) callconv(.c) bool { - const c: *Context = @ptrCast(@alignCast(context)); - declVisitor(c, decl) catch return false; - return true; -} - -fn declVisitorNamesOnly(c: *Context, decl: *const clang.Decl) Error!void { - if (decl.castToNamedDecl()) |named_decl| { - const decl_name = try c.str(named_decl.getName_bytes_begin()); - - switch (decl.getKind()) { - .Record, .Enum => { - // These types are prefixed with the container kind. - const container_prefix = if (decl.getKind() == .Record) prefix: { - const record_decl: *const clang.RecordDecl = @ptrCast(decl); - if (record_decl.isUnion()) { - break :prefix "union"; - } else { - break :prefix "struct"; - } - } else "enum"; - const prefixed_name = try std.fmt.allocPrint(c.arena, "{s}_{s}", .{ container_prefix, decl_name }); - // `decl_name` and `prefixed_name` are the preferred names for this type. - // However, we can name it anything else if necessary, so these are "weak names". - try c.weak_global_names.ensureUnusedCapacity(c.gpa, 2); - c.weak_global_names.putAssumeCapacity(decl_name, {}); - c.weak_global_names.putAssumeCapacity(prefixed_name, {}); - }, - else => { - try c.global_names.put(c.gpa, decl_name, {}); - }, - } - - // Check for typedefs with unnamed enum/record child types. - if (decl.getKind() == .Typedef) { - const typedef_decl = @as(*const clang.TypedefNameDecl, @ptrCast(decl)); - var child_ty = typedef_decl.getUnderlyingType().getTypePtr(); - const addr: usize = while (true) switch (child_ty.getTypeClass()) { - .Enum => { - const enum_ty = @as(*const clang.EnumType, @ptrCast(child_ty)); - const enum_decl = enum_ty.getDecl(); - // check if this decl is unnamed - if (@as(*const clang.NamedDecl, @ptrCast(enum_decl)).getName_bytes_begin()[0] != 0) return; - break @intFromPtr(enum_decl.getCanonicalDecl()); - }, - .Record => { - const record_ty = @as(*const clang.RecordType, @ptrCast(child_ty)); - const record_decl = record_ty.getDecl(); - // check if this decl is unnamed - if (@as(*const clang.NamedDecl, @ptrCast(record_decl)).getName_bytes_begin()[0] != 0) return; - break @intFromPtr(record_decl.getCanonicalDecl()); - }, - .Elaborated => { - const elaborated_ty = @as(*const clang.ElaboratedType, @ptrCast(child_ty)); - child_ty = elaborated_ty.getNamedType().getTypePtr(); - }, - .Decayed => { - const decayed_ty = @as(*const clang.DecayedType, @ptrCast(child_ty)); - child_ty = decayed_ty.getDecayedType().getTypePtr(); - }, - .Attributed => { - const attributed_ty = @as(*const clang.AttributedType, @ptrCast(child_ty)); - child_ty = attributed_ty.getEquivalentType().getTypePtr(); - }, - .MacroQualified => { - const macroqualified_ty = @as(*const clang.MacroQualifiedType, @ptrCast(child_ty)); - child_ty = macroqualified_ty.getModifiedType().getTypePtr(); - }, - else => return, - }; - - const result = try c.unnamed_typedefs.getOrPut(c.gpa, addr); - if (result.found_existing) { - // One typedef can declare multiple names. - // Don't put this one in `decl_table` so it's processed later. - return; - } - result.value_ptr.* = decl_name; - // Put this typedef in the decl_table to avoid redefinitions. - try c.decl_table.putNoClobber(c.gpa, @intFromPtr(typedef_decl.getCanonicalDecl()), decl_name); - try c.typedefs.put(c.gpa, decl_name, {}); - } - } -} - -fn declVisitor(c: *Context, decl: *const clang.Decl) Error!void { - switch (decl.getKind()) { - .Function => { - return transFnDecl(c, &c.global_scope.base, @as(*const clang.FunctionDecl, @ptrCast(decl))); - }, - .Typedef => { - try transTypeDef(c, &c.global_scope.base, @as(*const clang.TypedefNameDecl, @ptrCast(decl))); - }, - .Enum => { - try transEnumDecl(c, &c.global_scope.base, @as(*const clang.EnumDecl, @ptrCast(decl))); - }, - .Record => { - try transRecordDecl(c, &c.global_scope.base, @as(*const clang.RecordDecl, @ptrCast(decl))); - }, - .Var => { - return visitVarDecl(c, @as(*const clang.VarDecl, @ptrCast(decl)), null); - }, - .Empty => { - // Do nothing - }, - .FileScopeAsm => { - try transFileScopeAsm(c, &c.global_scope.base, @as(*const clang.FileScopeAsmDecl, @ptrCast(decl))); - }, - else => { - const decl_name = try c.str(decl.getDeclKindName()); - try warn(c, &c.global_scope.base, decl.getLocation(), "ignoring {s} declaration", .{decl_name}); - }, - } -} - -fn transFileScopeAsm(c: *Context, scope: *Scope, file_scope_asm: *const clang.FileScopeAsmDecl) Error!void { - const asm_string = file_scope_asm.getAsmString(); - var len: usize = undefined; - const bytes_ptr = asm_string.getString_bytes_begin_size(&len); - - const str = try std.fmt.allocPrint(c.arena, "\"{f}\"", .{std.zig.fmtString(bytes_ptr[0..len])}); - const str_node = try Tag.string_literal.create(c.arena, str); - - const asm_node = try Tag.asm_simple.create(c.arena, str_node); - const block = try Tag.block_single.create(c.arena, asm_node); - const comptime_node = try Tag.@"comptime".create(c.arena, block); - - try scope.appendNode(comptime_node); -} - -fn transFnDecl(c: *Context, scope: *Scope, fn_decl: *const clang.FunctionDecl) Error!void { - const fn_name = try c.str(@as(*const clang.NamedDecl, @ptrCast(fn_decl)).getName_bytes_begin()); - if (c.global_scope.sym_table.contains(fn_name)) - return; // Avoid processing this decl twice - - // Skip this declaration if a proper definition exists - if (!fn_decl.isThisDeclarationADefinition()) { - if (fn_decl.getDefinition()) |def| - return transFnDecl(c, scope, def); - } - - const fn_decl_loc = fn_decl.getLocation(); - const has_body = fn_decl.hasBody(); - const storage_class = fn_decl.getStorageClass(); - const is_always_inline = has_body and fn_decl.hasAlwaysInlineAttr(); - var decl_ctx = FnDeclContext{ - .fn_name = fn_name, - .has_body = has_body, - .storage_class = storage_class, - .is_always_inline = is_always_inline, - .is_export = switch (storage_class) { - .None => has_body and !is_always_inline and !fn_decl.isInlineSpecified(), - .Extern, .Static => false, - .PrivateExtern => return failDecl(c, fn_decl_loc, fn_name, "unsupported storage class: private extern", .{}), - .Auto => unreachable, // Not legal on functions - .Register => unreachable, // Not legal on functions - }, - }; - - var fn_qt = fn_decl.getType(); - - const fn_type = while (true) { - const fn_type = fn_qt.getTypePtr(); - - switch (fn_type.getTypeClass()) { - .Attributed => { - const attr_type: *const clang.AttributedType = @ptrCast(fn_type); - fn_qt = attr_type.getEquivalentType(); - }, - .Paren => { - const paren_type: *const clang.ParenType = @ptrCast(fn_type); - fn_qt = paren_type.getInnerType(); - }, - .MacroQualified => { - const macroqualified_ty: *const clang.MacroQualifiedType = @ptrCast(fn_type); - fn_qt = macroqualified_ty.getModifiedType(); - }, - else => break fn_type, - } - }; - const fn_ty: *const clang.FunctionType = @ptrCast(fn_type); - const return_qt = fn_ty.getReturnType(); - - const proto_node = switch (fn_type.getTypeClass()) { - .FunctionProto => blk: { - const fn_proto_type: *const clang.FunctionProtoType = @ptrCast(fn_type); - if (has_body and fn_proto_type.isVariadic()) { - decl_ctx.has_body = false; - decl_ctx.storage_class = .Extern; - decl_ctx.is_export = false; - decl_ctx.is_always_inline = false; - try warn(c, &c.global_scope.base, fn_decl_loc, "TODO unable to translate variadic function, demoted to extern", .{}); - } - break :blk transFnProto(c, fn_decl, fn_proto_type, fn_decl_loc, decl_ctx, true) catch |err| switch (err) { - error.UnsupportedType => { - return failDecl(c, fn_decl_loc, fn_name, "unable to resolve prototype of function", .{}); - }, - error.OutOfMemory => |e| return e, - }; - }, - .FunctionNoProto => blk: { - const fn_no_proto_type: *const clang.FunctionType = @ptrCast(fn_type); - break :blk transFnNoProto(c, fn_no_proto_type, fn_decl_loc, decl_ctx, true) catch |err| switch (err) { - error.UnsupportedType => { - return failDecl(c, fn_decl_loc, fn_name, "unable to resolve prototype of function", .{}); - }, - error.OutOfMemory => |e| return e, - }; - }, - else => return failDecl(c, fn_decl_loc, fn_name, "unable to resolve function type {}", .{fn_type.getTypeClass()}), - }; - - if (!decl_ctx.has_body) { - if (scope.id != .root) { - return addLocalExternFnDecl(c, scope, fn_name, Node.initPayload(&proto_node.base)); - } - return addTopLevelDecl(c, fn_name, Node.initPayload(&proto_node.base)); - } - - // actual function definition with body - const body_stmt = fn_decl.getBody(); - var block_scope = try Scope.Block.init(c, &c.global_scope.base, false); - block_scope.return_type = return_qt; - defer block_scope.deinit(); - - const top_scope = &block_scope.base; - - var param_id: c_uint = 0; - for (proto_node.data.params) |*param| { - const param_name = param.name orelse { - proto_node.data.is_extern = true; - proto_node.data.is_export = false; - proto_node.data.is_inline = false; - try warn(c, &c.global_scope.base, fn_decl_loc, "function {s} parameter has no name, demoted to extern", .{fn_name}); - return addTopLevelDecl(c, fn_name, Node.initPayload(&proto_node.base)); - }; - - const c_param = fn_decl.getParamDecl(param_id); - const qual_type = c_param.getOriginalType(); - const is_const = qual_type.isConstQualified(); - - const mangled_param_name = try block_scope.makeMangledName(c, param_name); - param.name = mangled_param_name; - - if (!is_const) { - const bare_arg_name = try std.fmt.allocPrint(c.arena, "arg_{s}", .{mangled_param_name}); - const arg_name = try block_scope.makeMangledName(c, bare_arg_name); - param.name = arg_name; - - const redecl_node = try Tag.arg_redecl.create(c.arena, .{ .actual = mangled_param_name, .mangled = arg_name }); - try block_scope.statements.append(redecl_node); - } - try block_scope.discardVariable(c, mangled_param_name); - - param_id += 1; - } - - const casted_body: *const clang.CompoundStmt = @ptrCast(body_stmt); - transCompoundStmtInline(c, casted_body, &block_scope) catch |err| switch (err) { - error.OutOfMemory => |e| return e, - error.UnsupportedTranslation, - error.UnsupportedType, - => { - proto_node.data.is_extern = true; - proto_node.data.is_export = false; - proto_node.data.is_inline = false; - try warn(c, &c.global_scope.base, fn_decl_loc, "unable to translate function, demoted to extern", .{}); - return addTopLevelDecl(c, fn_name, Node.initPayload(&proto_node.base)); - }, - }; - // add return statement if the function didn't have one - blk: { - const maybe_body = try block_scope.complete(c); - if (fn_ty.getNoReturnAttr() or isAnyopaque(return_qt) or maybe_body.isNoreturn(false)) { - proto_node.data.body = maybe_body; - break :blk; - } - - const rhs = transZeroInitExpr(c, top_scope, fn_decl_loc, return_qt.getTypePtr()) catch |err| switch (err) { - error.OutOfMemory => |e| return e, - error.UnsupportedTranslation, - error.UnsupportedType, - => { - proto_node.data.is_extern = true; - proto_node.data.is_export = false; - proto_node.data.is_inline = false; - try warn(c, &c.global_scope.base, fn_decl_loc, "unable to create a return value for function, demoted to extern", .{}); - return addTopLevelDecl(c, fn_name, Node.initPayload(&proto_node.base)); - }, - }; - const ret = try Tag.@"return".create(c.arena, rhs); - try block_scope.statements.append(ret); - proto_node.data.body = try block_scope.complete(c); - } - - return addTopLevelDecl(c, fn_name, Node.initPayload(&proto_node.base)); -} - -fn transQualTypeMaybeInitialized(c: *Context, scope: *Scope, qt: clang.QualType, decl_init: ?*const clang.Expr, loc: clang.SourceLocation) TransError!Node { - return if (decl_init) |init_expr| - transQualTypeInitialized(c, scope, qt, init_expr, loc) - else - transQualType(c, scope, qt, loc); -} - -/// This is used in global scope to convert a string literal `S` to [*c]u8: -/// &(struct { -/// var static = S.*; -/// }).static; -fn stringLiteralToCharStar(c: *Context, str: Node) Error!Node { - const var_name = Scope.Block.static_inner_name; - - const variables = try c.arena.alloc(Node, 1); - variables[0] = try Tag.mut_str.create(c.arena, .{ .name = var_name, .init = str }); - - const anon_struct = try Tag.@"struct".create(c.arena, .{ - .layout = .none, - .fields = &.{}, - .functions = &.{}, - .variables = variables, - }); - - const member_access = try Tag.field_access.create(c.arena, .{ - .lhs = anon_struct, - .field_name = var_name, - }); - return Tag.address_of.create(c.arena, member_access); -} - -/// if mangled_name is not null, this var decl was declared in a block scope. -fn visitVarDecl(c: *Context, var_decl: *const clang.VarDecl, mangled_name: ?[]const u8) Error!void { - const var_name = mangled_name orelse try c.str(@as(*const clang.NamedDecl, @ptrCast(var_decl)).getName_bytes_begin()); - if (c.global_scope.sym_table.contains(var_name)) - return; // Avoid processing this decl twice - - const is_pub = mangled_name == null; - const is_threadlocal = var_decl.getTLSKind() != .None; - const scope = &c.global_scope.base; - const var_decl_loc = var_decl.getLocation(); - - const qual_type = var_decl.getTypeSourceInfo_getType(); - const storage_class = var_decl.getStorageClass(); - const has_init = var_decl.hasInit(); - const decl_init = var_decl.getInit(); - var is_const = qual_type.isConstQualified(); - - // In C extern variables with initializers behave like Zig exports. - // extern int foo = 2; - // does the same as: - // extern int foo; - // int foo = 2; - var is_extern = storage_class == .Extern and !has_init; - var is_export = !is_extern and storage_class != .Static; - - if (!is_extern and qualTypeWasDemotedToOpaque(c, qual_type)) { - return failDecl(c, var_decl_loc, var_name, "non-extern variable has opaque type", .{}); - } - - const type_node = transQualTypeMaybeInitialized(c, scope, qual_type, decl_init, var_decl_loc) catch |err| switch (err) { - error.UnsupportedTranslation, error.UnsupportedType => { - return failDecl(c, var_decl_loc, var_name, "unable to resolve variable type", .{}); - }, - error.OutOfMemory => |e| return e, - }; - - var init_node: ?Node = null; - - // If the initialization expression is not present, initialize with undefined. - // If it is an integer literal, we can skip the @as since it will be redundant - // with the variable type. - if (has_init) trans_init: { - if (decl_init) |expr| { - const node_or_error = if (expr.getStmtClass() == .StringLiteralClass) - transStringLiteralInitializer(c, @as(*const clang.StringLiteral, @ptrCast(expr)), type_node) - else - transExprCoercing(c, scope, expr, .used); - init_node = node_or_error catch |err| switch (err) { - error.UnsupportedTranslation, - error.UnsupportedType, - => { - is_extern = true; - is_export = false; - try warn(c, scope, var_decl_loc, "unable to translate variable initializer, demoted to extern", .{}); - break :trans_init; - }, - error.OutOfMemory => |e| return e, - }; - if (!qualTypeIsBoolean(qual_type) and isBoolRes(init_node.?)) { - init_node = try Tag.int_from_bool.create(c.arena, init_node.?); - } else if (init_node.?.tag() == .string_literal and qualTypeIsCharStar(qual_type)) { - init_node = try stringLiteralToCharStar(c, init_node.?); - } - } else { - init_node = Tag.undefined_literal.init(); - } - } else if (storage_class != .Extern) { - // The C language specification states that variables with static or threadlocal - // storage without an initializer are initialized to a zero value. - - // std.mem.zeroes(T) - init_node = try Tag.std_mem_zeroes.create(c.arena, type_node); - } else if (qual_type.getTypeClass() == .IncompleteArray) { - // Oh no, an extern array of unknown size! These are really fun because there's no - // direct equivalent in Zig. To translate correctly, we'll have to create a C-pointer - // to the data initialized via @extern. - - const name_str = try std.fmt.allocPrint(c.arena, "\"{s}\"", .{var_name}); - init_node = try Tag.builtin_extern.create(c.arena, .{ - .type = type_node, - .name = try Tag.string_literal.create(c.arena, name_str), - }); - - // Since this is really a pointer to the underlying data, we tweak a few properties. - is_extern = false; - is_const = true; - } - - const linksection_string = blk: { - var str_len: usize = undefined; - if (var_decl.getSectionAttribute(&str_len)) |str_ptr| { - break :blk str_ptr[0..str_len]; - } - break :blk null; - }; - - const node = try Tag.var_decl.create(c.arena, .{ - .is_pub = is_pub, - .is_const = is_const, - .is_extern = is_extern, - .is_export = is_export, - .is_threadlocal = is_threadlocal, - .linksection_string = linksection_string, - .alignment = ClangAlignment.forVar(c, var_decl).zigAlignment(), - .name = var_name, - .type = type_node, - .init = init_node, - }); - return addTopLevelDecl(c, var_name, node); -} - -const builtin_typedef_map = std.StaticStringMap([]const u8).initComptime(.{ - .{ "uint8_t", "u8" }, - .{ "int8_t", "i8" }, - .{ "uint16_t", "u16" }, - .{ "int16_t", "i16" }, - .{ "uint32_t", "u32" }, - .{ "int32_t", "i32" }, - .{ "uint64_t", "u64" }, - .{ "int64_t", "i64" }, - .{ "intptr_t", "isize" }, - .{ "uintptr_t", "usize" }, - .{ "ssize_t", "isize" }, - .{ "size_t", "usize" }, -}); - -fn transTypeDef(c: *Context, scope: *Scope, typedef_decl: *const clang.TypedefNameDecl) Error!void { - if (c.decl_table.get(@intFromPtr(typedef_decl.getCanonicalDecl()))) |_| - return; // Avoid processing this decl twice - const toplevel = scope.id == .root; - const bs: *Scope.Block = if (!toplevel) try scope.findBlockScope(c) else undefined; - - var name: []const u8 = try c.str(@as(*const clang.NamedDecl, @ptrCast(typedef_decl)).getName_bytes_begin()); - try c.typedefs.put(c.gpa, name, {}); - - if (builtin_typedef_map.get(name)) |builtin| { - return c.decl_table.putNoClobber(c.gpa, @intFromPtr(typedef_decl.getCanonicalDecl()), builtin); - } - if (!toplevel) name = try bs.makeMangledName(c, name); - try c.decl_table.putNoClobber(c.gpa, @intFromPtr(typedef_decl.getCanonicalDecl()), name); - - const child_qt = typedef_decl.getUnderlyingType(); - const typedef_loc = typedef_decl.getLocation(); - const init_node = transQualType(c, scope, child_qt, typedef_loc) catch |err| switch (err) { - error.UnsupportedType => { - return failDecl(c, typedef_loc, name, "unable to resolve typedef child type", .{}); - }, - error.OutOfMemory => |e| return e, - }; - - const payload = try c.arena.create(ast.Payload.SimpleVarDecl); - payload.* = .{ - .base = .{ .tag = ([2]Tag{ .var_simple, .pub_var_simple })[@intFromBool(toplevel)] }, - .data = .{ - .name = name, - .init = init_node, - }, - }; - const node = Node.initPayload(&payload.base); - - if (toplevel) { - try addTopLevelDecl(c, name, node); - } else { - try scope.appendNode(node); - if (node.tag() != .pub_var_simple) { - try bs.discardVariable(c, name); - } - } -} - -/// Build a getter function for a flexible array member at the end of a C struct -/// e.g. `T items[]` or `T items[0]`. The generated function returns a [*c] pointer -/// to the flexible array with the correct const and volatile qualifiers -fn buildFlexibleArrayFn( - c: *Context, - scope: *Scope, - layout: *const clang.ASTRecordLayout, - field_name: []const u8, - field_decl: *const clang.FieldDecl, -) TypeError!Node { - const field_qt = field_decl.getType(); - const field_qt_canon = qualTypeCanon(field_qt); - - const u8_type = try Tag.type.create(c.arena, "u8"); - const self_param_name = "self"; - const self_param = try Tag.identifier.create(c.arena, self_param_name); - const self_type = try Tag.typeof.create(c.arena, self_param); - - const fn_params = try c.arena.alloc(ast.Payload.Param, 1); - - fn_params[0] = .{ - .name = self_param_name, - .type = Tag.@"anytype".init(), - .is_noalias = false, - }; - - const array_type = @as(*const clang.ArrayType, @ptrCast(field_qt_canon)); - const element_qt = array_type.getElementType(); - const element_type = try transQualType(c, scope, element_qt, field_decl.getLocation()); - - var block_scope = try Scope.Block.init(c, scope, false); - defer block_scope.deinit(); - - const intermediate_type_name = try block_scope.makeMangledName(c, "Intermediate"); - const intermediate_type = try Tag.helpers_flexible_array_type.create(c.arena, .{ .lhs = self_type, .rhs = u8_type }); - const intermediate_type_decl = try Tag.var_simple.create(c.arena, .{ - .name = intermediate_type_name, - .init = intermediate_type, - }); - try block_scope.statements.append(intermediate_type_decl); - const intermediate_type_ident = try Tag.identifier.create(c.arena, intermediate_type_name); - - const return_type_name = try block_scope.makeMangledName(c, "ReturnType"); - const return_type = try Tag.helpers_flexible_array_type.create(c.arena, .{ .lhs = self_type, .rhs = element_type }); - const return_type_decl = try Tag.var_simple.create(c.arena, .{ - .name = return_type_name, - .init = return_type, - }); - try block_scope.statements.append(return_type_decl); - const return_type_ident = try Tag.identifier.create(c.arena, return_type_name); - - const field_index = field_decl.getFieldIndex(); - const bit_offset = layout.getFieldOffset(field_index); // this is a target-specific constant based on the struct layout - const byte_offset = bit_offset / 8; - - const casted_self = try Tag.as.create(c.arena, .{ - .lhs = intermediate_type_ident, - .rhs = try Tag.ptr_cast.create(c.arena, self_param), - }); - const field_offset = try transCreateNodeNumber(c, byte_offset, .int); - const field_ptr = try Tag.add.create(c.arena, .{ .lhs = casted_self, .rhs = field_offset }); - - const ptr_cast = try Tag.as.create(c.arena, .{ - .lhs = return_type_ident, - .rhs = try Tag.ptr_cast.create( - c.arena, - try Tag.align_cast.create( - c.arena, - field_ptr, - ), - ), - }); - const return_stmt = try Tag.@"return".create(c.arena, ptr_cast); - try block_scope.statements.append(return_stmt); - - const payload = try c.arena.create(ast.Payload.Func); - payload.* = .{ - .base = .{ .tag = .func }, - .data = .{ - .is_pub = true, - .is_extern = false, - .is_export = false, - .is_inline = false, - .is_var_args = false, - .name = field_name, - .linksection_string = null, - .explicit_callconv = null, - .params = fn_params, - .return_type = return_type, - .body = try block_scope.complete(c), - .alignment = null, - }, - }; - return Node.initPayload(&payload.base); -} - -/// Return true if `field_decl` is the flexible array field for its parent record -fn isFlexibleArrayFieldDecl(c: *Context, field_decl: *const clang.FieldDecl) bool { - const record_decl = field_decl.getParent() orelse return false; - const record_flexible_field = flexibleArrayField(c, record_decl) orelse return false; - return field_decl == record_flexible_field; -} - -/// Find the flexible array field for a record if any. A flexible array field is an -/// incomplete or zero-length array that occurs as the last field of a record. -/// clang's RecordDecl::hasFlexibleArrayMember is not suitable for determining -/// this because it returns false for a record that ends with a zero-length -/// array, but we consider those to be flexible arrays -fn flexibleArrayField(c: *Context, record_def: *const clang.RecordDecl) ?*const clang.FieldDecl { - var it = record_def.field_begin(); - const end_it = record_def.field_end(); - var flexible_field: ?*const clang.FieldDecl = null; - while (it.neq(end_it)) : (it = it.next()) { - const field_decl = it.deref(); - const ty = qualTypeCanon(field_decl.getType()); - const incomplete_or_zero_size = ty.isIncompleteOrZeroLengthArrayType(c.clang_context); - if (incomplete_or_zero_size) { - flexible_field = field_decl; - } else { - flexible_field = null; - } - } - return flexible_field; -} - -fn mangleWeakGlobalName(c: *Context, want_name: []const u8) ![]const u8 { - var cur_name = want_name; - - if (!c.weak_global_names.contains(want_name)) { - // This type wasn't noticed by the name detection pass, so nothing has been treating this as - // a weak global name. We must mangle it to avoid conflicts with locals. - cur_name = try std.fmt.allocPrint(c.arena, "{s}_{d}", .{ want_name, c.getMangle() }); - } - - while (c.global_names.contains(cur_name)) { - cur_name = try std.fmt.allocPrint(c.arena, "{s}_{d}", .{ want_name, c.getMangle() }); - } - return cur_name; -} - -fn transRecordDecl(c: *Context, scope: *Scope, record_decl: *const clang.RecordDecl) Error!void { - if (c.decl_table.get(@intFromPtr(record_decl.getCanonicalDecl()))) |_| - return; // Avoid processing this decl twice - const record_loc = record_decl.getLocation(); - const toplevel = scope.id == .root; - const bs: *Scope.Block = if (!toplevel) try scope.findBlockScope(c) else undefined; - - var is_union = false; - var container_kind_name: []const u8 = undefined; - var bare_name: []const u8 = try c.str(@as(*const clang.NamedDecl, @ptrCast(record_decl)).getName_bytes_begin()); - - if (record_decl.isUnion()) { - container_kind_name = "union"; - is_union = true; - } else if (record_decl.isStruct()) { - container_kind_name = "struct"; - } else { - try c.decl_table.putNoClobber(c.gpa, @intFromPtr(record_decl.getCanonicalDecl()), bare_name); - return failDecl(c, record_loc, bare_name, "record {s} is not a struct or union", .{bare_name}); - } - - var is_unnamed = false; - var name = bare_name; - if (c.unnamed_typedefs.get(@intFromPtr(record_decl.getCanonicalDecl()))) |typedef_name| { - bare_name = typedef_name; - name = typedef_name; - } else { - // Record declarations such as `struct {...} x` have no name but they're not - // anonymous hence here isAnonymousStructOrUnion is not needed - if (bare_name.len == 0) { - bare_name = try std.fmt.allocPrint(c.arena, "unnamed_{d}", .{c.getMangle()}); - is_unnamed = true; - } - name = try std.fmt.allocPrint(c.arena, "{s}_{s}", .{ container_kind_name, bare_name }); - if (toplevel and !is_unnamed) { - name = try mangleWeakGlobalName(c, name); - } - } - if (!toplevel) name = try bs.makeMangledName(c, name); - try c.decl_table.putNoClobber(c.gpa, @intFromPtr(record_decl.getCanonicalDecl()), name); - - const is_pub = toplevel and !is_unnamed; - const init_node = blk: { - const record_def = record_decl.getDefinition() orelse { - try c.opaque_demotes.put(c.gpa, @intFromPtr(record_decl.getCanonicalDecl()), {}); - break :blk Tag.opaque_literal.init(); - }; - - var fields = std.array_list.Managed(ast.Payload.Record.Field).init(c.gpa); - defer fields.deinit(); - - var functions = std.array_list.Managed(Node).init(c.gpa); - defer functions.deinit(); - - const flexible_field = flexibleArrayField(c, record_def); - var unnamed_field_count: u32 = 0; - var it = record_def.field_begin(); - const end_it = record_def.field_end(); - const layout = record_def.getASTRecordLayout(c.clang_context); - const record_alignment = layout.getAlignment(); - - while (it.neq(end_it)) : (it = it.next()) { - const field_decl = it.deref(); - const field_loc = field_decl.getLocation(); - const field_qt = field_decl.getType(); - - if (field_decl.isBitField()) { - try c.opaque_demotes.put(c.gpa, @intFromPtr(record_decl.getCanonicalDecl()), {}); - try warn(c, scope, field_loc, "{s} demoted to opaque type - has bitfield", .{container_kind_name}); - break :blk Tag.opaque_literal.init(); - } - - var is_anon = false; - var field_name = try c.str(@as(*const clang.NamedDecl, @ptrCast(field_decl)).getName_bytes_begin()); - if (field_decl.isAnonymousStructOrUnion() or field_name.len == 0) { - // Context.getMangle() is not used here because doing so causes unpredictable field names for anonymous fields. - field_name = try std.fmt.allocPrint(c.arena, "unnamed_{d}", .{unnamed_field_count}); - unnamed_field_count += 1; - is_anon = true; - } - if (flexible_field == field_decl) { - const flexible_array_fn = buildFlexibleArrayFn(c, scope, layout, field_name, field_decl) catch |err| switch (err) { - error.UnsupportedType => { - try c.opaque_demotes.put(c.gpa, @intFromPtr(record_decl.getCanonicalDecl()), {}); - try warn(c, scope, record_loc, "{s} demoted to opaque type - unable to translate type of flexible array field {s}", .{ container_kind_name, field_name }); - break :blk Tag.opaque_literal.init(); - }, - else => |e| return e, - }; - try functions.append(flexible_array_fn); - continue; - } - const field_type = transQualType(c, scope, field_qt, field_loc) catch |err| switch (err) { - error.UnsupportedType => { - try c.opaque_demotes.put(c.gpa, @intFromPtr(record_decl.getCanonicalDecl()), {}); - try warn(c, scope, record_loc, "{s} demoted to opaque type - unable to translate type of field {s}", .{ container_kind_name, field_name }); - break :blk Tag.opaque_literal.init(); - }, - else => |e| return e, - }; - - const alignment = if (flexible_field != null and field_decl.getFieldIndex() == 0) - @as(c_uint, @intCast(record_alignment)) - else - ClangAlignment.forField(c, field_decl, record_def).zigAlignment(); - - // C99 introduced designated initializers for structs. Omitted fields are implicitly - // initialized to zero. Some C APIs are designed with this in mind. Defaulting to zero - // values for translated struct fields permits Zig code to comfortably use such an API. - const default_value = if (record_decl.isStruct()) - try Tag.std_mem_zeroes.create(c.arena, field_type) - else - null; - - if (is_anon) { - try c.decl_table.putNoClobber(c.gpa, @intFromPtr(field_decl.getCanonicalDecl()), field_name); - } - - try fields.append(.{ - .name = field_name, - .type = field_type, - .alignment = alignment, - .default_value = default_value, - }); - } - - const record_payload = try c.arena.create(ast.Payload.Record); - record_payload.* = .{ - .base = .{ .tag = ([2]Tag{ .@"struct", .@"union" })[@intFromBool(is_union)] }, - .data = .{ - .layout = .@"extern", - .fields = try c.arena.dupe(ast.Payload.Record.Field, fields.items), - .functions = try c.arena.dupe(Node, functions.items), - .variables = &.{}, - }, - }; - break :blk Node.initPayload(&record_payload.base); - }; - - const payload = try c.arena.create(ast.Payload.SimpleVarDecl); - payload.* = .{ - .base = .{ .tag = ([2]Tag{ .var_simple, .pub_var_simple })[@intFromBool(is_pub)] }, - .data = .{ - .name = name, - .init = init_node, - }, - }; - const node = Node.initPayload(&payload.base); - if (toplevel) { - try addTopLevelDecl(c, name, node); - // Only add the alias if the name is available *and* it was caught by - // name detection. Don't bother performing a weak mangle, since a - // mangled name is of no real use here. - if (!is_unnamed and !c.global_names.contains(bare_name) and c.weak_global_names.contains(bare_name)) - try c.alias_list.append(.{ .alias = bare_name, .name = name }); - } else { - try scope.appendNode(node); - if (node.tag() != .pub_var_simple) { - try bs.discardVariable(c, name); - } - } -} - -fn transEnumDecl(c: *Context, scope: *Scope, enum_decl: *const clang.EnumDecl) Error!void { - if (c.decl_table.get(@intFromPtr(enum_decl.getCanonicalDecl()))) |_| - return; // Avoid processing this decl twice - const enum_loc = enum_decl.getLocation(); - const toplevel = scope.id == .root; - const bs: *Scope.Block = if (!toplevel) try scope.findBlockScope(c) else undefined; - - var is_unnamed = false; - var bare_name: []const u8 = try c.str(@as(*const clang.NamedDecl, @ptrCast(enum_decl)).getName_bytes_begin()); - var name = bare_name; - if (c.unnamed_typedefs.get(@intFromPtr(enum_decl.getCanonicalDecl()))) |typedef_name| { - bare_name = typedef_name; - name = typedef_name; - } else { - if (bare_name.len == 0) { - bare_name = try std.fmt.allocPrint(c.arena, "unnamed_{d}", .{c.getMangle()}); - is_unnamed = true; - } - name = try std.fmt.allocPrint(c.arena, "enum_{s}", .{bare_name}); - if (toplevel and !is_unnamed) { - name = try mangleWeakGlobalName(c, name); - } - } - if (!toplevel) name = try bs.makeMangledName(c, name); - try c.decl_table.putNoClobber(c.gpa, @intFromPtr(enum_decl.getCanonicalDecl()), name); - - const enum_type_node = if (enum_decl.getDefinition()) |enum_def| blk: { - var it = enum_def.enumerator_begin(); - const end_it = enum_def.enumerator_end(); - while (it.neq(end_it)) : (it = it.next()) { - const enum_const = it.deref(); - var enum_val_name: []const u8 = try c.str(@as(*const clang.NamedDecl, @ptrCast(enum_const)).getName_bytes_begin()); - if (!toplevel) { - enum_val_name = try bs.makeMangledName(c, enum_val_name); - } - - const enum_const_qt = @as(*const clang.ValueDecl, @ptrCast(enum_const)).getType(); - const enum_const_loc = @as(*const clang.Decl, @ptrCast(enum_const)).getLocation(); - const enum_const_type_node: ?Node = transQualType(c, scope, enum_const_qt, enum_const_loc) catch |err| switch (err) { - error.UnsupportedType => null, - else => |e| return e, - }; - - const enum_const_def = try Tag.enum_constant.create(c.arena, .{ - .name = enum_val_name, - .is_public = toplevel, - .type = enum_const_type_node, - // TODO: as of LLVM 18, the return value from `enum_const.getInitVal` here needs - // to be freed with a call to its free() method. - .value = try transCreateNodeAPInt(c, enum_const.getInitVal()), - }); - if (toplevel) - try addTopLevelDecl(c, enum_val_name, enum_const_def) - else { - try scope.appendNode(enum_const_def); - try bs.discardVariable(c, enum_val_name); - } - } - - const int_type = enum_decl.getIntegerType(); - // The underlying type may be null in case of forward-declared enum - // types, while that's not ISO-C compliant many compilers allow this and - // default to the usual integer type used for all the enums. - - // default to c_int since msvc and gcc default to different types - break :blk if (int_type.ptr != null) - transQualType(c, scope, int_type, enum_loc) catch |err| switch (err) { - error.UnsupportedType => { - return failDecl(c, enum_loc, name, "unable to translate enum integer type", .{}); - }, - else => |e| return e, - } - else - try Tag.type.create(c.arena, "c_int"); - } else blk: { - try c.opaque_demotes.put(c.gpa, @intFromPtr(enum_decl.getCanonicalDecl()), {}); - break :blk Tag.opaque_literal.init(); - }; - - const is_pub = toplevel and !is_unnamed; - const payload = try c.arena.create(ast.Payload.SimpleVarDecl); - payload.* = .{ - .base = .{ .tag = ([2]Tag{ .var_simple, .pub_var_simple })[@intFromBool(is_pub)] }, - .data = .{ - .init = enum_type_node, - .name = name, - }, - }; - const node = Node.initPayload(&payload.base); - if (toplevel) { - try addTopLevelDecl(c, name, node); - // Only add the alias if the name is available *and* it was caught by - // name detection. Don't bother performing a weak mangle, since a - // mangled name is of no real use here. - if (!is_unnamed and !c.global_names.contains(bare_name) and c.weak_global_names.contains(bare_name)) - try c.alias_list.append(.{ .alias = bare_name, .name = name }); - } else { - try scope.appendNode(node); - if (node.tag() != .pub_var_simple) { - try bs.discardVariable(c, name); - } - } -} - -fn transStmt( - c: *Context, - scope: *Scope, - stmt: *const clang.Stmt, - result_used: ResultUsed, -) TransError!Node { - const sc = stmt.getStmtClass(); - switch (sc) { - .BinaryOperatorClass => return transBinaryOperator(c, scope, @as(*const clang.BinaryOperator, @ptrCast(stmt)), result_used), - .CompoundStmtClass => return transCompoundStmt(c, scope, @as(*const clang.CompoundStmt, @ptrCast(stmt))), - .CStyleCastExprClass => return transCStyleCastExprClass(c, scope, @as(*const clang.CStyleCastExpr, @ptrCast(stmt)), result_used), - .DeclStmtClass => return transDeclStmt(c, scope, @as(*const clang.DeclStmt, @ptrCast(stmt))), - .DeclRefExprClass => return transDeclRefExpr(c, scope, @as(*const clang.DeclRefExpr, @ptrCast(stmt))), - .ImplicitCastExprClass => return transImplicitCastExpr(c, scope, @as(*const clang.ImplicitCastExpr, @ptrCast(stmt)), result_used), - .IntegerLiteralClass => return transIntegerLiteral(c, scope, @as(*const clang.IntegerLiteral, @ptrCast(stmt)), result_used, .with_as), - .ReturnStmtClass => return transReturnStmt(c, scope, @as(*const clang.ReturnStmt, @ptrCast(stmt))), - .StringLiteralClass => return transStringLiteral(c, scope, @as(*const clang.StringLiteral, @ptrCast(stmt)), result_used), - .ParenExprClass => { - const expr = try transExpr(c, scope, @as(*const clang.ParenExpr, @ptrCast(stmt)).getSubExpr(), .used); - return maybeSuppressResult(c, result_used, expr); - }, - .InitListExprClass => return transInitListExpr(c, scope, @as(*const clang.InitListExpr, @ptrCast(stmt)), result_used), - .ImplicitValueInitExprClass => return transImplicitValueInitExpr(c, scope, @as(*const clang.Expr, @ptrCast(stmt))), - .IfStmtClass => return transIfStmt(c, scope, @as(*const clang.IfStmt, @ptrCast(stmt))), - .WhileStmtClass => return transWhileLoop(c, scope, @as(*const clang.WhileStmt, @ptrCast(stmt))), - .DoStmtClass => return transDoWhileLoop(c, scope, @as(*const clang.DoStmt, @ptrCast(stmt))), - .NullStmtClass => { - return Tag.empty_block.init(); - }, - .ContinueStmtClass => return Tag.@"continue".init(), - .BreakStmtClass => return Tag.@"break".init(), - .ForStmtClass => return transForLoop(c, scope, @as(*const clang.ForStmt, @ptrCast(stmt))), - .FloatingLiteralClass => return transFloatingLiteral(c, @as(*const clang.FloatingLiteral, @ptrCast(stmt)), result_used), - .ConditionalOperatorClass => { - return transConditionalOperator(c, scope, @as(*const clang.ConditionalOperator, @ptrCast(stmt)), result_used); - }, - .BinaryConditionalOperatorClass => { - return transBinaryConditionalOperator(c, scope, @as(*const clang.BinaryConditionalOperator, @ptrCast(stmt)), result_used); - }, - .SwitchStmtClass => return transSwitch(c, scope, @as(*const clang.SwitchStmt, @ptrCast(stmt))), - .CaseStmtClass, .DefaultStmtClass => { - return fail(c, error.UnsupportedTranslation, stmt.getBeginLoc(), "TODO complex switch", .{}); - }, - .ConstantExprClass => return transConstantExpr(c, scope, @as(*const clang.Expr, @ptrCast(stmt)), result_used), - .PredefinedExprClass => return transPredefinedExpr(c, scope, @as(*const clang.PredefinedExpr, @ptrCast(stmt)), result_used), - .CharacterLiteralClass => return transCharLiteral(c, scope, @as(*const clang.CharacterLiteral, @ptrCast(stmt)), result_used, .with_as), - .StmtExprClass => return transStmtExpr(c, scope, @as(*const clang.StmtExpr, @ptrCast(stmt)), result_used), - .MemberExprClass => return transMemberExpr(c, scope, @as(*const clang.MemberExpr, @ptrCast(stmt)), result_used), - .ArraySubscriptExprClass => return transArrayAccess(c, scope, @as(*const clang.ArraySubscriptExpr, @ptrCast(stmt)), result_used), - .CallExprClass => return transCallExpr(c, scope, @as(*const clang.CallExpr, @ptrCast(stmt)), result_used), - .UnaryExprOrTypeTraitExprClass => return transUnaryExprOrTypeTraitExpr(c, scope, @as(*const clang.UnaryExprOrTypeTraitExpr, @ptrCast(stmt)), result_used), - .UnaryOperatorClass => return transUnaryOperator(c, scope, @as(*const clang.UnaryOperator, @ptrCast(stmt)), result_used), - .CompoundAssignOperatorClass => return transCompoundAssignOperator(c, scope, @as(*const clang.CompoundAssignOperator, @ptrCast(stmt)), result_used), - .OpaqueValueExprClass => { - const source_expr = @as(*const clang.OpaqueValueExpr, @ptrCast(stmt)).getSourceExpr().?; - const expr = try transExpr(c, scope, source_expr, .used); - return maybeSuppressResult(c, result_used, expr); - }, - .OffsetOfExprClass => return transOffsetOfExpr(c, @as(*const clang.OffsetOfExpr, @ptrCast(stmt)), result_used), - .CompoundLiteralExprClass => { - const compound_literal = @as(*const clang.CompoundLiteralExpr, @ptrCast(stmt)); - return transExpr(c, scope, compound_literal.getInitializer(), result_used); - }, - .GenericSelectionExprClass => { - const gen_sel = @as(*const clang.GenericSelectionExpr, @ptrCast(stmt)); - return transExpr(c, scope, gen_sel.getResultExpr(), result_used); - }, - .ConvertVectorExprClass => { - const conv_vec = @as(*const clang.ConvertVectorExpr, @ptrCast(stmt)); - const conv_vec_node = try transConvertVectorExpr(c, scope, conv_vec); - return maybeSuppressResult(c, result_used, conv_vec_node); - }, - .ShuffleVectorExprClass => { - const shuffle_vec_expr = @as(*const clang.ShuffleVectorExpr, @ptrCast(stmt)); - const shuffle_vec_node = try transShuffleVectorExpr(c, scope, shuffle_vec_expr); - return maybeSuppressResult(c, result_used, shuffle_vec_node); - }, - .ChooseExprClass => { - const choose_expr = @as(*const clang.ChooseExpr, @ptrCast(stmt)); - return transExpr(c, scope, choose_expr.getChosenSubExpr(), result_used); - }, - // When adding new cases here, see comment for maybeBlockify() - .GCCAsmStmtClass, - .GotoStmtClass, - .IndirectGotoStmtClass, - .AttributedStmtClass, - .AddrLabelExprClass, - .AtomicExprClass, - .BlockExprClass, - .UserDefinedLiteralClass, - .BuiltinBitCastExprClass, - .DesignatedInitExprClass, - .LabelStmtClass, - => return fail(c, error.UnsupportedTranslation, stmt.getBeginLoc(), "TODO implement translation of stmt class {s}", .{@tagName(sc)}), - else => return fail(c, error.UnsupportedTranslation, stmt.getBeginLoc(), "unsupported stmt class {s}", .{@tagName(sc)}), - } -} - -/// See https://clang.llvm.org/docs/LanguageExtensions.html#langext-builtin-convertvector -fn transConvertVectorExpr( - c: *Context, - scope: *Scope, - expr: *const clang.ConvertVectorExpr, -) TransError!Node { - const base_stmt = @as(*const clang.Stmt, @ptrCast(expr)); - - var block_scope = try Scope.Block.init(c, scope, true); - defer block_scope.deinit(); - - const src_expr = expr.getSrcExpr(); - const src_type = qualTypeCanon(src_expr.getType()); - const src_vector_ty = @as(*const clang.VectorType, @ptrCast(src_type)); - const src_element_qt = src_vector_ty.getElementType(); - - const src_expr_node = try transExpr(c, &block_scope.base, src_expr, .used); - - const dst_qt = expr.getTypeSourceInfo_getType(); - const dst_type_node = try transQualType(c, &block_scope.base, dst_qt, base_stmt.getBeginLoc()); - const dst_vector_ty = @as(*const clang.VectorType, @ptrCast(qualTypeCanon(dst_qt))); - const num_elements = dst_vector_ty.getNumElements(); - const dst_element_qt = dst_vector_ty.getElementType(); - - // workaround for https://github.com/ziglang/zig/issues/8322 - // we store the casted results into temp variables and use those - // to initialize the vector. Eventually we can just directly - // construct the init_list from casted source members - var i: usize = 0; - while (i < num_elements) : (i += 1) { - const mangled_name = try block_scope.makeMangledName(c, "tmp"); - const value = try Tag.array_access.create(c.arena, .{ - .lhs = src_expr_node, - .rhs = try transCreateNodeNumber(c, i, .int), - }); - const tmp_decl_node = try Tag.var_simple.create(c.arena, .{ - .name = mangled_name, - .init = try transCCast(c, &block_scope.base, base_stmt.getBeginLoc(), dst_element_qt, src_element_qt, value), - }); - try block_scope.statements.append(tmp_decl_node); - } - - const init_list = try c.arena.alloc(Node, num_elements); - for (init_list, 0..) |*init, init_index| { - const tmp_decl = block_scope.statements.items[init_index]; - const name = tmp_decl.castTag(.var_simple).?.data.name; - init.* = try Tag.identifier.create(c.arena, name); - } - - const vec_init = try Tag.array_init.create(c.arena, .{ - .cond = dst_type_node, - .cases = init_list, - }); - - const break_node = try Tag.break_val.create(c.arena, .{ - .label = block_scope.label, - .val = vec_init, - }); - try block_scope.statements.append(break_node); - return block_scope.complete(c); -} - -fn makeShuffleMask(c: *Context, scope: *Scope, expr: *const clang.ShuffleVectorExpr, vector_len: Node) TransError!Node { - const num_subexprs = expr.getNumSubExprs(); - assert(num_subexprs >= 3); // two source vectors + at least 1 index expression - const mask_len = num_subexprs - 2; - - const mask_type = try Tag.vector.create(c.arena, .{ - .lhs = try transCreateNodeNumber(c, mask_len, .int), - .rhs = try Tag.type.create(c.arena, "i32"), - }); - - const init_list = try c.arena.alloc(Node, mask_len); - - for (init_list, 0..) |*init, i| { - const index_expr = try transExprCoercing(c, scope, expr.getExpr(@as(c_uint, @intCast(i + 2))), .used); - const converted_index = try Tag.helpers_shuffle_vector_index.create(c.arena, .{ .lhs = index_expr, .rhs = vector_len }); - init.* = converted_index; - } - - return Tag.array_init.create(c.arena, .{ - .cond = mask_type, - .cases = init_list, - }); -} - -/// @typeInfo(@TypeOf(vec_node)).Vector. -fn vectorTypeInfo(arena: mem.Allocator, vec_node: Node, field: []const u8) TransError!Node { - const typeof_call = try Tag.typeof.create(arena, vec_node); - const typeinfo_call = try Tag.typeinfo.create(arena, typeof_call); - const vector_type_info = try Tag.field_access.create(arena, .{ .lhs = typeinfo_call, .field_name = "vector" }); - return Tag.field_access.create(arena, .{ .lhs = vector_type_info, .field_name = field }); -} - -fn transShuffleVectorExpr( - c: *Context, - scope: *Scope, - expr: *const clang.ShuffleVectorExpr, -) TransError!Node { - const base_expr = @as(*const clang.Expr, @ptrCast(expr)); - const num_subexprs = expr.getNumSubExprs(); - if (num_subexprs < 3) return fail(c, error.UnsupportedTranslation, base_expr.getBeginLoc(), "ShuffleVector needs at least 1 index", .{}); - - const a = try transExpr(c, scope, expr.getExpr(0), .used); - const b = try transExpr(c, scope, expr.getExpr(1), .used); - - // clang requires first two arguments to __builtin_shufflevector to be same type - const vector_child_type = try vectorTypeInfo(c.arena, a, "child"); - const vector_len = try vectorTypeInfo(c.arena, a, "len"); - const shuffle_mask = try makeShuffleMask(c, scope, expr, vector_len); - - return Tag.shuffle.create(c.arena, .{ - .element_type = vector_child_type, - .a = a, - .b = b, - .mask_vector = shuffle_mask, - }); -} - -/// Translate a "simple" offsetof expression containing exactly one component, -/// when that component is of kind .Field - e.g. offsetof(mytype, myfield) -fn transSimpleOffsetOfExpr(c: *Context, expr: *const clang.OffsetOfExpr) TransError!Node { - assert(expr.getNumComponents() == 1); - const component = expr.getComponent(0); - if (component.getKind() == .Field) { - const field_decl = component.getField(); - if (field_decl.getParent()) |record_decl| { - if (c.decl_table.get(@intFromPtr(record_decl.getCanonicalDecl()))) |type_name| { - const type_node = try Tag.type.create(c.arena, type_name); - - const raw_field_name = try c.str(@as(*const clang.NamedDecl, @ptrCast(field_decl)).getName_bytes_begin()); - const quoted_field_name = try std.fmt.allocPrint(c.arena, "\"{s}\"", .{raw_field_name}); - const field_name_node = try Tag.string_literal.create(c.arena, quoted_field_name); - - return Tag.offset_of.create(c.arena, .{ - .lhs = type_node, - .rhs = field_name_node, - }); - } - } - } - return fail(c, error.UnsupportedTranslation, expr.getBeginLoc(), "failed to translate simple OffsetOfExpr", .{}); -} - -fn transOffsetOfExpr( - c: *Context, - expr: *const clang.OffsetOfExpr, - result_used: ResultUsed, -) TransError!Node { - if (expr.getNumComponents() == 1) { - const offsetof_expr = try transSimpleOffsetOfExpr(c, expr); - return maybeSuppressResult(c, result_used, offsetof_expr); - } - - // TODO implement OffsetOfExpr with more than 1 component - // OffsetOfExpr API: - // call expr.getComponent(idx) while idx < expr.getNumComponents() - // component.getKind() will be either .Array or .Field (other kinds are C++-only) - // if .Field, use component.getField() to retrieve *clang.FieldDecl - // if .Array, use component.getArrayExprIndex() to get a c_uint which - // can be passed to expr.getIndexExpr(expr_index) to get the *clang.Expr for the array index - - return fail(c, error.UnsupportedTranslation, expr.getBeginLoc(), "TODO: implement complex OffsetOfExpr translation", .{}); -} - -/// Cast a signed integer node to a usize, for use in pointer arithmetic. Negative numbers -/// will become very large positive numbers but that is ok since we only use this in -/// pointer arithmetic expressions, where wraparound will ensure we get the correct value. -/// node -> @bitCast(usize, @intCast(isize, node)) -fn usizeCastForWrappingPtrArithmetic(gpa: mem.Allocator, node: Node) TransError!Node { - const intcast_node = try Tag.as.create(gpa, .{ - .lhs = try Tag.type.create(gpa, "isize"), - .rhs = try Tag.int_cast.create(gpa, node), - }); - - return Tag.as.create(gpa, .{ - .lhs = try Tag.type.create(gpa, "usize"), - .rhs = try Tag.bit_cast.create(gpa, intcast_node), - }); -} - -/// Translate an arithmetic expression with a pointer operand and a signed-integer operand. -/// Zig requires a usize argument for pointer arithmetic, so we intCast to isize and then -/// bitcast to usize; pointer wraparound make the math work. -/// Zig pointer addition is not commutative (unlike C); the pointer operand needs to be on the left. -/// The + operator in C is not a sequence point so it should be safe to switch the order if necessary. -fn transCreatePointerArithmeticSignedOp( - c: *Context, - scope: *Scope, - stmt: *const clang.BinaryOperator, - result_used: ResultUsed, -) TransError!Node { - const is_add = stmt.getOpcode() == .Add; - const lhs = stmt.getLHS(); - const rhs = stmt.getRHS(); - const swap_operands = is_add and cIsSignedInteger(getExprQualType(c, lhs)); - - const swizzled_lhs = if (swap_operands) rhs else lhs; - const swizzled_rhs = if (swap_operands) lhs else rhs; - - const lhs_node = try transExpr(c, scope, swizzled_lhs, .used); - const rhs_node = try transExpr(c, scope, swizzled_rhs, .used); - - const bitcast_node = try usizeCastForWrappingPtrArithmetic(c.arena, rhs_node); - - return transCreateNodeInfixOp( - c, - if (is_add) .add else .sub, - lhs_node, - bitcast_node, - result_used, - ); -} - -fn transBinaryOperator( - c: *Context, - scope: *Scope, - stmt: *const clang.BinaryOperator, - result_used: ResultUsed, -) TransError!Node { - const op = stmt.getOpcode(); - const qt = stmt.getType(); - const isPointerDiffExpr = cIsPointerDiffExpr(stmt); - switch (op) { - .Assign => return try transCreateNodeAssign(c, scope, result_used, stmt.getLHS(), stmt.getRHS()), - .Comma => { - var block_scope = try Scope.Block.init(c, scope, true); - defer block_scope.deinit(); - - const lhs = try transExpr(c, &block_scope.base, stmt.getLHS(), .unused); - try block_scope.statements.append(lhs); - - const rhs = try transExpr(c, &block_scope.base, stmt.getRHS(), .used); - const break_node = try Tag.break_val.create(c.arena, .{ - .label = block_scope.label, - .val = rhs, - }); - try block_scope.statements.append(break_node); - const block_node = try block_scope.complete(c); - return maybeSuppressResult(c, result_used, block_node); - }, - .Div => { - if (cIsSignedInteger(qt)) { - // signed integer division uses @divTrunc - const lhs = try transExpr(c, scope, stmt.getLHS(), .used); - const rhs = try transExpr(c, scope, stmt.getRHS(), .used); - const div_trunc = try Tag.div_trunc.create(c.arena, .{ .lhs = lhs, .rhs = rhs }); - return maybeSuppressResult(c, result_used, div_trunc); - } - }, - .Rem => { - if (cIsSignedInteger(qt)) { - // signed integer remainder uses std.zig.c_translation.signedRemainder - const lhs = try transExpr(c, scope, stmt.getLHS(), .used); - const rhs = try transExpr(c, scope, stmt.getRHS(), .used); - const rem = try Tag.signed_remainder.create(c.arena, .{ .lhs = lhs, .rhs = rhs }); - return maybeSuppressResult(c, result_used, rem); - } - }, - .Shl => { - return transCreateNodeShiftOp(c, scope, stmt, .shl, result_used); - }, - .Shr => { - return transCreateNodeShiftOp(c, scope, stmt, .shr, result_used); - }, - .LAnd => { - return transCreateNodeBoolInfixOp(c, scope, stmt, .@"and", result_used); - }, - .LOr => { - return transCreateNodeBoolInfixOp(c, scope, stmt, .@"or", result_used); - }, - .Add, .Sub => { - // `ptr + idx` and `idx + ptr` -> ptr + @bitCast(usize, @intCast(isize, idx)) - // `ptr - idx` -> ptr - @bitCast(usize, @intCast(isize, idx)) - if (qualTypeIsPtr(qt) and (cIsSignedInteger(getExprQualType(c, stmt.getLHS())) or - cIsSignedInteger(getExprQualType(c, stmt.getRHS())))) return transCreatePointerArithmeticSignedOp(c, scope, stmt, result_used); - }, - else => {}, - } - var op_id: Tag = undefined; - switch (op) { - .Add => { - if (cIsUnsignedInteger(qt)) { - op_id = .add_wrap; - } else { - op_id = .add; - } - }, - .Sub => { - if (cIsUnsignedInteger(qt) or isPointerDiffExpr) { - op_id = .sub_wrap; - } else { - op_id = .sub; - } - }, - .Mul => { - if (cIsUnsignedInteger(qt)) { - op_id = .mul_wrap; - } else { - op_id = .mul; - } - }, - .Div => { - // unsigned/float division uses the operator - op_id = .div; - }, - .Rem => { - // unsigned/float division uses the operator - op_id = .mod; - }, - .LT => { - op_id = .less_than; - }, - .GT => { - op_id = .greater_than; - }, - .LE => { - op_id = .less_than_equal; - }, - .GE => { - op_id = .greater_than_equal; - }, - .EQ => { - op_id = .equal; - }, - .NE => { - op_id = .not_equal; - }, - .And => { - op_id = .bit_and; - }, - .Xor => { - op_id = .bit_xor; - }, - .Or => { - op_id = .bit_or; - }, - else => unreachable, - } - - const lhs_uncasted = try transExpr(c, scope, stmt.getLHS(), .used); - const rhs_uncasted = try transExpr(c, scope, stmt.getRHS(), .used); - - const lhs = if (isBoolRes(lhs_uncasted)) - try Tag.int_from_bool.create(c.arena, lhs_uncasted) - else if (isPointerDiffExpr) - try Tag.int_from_ptr.create(c.arena, lhs_uncasted) - else - lhs_uncasted; - - const rhs = if (isBoolRes(rhs_uncasted)) - try Tag.int_from_bool.create(c.arena, rhs_uncasted) - else if (isPointerDiffExpr) - try Tag.int_from_ptr.create(c.arena, rhs_uncasted) - else - rhs_uncasted; - - const infixOpNode = try transCreateNodeInfixOp(c, op_id, lhs, rhs, result_used); - if (isPointerDiffExpr) { - // @divExact(@bitCast(, @intFromPtr(lhs) -% @intFromPtr(rhs)), @sizeOf()) - const ptrdiff_type = try transQualTypeIntWidthOf(c, qt, true); - - const bitcast = try Tag.as.create(c.arena, .{ - .lhs = ptrdiff_type, - .rhs = try Tag.bit_cast.create(c.arena, infixOpNode), - }); - - // C standard requires that pointer subtraction operands are of the same type, - // otherwise it is undefined behavior. So we can assume the left and right - // sides are the same QualType and arbitrarily choose left. - const lhs_expr = stmt.getLHS(); - const lhs_qt = getExprQualType(c, lhs_expr); - const lhs_qt_translated = try transQualType(c, scope, lhs_qt, lhs_expr.getBeginLoc()); - const c_pointer = getContainer(c, lhs_qt_translated).?; - - if (c_pointer.castTag(.c_pointer)) |c_pointer_payload| { - const sizeof = try Tag.sizeof.create(c.arena, c_pointer_payload.data.elem_type); - return Tag.div_exact.create(c.arena, .{ - .lhs = bitcast, - .rhs = sizeof, - }); - } else { - // This is an opaque/incomplete type. This subtraction exhibits Undefined Behavior by the C99 spec. - // However, allowing subtraction on `void *` and function pointers is a commonly used extension. - // So, just return the value in byte units, mirroring the behavior of this language extension as implemented by GCC and Clang. - return bitcast; - } - } - return infixOpNode; -} - -fn transCompoundStmtInline( - c: *Context, - stmt: *const clang.CompoundStmt, - block: *Scope.Block, -) TransError!void { - var it = stmt.body_begin(); - const end_it = stmt.body_end(); - while (it != end_it) : (it += 1) { - const result = try transStmt(c, &block.base, it[0], .unused); - switch (result.tag()) { - .declaration, .empty_block => {}, - else => try block.statements.append(result), - } - } -} - -fn transCompoundStmt(c: *Context, scope: *Scope, stmt: *const clang.CompoundStmt) TransError!Node { - var block_scope = try Scope.Block.init(c, scope, false); - defer block_scope.deinit(); - try transCompoundStmtInline(c, stmt, &block_scope); - return try block_scope.complete(c); -} - -fn transCStyleCastExprClass( - c: *Context, - scope: *Scope, - stmt: *const clang.CStyleCastExpr, - result_used: ResultUsed, -) TransError!Node { - const cast_expr = @as(*const clang.CastExpr, @ptrCast(stmt)); - const sub_expr = stmt.getSubExpr(); - const dst_type = stmt.getType(); - const src_type = sub_expr.getType(); - const sub_expr_node = try transExpr(c, scope, sub_expr, .used); - const loc = stmt.getBeginLoc(); - - const cast_node = if (cast_expr.getCastKind() == .ToUnion) blk: { - const field_decl = cast_expr.getTargetFieldForToUnionCast(dst_type, src_type).?; // C syntax error if target field is null - const field_name = try c.str(@as(*const clang.NamedDecl, @ptrCast(field_decl)).getName_bytes_begin()); - - const union_ty = try transQualType(c, scope, dst_type, loc); - - const inits = [1]ast.Payload.ContainerInit.Initializer{.{ .name = field_name, .value = sub_expr_node }}; - break :blk try Tag.container_init.create(c.arena, .{ - .lhs = union_ty, - .inits = try c.arena.dupe(ast.Payload.ContainerInit.Initializer, &inits), - }); - } else (try transCCast( - c, - scope, - loc, - dst_type, - src_type, - sub_expr_node, - )); - return maybeSuppressResult(c, result_used, cast_node); -} - -/// The alignment of a variable or field -const ClangAlignment = struct { - /// Clang reports the alignment in bits, we use bytes - /// Clang uses 0 for "no alignment specified", we use null - bit_alignment: c_uint, - /// If the field or variable is marked as 'packed' - /// - /// According to the GCC variable attribute docs, this impacts alignment - /// https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html - /// - /// > The packed attribute specifies that a structure member - /// > should have the smallest possible alignment - /// - /// Note also that specifying the 'packed' attribute on a structure - /// implicitly packs all its fields (making their alignment 1). - /// - /// This will be null if the AST node doesn't support packing (functions) - is_packed: ?bool, - - /// Get the alignment for a field, optionally taking into account the parent record - pub fn forField(c: *const Context, field: *const clang.FieldDecl, parent: ?*const clang.RecordDecl) ClangAlignment { - const parent_packed = if (parent) |record| record.getPackedAttribute() else false; - // NOTE: According to GCC docs, parent attribute packed implies child attribute packed - return ClangAlignment{ - .bit_alignment = field.getAlignedAttribute(c.clang_context), - .is_packed = field.getPackedAttribute() or parent_packed, - }; - } - - pub fn forVar(c: *const Context, var_decl: *const clang.VarDecl) ClangAlignment { - return ClangAlignment{ - .bit_alignment = var_decl.getAlignedAttribute(c.clang_context), - .is_packed = var_decl.getPackedAttribute(), - }; - } - - pub fn forFunc(c: *const Context, fun: *const clang.FunctionDecl) ClangAlignment { - return ClangAlignment{ - .bit_alignment = fun.getAlignedAttribute(c.clang_context), - .is_packed = null, // not supported by GCC/clang (or meaningful), - }; - } - - /// Translate the clang alignment info into a zig alignment - /// - /// Returns null if there is no special alignment info - pub fn zigAlignment(self: ClangAlignment) ?c_uint { - if (self.bit_alignment != 0) { - return self.bit_alignment / 8; - } else if (self.is_packed orelse false) { - return 1; - } else { - return null; - } - } -}; - -/// Translate an "extern" variable that's been declared within a scoped block. -/// Similar to static local variables, this will be wrapped in a struct to work with Zig's syntax requirements. -/// -/// Assumptions made: -/// - No need to mangle the actual NamedDecl, as by definition this MUST be the same name as the external symbol it's referencing -/// - It's not valid C to have an initializer with this type of declaration, so we can safely operate assuming no initializer -/// - No need to look for any cleanup attributes with getCleanupAttribute(), not relevant for this type of decl -fn transLocalExternStmt(c: *Context, scope: *Scope, var_decl: *const clang.VarDecl, block_scope: *Scope.Block) TransError!void { - const extern_var_name = try c.str(@as(*const clang.NamedDecl, @ptrCast(var_decl)).getName_bytes_begin()); - - // Special naming convention for local extern variable wrapper struct - const name = try std.fmt.allocPrint(c.arena, "{s}_{s}", .{ Scope.Block.extern_inner_prepend, extern_var_name }); - - // On the off chance there's already a variable in scope named "ExternLocal_[extern_var_name]" - const mangled_name = try block_scope.makeMangledName(c, name); - - const qual_type = var_decl.getTypeSourceInfo_getType(); - const is_const = qual_type.isConstQualified(); - const loc = var_decl.getLocation(); - const type_node = try transQualType(c, scope, qual_type, loc); - - // Inner Node for the extern variable declaration - var node = try Tag.var_decl.create(c.arena, .{ - .is_pub = false, - .is_const = is_const, - .is_extern = true, - .is_export = false, - .is_threadlocal = var_decl.getTLSKind() != .None, // TODO: Neccessary? - .linksection_string = null, // TODO: Neccessary? - .alignment = ClangAlignment.forVar(c, var_decl).zigAlignment(), - .name = extern_var_name, - .type = type_node, - .init = null, - }); - - // Outer Node for the wrapper struct - node = try Tag.extern_local_var.create(c.arena, .{ .name = mangled_name, .init = node }); - - try block_scope.statements.append(node); - try block_scope.discardVariable(c, mangled_name); -} - -fn transDeclStmtOne( - c: *Context, - scope: *Scope, - decl: *const clang.Decl, - block_scope: *Scope.Block, -) TransError!void { - switch (decl.getKind()) { - .Var => { - const var_decl = @as(*const clang.VarDecl, @ptrCast(decl)); - - // Translation behavior for a block scope declared "extern" variable - // is enough of an outlier that it needs it's own function - if (var_decl.getStorageClass() == .Extern) { - return transLocalExternStmt(c, scope, var_decl, block_scope); - } - - const decl_init = var_decl.getInit(); - const loc = decl.getLocation(); - - const qual_type = var_decl.getTypeSourceInfo_getType(); - const name = try c.str(@as(*const clang.NamedDecl, @ptrCast(var_decl)).getName_bytes_begin()); - const mangled_name = try block_scope.makeMangledName(c, name); - - if (qualTypeWasDemotedToOpaque(c, qual_type)) { - return fail(c, error.UnsupportedTranslation, loc, "local variable has opaque type", .{}); - } - - const is_static_local = var_decl.isStaticLocal(); - const is_const = qual_type.isConstQualified(); - const type_node = try transQualTypeMaybeInitialized(c, scope, qual_type, decl_init, loc); - - var init_node = if (decl_init) |expr| - if (expr.getStmtClass() == .StringLiteralClass) - try transStringLiteralInitializer(c, @as(*const clang.StringLiteral, @ptrCast(expr)), type_node) - else - try transExprCoercing(c, scope, expr, .used) - else if (is_static_local) - try Tag.std_mem_zeroes.create(c.arena, type_node) - else - Tag.undefined_literal.init(); - if (!qualTypeIsBoolean(qual_type) and isBoolRes(init_node)) { - init_node = try Tag.int_from_bool.create(c.arena, init_node); - } else if (init_node.tag() == .string_literal and qualTypeIsCharStar(qual_type)) { - const dst_type_node = try transQualType(c, scope, qual_type, loc); - init_node = try removeCVQualifiers(c, dst_type_node, init_node); - } - - const var_name: []const u8 = if (is_static_local) Scope.Block.static_inner_name else mangled_name; - var node = try Tag.var_decl.create(c.arena, .{ - .is_pub = false, - .is_const = is_const, - .is_extern = false, - .is_export = false, - .is_threadlocal = var_decl.getTLSKind() != .None, - .linksection_string = null, - .alignment = ClangAlignment.forVar(c, var_decl).zigAlignment(), - .name = var_name, - .type = type_node, - .init = init_node, - }); - if (is_static_local) { - node = try Tag.static_local_var.create(c.arena, .{ .name = mangled_name, .init = node }); - } - try block_scope.statements.append(node); - try block_scope.discardVariable(c, mangled_name); - - const cleanup_attr = var_decl.getCleanupAttribute(); - if (cleanup_attr) |fn_decl| { - const cleanup_fn_name = try c.str(@as(*const clang.NamedDecl, @ptrCast(fn_decl)).getName_bytes_begin()); - const fn_id = try Tag.identifier.create(c.arena, cleanup_fn_name); - - const varname = try Tag.identifier.create(c.arena, mangled_name); - const args = try c.arena.alloc(Node, 1); - args[0] = try Tag.address_of.create(c.arena, varname); - - const cleanup_call = try Tag.call.create(c.arena, .{ .lhs = fn_id, .args = args }); - const discard = try Tag.discard.create(c.arena, .{ .should_skip = false, .value = cleanup_call }); - const deferred_cleanup = try Tag.@"defer".create(c.arena, discard); - - try block_scope.statements.append(deferred_cleanup); - } - }, - .Typedef => { - try transTypeDef(c, scope, @as(*const clang.TypedefNameDecl, @ptrCast(decl))); - }, - .Record => { - try transRecordDecl(c, scope, @as(*const clang.RecordDecl, @ptrCast(decl))); - }, - .Enum => { - try transEnumDecl(c, scope, @as(*const clang.EnumDecl, @ptrCast(decl))); - }, - .Function => { - try transFnDecl(c, scope, @as(*const clang.FunctionDecl, @ptrCast(decl))); - }, - else => { - const decl_name = try c.str(decl.getDeclKindName()); - try warn(c, &c.global_scope.base, decl.getLocation(), "ignoring {s} declaration", .{decl_name}); - }, - } -} - -fn transDeclStmt(c: *Context, scope: *Scope, stmt: *const clang.DeclStmt) TransError!Node { - const block_scope = try scope.findBlockScope(c); - - var it = stmt.decl_begin(); - const end_it = stmt.decl_end(); - while (it != end_it) : (it += 1) { - try transDeclStmtOne(c, scope, it[0], block_scope); - } - return Tag.declaration.init(); -} - -fn transDeclRefExpr( - c: *Context, - scope: *Scope, - expr: *const clang.DeclRefExpr, -) TransError!Node { - const value_decl = expr.getDecl(); - const name = try c.str(@as(*const clang.NamedDecl, @ptrCast(value_decl)).getName_bytes_begin()); - const mangled_name = scope.getAlias(name); - const decl_is_var = @as(*const clang.Decl, @ptrCast(value_decl)).getKind() == .Var; - const storage_class = @as(*const clang.VarDecl, @ptrCast(value_decl)).getStorageClass(); - const potential_local_extern = if (decl_is_var) ((storage_class == .Extern) and (scope.id != .root)) else false; - - var confirmed_local_extern = false; - var confirmed_local_extern_fn = false; - var ref_expr = val: { - if (cIsFunctionDeclRef(@as(*const clang.Expr, @ptrCast(expr)))) { - if (scope.id != .root) { - if (scope.getLocalExternAlias(name)) |v| { - confirmed_local_extern_fn = true; - break :val try Tag.identifier.create(c.arena, v); - } - } - break :val try Tag.fn_identifier.create(c.arena, mangled_name); - } else if (potential_local_extern) { - if (scope.getLocalExternAlias(name)) |v| { - confirmed_local_extern = true; - break :val try Tag.identifier.create(c.arena, v); - } else { - break :val try Tag.identifier.create(c.arena, mangled_name); - } - } else { - break :val try Tag.identifier.create(c.arena, mangled_name); - } - }; - - if (decl_is_var) { - const var_decl = @as(*const clang.VarDecl, @ptrCast(value_decl)); - if (var_decl.isStaticLocal()) { - ref_expr = try Tag.field_access.create(c.arena, .{ - .lhs = ref_expr, - .field_name = Scope.Block.static_inner_name, - }); - } else if (confirmed_local_extern) { - ref_expr = try Tag.field_access.create(c.arena, .{ - .lhs = ref_expr, - .field_name = name, // by necessity, name will always == mangled_name - }); - } - } else if (confirmed_local_extern_fn) { - ref_expr = try Tag.field_access.create(c.arena, .{ - .lhs = ref_expr, - .field_name = name, // by necessity, name will always == mangled_name - }); - } - scope.skipVariableDiscard(mangled_name); - return ref_expr; -} - -fn transImplicitCastExpr( - c: *Context, - scope: *Scope, - expr: *const clang.ImplicitCastExpr, - result_used: ResultUsed, -) TransError!Node { - const sub_expr = expr.getSubExpr(); - const dest_type = getExprQualType(c, @as(*const clang.Expr, @ptrCast(expr))); - const src_type = getExprQualType(c, sub_expr); - switch (expr.getCastKind()) { - .BitCast, .FloatingCast, .FloatingToIntegral, .IntegralToFloating, .IntegralCast, .PointerToIntegral, .IntegralToPointer => { - const sub_expr_node = try transExpr(c, scope, sub_expr, .used); - const casted = try transCCast(c, scope, expr.getBeginLoc(), dest_type, src_type, sub_expr_node); - return maybeSuppressResult(c, result_used, casted); - }, - .LValueToRValue, .NoOp, .FunctionToPointerDecay => { - const sub_expr_node = try transExpr(c, scope, sub_expr, .used); - return maybeSuppressResult(c, result_used, sub_expr_node); - }, - .ArrayToPointerDecay => { - const sub_expr_node = try transExpr(c, scope, sub_expr, .used); - if (exprIsNarrowStringLiteral(sub_expr) or exprIsFlexibleArrayRef(c, sub_expr)) { - return maybeSuppressResult(c, result_used, sub_expr_node); - } - - const index_val = try Tag.integer_literal.create(c.arena, "0"); - const index = try Tag.as.create(c.arena, .{ - .lhs = try Tag.type.create(c.arena, "usize"), - .rhs = try Tag.int_cast.create(c.arena, index_val), - }); - const array0_node = try Tag.array_access.create(c.arena, .{ .lhs = sub_expr_node, .rhs = index }); - // Convert array to pointer by expression: addr = &sub_expr[0] - const addr = try Tag.address_of.create(c.arena, array0_node); - const casted = try transCPtrCast(c, scope, expr.getBeginLoc(), dest_type, src_type, addr); - return maybeSuppressResult(c, result_used, casted); - }, - .NullToPointer => { - return Tag.null_literal.init(); - }, - .PointerToBoolean => { - // @intFromPtr(val) != 0 - const ptr_node = try transExpr(c, scope, sub_expr, .used); - const int_from_ptr = try Tag.int_from_ptr.create(c.arena, ptr_node); - - const ne = try Tag.not_equal.create(c.arena, .{ .lhs = int_from_ptr, .rhs = Tag.zero_literal.init() }); - return maybeSuppressResult(c, result_used, ne); - }, - .IntegralToBoolean, .FloatingToBoolean => { - const sub_expr_node = try transExpr(c, scope, sub_expr, .used); - - // The expression is already a boolean one, return it as-is - if (isBoolRes(sub_expr_node)) - return maybeSuppressResult(c, result_used, sub_expr_node); - - // val != 0 - const ne = try Tag.not_equal.create(c.arena, .{ .lhs = sub_expr_node, .rhs = Tag.zero_literal.init() }); - return maybeSuppressResult(c, result_used, ne); - }, - .BuiltinFnToFnPtr => { - return transBuiltinFnExpr(c, scope, sub_expr, result_used); - }, - .ToVoid => { - // Should only appear in the rhs and lhs of a ConditionalOperator - return transExpr(c, scope, sub_expr, .unused); - }, - else => |kind| return fail( - c, - error.UnsupportedTranslation, - @as(*const clang.Stmt, @ptrCast(expr)).getBeginLoc(), - "unsupported CastKind {s}", - .{@tagName(kind)}, - ), - } -} - -fn isBuiltinDefined(name: []const u8) bool { - inline for (@typeInfo(std.zig.c_builtins).@"struct".decls) |decl| { - if (std.mem.eql(u8, name, decl.name)) return true; - } - return false; -} - -fn transBuiltinFnExpr(c: *Context, scope: *Scope, expr: *const clang.Expr, used: ResultUsed) TransError!Node { - const node = try transExpr(c, scope, expr, used); - if (node.castTag(.fn_identifier)) |ident| { - const name = ident.data; - if (!isBuiltinDefined(name)) return fail(c, error.UnsupportedTranslation, expr.getBeginLoc(), "TODO implement function '{s}' in std.zig.c_builtins", .{name}); - } - return node; -} - -fn transBoolExpr( - c: *Context, - scope: *Scope, - expr: *const clang.Expr, - used: ResultUsed, -) TransError!Node { - if (@as(*const clang.Stmt, @ptrCast(expr)).getStmtClass() == .IntegerLiteralClass) { - var signum: c_int = undefined; - if (!(@as(*const clang.IntegerLiteral, @ptrCast(expr)).getSignum(&signum, c.clang_context))) { - return fail(c, error.UnsupportedTranslation, expr.getBeginLoc(), "invalid integer literal", .{}); - } - const is_zero = signum == 0; - return Node{ .tag_if_small_enough = @intFromEnum(([2]Tag{ .true_literal, .false_literal })[@intFromBool(is_zero)]) }; - } - - const res = try transExpr(c, scope, expr, used); - if (isBoolRes(res)) { - return maybeSuppressResult(c, used, res); - } - - const ty = getExprQualType(c, expr).getTypePtr(); - const node = try finishBoolExpr(c, scope, expr.getBeginLoc(), ty, res, used); - - return maybeSuppressResult(c, used, node); -} - -fn exprIsBooleanType(expr: *const clang.Expr) bool { - return qualTypeIsBoolean(expr.getType()); -} - -fn exprIsNarrowStringLiteral(expr: *const clang.Expr) bool { - switch (expr.getStmtClass()) { - .StringLiteralClass => { - const string_lit = @as(*const clang.StringLiteral, @ptrCast(expr)); - return string_lit.getCharByteWidth() == 1; - }, - .PredefinedExprClass => return true, - .UnaryOperatorClass => { - const op_expr = @as(*const clang.UnaryOperator, @ptrCast(expr)).getSubExpr(); - return exprIsNarrowStringLiteral(op_expr); - }, - .ParenExprClass => { - const op_expr = @as(*const clang.ParenExpr, @ptrCast(expr)).getSubExpr(); - return exprIsNarrowStringLiteral(op_expr); - }, - .GenericSelectionExprClass => { - const gen_sel = @as(*const clang.GenericSelectionExpr, @ptrCast(expr)); - return exprIsNarrowStringLiteral(gen_sel.getResultExpr()); - }, - else => return false, - } -} - -fn exprIsFlexibleArrayRef(c: *Context, expr: *const clang.Expr) bool { - if (expr.getStmtClass() == .MemberExprClass) { - const member_expr = @as(*const clang.MemberExpr, @ptrCast(expr)); - const member_decl = member_expr.getMemberDecl(); - const decl_kind = @as(*const clang.Decl, @ptrCast(member_decl)).getKind(); - if (decl_kind == .Field) { - const field_decl = @as(*const clang.FieldDecl, @ptrCast(member_decl)); - return isFlexibleArrayFieldDecl(c, field_decl); - } - } - return false; -} - -fn isBoolRes(res: Node) bool { - switch (res.tag()) { - .@"or", - .@"and", - .equal, - .not_equal, - .less_than, - .less_than_equal, - .greater_than, - .greater_than_equal, - .not, - .false_literal, - .true_literal, - => return true, - else => return false, - } -} - -fn finishBoolExpr( - c: *Context, - scope: *Scope, - loc: clang.SourceLocation, - ty: *const clang.Type, - node: Node, - used: ResultUsed, -) TransError!Node { - switch (ty.getTypeClass()) { - .Builtin => { - const builtin_ty = @as(*const clang.BuiltinType, @ptrCast(ty)); - - switch (builtin_ty.getKind()) { - .Bool => return node, - .Char_U, - .UChar, - .Char_S, - .SChar, - .UShort, - .UInt, - .ULong, - .ULongLong, - .Short, - .Int, - .Long, - .LongLong, - .UInt128, - .Int128, - .Float, - .Double, - .Float128, - .LongDouble, - .WChar_U, - .Char8, - .Char16, - .Char32, - .WChar_S, - .Float16, - => { - // node != 0 - return Tag.not_equal.create(c.arena, .{ .lhs = node, .rhs = Tag.zero_literal.init() }); - }, - .NullPtr => { - // node == null - return Tag.equal.create(c.arena, .{ .lhs = node, .rhs = Tag.null_literal.init() }); - }, - else => {}, - } - }, - .Pointer => { - if (node.tag() == .string_literal) { - // @intFromPtr(node) != 0 - const int_from_ptr = try Tag.int_from_ptr.create(c.arena, node); - return Tag.not_equal.create(c.arena, .{ .lhs = int_from_ptr, .rhs = Tag.zero_literal.init() }); - } - // node != null - return Tag.not_equal.create(c.arena, .{ .lhs = node, .rhs = Tag.null_literal.init() }); - }, - .Typedef => { - const typedef_ty = @as(*const clang.TypedefType, @ptrCast(ty)); - const typedef_decl = typedef_ty.getDecl(); - const underlying_type = typedef_decl.getUnderlyingType(); - return finishBoolExpr(c, scope, loc, underlying_type.getTypePtr(), node, used); - }, - .Enum => { - // node != 0 - return Tag.not_equal.create(c.arena, .{ .lhs = node, .rhs = Tag.zero_literal.init() }); - }, - .Elaborated => { - const elaborated_ty = @as(*const clang.ElaboratedType, @ptrCast(ty)); - const named_type = elaborated_ty.getNamedType(); - return finishBoolExpr(c, scope, loc, named_type.getTypePtr(), node, used); - }, - else => {}, - } - return fail(c, error.UnsupportedType, loc, "unsupported bool expression type", .{}); -} - -const SuppressCast = enum { - with_as, - no_as, -}; -fn transIntegerLiteral( - c: *Context, - scope: *Scope, - expr: *const clang.IntegerLiteral, - result_used: ResultUsed, - suppress_as: SuppressCast, -) TransError!Node { - var eval_result: clang.ExprEvalResult = undefined; - if (!expr.EvaluateAsInt(&eval_result, c.clang_context)) { - const loc = expr.getBeginLoc(); - return fail(c, error.UnsupportedTranslation, loc, "invalid integer literal", .{}); - } - - if (suppress_as == .no_as) { - const int_lit_node = try transCreateNodeAPInt(c, eval_result.Val.getInt()); - return maybeSuppressResult(c, result_used, int_lit_node); - } - - // Integer literals in C have types, and this can matter for several reasons. - // For example, this is valid C: - // unsigned char y = 256; - // How this gets evaluated is the 256 is an integer, which gets truncated to signed char, then bit-casted - // to unsigned char, resulting in 0. In order for this to work, we have to emit this zig code: - // var y = @as(u8, @bitCast(@as(i8, @truncate(@as(c_int, 256))))); - // Ideally in translate-c we could flatten this out to simply: - // var y: u8 = 0; - // But the first step is to be correct, and the next step is to make the output more elegant. - - // @as(T, x) - const expr_base = @as(*const clang.Expr, @ptrCast(expr)); - const ty_node = try transQualType(c, scope, expr_base.getType(), expr_base.getBeginLoc()); - const rhs = try transCreateNodeAPInt(c, eval_result.Val.getInt()); - const as = try Tag.as.create(c.arena, .{ .lhs = ty_node, .rhs = rhs }); - return maybeSuppressResult(c, result_used, as); -} - -fn transReturnStmt( - c: *Context, - scope: *Scope, - expr: *const clang.ReturnStmt, -) TransError!Node { - const val_expr = expr.getRetValue() orelse - return Tag.return_void.init(); - - var rhs = try transExprCoercing(c, scope, val_expr, .used); - const return_qt = scope.findBlockReturnType(); - if (isBoolRes(rhs) and !qualTypeIsBoolean(return_qt)) { - rhs = try Tag.int_from_bool.create(c.arena, rhs); - } - return Tag.@"return".create(c.arena, rhs); -} - -fn transNarrowStringLiteral( - c: *Context, - stmt: *const clang.StringLiteral, - result_used: ResultUsed, -) TransError!Node { - var len: usize = undefined; - const bytes_ptr = stmt.getString_bytes_begin_size(&len); - - const str = try std.fmt.allocPrint(c.arena, "\"{f}\"", .{std.zig.fmtString(bytes_ptr[0..len])}); - const node = try Tag.string_literal.create(c.arena, str); - return maybeSuppressResult(c, result_used, node); -} - -fn transStringLiteral( - c: *Context, - scope: *Scope, - stmt: *const clang.StringLiteral, - result_used: ResultUsed, -) TransError!Node { - const kind = stmt.getKind(); - switch (kind) { - .Ascii, .UTF8 => return transNarrowStringLiteral(c, stmt, result_used), - .UTF16, .UTF32, .Wide => { - const str_type = @tagName(stmt.getKind()); - const name = try std.fmt.allocPrint(c.arena, "zig.{s}_string_{d}", .{ str_type, c.getMangle() }); - - const expr_base = @as(*const clang.Expr, @ptrCast(stmt)); - const array_type = try transQualTypeInitialized(c, scope, expr_base.getType(), expr_base, expr_base.getBeginLoc()); - const lit_array = try transStringLiteralInitializer(c, stmt, array_type); - const decl = try Tag.var_simple.create(c.arena, .{ .name = name, .init = lit_array }); - try scope.appendNode(decl); - const node = try Tag.identifier.create(c.arena, name); - return maybeSuppressResult(c, result_used, node); - }, - } -} - -fn getArrayPayload(array_type: Node) ast.Payload.Array.ArrayTypeInfo { - return (array_type.castTag(.array_type) orelse array_type.castTag(.null_sentinel_array_type).?).data; -} - -/// Translate a string literal that is initializing an array. In general narrow string -/// literals become `"".*` or `""[0..].*` if they need truncation. -/// Wide string literals become an array of integers. zero-fillers pad out the array to -/// the appropriate length, if necessary. -fn transStringLiteralInitializer( - c: *Context, - stmt: *const clang.StringLiteral, - array_type: Node, -) TransError!Node { - assert(array_type.tag() == .array_type or array_type.tag() == .null_sentinel_array_type); - - const is_narrow = stmt.getKind() == .Ascii or stmt.getKind() == .UTF8; - - const str_length = stmt.getLength(); - const payload = getArrayPayload(array_type); - const array_size = payload.len; - const elem_type = payload.elem_type; - - if (array_size == 0) return Tag.empty_array.create(c.arena, elem_type); - - const num_inits = @min(str_length, array_size); - const init_node = if (num_inits > 0) blk: { - if (is_narrow) { - // "string literal".* or string literal"[0..num_inits].* - var str = try transNarrowStringLiteral(c, stmt, .used); - if (str_length != array_size) str = try Tag.string_slice.create(c.arena, .{ .string = str, .end = num_inits }); - break :blk try Tag.deref.create(c.arena, str); - } else { - const init_list = try c.arena.alloc(Node, num_inits); - var i: c_uint = 0; - while (i < num_inits) : (i += 1) { - init_list[i] = try transCreateCharLitNode(c, false, stmt.getCodeUnit(i)); - } - const init_args: ast.Payload.Array.ArrayTypeInfo = .{ .len = num_inits, .elem_type = elem_type }; - const init_array_type = if (array_type.tag() == .array_type) - try Tag.array_type.create(c.arena, init_args) - else - try Tag.null_sentinel_array_type.create(c.arena, init_args); - break :blk try Tag.array_init.create(c.arena, .{ - .cond = init_array_type, - .cases = init_list, - }); - } - } else null; - - if (num_inits == array_size) return init_node.?; // init_node is only null if num_inits == 0; but if num_inits == array_size == 0 we've already returned - assert(array_size > str_length); // If array_size <= str_length, `num_inits == array_size` and we've already returned. - - const filler_node = try Tag.array_filler.create(c.arena, .{ - .type = elem_type, - .filler = Tag.zero_literal.init(), - .count = array_size - str_length, - }); - - if (init_node) |some| { - return Tag.array_cat.create(c.arena, .{ .lhs = some, .rhs = filler_node }); - } else { - return filler_node; - } -} - -/// determine whether `stmt` is a "pointer subtraction expression" - a subtraction where -/// both operands resolve to addresses. The C standard requires that both operands -/// point to elements of the same array object, but we do not verify that here. -fn cIsPointerDiffExpr(stmt: *const clang.BinaryOperator) bool { - const lhs = @as(*const clang.Stmt, @ptrCast(stmt.getLHS())); - const rhs = @as(*const clang.Stmt, @ptrCast(stmt.getRHS())); - return stmt.getOpcode() == .Sub and - qualTypeIsPtr(@as(*const clang.Expr, @ptrCast(lhs)).getType()) and - qualTypeIsPtr(@as(*const clang.Expr, @ptrCast(rhs)).getType()); -} - -fn cIsEnum(qt: clang.QualType) bool { - return qt.getCanonicalType().getTypeClass() == .Enum; -} - -fn cIsVector(qt: clang.QualType) bool { - return qt.getCanonicalType().getTypeClass() == .Vector; -} - -/// Get the underlying int type of an enum. The C compiler chooses a signed int -/// type that is large enough to hold all of the enum's values. It is not required -/// to be the smallest possible type that can hold all the values. -fn cIntTypeForEnum(enum_qt: clang.QualType) clang.QualType { - assert(cIsEnum(enum_qt)); - const ty = enum_qt.getCanonicalType().getTypePtr(); - const enum_ty = @as(*const clang.EnumType, @ptrCast(ty)); - const enum_decl = enum_ty.getDecl(); - return enum_decl.getIntegerType(); -} - -// when modifying this function, make sure to also update std.zig.c_translation.cast -fn transCCast( - c: *Context, - scope: *Scope, - loc: clang.SourceLocation, - dst_type: clang.QualType, - src_type: clang.QualType, - expr: Node, -) !Node { - if (qualTypeCanon(dst_type).isVoidType()) return expr; - if (dst_type.eq(src_type)) return expr; - if (qualTypeIsPtr(dst_type) and qualTypeIsPtr(src_type)) - return transCPtrCast(c, scope, loc, dst_type, src_type, expr); - if (cIsEnum(dst_type)) return transCCast(c, scope, loc, cIntTypeForEnum(dst_type), src_type, expr); - if (cIsEnum(src_type)) return transCCast(c, scope, loc, dst_type, cIntTypeForEnum(src_type), expr); - - const dst_node = try transQualType(c, scope, dst_type, loc); - if (cIsInteger(dst_type) and cIsInteger(src_type)) { - // 1. If src_type is an enum, determine the underlying signed int type - // 2. Extend or truncate without changing signed-ness. - // 3. Bit-cast to correct signed-ness - const src_type_is_signed = cIsSignedInteger(src_type); - var src_int_expr = expr; - - if (isBoolRes(src_int_expr)) { - src_int_expr = try Tag.int_from_bool.create(c.arena, src_int_expr); - return Tag.as.create(c.arena, .{ .lhs = dst_node, .rhs = src_int_expr }); - } - - switch (cIntTypeCmp(dst_type, src_type)) { - .lt => { - // @truncate(SameSignSmallerInt, src_int_expr) - const ty_node = try transQualTypeIntWidthOf(c, dst_type, src_type_is_signed); - src_int_expr = try Tag.as.create(c.arena, .{ - .lhs = ty_node, - .rhs = try Tag.truncate.create(c.arena, src_int_expr), - }); - }, - .gt => { - // @as(SameSignBiggerInt, src_int_expr) - const ty_node = try transQualTypeIntWidthOf(c, dst_type, src_type_is_signed); - src_int_expr = try Tag.as.create(c.arena, .{ .lhs = ty_node, .rhs = src_int_expr }); - }, - .eq => { - // src_int_expr = src_int_expr - }, - } - // @as(dest_type, @bitCast(intermediate_value)) - return Tag.as.create(c.arena, .{ - .lhs = dst_node, - .rhs = try Tag.bit_cast.create(c.arena, src_int_expr), - }); - } - if (cIsVector(src_type) or cIsVector(dst_type)) { - // C cast where at least 1 operand is a vector requires them to be same size - // @as(dest_type, @bitCast(val)) - return Tag.as.create(c.arena, .{ - .lhs = dst_node, - .rhs = try Tag.bit_cast.create(c.arena, expr), - }); - } - if (cIsInteger(dst_type) and qualTypeIsPtr(src_type)) { - // @intCast(dest_type, @intFromPtr(val)) - const int_from_ptr = try Tag.int_from_ptr.create(c.arena, expr); - return Tag.as.create(c.arena, .{ - .lhs = dst_node, - .rhs = try Tag.int_cast.create(c.arena, int_from_ptr), - }); - } - if (cIsInteger(src_type) and qualTypeIsPtr(dst_type)) { - // @as(dest_type, @ptrFromInt(val)) - return Tag.as.create(c.arena, .{ - .lhs = dst_node, - .rhs = try Tag.ptr_from_int.create(c.arena, expr), - }); - } - if (cIsFloating(src_type) and cIsFloating(dst_type)) { - // @as(dest_type, @floatCast(val)) - return Tag.as.create(c.arena, .{ - .lhs = dst_node, - .rhs = try Tag.float_cast.create(c.arena, expr), - }); - } - if (cIsFloating(src_type) and !cIsFloating(dst_type)) { - // bool expression: floating val != 0 - if (qualTypeIsBoolean(dst_type)) { - return Tag.not_equal.create(c.arena, .{ - .lhs = expr, - .rhs = Tag.zero_literal.init(), - }); - } - - // @as(dest_type, @intFromFloat(val)) - return Tag.as.create(c.arena, .{ - .lhs = dst_node, - .rhs = try Tag.int_from_float.create(c.arena, expr), - }); - } - if (!cIsFloating(src_type) and cIsFloating(dst_type)) { - var rhs = expr; - if (qualTypeIsBoolean(src_type) or isBoolRes(rhs)) rhs = try Tag.int_from_bool.create(c.arena, expr); - // @as(dest_type, @floatFromInt(val)) - return Tag.as.create(c.arena, .{ - .lhs = dst_node, - .rhs = try Tag.float_from_int.create(c.arena, rhs), - }); - } - if (qualTypeIsBoolean(src_type) and !qualTypeIsBoolean(dst_type)) { - // @intFromBool returns a u1 - // TODO: if dst_type is 1 bit & signed (bitfield) we need @bitCast - // instead of @as - const int_from_bool = try Tag.int_from_bool.create(c.arena, expr); - return Tag.as.create(c.arena, .{ .lhs = dst_node, .rhs = int_from_bool }); - } - // @as(dest_type, val) - return Tag.as.create(c.arena, .{ .lhs = dst_node, .rhs = expr }); -} - -fn transExpr(c: *Context, scope: *Scope, expr: *const clang.Expr, used: ResultUsed) TransError!Node { - return transStmt(c, scope, @as(*const clang.Stmt, @ptrCast(expr)), used); -} - -/// Same as `transExpr` but with the knowledge that the operand will be type coerced, and therefore -/// an `@as` would be redundant. This is used to prevent redundant `@as` in integer literals. -fn transExprCoercing(c: *Context, scope: *Scope, expr: *const clang.Expr, used: ResultUsed) TransError!Node { - switch (@as(*const clang.Stmt, @ptrCast(expr)).getStmtClass()) { - .IntegerLiteralClass => { - return transIntegerLiteral(c, scope, @as(*const clang.IntegerLiteral, @ptrCast(expr)), .used, .no_as); - }, - .CharacterLiteralClass => { - return transCharLiteral(c, scope, @as(*const clang.CharacterLiteral, @ptrCast(expr)), .used, .no_as); - }, - .UnaryOperatorClass => { - const un_expr = @as(*const clang.UnaryOperator, @ptrCast(expr)); - if (un_expr.getOpcode() == .Extension) { - return transExprCoercing(c, scope, un_expr.getSubExpr(), used); - } - }, - .ImplicitCastExprClass => { - const cast_expr = @as(*const clang.ImplicitCastExpr, @ptrCast(expr)); - const sub_expr = cast_expr.getSubExpr(); - switch (@as(*const clang.Stmt, @ptrCast(sub_expr)).getStmtClass()) { - .IntegerLiteralClass, .CharacterLiteralClass => switch (cast_expr.getCastKind()) { - .IntegralToFloating => return transExprCoercing(c, scope, sub_expr, used), - .IntegralCast => { - const dest_type = getExprQualType(c, expr); - if (literalFitsInType(c, sub_expr, dest_type)) - return transExprCoercing(c, scope, sub_expr, used); - }, - else => {}, - }, - else => {}, - } - }, - else => {}, - } - return transExpr(c, scope, expr, .used); -} - -fn literalFitsInType(c: *Context, expr: *const clang.Expr, qt: clang.QualType) bool { - var width = qualTypeIntBitWidth(c, qt) catch 8; - if (width == 0) width = 8; // Byte is the smallest type. - const is_signed = cIsSignedInteger(qt); - const width_max_int = (@as(u64, 1) << math.lossyCast(u6, width - @intFromBool(is_signed))) - 1; - - switch (@as(*const clang.Stmt, @ptrCast(expr)).getStmtClass()) { - .CharacterLiteralClass => { - const char_lit = @as(*const clang.CharacterLiteral, @ptrCast(expr)); - const val = char_lit.getValue(); - // If the val is less than the max int then it fits. - return val <= width_max_int; - }, - .IntegerLiteralClass => { - const int_lit = @as(*const clang.IntegerLiteral, @ptrCast(expr)); - var eval_result: clang.ExprEvalResult = undefined; - if (!int_lit.EvaluateAsInt(&eval_result, c.clang_context)) { - return false; - } - - const int = eval_result.Val.getInt(); - return int.lessThanEqual(width_max_int); - }, - else => unreachable, - } -} - -fn transInitListExprRecord( - c: *Context, - scope: *Scope, - loc: clang.SourceLocation, - expr: *const clang.InitListExpr, - ty: *const clang.Type, -) TransError!Node { - var is_union_type = false; - // Unions and Structs are both represented as RecordDecl - const record_ty = ty.getAsRecordType() orelse - blk: { - is_union_type = true; - break :blk ty.getAsUnionType(); - } orelse unreachable; - const record_decl = record_ty.getDecl(); - const record_def = record_decl.getDefinition() orelse - unreachable; - - const ty_node = try transType(c, scope, ty, loc); - const init_count = expr.getNumInits(); - var field_inits = std.array_list.Managed(ast.Payload.ContainerInit.Initializer).init(c.gpa); - defer field_inits.deinit(); - - if (init_count == 0) { - const source_loc = @as(*const clang.Expr, @ptrCast(expr)).getBeginLoc(); - return transZeroInitExpr(c, scope, source_loc, ty); - } - - var init_i: c_uint = 0; - var it = record_def.field_begin(); - const end_it = record_def.field_end(); - while (it.neq(end_it)) : (it = it.next()) { - const field_decl = it.deref(); - - // The initializer for a union type has a single entry only - if (is_union_type and field_decl != expr.getInitializedFieldInUnion()) { - continue; - } - - assert(init_i < init_count); - const elem_expr = expr.getInit(init_i); - init_i += 1; - - // Generate the field assignment expression: - // .field_name = expr - var raw_name = try c.str(@as(*const clang.NamedDecl, @ptrCast(field_decl)).getName_bytes_begin()); - if (field_decl.isAnonymousStructOrUnion()) { - const name = c.decl_table.get(@intFromPtr(field_decl.getCanonicalDecl())).?; - raw_name = try c.arena.dupe(u8, name); - } - - var init_expr = try transExpr(c, scope, elem_expr, .used); - const field_qt = field_decl.getType(); - if (init_expr.tag() == .string_literal and qualTypeIsCharStar(field_qt)) { - if (scope.id == .root) { - init_expr = try stringLiteralToCharStar(c, init_expr); - } else { - const dst_type_node = try transQualType(c, scope, field_qt, loc); - init_expr = try removeCVQualifiers(c, dst_type_node, init_expr); - } - } - try field_inits.append(.{ - .name = raw_name, - .value = init_expr, - }); - } - if (ty_node.castTag(.identifier)) |ident_node| { - scope.skipVariableDiscard(ident_node.data); - } - return Tag.container_init.create(c.arena, .{ - .lhs = ty_node, - .inits = try c.arena.dupe(ast.Payload.ContainerInit.Initializer, field_inits.items), - }); -} - -fn transInitListExprArray( - c: *Context, - scope: *Scope, - loc: clang.SourceLocation, - expr: *const clang.InitListExpr, - ty: *const clang.Type, -) TransError!Node { - const arr_type = ty.getAsArrayTypeUnsafe(); - const child_qt = arr_type.getElementType(); - const child_type = try transQualType(c, scope, child_qt, loc); - const init_count = expr.getNumInits(); - assert(@as(*const clang.Type, @ptrCast(arr_type)).isConstantArrayType()); - const const_arr_ty = @as(*const clang.ConstantArrayType, @ptrCast(arr_type)); - var size_ap_int: *const clang.APInt = undefined; - const_arr_ty.getSize(&size_ap_int); - defer size_ap_int.free(); - const all_count = size_ap_int.getLimitedValue(usize); - const leftover_count = all_count - init_count; - - if (all_count == 0) { - return Tag.empty_array.create(c.arena, child_type); - } - - if (expr.isStringLiteralInit()) { - assert(init_count == 1); - const init_expr = expr.getInit(0); - const string_literal = init_expr.castToStringLiteral().?; - return try transStringLiteral(c, scope, string_literal, .used); - } - - const init_node = if (init_count != 0) blk: { - const init_list = try c.arena.alloc(Node, init_count); - - for (init_list, 0..) |*init, i| { - const elem_expr = expr.getInit(@as(c_uint, @intCast(i))); - init.* = try transExprCoercing(c, scope, elem_expr, .used); - } - const init_node = try Tag.array_init.create(c.arena, .{ - .cond = try Tag.array_type.create(c.arena, .{ .len = init_count, .elem_type = child_type }), - .cases = init_list, - }); - if (leftover_count == 0) { - return init_node; - } - break :blk init_node; - } else null; - - assert(expr.hasArrayFiller()); - const filler_val_expr = expr.getArrayFiller(); - const filler_node = try Tag.array_filler.create(c.arena, .{ - .type = child_type, - .filler = try transExprCoercing(c, scope, filler_val_expr, .used), - .count = leftover_count, - }); - - if (init_node) |some| { - return Tag.array_cat.create(c.arena, .{ .lhs = some, .rhs = filler_node }); - } else { - return filler_node; - } -} - -fn transInitListExprVector( - c: *Context, - scope: *Scope, - loc: clang.SourceLocation, - expr: *const clang.InitListExpr, -) TransError!Node { - const qt = getExprQualType(c, @as(*const clang.Expr, @ptrCast(expr))); - const vector_ty = @as(*const clang.VectorType, @ptrCast(qualTypeCanon(qt))); - - const init_count = expr.getNumInits(); - const num_elements = vector_ty.getNumElements(); - const element_qt = vector_ty.getElementType(); - - if (init_count == 0) { - const vec_node = try Tag.vector.create(c.arena, .{ - .lhs = try transCreateNodeNumber(c, num_elements, .int), - .rhs = try transQualType(c, scope, element_qt, loc), - }); - - return Tag.as.create(c.arena, .{ - .lhs = vec_node, - .rhs = try Tag.vector_zero_init.create(c.arena, Tag.zero_literal.init()), - }); - } - - const vector_type = try transQualType(c, scope, qt, loc); - - var block_scope = try Scope.Block.init(c, scope, true); - defer block_scope.deinit(); - - // workaround for https://github.com/ziglang/zig/issues/8322 - // we store the initializers in temp variables and use those - // to initialize the vector. Eventually we can just directly - // construct the init_list from casted source members - var i: usize = 0; - while (i < init_count) : (i += 1) { - const mangled_name = try block_scope.makeMangledName(c, "tmp"); - const init_expr = expr.getInit(@as(c_uint, @intCast(i))); - const tmp_decl_node = try Tag.var_simple.create(c.arena, .{ - .name = mangled_name, - .init = try transExpr(c, &block_scope.base, init_expr, .used), - }); - try block_scope.statements.append(tmp_decl_node); - } - - const init_list = try c.arena.alloc(Node, num_elements); - for (init_list, 0..) |*init, init_index| { - if (init_index < init_count) { - const tmp_decl = block_scope.statements.items[init_index]; - const name = tmp_decl.castTag(.var_simple).?.data.name; - init.* = try Tag.identifier.create(c.arena, name); - } else { - init.* = Tag.undefined_literal.init(); - } - } - - const array_init = try Tag.array_init.create(c.arena, .{ - .cond = vector_type, - .cases = init_list, - }); - const break_node = try Tag.break_val.create(c.arena, .{ - .label = block_scope.label, - .val = array_init, - }); - try block_scope.statements.append(break_node); - - return block_scope.complete(c); -} - -fn transInitListExpr( - c: *Context, - scope: *Scope, - expr: *const clang.InitListExpr, - used: ResultUsed, -) TransError!Node { - const qt = getExprQualType(c, @as(*const clang.Expr, @ptrCast(expr))); - var qual_type = qt.getTypePtr(); - const source_loc = @as(*const clang.Expr, @ptrCast(expr)).getBeginLoc(); - - if (qualTypeWasDemotedToOpaque(c, qt)) { - return fail(c, error.UnsupportedTranslation, source_loc, "cannot initialize opaque type", .{}); - } - - if (qual_type.isRecordType()) { - return maybeSuppressResult(c, used, try transInitListExprRecord( - c, - scope, - source_loc, - expr, - qual_type, - )); - } else if (qual_type.isArrayType()) { - return maybeSuppressResult(c, used, try transInitListExprArray( - c, - scope, - source_loc, - expr, - qual_type, - )); - } else if (qual_type.isVectorType()) { - return maybeSuppressResult(c, used, try transInitListExprVector(c, scope, source_loc, expr)); - } else { - const type_name = try c.str(qual_type.getTypeClassName()); - return fail(c, error.UnsupportedType, source_loc, "unsupported initlist type: '{s}'", .{type_name}); - } -} - -fn transZeroInitExpr( - c: *Context, - scope: *Scope, - source_loc: clang.SourceLocation, - ty: *const clang.Type, -) TransError!Node { - switch (ty.getTypeClass()) { - .Builtin => { - const builtin_ty = @as(*const clang.BuiltinType, @ptrCast(ty)); - switch (builtin_ty.getKind()) { - .Bool => return Tag.false_literal.init(), - .Char_U, - .UChar, - .Char_S, - .Char8, - .SChar, - .UShort, - .UInt, - .ULong, - .ULongLong, - .Short, - .Int, - .Long, - .LongLong, - .UInt128, - .Int128, - .Float, - .Double, - .Float128, - .Float16, - .LongDouble, - => return Tag.zero_literal.init(), - else => return fail(c, error.UnsupportedType, source_loc, "unsupported builtin type", .{}), - } - }, - .Pointer => return Tag.null_literal.init(), - .Typedef => { - const typedef_ty = @as(*const clang.TypedefType, @ptrCast(ty)); - const typedef_decl = typedef_ty.getDecl(); - return transZeroInitExpr( - c, - scope, - source_loc, - typedef_decl.getUnderlyingType().getTypePtr(), - ); - }, - else => return Tag.std_mem_zeroes.create(c.arena, try transType(c, scope, ty, source_loc)), - } -} - -fn transImplicitValueInitExpr( - c: *Context, - scope: *Scope, - expr: *const clang.Expr, -) TransError!Node { - const source_loc = expr.getBeginLoc(); - const qt = getExprQualType(c, expr); - const ty = qt.getTypePtr(); - return transZeroInitExpr(c, scope, source_loc, ty); -} - -/// If a statement can possibly translate to a Zig assignment (either directly because it's -/// an assignment in C or indirectly via result assignment to `_`) AND it's the sole statement -/// in the body of an if statement or loop, then we need to put the statement into its own block. -/// The `else` case here corresponds to statements that could result in an assignment. If a statement -/// class never needs a block, add its enum to the top prong. -fn maybeBlockify(c: *Context, scope: *Scope, stmt: *const clang.Stmt) TransError!Node { - switch (stmt.getStmtClass()) { - .BreakStmtClass, - .CompoundStmtClass, - .ContinueStmtClass, - .DeclRefExprClass, - .DeclStmtClass, - .DoStmtClass, - .ForStmtClass, - .IfStmtClass, - .ReturnStmtClass, - .NullStmtClass, - .WhileStmtClass, - => return transStmt(c, scope, stmt, .unused), - else => return blockify(c, scope, stmt), - } -} - -fn blockify(c: *Context, scope: *Scope, stmt: *const clang.Stmt) TransError!Node { - var block_scope = try Scope.Block.init(c, scope, false); - defer block_scope.deinit(); - const result = try transStmt(c, &block_scope.base, stmt, .unused); - try block_scope.statements.append(result); - return block_scope.complete(c); -} - -fn transIfStmt( - c: *Context, - scope: *Scope, - stmt: *const clang.IfStmt, -) TransError!Node { - // if (c) t - // if (c) t else e - var cond_scope = Scope.Condition{ - .base = .{ - .parent = scope, - .id = .condition, - }, - }; - defer cond_scope.deinit(); - const cond_expr = @as(*const clang.Expr, @ptrCast(stmt.getCond())); - const cond = try transBoolExpr(c, &cond_scope.base, cond_expr, .used); - - const then_stmt = stmt.getThen(); - const else_stmt = stmt.getElse(); - const then_class = then_stmt.getStmtClass(); - // block needed to keep else statement from attaching to inner while - const must_blockify = (else_stmt != null) and switch (then_class) { - .DoStmtClass, .ForStmtClass, .WhileStmtClass => true, - else => false, - }; - - const then_body = if (must_blockify) - try blockify(c, scope, then_stmt) - else - try maybeBlockify(c, scope, then_stmt); - - const else_body = if (else_stmt) |expr| - try maybeBlockify(c, scope, expr) - else - null; - return Tag.@"if".create(c.arena, .{ .cond = cond, .then = then_body, .@"else" = else_body }); -} - -fn transWhileLoop( - c: *Context, - scope: *Scope, - stmt: *const clang.WhileStmt, -) TransError!Node { - var cond_scope = Scope.Condition{ - .base = .{ - .parent = scope, - .id = .condition, - }, - }; - defer cond_scope.deinit(); - const cond_expr = @as(*const clang.Expr, @ptrCast(stmt.getCond())); - const cond = try transBoolExpr(c, &cond_scope.base, cond_expr, .used); - - var loop_scope = Scope{ - .parent = scope, - .id = .loop, - }; - const body = try maybeBlockify(c, &loop_scope, stmt.getBody()); - return Tag.@"while".create(c.arena, .{ .cond = cond, .body = body, .cont_expr = null }); -} - -fn transDoWhileLoop( - c: *Context, - scope: *Scope, - stmt: *const clang.DoStmt, -) TransError!Node { - var loop_scope = Scope{ - .parent = scope, - .id = .do_loop, - }; - - // if (!cond) break; - var cond_scope = Scope.Condition{ - .base = .{ - .parent = scope, - .id = .condition, - }, - }; - defer cond_scope.deinit(); - const cond = try transBoolExpr(c, &cond_scope.base, @as(*const clang.Expr, @ptrCast(stmt.getCond())), .used); - const if_not_break = switch (cond.tag()) { - .true_literal => { - const body_node = try maybeBlockify(c, scope, stmt.getBody()); - return Tag.while_true.create(c.arena, body_node); - }, - else => try Tag.if_not_break.create(c.arena, cond), - }; - - var body_node = try transStmt(c, &loop_scope, stmt.getBody(), .unused); - if (body_node.isNoreturn(true)) { - // The body node ends in a noreturn statement. Simply put it in a while (true) - // in case it contains breaks or continues. - } else if (stmt.getBody().getStmtClass() == .CompoundStmtClass) { - // there's already a block in C, so we'll append our condition to it. - // c: do { - // c: a; - // c: b; - // c: } while(c); - // zig: while (true) { - // zig: a; - // zig: b; - // zig: if (!cond) break; - // zig: } - const block = body_node.castTag(.block).?; - block.data.stmts.len += 1; // This is safe since we reserve one extra space in Scope.Block.complete. - block.data.stmts[block.data.stmts.len - 1] = if_not_break; - } else { - // the C statement is without a block, so we need to create a block to contain it. - // c: do - // c: a; - // c: while(c); - // zig: while (true) { - // zig: a; - // zig: if (!cond) break; - // zig: } - const statements = try c.arena.alloc(Node, 2); - statements[0] = body_node; - statements[1] = if_not_break; - body_node = try Tag.block.create(c.arena, .{ .label = null, .stmts = statements }); - } - return Tag.while_true.create(c.arena, body_node); -} - -fn transForLoop( - c: *Context, - scope: *Scope, - stmt: *const clang.ForStmt, -) TransError!Node { - var loop_scope = Scope{ - .parent = scope, - .id = .loop, - }; - - var block_scope: ?Scope.Block = null; - defer if (block_scope) |*bs| bs.deinit(); - - if (stmt.getInit()) |init| { - block_scope = try Scope.Block.init(c, scope, false); - loop_scope.parent = &block_scope.?.base; - const init_node = try transStmt(c, &block_scope.?.base, init, .unused); - if (init_node.tag() != .declaration) try block_scope.?.statements.append(init_node); - } - var cond_scope = Scope.Condition{ - .base = .{ - .parent = &loop_scope, - .id = .condition, - }, - }; - defer cond_scope.deinit(); - - const cond = if (stmt.getCond()) |cond| - try transBoolExpr(c, &cond_scope.base, cond, .used) - else - Tag.true_literal.init(); - - const cont_expr = if (stmt.getInc()) |incr| - try transExpr(c, &cond_scope.base, incr, .unused) - else - null; - - const body = try maybeBlockify(c, &loop_scope, stmt.getBody()); - const while_node = try Tag.@"while".create(c.arena, .{ .cond = cond, .body = body, .cont_expr = cont_expr }); - if (block_scope) |*bs| { - try bs.statements.append(while_node); - return try bs.complete(c); - } else { - return while_node; - } -} - -fn transSwitch( - c: *Context, - scope: *Scope, - stmt: *const clang.SwitchStmt, -) TransError!Node { - var loop_scope = Scope{ - .parent = scope, - .id = .loop, - }; - - var block_scope = try Scope.Block.init(c, &loop_scope, false); - defer block_scope.deinit(); - - const base_scope = &block_scope.base; - - var cond_scope = Scope.Condition{ - .base = .{ - .parent = base_scope, - .id = .condition, - }, - }; - defer cond_scope.deinit(); - const switch_expr = try transExpr(c, &cond_scope.base, stmt.getCond(), .used); - - var cases = std.array_list.Managed(Node).init(c.gpa); - defer cases.deinit(); - var has_default = false; - - const body = stmt.getBody(); - assert(body.getStmtClass() == .CompoundStmtClass); - const compound_stmt = @as(*const clang.CompoundStmt, @ptrCast(body)); - var it = compound_stmt.body_begin(); - const end_it = compound_stmt.body_end(); - // Iterate over switch body and collect all cases. - // Fallthrough is handled by duplicating statements. - while (it != end_it) : (it += 1) { - switch (it[0].getStmtClass()) { - .CaseStmtClass => { - var items = std.array_list.Managed(Node).init(c.gpa); - defer items.deinit(); - const sub = try transCaseStmt(c, base_scope, it[0], &items); - const res = try transSwitchProngStmt(c, base_scope, sub, it, end_it); - - if (items.items.len == 0) { - has_default = true; - const switch_else = try Tag.switch_else.create(c.arena, res); - try cases.append(switch_else); - } else { - const switch_prong = try Tag.switch_prong.create(c.arena, .{ - .cases = try c.arena.dupe(Node, items.items), - .cond = res, - }); - try cases.append(switch_prong); - } - }, - .DefaultStmtClass => { - has_default = true; - const default_stmt = @as(*const clang.DefaultStmt, @ptrCast(it[0])); - - var sub = default_stmt.getSubStmt(); - while (true) switch (sub.getStmtClass()) { - .CaseStmtClass => sub = @as(*const clang.CaseStmt, @ptrCast(sub)).getSubStmt(), - .DefaultStmtClass => sub = @as(*const clang.DefaultStmt, @ptrCast(sub)).getSubStmt(), - else => break, - }; - - const res = try transSwitchProngStmt(c, base_scope, sub, it, end_it); - - const switch_else = try Tag.switch_else.create(c.arena, res); - try cases.append(switch_else); - }, - else => {}, // collected in transSwitchProngStmt - } - } - - if (!has_default) { - const else_prong = try Tag.switch_else.create(c.arena, Tag.empty_block.init()); - try cases.append(else_prong); - } - - const switch_node = try Tag.@"switch".create(c.arena, .{ - .cond = switch_expr, - .cases = try c.arena.dupe(Node, cases.items), - }); - try block_scope.statements.append(switch_node); - try block_scope.statements.append(Tag.@"break".init()); - const while_body = try block_scope.complete(c); - - return Tag.while_true.create(c.arena, while_body); -} - -/// Collects all items for this case, returns the first statement after the labels. -/// If items ends up empty, the prong should be translated as an else. -fn transCaseStmt(c: *Context, scope: *Scope, stmt: *const clang.Stmt, items: *std.array_list.Managed(Node)) TransError!*const clang.Stmt { - var sub = stmt; - var seen_default = false; - while (true) { - switch (sub.getStmtClass()) { - .DefaultStmtClass => { - seen_default = true; - items.items.len = 0; - const default_stmt = @as(*const clang.DefaultStmt, @ptrCast(sub)); - sub = default_stmt.getSubStmt(); - }, - .CaseStmtClass => { - const case_stmt = @as(*const clang.CaseStmt, @ptrCast(sub)); - - if (seen_default) { - items.items.len = 0; - sub = case_stmt.getSubStmt(); - continue; - } - - const expr = if (case_stmt.getRHS()) |rhs| blk: { - const lhs_node = try transExprCoercing(c, scope, case_stmt.getLHS(), .used); - const rhs_node = try transExprCoercing(c, scope, rhs, .used); - - break :blk try Tag.ellipsis3.create(c.arena, .{ .lhs = lhs_node, .rhs = rhs_node }); - } else try transExprCoercing(c, scope, case_stmt.getLHS(), .used); - - try items.append(expr); - sub = case_stmt.getSubStmt(); - }, - else => return sub, - } - } -} - -/// Collects all statements seen by this case into a block. -/// Avoids creating a block if the first statement is a break or return. -fn transSwitchProngStmt( - c: *Context, - scope: *Scope, - stmt: *const clang.Stmt, - parent_it: clang.CompoundStmt.ConstBodyIterator, - parent_end_it: clang.CompoundStmt.ConstBodyIterator, -) TransError!Node { - switch (stmt.getStmtClass()) { - .BreakStmtClass => return Tag.@"break".init(), - .ReturnStmtClass => return transStmt(c, scope, stmt, .unused), - .CaseStmtClass, .DefaultStmtClass => unreachable, - else => { - var block_scope = try Scope.Block.init(c, scope, false); - defer block_scope.deinit(); - - // we do not need to translate `stmt` since it is the first stmt of `parent_it` - try transSwitchProngStmtInline(c, &block_scope, parent_it, parent_end_it); - return try block_scope.complete(c); - }, - } -} - -/// Collects all statements seen by this case into a block. -fn transSwitchProngStmtInline( - c: *Context, - block: *Scope.Block, - start_it: clang.CompoundStmt.ConstBodyIterator, - end_it: clang.CompoundStmt.ConstBodyIterator, -) TransError!void { - var it = start_it; - while (it != end_it) : (it += 1) { - switch (it[0].getStmtClass()) { - .ReturnStmtClass => { - const result = try transStmt(c, &block.base, it[0], .unused); - try block.statements.append(result); - return; - }, - .BreakStmtClass => { - try block.statements.append(Tag.@"break".init()); - return; - }, - .CaseStmtClass => { - var sub = @as(*const clang.CaseStmt, @ptrCast(it[0])).getSubStmt(); - while (true) switch (sub.getStmtClass()) { - .CaseStmtClass => sub = @as(*const clang.CaseStmt, @ptrCast(sub)).getSubStmt(), - .DefaultStmtClass => sub = @as(*const clang.DefaultStmt, @ptrCast(sub)).getSubStmt(), - else => break, - }; - const result = try transStmt(c, &block.base, sub, .unused); - assert(result.tag() != .declaration); - try block.statements.append(result); - if (result.isNoreturn(true)) { - return; - } - }, - .DefaultStmtClass => { - var sub = @as(*const clang.DefaultStmt, @ptrCast(it[0])).getSubStmt(); - while (true) switch (sub.getStmtClass()) { - .CaseStmtClass => sub = @as(*const clang.CaseStmt, @ptrCast(sub)).getSubStmt(), - .DefaultStmtClass => sub = @as(*const clang.DefaultStmt, @ptrCast(sub)).getSubStmt(), - else => break, - }; - const result = try transStmt(c, &block.base, sub, .unused); - assert(result.tag() != .declaration); - try block.statements.append(result); - if (result.isNoreturn(true)) { - return; - } - }, - .CompoundStmtClass => { - const result = try transCompoundStmt(c, &block.base, @as(*const clang.CompoundStmt, @ptrCast(it[0]))); - try block.statements.append(result); - if (result.isNoreturn(true)) { - return; - } - }, - else => { - const result = try transStmt(c, &block.base, it[0], .unused); - switch (result.tag()) { - .declaration, .empty_block => {}, - else => try block.statements.append(result), - } - }, - } - } - return; -} - -fn transConstantExpr(c: *Context, scope: *Scope, expr: *const clang.Expr, used: ResultUsed) TransError!Node { - var result: clang.ExprEvalResult = undefined; - if (!expr.evaluateAsConstantExpr(&result, .Normal, c.clang_context)) - return fail(c, error.UnsupportedTranslation, expr.getBeginLoc(), "invalid constant expression", .{}); - - switch (result.Val.getKind()) { - .Int => { - // See comment in `transIntegerLiteral` for why this code is here. - // @as(T, x) - const expr_base = @as(*const clang.Expr, @ptrCast(expr)); - const as_node = try Tag.as.create(c.arena, .{ - .lhs = try transQualType(c, scope, expr_base.getType(), expr_base.getBeginLoc()), - .rhs = try transCreateNodeAPInt(c, result.Val.getInt()), - }); - return maybeSuppressResult(c, used, as_node); - }, - else => |kind| { - return fail(c, error.UnsupportedTranslation, expr.getBeginLoc(), "unsupported constant expression kind '{}'", .{kind}); - }, - } -} - -fn transPredefinedExpr(c: *Context, scope: *Scope, expr: *const clang.PredefinedExpr, used: ResultUsed) TransError!Node { - return transStringLiteral(c, scope, expr.getFunctionName(), used); -} - -fn transCreateCharLitNode(c: *Context, narrow: bool, val: u32) TransError!Node { - return Tag.char_literal.create(c.arena, if (narrow) - try std.fmt.allocPrint(c.arena, "'{f}'", .{std.zig.fmtChar(@intCast(val))}) - else - try std.fmt.allocPrint(c.arena, "'\\u{{{x}}}'", .{val})); -} - -fn transCharLiteral( - c: *Context, - scope: *Scope, - stmt: *const clang.CharacterLiteral, - result_used: ResultUsed, - suppress_as: SuppressCast, -) TransError!Node { - const kind = stmt.getKind(); - const val = stmt.getValue(); - const narrow = kind == .Ascii or kind == .UTF8; - // C has a somewhat obscure feature called multi-character character constant - // e.g. 'abcd' - const int_lit_node = if (kind == .Ascii and val > 255) - try transCreateNodeNumber(c, val, .int) - else - try transCreateCharLitNode(c, narrow, val); - - if (suppress_as == .no_as) { - return maybeSuppressResult(c, result_used, int_lit_node); - } - // See comment in `transIntegerLiteral` for why this code is here. - // @as(T, x) - const expr_base = @as(*const clang.Expr, @ptrCast(stmt)); - const as_node = try Tag.as.create(c.arena, .{ - .lhs = try transQualType(c, scope, expr_base.getType(), expr_base.getBeginLoc()), - .rhs = int_lit_node, - }); - return maybeSuppressResult(c, result_used, as_node); -} - -fn transStmtExpr(c: *Context, scope: *Scope, stmt: *const clang.StmtExpr, used: ResultUsed) TransError!Node { - const comp = stmt.getSubStmt(); - if (used == .unused) { - return transCompoundStmt(c, scope, comp); - } - var block_scope = try Scope.Block.init(c, scope, true); - defer block_scope.deinit(); - - var it = comp.body_begin(); - const end_it = comp.body_end(); - while (it != end_it - 1) : (it += 1) { - const result = try transStmt(c, &block_scope.base, it[0], .unused); - switch (result.tag()) { - .declaration, .empty_block => {}, - else => try block_scope.statements.append(result), - } - } - - const last_result = try transStmt(c, &block_scope.base, it[0], .used); - switch (last_result.tag()) { - .declaration, .empty_block => {}, - else => { - const break_node = try Tag.break_val.create(c.arena, .{ - .label = block_scope.label, - .val = last_result, - }); - try block_scope.statements.append(break_node); - }, - } - const res = try block_scope.complete(c); - return maybeSuppressResult(c, used, res); -} - -fn transMemberExpr(c: *Context, scope: *Scope, stmt: *const clang.MemberExpr, result_used: ResultUsed) TransError!Node { - var container_node = try transExpr(c, scope, stmt.getBase(), .used); - if (stmt.isArrow()) { - container_node = try Tag.deref.create(c.arena, container_node); - } - - const member_decl = stmt.getMemberDecl(); - const name = blk: { - const decl_kind = @as(*const clang.Decl, @ptrCast(member_decl)).getKind(); - // If we're referring to a anonymous struct/enum find the bogus name - // we've assigned to it during the RecordDecl translation - if (decl_kind == .Field) { - const field_decl = @as(*const clang.FieldDecl, @ptrCast(member_decl)); - if (field_decl.isAnonymousStructOrUnion()) { - const name = c.decl_table.get(@intFromPtr(field_decl.getCanonicalDecl())).?; - break :blk try c.arena.dupe(u8, name); - } - } - const decl = @as(*const clang.NamedDecl, @ptrCast(member_decl)); - break :blk try c.str(decl.getName_bytes_begin()); - }; - - var node = try Tag.field_access.create(c.arena, .{ .lhs = container_node, .field_name = name }); - if (exprIsFlexibleArrayRef(c, @as(*const clang.Expr, @ptrCast(stmt)))) { - node = try Tag.call.create(c.arena, .{ .lhs = node, .args = &.{} }); - } - return maybeSuppressResult(c, result_used, node); -} - -/// ptr[subscr] (`subscr` is a signed integer expression, `ptr` a pointer) becomes: -/// (blk: { -/// const tmp = subscr; -/// if (tmp >= 0) break :blk ptr + @intCast(usize, tmp) else break :blk ptr - ~@bitCast(usize, @intCast(isize, tmp) +% -1); -/// }).* -/// Todo: rip this out once `[*]T + isize` becomes valid. -fn transSignedArrayAccess( - c: *Context, - scope: *Scope, - container_expr: *const clang.Expr, - subscr_expr: *const clang.Expr, - result_used: ResultUsed, -) TransError!Node { - var block_scope = try Scope.Block.init(c, scope, true); - defer block_scope.deinit(); - - const tmp = try block_scope.makeMangledName(c, "tmp"); - - const subscr_node = try transExpr(c, &block_scope.base, subscr_expr, .used); - const subscr_decl = try Tag.var_simple.create(c.arena, .{ .name = tmp, .init = subscr_node }); - try block_scope.statements.append(subscr_decl); - - const tmp_ref = try Tag.identifier.create(c.arena, tmp); - - const container_node = try transExpr(c, &block_scope.base, container_expr, .used); - - const cond_node = try Tag.greater_than_equal.create(c.arena, .{ .lhs = tmp_ref, .rhs = Tag.zero_literal.init() }); - - const then_value = try Tag.add.create(c.arena, .{ - .lhs = container_node, - .rhs = try Tag.as.create(c.arena, .{ - .lhs = try Tag.type.create(c.arena, "usize"), - .rhs = try Tag.int_cast.create(c.arena, tmp_ref), - }), - }); - - const then_body = try Tag.break_val.create(c.arena, .{ - .label = block_scope.label, - .val = then_value, - }); - - const minuend = container_node; - const signed_size = try Tag.as.create(c.arena, .{ - .lhs = try Tag.type.create(c.arena, "isize"), - .rhs = try Tag.int_cast.create(c.arena, tmp_ref), - }); - const to_cast = try Tag.add_wrap.create(c.arena, .{ - .lhs = signed_size, - .rhs = try Tag.negate.create(c.arena, Tag.one_literal.init()), - }); - const bitcast_node = try Tag.as.create(c.arena, .{ - .lhs = try Tag.type.create(c.arena, "usize"), - .rhs = try Tag.bit_cast.create(c.arena, to_cast), - }); - const subtrahend = try Tag.bit_not.create(c.arena, bitcast_node); - const difference = try Tag.sub.create(c.arena, .{ - .lhs = minuend, - .rhs = subtrahend, - }); - const else_body = try Tag.break_val.create(c.arena, .{ - .label = block_scope.label, - .val = difference, - }); - - const if_node = try Tag.@"if".create(c.arena, .{ - .cond = cond_node, - .then = then_body, - .@"else" = else_body, - }); - - try block_scope.statements.append(if_node); - const block_node = try block_scope.complete(c); - - const derefed = try Tag.deref.create(c.arena, block_node); - - return maybeSuppressResult(c, result_used, derefed); -} - -fn transArrayAccess(c: *Context, scope: *Scope, stmt: *const clang.ArraySubscriptExpr, result_used: ResultUsed) TransError!Node { - const base_stmt = stmt.getBase(); - const base_qt = getExprQualType(c, base_stmt); - const is_vector = cIsVector(base_qt); - - const subscr_expr = stmt.getIdx(); - const subscr_qt = getExprQualType(c, subscr_expr); - const is_longlong = cIsLongLongInteger(subscr_qt); - const is_signed = cIsSignedInteger(subscr_qt); - const is_nonnegative_int_literal = cIsNonNegativeIntLiteral(c, subscr_expr); - - // Unwrap the base statement if it's an array decayed to a bare pointer type - // so that we index the array itself - var unwrapped_base = base_stmt; - if (@as(*const clang.Stmt, @ptrCast(base_stmt)).getStmtClass() == .ImplicitCastExprClass) { - const implicit_cast = @as(*const clang.ImplicitCastExpr, @ptrCast(base_stmt)); - - if (implicit_cast.getCastKind() == .ArrayToPointerDecay) { - unwrapped_base = implicit_cast.getSubExpr(); - } - } - - // Special case: actual pointer (not decayed array) and signed integer subscript - // See discussion at https://github.com/ziglang/zig/pull/8589 - if (is_signed and (base_stmt == unwrapped_base) and !is_vector and !is_nonnegative_int_literal) - return transSignedArrayAccess(c, scope, base_stmt, subscr_expr, result_used); - - const container_node = try transExpr(c, scope, unwrapped_base, .used); - const rhs = if (is_longlong or is_signed) blk: { - // check if long long first so that signed long long doesn't just become unsigned long long - const typeid_node = if (is_longlong) try Tag.type.create(c.arena, "usize") else try transQualTypeIntWidthOf(c, subscr_qt, false); - break :blk try Tag.as.create(c.arena, .{ - .lhs = typeid_node, - .rhs = try Tag.int_cast.create( - c.arena, - try transExpr(c, scope, subscr_expr, .used), - ), - }); - } else try transExpr(c, scope, subscr_expr, .used); - - const node = try Tag.array_access.create(c.arena, .{ - .lhs = container_node, - .rhs = rhs, - }); - return maybeSuppressResult(c, result_used, node); -} - -/// Check if an expression is ultimately a reference to a function declaration -/// (which means it should not be unwrapped with `.?` in translated code) -fn cIsFunctionDeclRef(expr: *const clang.Expr) bool { - switch (expr.getStmtClass()) { - .ParenExprClass => { - const op_expr = @as(*const clang.ParenExpr, @ptrCast(expr)).getSubExpr(); - return cIsFunctionDeclRef(op_expr); - }, - .DeclRefExprClass => { - const decl_ref = @as(*const clang.DeclRefExpr, @ptrCast(expr)); - const value_decl = decl_ref.getDecl(); - const qt = value_decl.getType(); - return qualTypeChildIsFnProto(qt); - }, - .ImplicitCastExprClass => { - const implicit_cast = @as(*const clang.ImplicitCastExpr, @ptrCast(expr)); - const cast_kind = implicit_cast.getCastKind(); - if (cast_kind == .BuiltinFnToFnPtr) return true; - if (cast_kind == .FunctionToPointerDecay) { - return cIsFunctionDeclRef(implicit_cast.getSubExpr()); - } - return false; - }, - .UnaryOperatorClass => { - const un_op = @as(*const clang.UnaryOperator, @ptrCast(expr)); - const opcode = un_op.getOpcode(); - return (opcode == .AddrOf or opcode == .Deref) and cIsFunctionDeclRef(un_op.getSubExpr()); - }, - .GenericSelectionExprClass => { - const gen_sel = @as(*const clang.GenericSelectionExpr, @ptrCast(expr)); - return cIsFunctionDeclRef(gen_sel.getResultExpr()); - }, - else => return false, - } -} - -fn transCallExpr(c: *Context, scope: *Scope, stmt: *const clang.CallExpr, result_used: ResultUsed) TransError!Node { - const callee = stmt.getCallee(); - const raw_fn_expr = try transExpr(c, scope, callee, .used); - - var is_ptr = false; - const fn_ty = qualTypeGetFnProto(callee.getType(), &is_ptr); - - const fn_expr = if (is_ptr and fn_ty != null and !cIsFunctionDeclRef(callee)) - try Tag.unwrap.create(c.arena, raw_fn_expr) - else - raw_fn_expr; - - const num_args = stmt.getNumArgs(); - const args = try c.arena.alloc(Node, num_args); - - const c_args = stmt.getArgs(); - var i: usize = 0; - while (i < num_args) : (i += 1) { - var arg = try transExpr(c, scope, c_args[i], .used); - - // In C the result type of a boolean expression is int. If this result is passed as - // an argument to a function whose parameter is also int, there is no cast. Therefore - // in Zig we'll need to cast it from bool to u1 (which will safely coerce to c_int). - if (fn_ty) |ty| { - switch (ty) { - .Proto => |fn_proto| { - const param_count = fn_proto.getNumParams(); - if (i < param_count) { - const param_qt = fn_proto.getParamType(@as(c_uint, @intCast(i))); - if (isBoolRes(arg) and cIsNativeInt(param_qt)) { - arg = try Tag.int_from_bool.create(c.arena, arg); - } else if (arg.tag() == .string_literal and qualTypeIsCharStar(param_qt)) { - const loc = @as(*const clang.Stmt, @ptrCast(stmt)).getBeginLoc(); - const dst_type_node = try transQualType(c, scope, param_qt, loc); - arg = try removeCVQualifiers(c, dst_type_node, arg); - } - } - }, - else => {}, - } - } - args[i] = arg; - } - const node = try Tag.call.create(c.arena, .{ .lhs = fn_expr, .args = args }); - if (fn_ty) |ty| { - const canon = ty.getReturnType().getCanonicalType(); - const ret_ty = canon.getTypePtr(); - if (ret_ty.isVoidType()) { - return node; - } - } - - return maybeSuppressResult(c, result_used, node); -} - -const ClangFunctionType = union(enum) { - Proto: *const clang.FunctionProtoType, - NoProto: *const clang.FunctionType, - - fn getReturnType(self: @This()) clang.QualType { - switch (@as(meta.Tag(@This()), self)) { - .Proto => return self.Proto.getReturnType(), - .NoProto => return self.NoProto.getReturnType(), - } - } -}; - -fn qualTypeGetFnProto(qt: clang.QualType, is_ptr: *bool) ?ClangFunctionType { - const canon = qt.getCanonicalType(); - var ty = canon.getTypePtr(); - is_ptr.* = false; - - if (ty.getTypeClass() == .Pointer) { - is_ptr.* = true; - const child_qt = ty.getPointeeType(); - ty = child_qt.getTypePtr(); - } - if (ty.getTypeClass() == .FunctionProto) { - return ClangFunctionType{ .Proto = @as(*const clang.FunctionProtoType, @ptrCast(ty)) }; - } - if (ty.getTypeClass() == .FunctionNoProto) { - return ClangFunctionType{ .NoProto = @as(*const clang.FunctionType, @ptrCast(ty)) }; - } - return null; -} - -fn transUnaryExprOrTypeTraitExpr( - c: *Context, - scope: *Scope, - stmt: *const clang.UnaryExprOrTypeTraitExpr, - result_used: ResultUsed, -) TransError!Node { - const loc = stmt.getBeginLoc(); - const type_node = try transQualType(c, scope, stmt.getTypeOfArgument(), loc); - - const kind = stmt.getKind(); - const node = switch (kind) { - .SizeOf => try Tag.sizeof.create(c.arena, type_node), - .AlignOf => try Tag.alignof.create(c.arena, type_node), - .DataSizeOf, - .PreferredAlignOf, - .PtrAuthTypeDiscriminator, - .VecStep, - .OpenMPRequiredSimdAlign, - => return fail( - c, - error.UnsupportedTranslation, - loc, - "unsupported type trait kind {}", - .{kind}, - ), - }; - return maybeSuppressResult(c, result_used, node); -} - -fn qualTypeHasWrappingOverflow(qt: clang.QualType) bool { - if (cIsUnsignedInteger(qt)) { - // unsigned integer overflow wraps around. - return true; - } else { - // float, signed integer, and pointer overflow is undefined behavior. - return false; - } -} - -fn transUnaryOperator(c: *Context, scope: *Scope, stmt: *const clang.UnaryOperator, used: ResultUsed) TransError!Node { - const op_expr = stmt.getSubExpr(); - switch (stmt.getOpcode()) { - .PostInc => if (qualTypeHasWrappingOverflow(stmt.getType())) - return transCreatePostCrement(c, scope, stmt, .add_wrap_assign, used) - else - return transCreatePostCrement(c, scope, stmt, .add_assign, used), - .PostDec => if (qualTypeHasWrappingOverflow(stmt.getType())) - return transCreatePostCrement(c, scope, stmt, .sub_wrap_assign, used) - else - return transCreatePostCrement(c, scope, stmt, .sub_assign, used), - .PreInc => if (qualTypeHasWrappingOverflow(stmt.getType())) - return transCreatePreCrement(c, scope, stmt, .add_wrap_assign, used) - else - return transCreatePreCrement(c, scope, stmt, .add_assign, used), - .PreDec => if (qualTypeHasWrappingOverflow(stmt.getType())) - return transCreatePreCrement(c, scope, stmt, .sub_wrap_assign, used) - else - return transCreatePreCrement(c, scope, stmt, .sub_assign, used), - .AddrOf => { - return Tag.address_of.create(c.arena, try transExpr(c, scope, op_expr, used)); - }, - .Deref => { - if (qualTypeWasDemotedToOpaque(c, stmt.getType())) - return fail(c, error.UnsupportedTranslation, stmt.getBeginLoc(), "cannot dereference opaque type", .{}); - - const node = try transExpr(c, scope, op_expr, used); - var is_ptr = false; - const fn_ty = qualTypeGetFnProto(op_expr.getType(), &is_ptr); - if (fn_ty != null and is_ptr) - return node; - return Tag.deref.create(c.arena, node); - }, - .Plus => return transExpr(c, scope, op_expr, used), - .Minus => { - if (!qualTypeHasWrappingOverflow(op_expr.getType())) { - const sub_expr_node = try transExpr(c, scope, op_expr, .used); - const to_negate = if (isBoolRes(sub_expr_node)) blk: { - const ty_node = try Tag.type.create(c.arena, "c_int"); - const int_node = try Tag.int_from_bool.create(c.arena, sub_expr_node); - break :blk try Tag.as.create(c.arena, .{ .lhs = ty_node, .rhs = int_node }); - } else sub_expr_node; - return Tag.negate.create(c.arena, to_negate); - } else if (cIsUnsignedInteger(op_expr.getType())) { - // use -% x for unsigned integers - return Tag.negate_wrap.create(c.arena, try transExpr(c, scope, op_expr, .used)); - } else return fail(c, error.UnsupportedTranslation, stmt.getBeginLoc(), "C negation with non float non integer", .{}); - }, - .Not => { - return Tag.bit_not.create(c.arena, try transExpr(c, scope, op_expr, .used)); - }, - .LNot => { - return Tag.not.create(c.arena, try transBoolExpr(c, scope, op_expr, .used)); - }, - .Extension => { - return transExpr(c, scope, stmt.getSubExpr(), used); - }, - else => return fail(c, error.UnsupportedTranslation, stmt.getBeginLoc(), "unsupported C translation {}", .{stmt.getOpcode()}), - } -} - -fn transCreatePreCrement( - c: *Context, - scope: *Scope, - stmt: *const clang.UnaryOperator, - op: Tag, - used: ResultUsed, -) TransError!Node { - const op_expr = stmt.getSubExpr(); - - if (used == .unused) { - // common case - // c: ++expr - // zig: expr += 1 - const lhs = try transExpr(c, scope, op_expr, .used); - const rhs = Tag.one_literal.init(); - return transCreateNodeInfixOp(c, op, lhs, rhs, .used); - } - // worst case - // c: ++expr - // zig: (blk: { - // zig: const _ref = &expr; - // zig: _ref.* += 1; - // zig: break :blk _ref.* - // zig: }) - var block_scope = try Scope.Block.init(c, scope, true); - defer block_scope.deinit(); - - const ref = try block_scope.reserveMangledName(c, "ref"); - const expr = try transExpr(c, &block_scope.base, op_expr, .used); - const addr_of = try Tag.address_of.create(c.arena, expr); - const ref_decl = try Tag.var_simple.create(c.arena, .{ .name = ref, .init = addr_of }); - try block_scope.statements.append(ref_decl); - - const lhs_node = try Tag.identifier.create(c.arena, ref); - const ref_node = try Tag.deref.create(c.arena, lhs_node); - const node = try transCreateNodeInfixOp(c, op, ref_node, Tag.one_literal.init(), .used); - try block_scope.statements.append(node); - - const break_node = try Tag.break_val.create(c.arena, .{ - .label = block_scope.label, - .val = ref_node, - }); - try block_scope.statements.append(break_node); - return block_scope.complete(c); -} - -fn transCreatePostCrement( - c: *Context, - scope: *Scope, - stmt: *const clang.UnaryOperator, - op: Tag, - used: ResultUsed, -) TransError!Node { - const op_expr = stmt.getSubExpr(); - - if (used == .unused) { - // common case - // c: expr++ - // zig: expr += 1 - const lhs = try transExpr(c, scope, op_expr, .used); - const rhs = Tag.one_literal.init(); - return transCreateNodeInfixOp(c, op, lhs, rhs, .used); - } - // worst case - // c: expr++ - // zig: (blk: { - // zig: const _ref = &expr; - // zig: const _tmp = _ref.*; - // zig: _ref.* += 1; - // zig: break :blk _tmp - // zig: }) - var block_scope = try Scope.Block.init(c, scope, true); - defer block_scope.deinit(); - const ref = try block_scope.reserveMangledName(c, "ref"); - const tmp = try block_scope.reserveMangledName(c, "tmp"); - - const expr = try transExpr(c, &block_scope.base, op_expr, .used); - const addr_of = try Tag.address_of.create(c.arena, expr); - const ref_decl = try Tag.var_simple.create(c.arena, .{ .name = ref, .init = addr_of }); - try block_scope.statements.append(ref_decl); - - const lhs_node = try Tag.identifier.create(c.arena, ref); - const ref_node = try Tag.deref.create(c.arena, lhs_node); - - const tmp_decl = try Tag.var_simple.create(c.arena, .{ .name = tmp, .init = ref_node }); - try block_scope.statements.append(tmp_decl); - - const node = try transCreateNodeInfixOp(c, op, ref_node, Tag.one_literal.init(), .used); - try block_scope.statements.append(node); - - const break_node = try Tag.break_val.create(c.arena, .{ - .label = block_scope.label, - .val = try Tag.identifier.create(c.arena, tmp), - }); - try block_scope.statements.append(break_node); - return block_scope.complete(c); -} - -fn transCompoundAssignOperator(c: *Context, scope: *Scope, stmt: *const clang.CompoundAssignOperator, used: ResultUsed) TransError!Node { - switch (stmt.getOpcode()) { - .MulAssign => if (qualTypeHasWrappingOverflow(stmt.getType())) - return transCreateCompoundAssign(c, scope, stmt, .mul_wrap_assign, used) - else - return transCreateCompoundAssign(c, scope, stmt, .mul_assign, used), - .AddAssign => if (qualTypeHasWrappingOverflow(stmt.getType())) - return transCreateCompoundAssign(c, scope, stmt, .add_wrap_assign, used) - else - return transCreateCompoundAssign(c, scope, stmt, .add_assign, used), - .SubAssign => if (qualTypeHasWrappingOverflow(stmt.getType())) - return transCreateCompoundAssign(c, scope, stmt, .sub_wrap_assign, used) - else - return transCreateCompoundAssign(c, scope, stmt, .sub_assign, used), - .DivAssign => return transCreateCompoundAssign(c, scope, stmt, .div_assign, used), - .RemAssign => return transCreateCompoundAssign(c, scope, stmt, .mod_assign, used), - .ShlAssign => return transCreateCompoundAssign(c, scope, stmt, .shl_assign, used), - .ShrAssign => return transCreateCompoundAssign(c, scope, stmt, .shr_assign, used), - .AndAssign => return transCreateCompoundAssign(c, scope, stmt, .bit_and_assign, used), - .XorAssign => return transCreateCompoundAssign(c, scope, stmt, .bit_xor_assign, used), - .OrAssign => return transCreateCompoundAssign(c, scope, stmt, .bit_or_assign, used), - else => return fail( - c, - error.UnsupportedTranslation, - stmt.getBeginLoc(), - "unsupported C translation {}", - .{stmt.getOpcode()}, - ), - } -} - -fn transCreateCompoundAssign( - c: *Context, - scope: *Scope, - stmt: *const clang.CompoundAssignOperator, - op: Tag, - used: ResultUsed, -) TransError!Node { - const is_shift = op == .shl_assign or op == .shr_assign; - const is_div = op == .div_assign; - const is_mod = op == .mod_assign; - const lhs = stmt.getLHS(); - const rhs = stmt.getRHS(); - const loc = stmt.getBeginLoc(); - const lhs_qt = getExprQualType(c, lhs); - const rhs_qt = getExprQualType(c, rhs); - const is_signed = cIsSignedInteger(lhs_qt); - const is_ptr_arithmetic = qualTypeIsPtr(lhs_qt) and cIsInteger(rhs_qt); - const is_ptr_op_signed = qualTypeIsPtr(lhs_qt) and cIsSignedInteger(rhs_qt); - const requires_cast = !lhs_qt.eq(rhs_qt) and !is_ptr_arithmetic; - - if (used == .unused) { - // common case - // c: lhs += rhs - // zig: lhs += rhs - const lhs_node = try transExpr(c, scope, lhs, .used); - var rhs_node = try transExpr(c, scope, rhs, .used); - if (is_ptr_op_signed) rhs_node = try usizeCastForWrappingPtrArithmetic(c.arena, rhs_node); - - if ((is_mod or is_div) and is_signed) { - if (requires_cast) rhs_node = try transCCast(c, scope, loc, lhs_qt, rhs_qt, rhs_node); - const operands: @FieldType(ast.Payload.BinOp, "data") = .{ .lhs = lhs_node, .rhs = rhs_node }; - const builtin = if (is_mod) - try Tag.signed_remainder.create(c.arena, operands) - else - try Tag.div_trunc.create(c.arena, operands); - - return transCreateNodeInfixOp(c, .assign, lhs_node, builtin, .used); - } - - if (is_shift) { - rhs_node = try Tag.int_cast.create(c.arena, rhs_node); - } else if (requires_cast) { - rhs_node = try transCCast(c, scope, loc, lhs_qt, rhs_qt, rhs_node); - } - return transCreateNodeInfixOp(c, op, lhs_node, rhs_node, .used); - } - // worst case - // c: lhs += rhs - // zig: (blk: { - // zig: const _ref = &lhs; - // zig: _ref.* += rhs; - // zig: break :blk _ref.* - // zig: }) - var block_scope = try Scope.Block.init(c, scope, true); - defer block_scope.deinit(); - const ref = try block_scope.reserveMangledName(c, "ref"); - - const expr = try transExpr(c, &block_scope.base, lhs, .used); - const addr_of = try Tag.address_of.create(c.arena, expr); - const ref_decl = try Tag.var_simple.create(c.arena, .{ .name = ref, .init = addr_of }); - try block_scope.statements.append(ref_decl); - - const lhs_node = try Tag.identifier.create(c.arena, ref); - const ref_node = try Tag.deref.create(c.arena, lhs_node); - - var rhs_node = try transExpr(c, &block_scope.base, rhs, .used); - if (is_ptr_op_signed) rhs_node = try usizeCastForWrappingPtrArithmetic(c.arena, rhs_node); - if ((is_mod or is_div) and is_signed) { - if (requires_cast) rhs_node = try transCCast(c, scope, loc, lhs_qt, rhs_qt, rhs_node); - const operands: @FieldType(ast.Payload.BinOp, "data") = .{ .lhs = ref_node, .rhs = rhs_node }; - const builtin = if (is_mod) - try Tag.signed_remainder.create(c.arena, operands) - else - try Tag.div_trunc.create(c.arena, operands); - - const assign = try transCreateNodeInfixOp(c, .assign, ref_node, builtin, .used); - try block_scope.statements.append(assign); - } else { - if (is_shift) { - rhs_node = try Tag.int_cast.create(c.arena, rhs_node); - } else if (requires_cast) { - rhs_node = try transCCast(c, &block_scope.base, loc, lhs_qt, rhs_qt, rhs_node); - } - - const assign = try transCreateNodeInfixOp(c, op, ref_node, rhs_node, .used); - try block_scope.statements.append(assign); - } - - const break_node = try Tag.break_val.create(c.arena, .{ - .label = block_scope.label, - .val = ref_node, - }); - try block_scope.statements.append(break_node); - return block_scope.complete(c); -} - -fn removeCVQualifiers(c: *Context, dst_type_node: Node, expr: Node) Error!Node { - const volatile_casted = try Tag.volatile_cast.create(c.arena, expr); - const const_casted = try Tag.const_cast.create(c.arena, volatile_casted); - return Tag.as.create(c.arena, .{ - .lhs = dst_type_node, - .rhs = try Tag.ptr_cast.create(c.arena, const_casted), - }); -} - -fn transCPtrCast( - c: *Context, - scope: *Scope, - loc: clang.SourceLocation, - dst_type: clang.QualType, - src_type: clang.QualType, - expr: Node, -) !Node { - const ty = dst_type.getTypePtr(); - const child_type = ty.getPointeeType(); - const src_ty = src_type.getTypePtr(); - const src_child_type = src_ty.getPointeeType(); - const dst_type_node = try transType(c, scope, ty, loc); - - if (!src_ty.isArrayType() and ((src_child_type.isConstQualified() and - !child_type.isConstQualified()) or - (src_child_type.isVolatileQualified() and - !child_type.isVolatileQualified()))) - { - return removeCVQualifiers(c, dst_type_node, expr); - } else { - // Implicit downcasting from higher to lower alignment values is forbidden, - // use @alignCast to side-step this problem - const rhs = if (qualTypeCanon(child_type).isVoidType()) - // void has 1-byte alignment, so @alignCast is not needed - expr - else if (typeIsOpaque(c, qualTypeCanon(child_type), loc)) - // For opaque types a ptrCast is enough - expr - else blk: { - break :blk try Tag.align_cast.create(c.arena, expr); - }; - return Tag.as.create(c.arena, .{ - .lhs = dst_type_node, - .rhs = try Tag.ptr_cast.create(c.arena, rhs), - }); - } -} - -fn transFloatingLiteral(c: *Context, expr: *const clang.FloatingLiteral, used: ResultUsed) TransError!Node { - // TODO use something more accurate than widening to a larger float type and printing that result - switch (expr.getRawSemantics()) { - .IEEEhalf, // f16 - .IEEEsingle, // f32 - .IEEEdouble, // f64 - => { - var dbl = expr.getValueAsApproximateDouble(); - const is_negative = dbl < 0; // -0.0 is considered non-negative - if (is_negative) dbl = -dbl; - const str = if (dbl == @floor(dbl)) - try std.fmt.allocPrint(c.arena, "{d}.0", .{dbl}) - else - try std.fmt.allocPrint(c.arena, "{d}", .{dbl}); - var node = try Tag.float_literal.create(c.arena, str); - if (is_negative) node = try Tag.negate.create(c.arena, node); - return maybeSuppressResult(c, used, node); - }, - .x87DoubleExtended, // f80 - .IEEEquad, // f128 - => return transFloatingLiteralQuad(c, expr, used), - else => |format| return fail( - c, - error.UnsupportedTranslation, - expr.getBeginLoc(), - "unsupported floating point constant format {}", - .{format}, - ), - } -} - -fn transFloatingLiteralQuad(c: *Context, expr: *const clang.FloatingLiteral, used: ResultUsed) TransError!Node { - assert(switch (expr.getRawSemantics()) { - .x87DoubleExtended, .IEEEquad => true, - else => false, - }); - - var low: u64 = undefined; - var high: u64 = undefined; - expr.getValueAsApproximateQuadBits(&low, &high); - var quad: f128 = @bitCast(low | @as(u128, high) << 64); - const is_negative = quad < 0; // -0.0 is considered non-negative - if (is_negative) quad = -quad; - - // TODO implement decimal format for f128 - // in the meantime, if the value can be roundtripped by casting it to f64, serializing it to - // the decimal format and parsing it back as the exact same f128 value, then use that serialized form - const str = fmt_decimal: { - var buf: [512]u8 = undefined; // should be large enough to print any f64 in decimal form - const dbl: f64 = @floatCast(quad); - const temp_str = if (dbl == @floor(dbl)) - std.fmt.bufPrint(&buf, "{d}.0", .{dbl}) catch |err| switch (err) { - error.NoSpaceLeft => unreachable, - } - else - std.fmt.bufPrint(&buf, "{d}", .{dbl}) catch |err| switch (err) { - error.NoSpaceLeft => unreachable, - }; - const could_roundtrip = if (std.fmt.parseFloat(f128, temp_str)) |parsed_quad| - quad == parsed_quad - else |_| - false; - break :fmt_decimal if (could_roundtrip) try c.arena.dupe(u8, temp_str) else null; - } - // otherwise, fall back to the hexadecimal format - orelse try std.fmt.allocPrint(c.arena, "{x}", .{quad}); - - var node = try Tag.float_literal.create(c.arena, str); - if (is_negative) node = try Tag.negate.create(c.arena, node); - return maybeSuppressResult(c, used, node); -} - -fn transBinaryConditionalOperator(c: *Context, scope: *Scope, stmt: *const clang.BinaryConditionalOperator, used: ResultUsed) TransError!Node { - // GNU extension of the ternary operator where the middle expression is - // omitted, the condition itself is returned if it evaluates to true - const qt = @as(*const clang.Expr, @ptrCast(stmt)).getType(); - const res_is_bool = qualTypeIsBoolean(qt); - const casted_stmt = @as(*const clang.AbstractConditionalOperator, @ptrCast(stmt)); - const cond_expr = casted_stmt.getCond(); - const false_expr = casted_stmt.getFalseExpr(); - - // c: (cond_expr)?:(false_expr) - // zig: (blk: { - // const _cond_temp = (cond_expr); - // break :blk if (_cond_temp) _cond_temp else (false_expr); - // }) - var block_scope = try Scope.Block.init(c, scope, true); - defer block_scope.deinit(); - - const cond_temp = try block_scope.reserveMangledName(c, "cond_temp"); - const init_node = try transExpr(c, &block_scope.base, cond_expr, .used); - const ref_decl = try Tag.var_simple.create(c.arena, .{ .name = cond_temp, .init = init_node }); - try block_scope.statements.append(ref_decl); - - var cond_scope = Scope.Condition{ - .base = .{ - .parent = &block_scope.base, - .id = .condition, - }, - }; - defer cond_scope.deinit(); - - const cond_ident = try Tag.identifier.create(c.arena, cond_temp); - const ty = getExprQualType(c, cond_expr).getTypePtr(); - const cond_node = try finishBoolExpr(c, &cond_scope.base, cond_expr.getBeginLoc(), ty, cond_ident, .used); - var then_body = cond_ident; - if (!res_is_bool and isBoolRes(init_node)) { - then_body = try Tag.int_from_bool.create(c.arena, then_body); - } - - var else_body = try transExpr(c, &block_scope.base, false_expr, .used); - if (!res_is_bool and isBoolRes(else_body)) { - else_body = try Tag.int_from_bool.create(c.arena, else_body); - } - const if_node = try Tag.@"if".create(c.arena, .{ - .cond = cond_node, - .then = then_body, - .@"else" = else_body, - }); - const break_node = try Tag.break_val.create(c.arena, .{ - .label = block_scope.label, - .val = if_node, - }); - try block_scope.statements.append(break_node); - const res = try block_scope.complete(c); - return maybeSuppressResult(c, used, res); -} - -fn transConditionalOperator(c: *Context, scope: *Scope, stmt: *const clang.ConditionalOperator, used: ResultUsed) TransError!Node { - var cond_scope = Scope.Condition{ - .base = .{ - .parent = scope, - .id = .condition, - }, - }; - defer cond_scope.deinit(); - - const qt = @as(*const clang.Expr, @ptrCast(stmt)).getType(); - const res_is_bool = qualTypeIsBoolean(qt); - const casted_stmt = @as(*const clang.AbstractConditionalOperator, @ptrCast(stmt)); - const cond_expr = casted_stmt.getCond(); - const true_expr = casted_stmt.getTrueExpr(); - const false_expr = casted_stmt.getFalseExpr(); - - const cond = try transBoolExpr(c, &cond_scope.base, cond_expr, .used); - - var then_body = try transExpr(c, scope, true_expr, used); - if (!res_is_bool and isBoolRes(then_body)) { - then_body = try Tag.int_from_bool.create(c.arena, then_body); - } - - var else_body = try transExpr(c, scope, false_expr, used); - if (!res_is_bool and isBoolRes(else_body)) { - else_body = try Tag.int_from_bool.create(c.arena, else_body); - } - - const if_node = try Tag.@"if".create(c.arena, .{ - .cond = cond, - .then = then_body, - .@"else" = else_body, - }); - // Clang inserts ImplicitCast(ToVoid)'s to both rhs and lhs so we don't need to suppress the result here. - return if_node; -} - -fn maybeSuppressResult(c: *Context, used: ResultUsed, result: Node) TransError!Node { - if (used == .used) return result; - return Tag.discard.create(c.arena, .{ .should_skip = false, .value = result }); -} - -fn addTopLevelDecl(c: *Context, name: []const u8, decl_node: Node) !void { - const gop = try c.global_scope.sym_table.getOrPut(name); - if (!gop.found_existing) { - gop.value_ptr.* = decl_node; - try c.global_scope.nodes.append(decl_node); - } -} - -/// Add an "extern" function prototype declaration that's been declared within a scoped block. -/// Similar to static local variables, this will be wrapped in a struct to work with Zig's syntax requirements. -/// -fn addLocalExternFnDecl(c: *Context, scope: *Scope, name: []const u8, decl_node: Node) !void { - const bs: *Scope.Block = try scope.findBlockScope(c); - - // Special naming convention for local extern function wrapper struct, - // this named "ExternLocal_[name]". - const struct_name = try std.fmt.allocPrint(c.arena, "{s}_{s}", .{ Scope.Block.extern_inner_prepend, name }); - - // Outer Node for the wrapper struct - const node = try Tag.extern_local_fn.create(c.arena, .{ .name = struct_name, .init = decl_node }); - - try bs.statements.append(node); - try bs.discardVariable(c, struct_name); -} - -fn transQualTypeInitializedStringLiteral(c: *Context, elem_ty: Node, string_lit: *const clang.StringLiteral) TypeError!Node { - const string_lit_size = string_lit.getLength(); - const array_size = @as(usize, @intCast(string_lit_size)); - - // incomplete array initialized with empty string, will be translated as [1]T{0} - // see https://github.com/ziglang/zig/issues/8256 - if (array_size == 0) return Tag.array_type.create(c.arena, .{ .len = 1, .elem_type = elem_ty }); - - return Tag.null_sentinel_array_type.create(c.arena, .{ .len = array_size, .elem_type = elem_ty }); -} - -/// Translate a qualtype for a variable with an initializer. This only matters -/// for incomplete arrays, since the initializer determines the size of the array. -fn transQualTypeInitialized( - c: *Context, - scope: *Scope, - qt: clang.QualType, - decl_init: *const clang.Expr, - source_loc: clang.SourceLocation, -) TypeError!Node { - const ty = qt.getTypePtr(); - if (ty.getTypeClass() == .IncompleteArray) { - const incomplete_array_ty = @as(*const clang.IncompleteArrayType, @ptrCast(ty)); - const elem_ty = try transType(c, scope, incomplete_array_ty.getElementType().getTypePtr(), source_loc); - - switch (decl_init.getStmtClass()) { - .StringLiteralClass => { - const string_lit = @as(*const clang.StringLiteral, @ptrCast(decl_init)); - return transQualTypeInitializedStringLiteral(c, elem_ty, string_lit); - }, - .InitListExprClass => { - const init_expr = @as(*const clang.InitListExpr, @ptrCast(decl_init)); - const size = init_expr.getNumInits(); - - if (init_expr.isStringLiteralInit()) { - assert(size == 1); - const string_lit = init_expr.getInit(0).castToStringLiteral().?; - return transQualTypeInitializedStringLiteral(c, elem_ty, string_lit); - } - - return Tag.array_type.create(c.arena, .{ .len = size, .elem_type = elem_ty }); - }, - else => {}, - } - } - return transQualType(c, scope, qt, source_loc); -} - -fn transQualType(c: *Context, scope: *Scope, qt: clang.QualType, source_loc: clang.SourceLocation) TypeError!Node { - return transType(c, scope, qt.getTypePtr(), source_loc); -} - -/// Produces a Zig AST node by translating a Clang QualType, respecting the width, but modifying the signed-ness. -/// Asserts the type is an integer. -fn transQualTypeIntWidthOf(c: *Context, ty: clang.QualType, is_signed: bool) TypeError!Node { - return transTypeIntWidthOf(c, qualTypeCanon(ty), is_signed); -} - -/// Produces a Zig AST node by translating a Clang Type, respecting the width, but modifying the signed-ness. -/// Asserts the type is an integer. -fn transTypeIntWidthOf(c: *Context, ty: *const clang.Type, is_signed: bool) TypeError!Node { - assert(ty.getTypeClass() == .Builtin); - const builtin_ty = @as(*const clang.BuiltinType, @ptrCast(ty)); - return Tag.type.create(c.arena, switch (builtin_ty.getKind()) { - .Char_U, .Char_S, .UChar, .SChar, .Char8 => if (is_signed) "i8" else "u8", - .UShort, .Short => if (is_signed) "c_short" else "c_ushort", - .UInt, .Int => if (is_signed) "c_int" else "c_uint", - .ULong, .Long => if (is_signed) "c_long" else "c_ulong", - .ULongLong, .LongLong => if (is_signed) "c_longlong" else "c_ulonglong", - .UInt128, .Int128 => if (is_signed) "i128" else "u128", - .Char16 => if (is_signed) "i16" else "u16", - .Char32 => if (is_signed) "i32" else "u32", - else => unreachable, // only call this function when it has already been determined the type is int - }); -} - -fn isCBuiltinType(qt: clang.QualType, kind: clang.BuiltinTypeKind) bool { - const c_type = qualTypeCanon(qt); - if (c_type.getTypeClass() != .Builtin) - return false; - const builtin_ty = @as(*const clang.BuiltinType, @ptrCast(c_type)); - return builtin_ty.getKind() == kind; -} - -fn qualTypeIsPtr(qt: clang.QualType) bool { - return qualTypeCanon(qt).getTypeClass() == .Pointer; -} - -fn qualTypeIsBoolean(qt: clang.QualType) bool { - return qualTypeCanon(qt).isBooleanType(); -} - -fn qualTypeIntBitWidth(c: *Context, qt: clang.QualType) !u32 { - const ty = qt.getTypePtr(); - - switch (ty.getTypeClass()) { - .Builtin => { - const builtin_ty = @as(*const clang.BuiltinType, @ptrCast(ty)); - - switch (builtin_ty.getKind()) { - .Char_U, - .UChar, - .Char_S, - .SChar, - => return 8, - .UInt128, - .Int128, - => return 128, - else => return 0, - } - - unreachable; - }, - .Typedef => { - const typedef_ty = @as(*const clang.TypedefType, @ptrCast(ty)); - const typedef_decl = typedef_ty.getDecl(); - const type_name = try c.str(@as(*const clang.NamedDecl, @ptrCast(typedef_decl)).getName_bytes_begin()); - - if (mem.eql(u8, type_name, "uint8_t") or mem.eql(u8, type_name, "int8_t")) { - return 8; - } else if (mem.eql(u8, type_name, "uint16_t") or mem.eql(u8, type_name, "int16_t")) { - return 16; - } else if (mem.eql(u8, type_name, "uint32_t") or mem.eql(u8, type_name, "int32_t")) { - return 32; - } else if (mem.eql(u8, type_name, "uint64_t") or mem.eql(u8, type_name, "int64_t")) { - return 64; - } else { - return 0; - } - }, - else => return 0, - } -} - -fn qualTypeChildIsFnProto(qt: clang.QualType) bool { - const ty = qualTypeCanon(qt); - - switch (ty.getTypeClass()) { - .FunctionProto, .FunctionNoProto => return true, - else => return false, - } -} - -fn qualTypeCanon(qt: clang.QualType) *const clang.Type { - const canon = qt.getCanonicalType(); - return canon.getTypePtr(); -} - -fn getExprQualType(c: *Context, expr: *const clang.Expr) clang.QualType { - blk: { - // If this is a C `char *`, turn it into a `const char *` - if (expr.getStmtClass() != .ImplicitCastExprClass) break :blk; - const cast_expr = @as(*const clang.ImplicitCastExpr, @ptrCast(expr)); - if (cast_expr.getCastKind() != .ArrayToPointerDecay) break :blk; - const sub_expr = cast_expr.getSubExpr(); - if (sub_expr.getStmtClass() != .StringLiteralClass) break :blk; - const array_qt = sub_expr.getType(); - const array_type = @as(*const clang.ArrayType, @ptrCast(array_qt.getTypePtr())); - var pointee_qt = array_type.getElementType(); - pointee_qt.addConst(); - return c.clang_context.getPointerType(pointee_qt); - } - return expr.getType(); -} - -fn typeIsOpaque(c: *Context, ty: *const clang.Type, loc: clang.SourceLocation) bool { - switch (ty.getTypeClass()) { - .Builtin => { - const builtin_ty = @as(*const clang.BuiltinType, @ptrCast(ty)); - return builtin_ty.getKind() == .Void; - }, - .Record => { - const record_ty = @as(*const clang.RecordType, @ptrCast(ty)); - const record_decl = record_ty.getDecl(); - const record_def = record_decl.getDefinition() orelse - return true; - var it = record_def.field_begin(); - const end_it = record_def.field_end(); - while (it.neq(end_it)) : (it = it.next()) { - const field_decl = it.deref(); - - if (field_decl.isBitField()) { - return true; - } - } - return false; - }, - .Elaborated => { - const elaborated_ty = @as(*const clang.ElaboratedType, @ptrCast(ty)); - const qt = elaborated_ty.getNamedType(); - return typeIsOpaque(c, qt.getTypePtr(), loc); - }, - .Typedef => { - const typedef_ty = @as(*const clang.TypedefType, @ptrCast(ty)); - const typedef_decl = typedef_ty.getDecl(); - const underlying_type = typedef_decl.getUnderlyingType(); - return typeIsOpaque(c, underlying_type.getTypePtr(), loc); - }, - else => return false, - } -} - -/// plain `char *` (not const; not explicitly signed or unsigned) -fn qualTypeIsCharStar(qt: clang.QualType) bool { - if (qualTypeIsPtr(qt)) { - const child_qt = qualTypeCanon(qt).getPointeeType(); - return cIsUnqualifiedChar(child_qt) and !child_qt.isConstQualified(); - } - return false; -} - -/// C `char` without explicit signed or unsigned qualifier -fn cIsUnqualifiedChar(qt: clang.QualType) bool { - const c_type = qualTypeCanon(qt); - if (c_type.getTypeClass() != .Builtin) return false; - const builtin_ty = @as(*const clang.BuiltinType, @ptrCast(c_type)); - return switch (builtin_ty.getKind()) { - .Char_S, .Char_U => true, - else => false, - }; -} - -fn cIsInteger(qt: clang.QualType) bool { - return cIsSignedInteger(qt) or cIsUnsignedInteger(qt); -} - -fn cIsUnsignedInteger(qt: clang.QualType) bool { - const c_type = qualTypeCanon(qt); - if (c_type.getTypeClass() != .Builtin) return false; - const builtin_ty = @as(*const clang.BuiltinType, @ptrCast(c_type)); - return switch (builtin_ty.getKind()) { - .Char_U, - .UChar, - .Char_S, - .UShort, - .UInt, - .ULong, - .ULongLong, - .UInt128, - .WChar_U, - => true, - else => false, - }; -} - -fn cIntTypeToIndex(qt: clang.QualType) u8 { - const c_type = qualTypeCanon(qt); - assert(c_type.getTypeClass() == .Builtin); - const builtin_ty = @as(*const clang.BuiltinType, @ptrCast(c_type)); - return switch (builtin_ty.getKind()) { - .Bool, .Char_U, .Char_S, .UChar, .SChar, .Char8 => 1, - .WChar_U, .WChar_S => 2, - .UShort, .Short, .Char16 => 3, - .UInt, .Int, .Char32 => 4, - .ULong, .Long => 5, - .ULongLong, .LongLong => 6, - .UInt128, .Int128 => 7, - else => unreachable, - }; -} - -fn cIntTypeCmp(a: clang.QualType, b: clang.QualType) math.Order { - const a_index = cIntTypeToIndex(a); - const b_index = cIntTypeToIndex(b); - return math.order(a_index, b_index); -} - -/// Checks if expr is an integer literal >= 0 -fn cIsNonNegativeIntLiteral(c: *Context, expr: *const clang.Expr) bool { - if (@as(*const clang.Stmt, @ptrCast(expr)).getStmtClass() == .IntegerLiteralClass) { - var signum: c_int = undefined; - if (!(@as(*const clang.IntegerLiteral, @ptrCast(expr)).getSignum(&signum, c.clang_context))) { - return false; - } - return signum >= 0; - } - return false; -} - -fn cIsSignedInteger(qt: clang.QualType) bool { - const c_type = qualTypeCanon(qt); - if (c_type.getTypeClass() != .Builtin) return false; - const builtin_ty = @as(*const clang.BuiltinType, @ptrCast(c_type)); - return switch (builtin_ty.getKind()) { - .SChar, - .Short, - .Int, - .Long, - .LongLong, - .Int128, - .WChar_S, - => true, - else => false, - }; -} - -fn cIsNativeInt(qt: clang.QualType) bool { - const c_type = qualTypeCanon(qt); - if (c_type.getTypeClass() != .Builtin) return false; - const builtin_ty = @as(*const clang.BuiltinType, @ptrCast(c_type)); - return builtin_ty.getKind() == .Int; -} - -fn cIsFloating(qt: clang.QualType) bool { - const c_type = qualTypeCanon(qt); - if (c_type.getTypeClass() != .Builtin) return false; - const builtin_ty = @as(*const clang.BuiltinType, @ptrCast(c_type)); - return switch (builtin_ty.getKind()) { - .Float, - .Double, - .Float128, - .LongDouble, - => true, - else => false, - }; -} - -fn cIsLongLongInteger(qt: clang.QualType) bool { - const c_type = qualTypeCanon(qt); - if (c_type.getTypeClass() != .Builtin) return false; - const builtin_ty = @as(*const clang.BuiltinType, @ptrCast(c_type)); - return switch (builtin_ty.getKind()) { - .LongLong, .ULongLong, .Int128, .UInt128 => true, - else => false, - }; -} -fn transCreateNodeAssign( - c: *Context, - scope: *Scope, - result_used: ResultUsed, - lhs: *const clang.Expr, - rhs: *const clang.Expr, -) !Node { - // common case - // c: lhs = rhs - // zig: lhs = rhs - if (result_used == .unused) { - const lhs_node = try transExpr(c, scope, lhs, .used); - var rhs_node = try transExprCoercing(c, scope, rhs, .used); - if (!exprIsBooleanType(lhs) and isBoolRes(rhs_node)) { - rhs_node = try Tag.int_from_bool.create(c.arena, rhs_node); - } - return transCreateNodeInfixOp(c, .assign, lhs_node, rhs_node, .used); - } - - // worst case - // c: lhs = rhs - // zig: (blk: { - // zig: const _tmp = rhs; - // zig: lhs = _tmp; - // zig: break :blk _tmp - // zig: }) - var block_scope = try Scope.Block.init(c, scope, true); - defer block_scope.deinit(); - - const tmp = try block_scope.reserveMangledName(c, "tmp"); - var rhs_node = try transExpr(c, &block_scope.base, rhs, .used); - if (!exprIsBooleanType(lhs) and isBoolRes(rhs_node)) { - rhs_node = try Tag.int_from_bool.create(c.arena, rhs_node); - } - - const tmp_decl = try Tag.var_simple.create(c.arena, .{ .name = tmp, .init = rhs_node }); - try block_scope.statements.append(tmp_decl); - - const lhs_node = try transExpr(c, &block_scope.base, lhs, .used); - const tmp_ident = try Tag.identifier.create(c.arena, tmp); - const assign = try transCreateNodeInfixOp(c, .assign, lhs_node, tmp_ident, .used); - try block_scope.statements.append(assign); - - const break_node = try Tag.break_val.create(c.arena, .{ - .label = block_scope.label, - .val = tmp_ident, - }); - try block_scope.statements.append(break_node); - return block_scope.complete(c); -} - -fn transCreateNodeInfixOp( - c: *Context, - op: Tag, - lhs: Node, - rhs: Node, - used: ResultUsed, -) !Node { - const payload = try c.arena.create(ast.Payload.BinOp); - payload.* = .{ - .base = .{ .tag = op }, - .data = .{ - .lhs = lhs, - .rhs = rhs, - }, - }; - return maybeSuppressResult(c, used, Node.initPayload(&payload.base)); -} - -fn transCreateNodeBoolInfixOp( - c: *Context, - scope: *Scope, - stmt: *const clang.BinaryOperator, - op: Tag, - used: ResultUsed, -) !Node { - std.debug.assert(op == .@"and" or op == .@"or"); - - const lhs = try transBoolExpr(c, scope, stmt.getLHS(), .used); - const rhs = try transBoolExpr(c, scope, stmt.getRHS(), .used); - - return transCreateNodeInfixOp(c, op, lhs, rhs, used); -} - -fn transCreateNodeAPInt(c: *Context, int: *const clang.APSInt) !Node { - const num_limbs = math.cast(usize, int.getNumWords()) orelse return error.OutOfMemory; - var aps_int = int; - const is_negative = int.isSigned() and int.isNegative(); - if (is_negative) aps_int = aps_int.negate(); - defer if (is_negative) { - aps_int.free(); - }; - - const limbs = try c.arena.alloc(math.big.Limb, num_limbs); - defer c.arena.free(limbs); - - const data = aps_int.getRawData(); - switch (@sizeOf(math.big.Limb)) { - 8 => { - var i: usize = 0; - while (i < num_limbs) : (i += 1) { - limbs[i] = data[i]; - } - }, - 4 => { - var limb_i: usize = 0; - var data_i: usize = 0; - while (limb_i < num_limbs) : ({ - limb_i += 2; - data_i += 1; - }) { - limbs[limb_i] = @as(u32, @truncate(data[data_i])); - limbs[limb_i + 1] = @as(u32, @truncate(data[data_i] >> 32)); - } - }, - else => @compileError("unimplemented"), - } - - const big: math.big.int.Const = .{ .limbs = limbs, .positive = true }; - const str = big.toStringAlloc(c.arena, 10, .lower) catch |err| switch (err) { - error.OutOfMemory => return error.OutOfMemory, - }; - const res = try Tag.integer_literal.create(c.arena, str); - if (is_negative) return Tag.negate.create(c.arena, res); - return res; -} - -fn transCreateNodeNumber(c: *Context, num: anytype, num_kind: enum { int, float }) !Node { - const fmt_s = switch (@typeInfo(@TypeOf(num))) { - .int, .comptime_int => "{d}", - else => "{s}", - }; - const str = try std.fmt.allocPrint(c.arena, fmt_s, .{num}); - if (num_kind == .float) - return Tag.float_literal.create(c.arena, str) - else - return Tag.integer_literal.create(c.arena, str); -} - -fn transCreateNodeMacroFn(c: *Context, name: []const u8, ref: Node, proto_alias: *ast.Payload.Func) !Node { - var fn_params = std.array_list.Managed(ast.Payload.Param).init(c.gpa); - defer fn_params.deinit(); - - for (proto_alias.data.params) |param| { - const param_name = param.name orelse - try std.fmt.allocPrint(c.arena, "arg_{d}", .{c.getMangle()}); - - try fn_params.append(.{ - .name = param_name, - .type = param.type, - .is_noalias = param.is_noalias, - }); - } - - const init = if (ref.castTag(.var_decl)) |v| - v.data.init.? - else if (ref.castTag(.var_simple) orelse ref.castTag(.pub_var_simple)) |v| - v.data.init - else - unreachable; - - const unwrap_expr = try Tag.unwrap.create(c.arena, init); - const args = try c.arena.alloc(Node, fn_params.items.len); - for (fn_params.items, 0..) |param, i| { - args[i] = try Tag.identifier.create(c.arena, param.name.?); - } - const call_expr = try Tag.call.create(c.arena, .{ - .lhs = unwrap_expr, - .args = args, - }); - const return_expr = try Tag.@"return".create(c.arena, call_expr); - const block = try Tag.block_single.create(c.arena, return_expr); - - return Tag.pub_inline_fn.create(c.arena, .{ - .name = name, - .params = try c.arena.dupe(ast.Payload.Param, fn_params.items), - .return_type = proto_alias.data.return_type, - .body = block, - }); -} - -fn transCreateNodeShiftOp( - c: *Context, - scope: *Scope, - stmt: *const clang.BinaryOperator, - op: Tag, - used: ResultUsed, -) !Node { - std.debug.assert(op == .shl or op == .shr); - - const lhs_expr = stmt.getLHS(); - const rhs_expr = stmt.getRHS(); - // lhs >> @as(u5, rh) - - const lhs = try transExpr(c, scope, lhs_expr, .used); - - const rhs = try transExprCoercing(c, scope, rhs_expr, .used); - const rhs_casted = try Tag.int_cast.create(c.arena, rhs); - - return transCreateNodeInfixOp(c, op, lhs, rhs_casted, used); -} - -fn transType(c: *Context, scope: *Scope, ty: *const clang.Type, source_loc: clang.SourceLocation) TypeError!Node { - switch (ty.getTypeClass()) { - .Builtin => { - const builtin_ty = @as(*const clang.BuiltinType, @ptrCast(ty)); - return Tag.type.create(c.arena, switch (builtin_ty.getKind()) { - .Void => "anyopaque", - .Bool => "bool", - .Char_U, .UChar, .Char_S, .Char8 => "u8", - .SChar => "i8", - .UShort => "c_ushort", - .UInt => "c_uint", - .ULong => "c_ulong", - .ULongLong => "c_ulonglong", - .Short => "c_short", - .Int => "c_int", - .Long => "c_long", - .LongLong => "c_longlong", - .UInt128 => "u128", - .Int128 => "i128", - .Float => "f32", - .Double => "f64", - .Float128 => "f128", - .Float16 => "f16", - .LongDouble => "c_longdouble", - else => return fail(c, error.UnsupportedType, source_loc, "unsupported builtin type", .{}), - }); - }, - .FunctionProto => { - const fn_proto_ty = @as(*const clang.FunctionProtoType, @ptrCast(ty)); - const fn_proto = try transFnProto(c, null, fn_proto_ty, source_loc, null, false); - return Node.initPayload(&fn_proto.base); - }, - .FunctionNoProto => { - const fn_no_proto_ty = @as(*const clang.FunctionType, @ptrCast(ty)); - const fn_proto = try transFnNoProto(c, fn_no_proto_ty, source_loc, null, false); - return Node.initPayload(&fn_proto.base); - }, - .Paren => { - const paren_ty = @as(*const clang.ParenType, @ptrCast(ty)); - return transQualType(c, scope, paren_ty.getInnerType(), source_loc); - }, - .Pointer => { - const child_qt = ty.getPointeeType(); - const is_fn_proto = qualTypeChildIsFnProto(child_qt); - const is_const = is_fn_proto or child_qt.isConstQualified(); - const is_volatile = child_qt.isVolatileQualified(); - const elem_type = try transQualType(c, scope, child_qt, source_loc); - const ptr_info: @FieldType(ast.Payload.Pointer, "data") = .{ - .is_const = is_const, - .is_volatile = is_volatile, - .elem_type = elem_type, - }; - if (is_fn_proto or - typeIsOpaque(c, child_qt.getTypePtr(), source_loc) or - qualTypeWasDemotedToOpaque(c, child_qt)) - { - const ptr = try Tag.single_pointer.create(c.arena, ptr_info); - return Tag.optional_type.create(c.arena, ptr); - } - - return Tag.c_pointer.create(c.arena, ptr_info); - }, - .ConstantArray => { - const const_arr_ty = @as(*const clang.ConstantArrayType, @ptrCast(ty)); - - var size_ap_int: *const clang.APInt = undefined; - const_arr_ty.getSize(&size_ap_int); - defer size_ap_int.free(); - const size = size_ap_int.getLimitedValue(usize); - const elem_type = try transType(c, scope, const_arr_ty.getElementType().getTypePtr(), source_loc); - - return Tag.array_type.create(c.arena, .{ .len = size, .elem_type = elem_type }); - }, - .IncompleteArray => { - const incomplete_array_ty = @as(*const clang.IncompleteArrayType, @ptrCast(ty)); - - const child_qt = incomplete_array_ty.getElementType(); - const is_const = child_qt.isConstQualified(); - const is_volatile = child_qt.isVolatileQualified(); - const elem_type = try transQualType(c, scope, child_qt, source_loc); - - return Tag.c_pointer.create(c.arena, .{ .is_const = is_const, .is_volatile = is_volatile, .elem_type = elem_type }); - }, - .Typedef => { - const typedef_ty = @as(*const clang.TypedefType, @ptrCast(ty)); - - const typedef_decl = typedef_ty.getDecl(); - var trans_scope = scope; - if (@as(*const clang.Decl, @ptrCast(typedef_decl)).castToNamedDecl()) |named_decl| { - const decl_name = try c.str(named_decl.getName_bytes_begin()); - if (c.global_names.get(decl_name)) |_| trans_scope = &c.global_scope.base; - if (builtin_typedef_map.get(decl_name)) |builtin| return Tag.type.create(c.arena, builtin); - } - try transTypeDef(c, trans_scope, typedef_decl); - const name = c.decl_table.get(@intFromPtr(typedef_decl.getCanonicalDecl())).?; - return Tag.identifier.create(c.arena, name); - }, - .Record => { - const record_ty = @as(*const clang.RecordType, @ptrCast(ty)); - - const record_decl = record_ty.getDecl(); - var trans_scope = scope; - if (@as(*const clang.Decl, @ptrCast(record_decl)).castToNamedDecl()) |named_decl| { - const decl_name = try c.str(named_decl.getName_bytes_begin()); - if (c.weak_global_names.contains(decl_name)) trans_scope = &c.global_scope.base; - } - try transRecordDecl(c, trans_scope, record_decl); - const name = c.decl_table.get(@intFromPtr(record_decl.getCanonicalDecl())).?; - return Tag.identifier.create(c.arena, name); - }, - .Enum => { - const enum_ty = @as(*const clang.EnumType, @ptrCast(ty)); - - const enum_decl = enum_ty.getDecl(); - var trans_scope = scope; - if (@as(*const clang.Decl, @ptrCast(enum_decl)).castToNamedDecl()) |named_decl| { - const decl_name = try c.str(named_decl.getName_bytes_begin()); - if (c.weak_global_names.contains(decl_name)) trans_scope = &c.global_scope.base; - } - try transEnumDecl(c, trans_scope, enum_decl); - const name = c.decl_table.get(@intFromPtr(enum_decl.getCanonicalDecl())).?; - return Tag.identifier.create(c.arena, name); - }, - .Elaborated => { - const elaborated_ty = @as(*const clang.ElaboratedType, @ptrCast(ty)); - return transQualType(c, scope, elaborated_ty.getNamedType(), source_loc); - }, - .Decayed => { - const decayed_ty = @as(*const clang.DecayedType, @ptrCast(ty)); - return transQualType(c, scope, decayed_ty.getDecayedType(), source_loc); - }, - .Attributed => { - const attributed_ty = @as(*const clang.AttributedType, @ptrCast(ty)); - return transQualType(c, scope, attributed_ty.getEquivalentType(), source_loc); - }, - .MacroQualified => { - const macroqualified_ty = @as(*const clang.MacroQualifiedType, @ptrCast(ty)); - return transQualType(c, scope, macroqualified_ty.getModifiedType(), source_loc); - }, - .TypeOf => { - const typeof_ty = @as(*const clang.TypeOfType, @ptrCast(ty)); - return transQualType(c, scope, typeof_ty.getUnmodifiedType(), source_loc); - }, - .TypeOfExpr => { - const typeofexpr_ty = @as(*const clang.TypeOfExprType, @ptrCast(ty)); - const underlying_expr = transExpr(c, scope, typeofexpr_ty.getUnderlyingExpr(), .used) catch |err| switch (err) { - error.UnsupportedTranslation => { - return fail(c, error.UnsupportedType, source_loc, "unsupported underlying expression for TypeOfExpr", .{}); - }, - else => |e| return e, - }; - return Tag.typeof.create(c.arena, underlying_expr); - }, - .Vector => { - const vector_ty = @as(*const clang.VectorType, @ptrCast(ty)); - const num_elements = vector_ty.getNumElements(); - const element_qt = vector_ty.getElementType(); - return Tag.vector.create(c.arena, .{ - .lhs = try transCreateNodeNumber(c, num_elements, .int), - .rhs = try transQualType(c, scope, element_qt, source_loc), - }); - }, - .BitInt, .ExtVector => { - const type_name = try c.str(ty.getTypeClassName()); - return fail(c, error.UnsupportedType, source_loc, "TODO implement translation of type: '{s}'", .{type_name}); - }, - else => { - const type_name = try c.str(ty.getTypeClassName()); - return fail(c, error.UnsupportedType, source_loc, "unsupported type: '{s}'", .{type_name}); - }, - } -} - -fn qualTypeWasDemotedToOpaque(c: *Context, qt: clang.QualType) bool { - const ty = qt.getTypePtr(); - switch (qt.getTypeClass()) { - .Typedef => { - const typedef_ty = @as(*const clang.TypedefType, @ptrCast(ty)); - - const typedef_decl = typedef_ty.getDecl(); - const underlying_type = typedef_decl.getUnderlyingType(); - return qualTypeWasDemotedToOpaque(c, underlying_type); - }, - .Record => { - const record_ty = @as(*const clang.RecordType, @ptrCast(ty)); - - const record_decl = record_ty.getDecl(); - const canonical = @intFromPtr(record_decl.getCanonicalDecl()); - if (c.opaque_demotes.contains(canonical)) return true; - - // check all childern for opaque types. - var it = record_decl.field_begin(); - const end_it = record_decl.field_end(); - while (it.neq(end_it)) : (it = it.next()) { - const field_decl = it.deref(); - if (qualTypeWasDemotedToOpaque(c, field_decl.getType())) return true; - } - return false; - }, - .Enum => { - const enum_ty = @as(*const clang.EnumType, @ptrCast(ty)); - - const enum_decl = enum_ty.getDecl(); - const canonical = @intFromPtr(enum_decl.getCanonicalDecl()); - return c.opaque_demotes.contains(canonical); - }, - .Elaborated => { - const elaborated_ty = @as(*const clang.ElaboratedType, @ptrCast(ty)); - return qualTypeWasDemotedToOpaque(c, elaborated_ty.getNamedType()); - }, - .Decayed => { - const decayed_ty = @as(*const clang.DecayedType, @ptrCast(ty)); - return qualTypeWasDemotedToOpaque(c, decayed_ty.getDecayedType()); - }, - .Attributed => { - const attributed_ty = @as(*const clang.AttributedType, @ptrCast(ty)); - return qualTypeWasDemotedToOpaque(c, attributed_ty.getEquivalentType()); - }, - .MacroQualified => { - const macroqualified_ty = @as(*const clang.MacroQualifiedType, @ptrCast(ty)); - return qualTypeWasDemotedToOpaque(c, macroqualified_ty.getModifiedType()); - }, - else => return false, - } -} - -fn isAnyopaque(qt: clang.QualType) bool { - const ty = qt.getTypePtr(); - switch (ty.getTypeClass()) { - .Builtin => { - const builtin_ty = @as(*const clang.BuiltinType, @ptrCast(ty)); - return builtin_ty.getKind() == .Void; - }, - .Typedef => { - const typedef_ty = @as(*const clang.TypedefType, @ptrCast(ty)); - const typedef_decl = typedef_ty.getDecl(); - return isAnyopaque(typedef_decl.getUnderlyingType()); - }, - .Elaborated => { - const elaborated_ty = @as(*const clang.ElaboratedType, @ptrCast(ty)); - return isAnyopaque(elaborated_ty.getNamedType().getCanonicalType()); - }, - .Decayed => { - const decayed_ty = @as(*const clang.DecayedType, @ptrCast(ty)); - return isAnyopaque(decayed_ty.getDecayedType().getCanonicalType()); - }, - .Attributed => { - const attributed_ty = @as(*const clang.AttributedType, @ptrCast(ty)); - return isAnyopaque(attributed_ty.getEquivalentType().getCanonicalType()); - }, - .MacroQualified => { - const macroqualified_ty = @as(*const clang.MacroQualifiedType, @ptrCast(ty)); - return isAnyopaque(macroqualified_ty.getModifiedType().getCanonicalType()); - }, - else => return false, - } -} - -const FnDeclContext = struct { - fn_name: []const u8, - has_body: bool, - storage_class: clang.StorageClass, - is_always_inline: bool, - is_export: bool, -}; - -fn transCC( - c: *Context, - fn_ty: *const clang.FunctionType, - source_loc: clang.SourceLocation, -) !ast.Payload.Func.CallingConvention { - const clang_cc = fn_ty.getCallConv(); - return switch (clang_cc) { - .C => .c, - .X86_64SysV => .x86_64_sysv, - .Win64 => .x86_64_win, - .X86StdCall => .x86_stdcall, - .X86FastCall => .x86_fastcall, - .X86ThisCall => .x86_thiscall, - .X86VectorCall => .x86_vectorcall, - .AArch64VectorCall => .aarch64_vfabi, - .AAPCS => .arm_aapcs, - .AAPCS_VFP => .arm_aapcs_vfp, - .M68kRTD => .m68k_rtd, - else => return fail( - c, - error.UnsupportedType, - source_loc, - "unsupported calling convention: {s}", - .{@tagName(clang_cc)}, - ), - }; -} - -fn transFnProto( - c: *Context, - fn_decl: ?*const clang.FunctionDecl, - fn_proto_ty: *const clang.FunctionProtoType, - source_loc: clang.SourceLocation, - fn_decl_context: ?FnDeclContext, - is_pub: bool, -) !*ast.Payload.Func { - const fn_ty = @as(*const clang.FunctionType, @ptrCast(fn_proto_ty)); - const cc = try transCC(c, fn_ty, source_loc); - const is_var_args = fn_proto_ty.isVariadic(); - return finishTransFnProto(c, fn_decl, fn_proto_ty, fn_ty, source_loc, fn_decl_context, is_var_args, cc, is_pub); -} - -fn transFnNoProto( - c: *Context, - fn_ty: *const clang.FunctionType, - source_loc: clang.SourceLocation, - fn_decl_context: ?FnDeclContext, - is_pub: bool, -) !*ast.Payload.Func { - const cc = try transCC(c, fn_ty, source_loc); - const is_var_args = if (fn_decl_context) |ctx| (!ctx.is_export and ctx.storage_class != .Static and !ctx.is_always_inline) else true; - return finishTransFnProto(c, null, null, fn_ty, source_loc, fn_decl_context, is_var_args, cc, is_pub); -} - -fn finishTransFnProto( - c: *Context, - fn_decl: ?*const clang.FunctionDecl, - fn_proto_ty: ?*const clang.FunctionProtoType, - fn_ty: *const clang.FunctionType, - source_loc: clang.SourceLocation, - fn_decl_context: ?FnDeclContext, - is_var_args: bool, - cc: ast.Payload.Func.CallingConvention, - is_pub: bool, -) !*ast.Payload.Func { - const is_export = if (fn_decl_context) |ctx| ctx.is_export else false; - const is_extern = if (fn_decl_context) |ctx| !ctx.has_body else false; - const is_inline = if (fn_decl_context) |ctx| ctx.is_always_inline else false; - const scope = &c.global_scope.base; - - const param_count: usize = if (fn_proto_ty != null) fn_proto_ty.?.getNumParams() else 0; - var fn_params = try std.array_list.Managed(ast.Payload.Param).initCapacity(c.gpa, param_count); - defer fn_params.deinit(); - - var i: usize = 0; - while (i < param_count) : (i += 1) { - const param_qt = fn_proto_ty.?.getParamType(@as(c_uint, @intCast(i))); - const is_noalias = param_qt.isRestrictQualified(); - - const param_name: ?[]const u8 = - if (fn_decl) |decl| blk: { - const param = decl.getParamDecl(@as(c_uint, @intCast(i))); - const param_name: []const u8 = try c.str(@as(*const clang.NamedDecl, @ptrCast(param)).getName_bytes_begin()); - if (param_name.len < 1) - break :blk null; - - break :blk param_name; - } else null; - const type_node = try transQualType(c, scope, param_qt, source_loc); - - fn_params.addOneAssumeCapacity().* = .{ - .is_noalias = is_noalias, - .name = param_name, - .type = type_node, - }; - } - - const linksection_string = blk: { - if (fn_decl) |decl| { - var str_len: usize = undefined; - if (decl.getSectionAttribute(&str_len)) |str_ptr| { - break :blk str_ptr[0..str_len]; - } - } - break :blk null; - }; - - const alignment = if (fn_decl) |decl| ClangAlignment.forFunc(c, decl).zigAlignment() else null; - - const explicit_callconv = if ((is_inline or is_export or is_extern) and cc == .c) null else cc; - - const return_type_node = blk: { - if (fn_ty.getNoReturnAttr()) { - break :blk Tag.noreturn_type.init(); - } else { - const return_qt = fn_ty.getReturnType(); - if (isAnyopaque(return_qt)) { - // convert primitive anyopaque to actual void (only for return type) - break :blk Tag.void_type.init(); - } else { - break :blk transQualType(c, scope, return_qt, source_loc) catch |err| switch (err) { - error.UnsupportedType => { - try warn(c, scope, source_loc, "unsupported function proto return type", .{}); - return err; - }, - error.OutOfMemory => |e| return e, - }; - } - } - }; - const name: ?[]const u8 = if (fn_decl_context) |ctx| ctx.fn_name else null; - const payload = try c.arena.create(ast.Payload.Func); - payload.* = .{ - .base = .{ .tag = .func }, - .data = .{ - .is_pub = is_pub, - .is_extern = is_extern, - .is_export = is_export, - .is_inline = is_inline, - .is_var_args = is_var_args, - .name = name, - .linksection_string = linksection_string, - .explicit_callconv = explicit_callconv, - .params = try c.arena.dupe(ast.Payload.Param, fn_params.items), - .return_type = return_type_node, - .body = null, - .alignment = alignment, - }, - }; - return payload; -} - -fn warn(c: *Context, scope: *Scope, loc: clang.SourceLocation, comptime format: []const u8, args: anytype) !void { - const str = try c.locStr(loc); - const value = try std.fmt.allocPrint(c.arena, "// {s}: warning: " ++ format, .{str} ++ args); - try scope.appendNode(try Tag.warning.create(c.arena, value)); -} - -fn fail( - c: *Context, - err: anytype, - source_loc: clang.SourceLocation, - comptime format: []const u8, - args: anytype, -) (@TypeOf(err) || error{OutOfMemory}) { - try warn(c, &c.global_scope.base, source_loc, format, args); - return err; -} - -pub fn failDecl(c: *Context, loc: clang.SourceLocation, name: []const u8, comptime format: []const u8, args: anytype) Error!void { - // location - // pub const name = @compileError(msg); - const fail_msg = try std.fmt.allocPrint(c.arena, format, args); - try addTopLevelDecl(c, name, try Tag.fail_decl.create(c.arena, .{ .actual = name, .mangled = fail_msg })); - const str = try c.locStr(loc); - const location_comment = try std.fmt.allocPrint(c.arena, "// {s}", .{str}); - try c.global_scope.nodes.append(try Tag.warning.create(c.arena, location_comment)); -} - -const MacroCtx = struct { - source: []const u8, - list: []const CToken, - i: usize = 0, - loc: clang.SourceLocation, - name: []const u8, - refs_var_decl: bool = false, - fn_params: ?[]const ast.Payload.Param = null, - - fn peek(self: *MacroCtx) ?CToken.Id { - if (self.i >= self.list.len) return null; - return self.list[self.i + 1].id; - } - - fn next(self: *MacroCtx) ?CToken.Id { - if (self.i >= self.list.len) return null; - self.i += 1; - return self.list[self.i].id; - } - - fn skip(self: *MacroCtx, c: *Context, expected_id: CToken.Id) ParseError!void { - const next_id = self.next().?; - if (next_id != expected_id and !(expected_id == .identifier and next_id == .extended_identifier)) { - try self.fail( - c, - "unable to translate C expr: expected '{s}' instead got '{s}'", - .{ expected_id.symbol(), next_id.symbol() }, - ); - return error.ParseError; - } - } - - fn slice(self: *MacroCtx) []const u8 { - const tok = self.list[self.i]; - return self.source[tok.start..tok.end]; - } - - fn fail(self: *MacroCtx, c: *Context, comptime fmt: []const u8, args: anytype) !void { - return failDecl(c, self.loc, self.name, fmt, args); - } - - fn makeSlicer(self: *const MacroCtx) MacroSlicer { - return .{ .source = self.source, .tokens = self.list }; - } - - const MacroTranslateError = union(enum) { - undefined_identifier: []const u8, - invalid_arg_usage: []const u8, - }; - - fn checkTranslatableMacro(self: *MacroCtx, scope: *Scope, params: []const ast.Payload.Param) ?MacroTranslateError { - const slicer = self.makeSlicer(); - var last_is_type_kw = false; - var i: usize = 1; // index 0 is the macro name - while (i < self.list.len) : (i += 1) { - const token = self.list[i]; - switch (token.id) { - .period, .arrow => i += 1, // skip next token since field identifiers can be unknown - .keyword_struct, .keyword_union, .keyword_enum => if (!last_is_type_kw) { - last_is_type_kw = true; - continue; - }, - .identifier, .extended_identifier => { - const identifier = slicer.slice(token); - const is_param = for (params) |param| { - if (param.name != null and mem.eql(u8, identifier, param.name.?)) break true; - } else false; - if (is_param and last_is_type_kw) { - return .{ .invalid_arg_usage = identifier }; - } - if (!scope.contains(identifier) and !isBuiltinDefined(identifier) and !is_param) { - return .{ .undefined_identifier = identifier }; - } - }, - else => {}, - } - last_is_type_kw = false; - } - return null; - } - - fn checkFnParam(self: *MacroCtx, str: []const u8) bool { - if (self.fn_params == null) return false; - - for (self.fn_params.?) |param| { - if (mem.eql(u8, param.name.?, str)) return true; - } - return false; - } -}; - -fn getMacroText(unit: *const clang.ASTUnit, c: *const Context, macro: *const clang.MacroDefinitionRecord) ![]const u8 { - const begin_loc = macro.getSourceRange_getBegin(); - const end_loc = clang.Lexer.getLocForEndOfToken(macro.getSourceRange_getEnd(), c.source_manager, unit); - - const begin_c = c.source_manager.getCharacterData(begin_loc); - const end_c = c.source_manager.getCharacterData(end_loc); - const slice_len = @intFromPtr(end_c) - @intFromPtr(begin_c); - - var comp = aro.Compilation.init(c.gpa, std.fs.cwd()); - defer comp.deinit(); - const result = comp.addSourceFromBuffer("", begin_c[0..slice_len]) catch return error.OutOfMemory; - - return c.arena.dupe(u8, result.buf); -} - -fn transPreprocessorEntities(c: *Context, unit: *clang.ASTUnit) Error!void { - // TODO if we see #undef, delete it from the table - var it = unit.getLocalPreprocessingEntities_begin(); - const it_end = unit.getLocalPreprocessingEntities_end(); - var tok_list = std.array_list.Managed(CToken).init(c.gpa); - defer tok_list.deinit(); - const scope = c.global_scope; - - while (it.I != it_end.I) : (it.I += 1) { - const entity = it.deref(); - tok_list.items.len = 0; - switch (entity.getKind()) { - .MacroDefinitionKind => { - const macro = @as(*clang.MacroDefinitionRecord, @ptrCast(entity)); - const raw_name = macro.getName_getNameStart(); - const begin_loc = macro.getSourceRange_getBegin(); - - const name = try c.str(raw_name); - if (scope.containsNow(name)) { - continue; - } - - const source = try getMacroText(unit, c, macro); - - try common.tokenizeMacro(source, &tok_list); - - var macro_ctx = MacroCtx{ - .source = source, - .list = tok_list.items, - .name = name, - .loc = begin_loc, - }; - assert(mem.eql(u8, macro_ctx.slice(), name)); - - var macro_fn = false; - switch (macro_ctx.peek().?) { - .identifier, .extended_identifier => { - // if it equals itself, ignore. for example, from stdio.h: - // #define stdin stdin - const tok = macro_ctx.list[1]; - if (mem.eql(u8, name, source[tok.start..tok.end])) { - assert(!c.global_names.contains(source[tok.start..tok.end])); - continue; - } - }, - .nl, .eof => { - // this means it is a macro without a value - // We define it as an empty string so that it can still be used with ++ - const str_node = try Tag.string_literal.create(c.arena, "\"\""); - const var_decl = try Tag.pub_var_simple.create(c.arena, .{ .name = name, .init = str_node }); - try addTopLevelDecl(c, name, var_decl); - try c.global_scope.blank_macros.put(name, {}); - continue; - }, - .l_paren => { - // if the name is immediately followed by a '(' then it is a function - macro_fn = macro_ctx.list[0].end == macro_ctx.list[1].start; - }, - else => {}, - } - - (if (macro_fn) - transMacroFnDefine(c, ¯o_ctx) - else - transMacroDefine(c, ¯o_ctx)) catch |err| switch (err) { - error.ParseError => continue, - error.OutOfMemory => |e| return e, - }; - }, - else => {}, - } - } -} - -fn transMacroDefine(c: *Context, m: *MacroCtx) ParseError!void { - const scope = &c.global_scope.base; - - if (m.checkTranslatableMacro(scope, &.{})) |err| switch (err) { - .undefined_identifier => |ident| return m.fail(c, "unable to translate macro: undefined identifier `{s}`", .{ident}), - .invalid_arg_usage => unreachable, // no args - }; - - // Check if the macro only uses other blank macros. - while (true) { - switch (m.peek().?) { - .identifier, .extended_identifier => { - const tok = m.list[m.i + 1]; - const slice = m.source[tok.start..tok.end]; - if (c.global_scope.blank_macros.contains(slice)) { - m.i += 1; - continue; - } - }, - .eof, .nl => { - try c.global_scope.blank_macros.put(m.name, {}); - const init_node = try Tag.string_literal.create(c.arena, "\"\""); - const var_decl = try Tag.pub_var_simple.create(c.arena, .{ .name = m.name, .init = init_node }); - try addTopLevelDecl(c, m.name, var_decl); - return; - }, - else => {}, - } - break; - } - - const init_node = try parseCExpr(c, m, scope); - const last = m.next().?; - if (last != .eof and last != .nl) - return m.fail(c, "unable to translate C expr: unexpected token '{s}'", .{last.symbol()}); - - const node = node: { - const var_decl = try Tag.pub_var_simple.create(c.arena, .{ .name = m.name, .init = init_node }); - - if (getFnProto(c, var_decl)) |proto_node| { - // If a macro aliases a global variable which is a function pointer, we conclude that - // the macro is intended to represent a function that assumes the function pointer - // variable is non-null and calls it. - break :node try transCreateNodeMacroFn(c, m.name, var_decl, proto_node); - } else if (m.refs_var_decl) { - const return_type = try Tag.typeof.create(c.arena, init_node); - const return_expr = try Tag.@"return".create(c.arena, init_node); - const block = try Tag.block_single.create(c.arena, return_expr); - try warn(c, scope, m.loc, "macro '{s}' contains a runtime value, translated to function", .{m.name}); - - break :node try Tag.pub_inline_fn.create(c.arena, .{ - .name = m.name, - .params = &.{}, - .return_type = return_type, - .body = block, - }); - } - - break :node var_decl; - }; - - try addTopLevelDecl(c, m.name, node); -} - -fn transMacroFnDefine(c: *Context, m: *MacroCtx) ParseError!void { - const macro_slicer = m.makeSlicer(); - if (try c.pattern_list.match(c.gpa, macro_slicer)) |pattern| { - const decl = try Tag.pub_var_simple.create(c.arena, .{ - .name = m.name, - .init = try Tag.helpers_macro.create(c.arena, pattern.impl), - }); - try addTopLevelDecl(c, m.name, decl); - return; - } - - var block_scope = try Scope.Block.init(c, &c.global_scope.base, false); - defer block_scope.deinit(); - const scope = &block_scope.base; - - try m.skip(c, .l_paren); - - var fn_params = std.array_list.Managed(ast.Payload.Param).init(c.gpa); - defer fn_params.deinit(); - - while (true) { - if (!m.peek().?.isMacroIdentifier()) break; - - _ = m.next(); - - const mangled_name = try block_scope.makeMangledName(c, m.slice()); - try fn_params.append(.{ - .is_noalias = false, - .name = mangled_name, - .type = Tag.@"anytype".init(), - }); - try block_scope.discardVariable(c, mangled_name); - if (m.peek().? != .comma) break; - _ = m.next(); - } - - m.fn_params = fn_params.items; - - try m.skip(c, .r_paren); - - if (m.checkTranslatableMacro(scope, fn_params.items)) |err| switch (err) { - .undefined_identifier => |ident| return m.fail(c, "unable to translate macro: undefined identifier `{s}`", .{ident}), - .invalid_arg_usage => |ident| return m.fail(c, "unable to translate macro: untranslatable usage of arg `{s}`", .{ident}), - }; - - const expr = try parseCExpr(c, m, scope); - const last = m.next().?; - if (last != .eof and last != .nl) - return m.fail(c, "unable to translate C expr: unexpected token '{s}'", .{last.symbol()}); - - const typeof_arg = if (expr.castTag(.block)) |some| blk: { - const stmts = some.data.stmts; - const blk_last = stmts[stmts.len - 1]; - const br = blk_last.castTag(.break_val).?; - break :blk br.data.val; - } else expr; - - const return_type = if (typeof_arg.castTag(.helpers_cast) orelse typeof_arg.castTag(.std_mem_zeroinit)) |some| - some.data.lhs - else if (typeof_arg.castTag(.std_mem_zeroes)) |some| - some.data - else - try Tag.typeof.create(c.arena, typeof_arg); - - const return_expr = try Tag.@"return".create(c.arena, expr); - try block_scope.statements.append(return_expr); - - const fn_decl = try Tag.pub_inline_fn.create(c.arena, .{ - .name = m.name, - .params = try c.arena.dupe(ast.Payload.Param, fn_params.items), - .return_type = return_type, - .body = try block_scope.complete(c), - }); - try addTopLevelDecl(c, m.name, fn_decl); -} - -const ParseError = Error || error{ParseError}; - -fn parseCExpr(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!Node { - // TODO parseCAssignExpr here - var block_scope = try Scope.Block.init(c, scope, true); - defer block_scope.deinit(); - - const node = try parseCCondExpr(c, m, &block_scope.base); - if (m.next().? != .comma) { - m.i -= 1; - return node; - } - - var last = node; - while (true) { - // suppress result - const ignore = try Tag.discard.create(c.arena, .{ .should_skip = false, .value = last }); - try block_scope.statements.append(ignore); - - last = try parseCCondExpr(c, m, &block_scope.base); - if (m.next().? != .comma) { - m.i -= 1; - break; - } - } - - const break_node = try Tag.break_val.create(c.arena, .{ - .label = block_scope.label, - .val = last, - }); - try block_scope.statements.append(break_node); - return try block_scope.complete(c); -} - -fn parseCNumLit(ctx: *Context, m: *MacroCtx) ParseError!Node { - const lit_bytes = m.slice(); - var bytes = try std.ArrayListUnmanaged(u8).initCapacity(ctx.arena, lit_bytes.len + 3); - - const prefix = aro.Tree.Token.NumberPrefix.fromString(lit_bytes); - switch (prefix) { - .binary => bytes.appendSliceAssumeCapacity("0b"), - .octal => bytes.appendSliceAssumeCapacity("0o"), - .hex => bytes.appendSliceAssumeCapacity("0x"), - .decimal => {}, - } - - const after_prefix = lit_bytes[prefix.stringLen()..]; - const after_int = for (after_prefix, 0..) |c, i| switch (c) { - '.' => { - if (i == 0) { - bytes.appendAssumeCapacity('0'); - } - break after_prefix[i..]; - }, - 'e', 'E' => { - if (prefix != .hex) break after_prefix[i..]; - bytes.appendAssumeCapacity(c); - }, - 'p', 'P' => break after_prefix[i..], - '0'...'9', 'a'...'d', 'A'...'D', 'f', 'F' => { - if (!prefix.digitAllowed(c)) break after_prefix[i..]; - bytes.appendAssumeCapacity(c); - }, - '\'' => { - bytes.appendAssumeCapacity('_'); - }, - else => break after_prefix[i..], - } else ""; - - const after_frac = frac: { - if (after_int.len == 0 or after_int[0] != '.') break :frac after_int; - bytes.appendAssumeCapacity('.'); - for (after_int[1..], 1..) |c, i| { - if (c == '\'') { - bytes.appendAssumeCapacity('_'); - continue; - } - if (!prefix.digitAllowed(c)) break :frac after_int[i..]; - bytes.appendAssumeCapacity(c); - } - break :frac ""; - }; - - const suffix_str = exponent: { - if (after_frac.len == 0) break :exponent after_frac; - switch (after_frac[0]) { - 'e', 'E' => {}, - 'p', 'P' => if (prefix != .hex) break :exponent after_frac, - else => break :exponent after_frac, - } - bytes.appendAssumeCapacity(after_frac[0]); - for (after_frac[1..], 1..) |c, i| switch (c) { - '+', '-', '0'...'9' => { - bytes.appendAssumeCapacity(c); - }, - '\'' => { - bytes.appendAssumeCapacity('_'); - }, - else => break :exponent after_frac[i..], - }; - break :exponent ""; - }; - - const is_float = after_int.len != suffix_str.len; - const suffix = aro.Tree.Token.NumberSuffix.fromString(suffix_str, if (is_float) .float else .int) orelse { - try m.fail(ctx, "invalid number suffix: '{s}'", .{suffix_str}); - return error.ParseError; - }; - if (suffix.isImaginary()) { - try m.fail(ctx, "TODO: imaginary literals", .{}); - return error.ParseError; - } - if (suffix.isBitInt()) { - try m.fail(ctx, "TODO: _BitInt literals", .{}); - return error.ParseError; - } - - if (is_float) { - const type_node = try Tag.type.create(ctx.arena, switch (suffix) { - .F16 => "f16", - .F => "f32", - .None => "f64", - .L => "c_longdouble", - .W => "f80", - .Q, .F128 => "f128", - else => unreachable, - }); - const rhs = try Tag.float_literal.create(ctx.arena, bytes.items); - return Tag.as.create(ctx.arena, .{ .lhs = type_node, .rhs = rhs }); - } else { - const type_node = try Tag.type.create(ctx.arena, switch (suffix) { - .None => "c_int", - .U => "c_uint", - .L => "c_long", - .UL => "c_ulong", - .LL => "c_longlong", - .ULL => "c_ulonglong", - else => unreachable, - }); - const value = std.fmt.parseInt(i128, bytes.items, 0) catch math.maxInt(i128); - - // make the output less noisy by skipping promoteIntLiteral where - // it's guaranteed to not be required because of C standard type constraints - const guaranteed_to_fit = switch (suffix) { - .None => math.cast(i16, value) != null, - .U => math.cast(u16, value) != null, - .L => math.cast(i32, value) != null, - .UL => math.cast(u32, value) != null, - .LL => math.cast(i64, value) != null, - .ULL => math.cast(u64, value) != null, - else => unreachable, - }; - - const literal_node = try Tag.integer_literal.create(ctx.arena, bytes.items); - if (guaranteed_to_fit) { - return Tag.as.create(ctx.arena, .{ .lhs = type_node, .rhs = literal_node }); - } else { - return Tag.helpers_promoteIntLiteral.create(ctx.arena, .{ - .type = type_node, - .value = literal_node, - .base = try Tag.enum_literal.create(ctx.arena, @tagName(prefix)), - }); - } - } -} - -fn zigifyEscapeSequences(ctx: *Context, m: *MacroCtx) ![]const u8 { - var source = m.slice(); - for (source, 0..) |c, i| { - if (c == '\"' or c == '\'') { - source = source[i..]; - break; - } - } - for (source) |c| { - if (c == '\\' or c == '\t') { - break; - } - } else return source; - var bytes = try ctx.arena.alloc(u8, source.len * 2); - var state: enum { - start, - escape, - hex, - octal, - } = .start; - var i: usize = 0; - var count: u8 = 0; - var num: u8 = 0; - for (source) |c| { - switch (state) { - .escape => { - switch (c) { - 'n', 'r', 't', '\\', '\'', '\"' => { - bytes[i] = c; - }, - '0'...'7' => { - count += 1; - num += c - '0'; - state = .octal; - bytes[i] = 'x'; - }, - 'x' => { - state = .hex; - bytes[i] = 'x'; - }, - 'a' => { - bytes[i] = 'x'; - i += 1; - bytes[i] = '0'; - i += 1; - bytes[i] = '7'; - }, - 'b' => { - bytes[i] = 'x'; - i += 1; - bytes[i] = '0'; - i += 1; - bytes[i] = '8'; - }, - 'f' => { - bytes[i] = 'x'; - i += 1; - bytes[i] = '0'; - i += 1; - bytes[i] = 'C'; - }, - 'v' => { - bytes[i] = 'x'; - i += 1; - bytes[i] = '0'; - i += 1; - bytes[i] = 'B'; - }, - '?' => { - i -= 1; - bytes[i] = '?'; - }, - 'u', 'U' => { - try m.fail(ctx, "macro tokenizing failed: TODO unicode escape sequences", .{}); - return error.ParseError; - }, - else => { - try m.fail(ctx, "macro tokenizing failed: unknown escape sequence", .{}); - return error.ParseError; - }, - } - i += 1; - if (state == .escape) - state = .start; - }, - .start => { - if (c == '\t') { - bytes[i] = '\\'; - i += 1; - bytes[i] = 't'; - i += 1; - continue; - } - if (c == '\\') { - state = .escape; - } - bytes[i] = c; - i += 1; - }, - .hex => { - switch (c) { - '0'...'9' => { - num = std.math.mul(u8, num, 16) catch { - try m.fail(ctx, "macro tokenizing failed: hex literal overflowed", .{}); - return error.ParseError; - }; - num += c - '0'; - }, - 'a'...'f' => { - num = std.math.mul(u8, num, 16) catch { - try m.fail(ctx, "macro tokenizing failed: hex literal overflowed", .{}); - return error.ParseError; - }; - num += c - 'a' + 10; - }, - 'A'...'F' => { - num = std.math.mul(u8, num, 16) catch { - try m.fail(ctx, "macro tokenizing failed: hex literal overflowed", .{}); - return error.ParseError; - }; - num += c - 'A' + 10; - }, - else => { - i += std.fmt.printInt(bytes[i..], num, 16, .lower, .{ .fill = '0', .width = 2 }); - num = 0; - if (c == '\\') - state = .escape - else - state = .start; - bytes[i] = c; - i += 1; - }, - } - }, - .octal => { - const accept_digit = switch (c) { - // The maximum length of a octal literal is 3 digits - '0'...'7' => count < 3, - else => false, - }; - - if (accept_digit) { - count += 1; - num = std.math.mul(u8, num, 8) catch { - try m.fail(ctx, "macro tokenizing failed: octal literal overflowed", .{}); - return error.ParseError; - }; - num += c - '0'; - } else { - i += std.fmt.printInt(bytes[i..], num, 16, .lower, .{ .fill = '0', .width = 2 }); - num = 0; - count = 0; - if (c == '\\') - state = .escape - else - state = .start; - bytes[i] = c; - i += 1; - } - }, - } - } - if (state == .hex or state == .octal) - i += std.fmt.printInt(bytes[i..], num, 16, .lower, .{ .fill = '0', .width = 2 }); - return bytes[0..i]; -} - -/// non-ASCII characters (c > 127) are also treated as non-printable by ascii.hexEscape. -/// If a C string literal or char literal in a macro is not valid UTF-8, we need to escape -/// non-ASCII characters so that the Zig source we output will itself be UTF-8. -fn escapeUnprintables(ctx: *Context, m: *MacroCtx) ![]const u8 { - const zigified = try zigifyEscapeSequences(ctx, m); - if (std.unicode.utf8ValidateSlice(zigified)) return zigified; - - const formatter = std.ascii.hexEscape(zigified, .lower); - const encoded_size: usize = @intCast(std.fmt.count("{f}", .{formatter})); - const output = try ctx.arena.alloc(u8, encoded_size); - return std.fmt.bufPrint(output, "{f}", .{formatter}) catch |err| switch (err) { - error.NoSpaceLeft => unreachable, - else => |e| return e, - }; -} - -fn parseCPrimaryExpr(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!Node { - const tok = m.next().?; - const slice = m.slice(); - switch (tok) { - .char_literal, - .char_literal_utf_8, - .char_literal_utf_16, - .char_literal_utf_32, - .char_literal_wide, - => { - if (slice[0] != '\'' or slice[1] == '\\' or slice.len == 3) { - return Tag.char_literal.create(c.arena, try escapeUnprintables(c, m)); - } else { - const str = try std.fmt.allocPrint(c.arena, "0x{x}", .{slice[1 .. slice.len - 1]}); - return Tag.integer_literal.create(c.arena, str); - } - }, - .string_literal, - .string_literal_utf_16, - .string_literal_utf_8, - .string_literal_utf_32, - .string_literal_wide, - => { - return Tag.string_literal.create(c.arena, try escapeUnprintables(c, m)); - }, - .pp_num => { - return parseCNumLit(c, m); - }, - .l_paren => { - const inner_node = try parseCExpr(c, m, scope); - - try m.skip(c, .r_paren); - return inner_node; - }, - else => {}, - } - - // The C preprocessor has no knowledge of C, so C keywords aren't special in macros. - // Thus the current token should be treated like an identifier if its name matches a parameter. - if (tok == .identifier or tok == .extended_identifier or m.checkFnParam(slice)) { - if (c.global_scope.blank_macros.contains(slice)) { - return parseCPrimaryExpr(c, m, scope); - } - const mangled_name = scope.getAlias(slice); - if (builtin_typedef_map.get(mangled_name)) |ty| return Tag.type.create(c.arena, ty); - const identifier = try Tag.identifier.create(c.arena, mangled_name); - scope.skipVariableDiscard(identifier.castTag(.identifier).?.data); - refs_var: { - const ident_node = c.global_scope.sym_table.get(slice) orelse break :refs_var; - const var_decl_node = ident_node.castTag(.var_decl) orelse break :refs_var; - if (!var_decl_node.data.is_const) m.refs_var_decl = true; - } - return identifier; - } - - // for handling type macros (EVIL) - // TODO maybe detect and treat type macros as typedefs in parseCSpecifierQualifierList? - m.i -= 1; - if (try parseCTypeName(c, m, scope, true)) |type_name| { - return type_name; - } - try m.fail(c, "unable to translate C expr: unexpected token '{s}'", .{tok.symbol()}); - return error.ParseError; -} - -fn macroIntFromBool(c: *Context, node: Node) !Node { - if (!isBoolRes(node)) { - return node; - } - - return Tag.int_from_bool.create(c.arena, node); -} - -fn macroIntToBool(c: *Context, node: Node) !Node { - if (isBoolRes(node)) { - return node; - } - if (node.tag() == .string_literal) { - // @intFromPtr(node) != 0 - const int_from_ptr = try Tag.int_from_ptr.create(c.arena, node); - return Tag.not_equal.create(c.arena, .{ .lhs = int_from_ptr, .rhs = Tag.zero_literal.init() }); - } - // node != 0 - return Tag.not_equal.create(c.arena, .{ .lhs = node, .rhs = Tag.zero_literal.init() }); -} - -fn parseCCondExpr(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!Node { - const node = try parseCOrExpr(c, m, scope); - if (m.peek().? != .question_mark) { - return node; - } - _ = m.next(); - - const then_body = try parseCOrExpr(c, m, scope); - try m.skip(c, .colon); - const else_body = try parseCCondExpr(c, m, scope); - return Tag.@"if".create(c.arena, .{ .cond = node, .then = then_body, .@"else" = else_body }); -} - -fn parseCOrExpr(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!Node { - var node = try parseCAndExpr(c, m, scope); - while (m.next().? == .pipe_pipe) { - const lhs = try macroIntToBool(c, node); - const rhs = try macroIntToBool(c, try parseCAndExpr(c, m, scope)); - node = try Tag.@"or".create(c.arena, .{ .lhs = lhs, .rhs = rhs }); - } - m.i -= 1; - return node; -} - -fn parseCAndExpr(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!Node { - var node = try parseCBitOrExpr(c, m, scope); - while (m.next().? == .ampersand_ampersand) { - const lhs = try macroIntToBool(c, node); - const rhs = try macroIntToBool(c, try parseCBitOrExpr(c, m, scope)); - node = try Tag.@"and".create(c.arena, .{ .lhs = lhs, .rhs = rhs }); - } - m.i -= 1; - return node; -} - -fn parseCBitOrExpr(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!Node { - var node = try parseCBitXorExpr(c, m, scope); - while (m.next().? == .pipe) { - const lhs = try macroIntFromBool(c, node); - const rhs = try macroIntFromBool(c, try parseCBitXorExpr(c, m, scope)); - node = try Tag.bit_or.create(c.arena, .{ .lhs = lhs, .rhs = rhs }); - } - m.i -= 1; - return node; -} - -fn parseCBitXorExpr(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!Node { - var node = try parseCBitAndExpr(c, m, scope); - while (m.next().? == .caret) { - const lhs = try macroIntFromBool(c, node); - const rhs = try macroIntFromBool(c, try parseCBitAndExpr(c, m, scope)); - node = try Tag.bit_xor.create(c.arena, .{ .lhs = lhs, .rhs = rhs }); - } - m.i -= 1; - return node; -} - -fn parseCBitAndExpr(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!Node { - var node = try parseCEqExpr(c, m, scope); - while (m.next().? == .ampersand) { - const lhs = try macroIntFromBool(c, node); - const rhs = try macroIntFromBool(c, try parseCEqExpr(c, m, scope)); - node = try Tag.bit_and.create(c.arena, .{ .lhs = lhs, .rhs = rhs }); - } - m.i -= 1; - return node; -} - -fn parseCEqExpr(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!Node { - var node = try parseCRelExpr(c, m, scope); - while (true) { - switch (m.peek().?) { - .bang_equal => { - _ = m.next(); - const lhs = try macroIntFromBool(c, node); - const rhs = try macroIntFromBool(c, try parseCRelExpr(c, m, scope)); - node = try Tag.not_equal.create(c.arena, .{ .lhs = lhs, .rhs = rhs }); - }, - .equal_equal => { - _ = m.next(); - const lhs = try macroIntFromBool(c, node); - const rhs = try macroIntFromBool(c, try parseCRelExpr(c, m, scope)); - node = try Tag.equal.create(c.arena, .{ .lhs = lhs, .rhs = rhs }); - }, - else => return node, - } - } -} - -fn parseCRelExpr(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!Node { - var node = try parseCShiftExpr(c, m, scope); - while (true) { - switch (m.peek().?) { - .angle_bracket_right => { - _ = m.next(); - const lhs = try macroIntFromBool(c, node); - const rhs = try macroIntFromBool(c, try parseCShiftExpr(c, m, scope)); - node = try Tag.greater_than.create(c.arena, .{ .lhs = lhs, .rhs = rhs }); - }, - .angle_bracket_right_equal => { - _ = m.next(); - const lhs = try macroIntFromBool(c, node); - const rhs = try macroIntFromBool(c, try parseCShiftExpr(c, m, scope)); - node = try Tag.greater_than_equal.create(c.arena, .{ .lhs = lhs, .rhs = rhs }); - }, - .angle_bracket_left => { - _ = m.next(); - const lhs = try macroIntFromBool(c, node); - const rhs = try macroIntFromBool(c, try parseCShiftExpr(c, m, scope)); - node = try Tag.less_than.create(c.arena, .{ .lhs = lhs, .rhs = rhs }); - }, - .angle_bracket_left_equal => { - _ = m.next(); - const lhs = try macroIntFromBool(c, node); - const rhs = try macroIntFromBool(c, try parseCShiftExpr(c, m, scope)); - node = try Tag.less_than_equal.create(c.arena, .{ .lhs = lhs, .rhs = rhs }); - }, - else => return node, - } - } -} - -fn parseCShiftExpr(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!Node { - var node = try parseCAddSubExpr(c, m, scope); - while (true) { - switch (m.peek().?) { - .angle_bracket_angle_bracket_left => { - _ = m.next(); - const lhs = try macroIntFromBool(c, node); - const rhs = try macroIntFromBool(c, try parseCAddSubExpr(c, m, scope)); - node = try Tag.shl.create(c.arena, .{ .lhs = lhs, .rhs = rhs }); - }, - .angle_bracket_angle_bracket_right => { - _ = m.next(); - const lhs = try macroIntFromBool(c, node); - const rhs = try macroIntFromBool(c, try parseCAddSubExpr(c, m, scope)); - node = try Tag.shr.create(c.arena, .{ .lhs = lhs, .rhs = rhs }); - }, - else => return node, - } - } -} - -fn parseCAddSubExpr(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!Node { - var node = try parseCMulExpr(c, m, scope); - while (true) { - switch (m.peek().?) { - .plus => { - _ = m.next(); - const lhs = try macroIntFromBool(c, node); - const rhs = try macroIntFromBool(c, try parseCMulExpr(c, m, scope)); - node = try Tag.add.create(c.arena, .{ .lhs = lhs, .rhs = rhs }); - }, - .minus => { - _ = m.next(); - const lhs = try macroIntFromBool(c, node); - const rhs = try macroIntFromBool(c, try parseCMulExpr(c, m, scope)); - node = try Tag.sub.create(c.arena, .{ .lhs = lhs, .rhs = rhs }); - }, - else => return node, - } - } -} - -fn parseCMulExpr(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!Node { - var node = try parseCCastExpr(c, m, scope); - while (true) { - switch (m.next().?) { - .asterisk => { - const lhs = try macroIntFromBool(c, node); - const rhs = try macroIntFromBool(c, try parseCCastExpr(c, m, scope)); - node = try Tag.mul.create(c.arena, .{ .lhs = lhs, .rhs = rhs }); - }, - .slash => { - const lhs = try macroIntFromBool(c, node); - const rhs = try macroIntFromBool(c, try parseCCastExpr(c, m, scope)); - node = try Tag.macro_arithmetic.create(c.arena, .{ .op = .div, .lhs = lhs, .rhs = rhs }); - }, - .percent => { - const lhs = try macroIntFromBool(c, node); - const rhs = try macroIntFromBool(c, try parseCCastExpr(c, m, scope)); - node = try Tag.macro_arithmetic.create(c.arena, .{ .op = .rem, .lhs = lhs, .rhs = rhs }); - }, - else => { - m.i -= 1; - return node; - }, - } - } -} - -fn parseCCastExpr(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!Node { - switch (m.next().?) { - .l_paren => { - if (try parseCTypeName(c, m, scope, true)) |type_name| { - while (true) { - const next_token = m.next().?; - switch (next_token) { - .r_paren => break, - else => |next_tag| { - // Skip trailing blank defined before the RParen. - if ((next_tag == .identifier or next_tag == .extended_identifier) and - c.global_scope.blank_macros.contains(m.slice())) - continue; - - try m.fail( - c, - "unable to translate C expr: expected ')' instead got '{s}'", - .{next_token.symbol()}, - ); - return error.ParseError; - }, - } - } - if (m.peek().? == .l_brace) { - // initializer list - return parseCPostfixExpr(c, m, scope, type_name); - } - const node_to_cast = try parseCCastExpr(c, m, scope); - return Tag.helpers_cast.create(c.arena, .{ .lhs = type_name, .rhs = node_to_cast }); - } - }, - else => {}, - } - m.i -= 1; - return parseCUnaryExpr(c, m, scope); -} - -// allow_fail is set when unsure if we are parsing a type-name -fn parseCTypeName(c: *Context, m: *MacroCtx, scope: *Scope, allow_fail: bool) ParseError!?Node { - if (try parseCSpecifierQualifierList(c, m, scope, allow_fail)) |node| { - return try parseCAbstractDeclarator(c, m, node); - } else { - return null; - } -} - -fn parseCSpecifierQualifierList(c: *Context, m: *MacroCtx, scope: *Scope, allow_fail: bool) ParseError!?Node { - const tok = m.next().?; - const slice = m.slice(); - const mangled_name = scope.getAlias(slice); - if (!m.checkFnParam(mangled_name)) { - switch (tok) { - .identifier, .extended_identifier => { - if (c.global_scope.blank_macros.contains(m.slice())) { - return try parseCSpecifierQualifierList(c, m, scope, allow_fail); - } - if (!allow_fail or c.typedefs.contains(mangled_name)) { - if (builtin_typedef_map.get(mangled_name)) |ty| return try Tag.type.create(c.arena, ty); - return try Tag.identifier.create(c.arena, mangled_name); - } - }, - .keyword_void => return try Tag.type.create(c.arena, "anyopaque"), - .keyword_bool => return try Tag.type.create(c.arena, "bool"), - .keyword_char, - .keyword_int, - .keyword_short, - .keyword_long, - .keyword_float, - .keyword_double, - .keyword_signed, - .keyword_unsigned, - .keyword_complex, - => { - m.i -= 1; - return try parseCNumericType(c, m); - }, - .keyword_enum, .keyword_struct, .keyword_union => { - // struct Foo will be declared as struct_Foo by transRecordDecl - try m.skip(c, .identifier); - - const name = try std.fmt.allocPrint(c.arena, "{s}_{s}", .{ slice, m.slice() }); - return try Tag.identifier.create(c.arena, name); - }, - else => {}, - } - } else { - if (allow_fail) { - m.i -= 1; - return null; - } else { - return try Tag.identifier.create(c.arena, mangled_name); - } - } - - if (allow_fail) { - m.i -= 1; - return null; - } else { - try m.fail(c, "unable to translate C expr: unexpected token '{s}'", .{tok.symbol()}); - return error.ParseError; - } -} - -fn parseCNumericType(c: *Context, m: *MacroCtx) ParseError!Node { - const KwCounter = struct { - double: u8 = 0, - long: u8 = 0, - int: u8 = 0, - float: u8 = 0, - short: u8 = 0, - char: u8 = 0, - unsigned: u8 = 0, - signed: u8 = 0, - complex: u8 = 0, - - fn eql(self: @This(), other: @This()) bool { - return meta.eql(self, other); - } - }; - - // Yes, these can be in *any* order - // This still doesn't cover cases where for example volatile is intermixed - - var kw = KwCounter{}; - // prevent overflow - var i: u8 = 0; - while (i < math.maxInt(u8)) : (i += 1) { - switch (m.next().?) { - .keyword_double => kw.double += 1, - .keyword_long => kw.long += 1, - .keyword_int => kw.int += 1, - .keyword_float => kw.float += 1, - .keyword_short => kw.short += 1, - .keyword_char => kw.char += 1, - .keyword_unsigned => kw.unsigned += 1, - .keyword_signed => kw.signed += 1, - .keyword_complex => kw.complex += 1, - else => { - m.i -= 1; - break; - }, - } - } - - if (kw.eql(.{ .int = 1 }) or kw.eql(.{ .signed = 1 }) or kw.eql(.{ .signed = 1, .int = 1 })) - return Tag.type.create(c.arena, "c_int"); - - if (kw.eql(.{ .unsigned = 1 }) or kw.eql(.{ .unsigned = 1, .int = 1 })) - return Tag.type.create(c.arena, "c_uint"); - - if (kw.eql(.{ .long = 1 }) or kw.eql(.{ .signed = 1, .long = 1 }) or kw.eql(.{ .long = 1, .int = 1 }) or kw.eql(.{ .signed = 1, .long = 1, .int = 1 })) - return Tag.type.create(c.arena, "c_long"); - - if (kw.eql(.{ .unsigned = 1, .long = 1 }) or kw.eql(.{ .unsigned = 1, .long = 1, .int = 1 })) - return Tag.type.create(c.arena, "c_ulong"); - - if (kw.eql(.{ .long = 2 }) or kw.eql(.{ .signed = 1, .long = 2 }) or kw.eql(.{ .long = 2, .int = 1 }) or kw.eql(.{ .signed = 1, .long = 2, .int = 1 })) - return Tag.type.create(c.arena, "c_longlong"); - - if (kw.eql(.{ .unsigned = 1, .long = 2 }) or kw.eql(.{ .unsigned = 1, .long = 2, .int = 1 })) - return Tag.type.create(c.arena, "c_ulonglong"); - - if (kw.eql(.{ .signed = 1, .char = 1 })) - return Tag.type.create(c.arena, "i8"); - - if (kw.eql(.{ .char = 1 }) or kw.eql(.{ .unsigned = 1, .char = 1 })) - return Tag.type.create(c.arena, "u8"); - - if (kw.eql(.{ .short = 1 }) or kw.eql(.{ .signed = 1, .short = 1 }) or kw.eql(.{ .short = 1, .int = 1 }) or kw.eql(.{ .signed = 1, .short = 1, .int = 1 })) - return Tag.type.create(c.arena, "c_short"); - - if (kw.eql(.{ .unsigned = 1, .short = 1 }) or kw.eql(.{ .unsigned = 1, .short = 1, .int = 1 })) - return Tag.type.create(c.arena, "c_ushort"); - - if (kw.eql(.{ .float = 1 })) - return Tag.type.create(c.arena, "f32"); - - if (kw.eql(.{ .double = 1 })) - return Tag.type.create(c.arena, "f64"); - - if (kw.eql(.{ .long = 1, .double = 1 })) { - try m.fail(c, "unable to translate: TODO long double", .{}); - return error.ParseError; - } - - if (kw.eql(.{ .float = 1, .complex = 1 })) { - try m.fail(c, "unable to translate: TODO _Complex", .{}); - return error.ParseError; - } - - if (kw.eql(.{ .double = 1, .complex = 1 })) { - try m.fail(c, "unable to translate: TODO _Complex", .{}); - return error.ParseError; - } - - if (kw.eql(.{ .long = 1, .double = 1, .complex = 1 })) { - try m.fail(c, "unable to translate: TODO _Complex", .{}); - return error.ParseError; - } - - try m.fail(c, "unable to translate: invalid numeric type", .{}); - return error.ParseError; -} - -fn parseCAbstractDeclarator(c: *Context, m: *MacroCtx, node: Node) ParseError!Node { - switch (m.next().?) { - .asterisk => { - // last token of `node` - const prev_id = m.list[m.i - 1].id; - - if (prev_id == .keyword_void) { - const ptr = try Tag.single_pointer.create(c.arena, .{ - .is_const = false, - .is_volatile = false, - .elem_type = node, - }); - return Tag.optional_type.create(c.arena, ptr); - } else { - return Tag.c_pointer.create(c.arena, .{ - .is_const = false, - .is_volatile = false, - .elem_type = node, - }); - } - }, - else => { - m.i -= 1; - return node; - }, - } -} - -fn parseCPostfixExpr(c: *Context, m: *MacroCtx, scope: *Scope, type_name: ?Node) ParseError!Node { - var node = try parseCPostfixExprInner(c, m, scope, type_name); - // In C the preprocessor would handle concatting strings while expanding macros. - // This should do approximately the same by concatting any strings and identifiers - // after a primary or postfix expression. - while (true) { - switch (m.peek().?) { - .string_literal, - .string_literal_utf_16, - .string_literal_utf_8, - .string_literal_utf_32, - .string_literal_wide, - => {}, - .identifier, .extended_identifier => { - const tok = m.list[m.i + 1]; - const slice = m.source[tok.start..tok.end]; - if (c.global_scope.blank_macros.contains(slice)) { - m.i += 1; - continue; - } - }, - else => break, - } - const rhs = try parseCPostfixExprInner(c, m, scope, type_name); - node = try Tag.array_cat.create(c.arena, .{ .lhs = node, .rhs = rhs }); - } - return node; -} - -fn parseCPostfixExprInner(c: *Context, m: *MacroCtx, scope: *Scope, type_name: ?Node) ParseError!Node { - var node = type_name orelse try parseCPrimaryExpr(c, m, scope); - while (true) { - switch (m.next().?) { - .period => { - try m.skip(c, .identifier); - - node = try Tag.field_access.create(c.arena, .{ .lhs = node, .field_name = m.slice() }); - }, - .arrow => { - try m.skip(c, .identifier); - - const deref = try Tag.deref.create(c.arena, node); - node = try Tag.field_access.create(c.arena, .{ .lhs = deref, .field_name = m.slice() }); - }, - .l_bracket => { - const index_val = try macroIntFromBool(c, try parseCExpr(c, m, scope)); - const index = try Tag.as.create(c.arena, .{ - .lhs = try Tag.type.create(c.arena, "usize"), - .rhs = try Tag.int_cast.create(c.arena, index_val), - }); - node = try Tag.array_access.create(c.arena, .{ .lhs = node, .rhs = index }); - try m.skip(c, .r_bracket); - }, - .l_paren => { - if (m.peek().? == .r_paren) { - m.i += 1; - node = try Tag.call.create(c.arena, .{ .lhs = node, .args = &[0]Node{} }); - } else { - var args = std.array_list.Managed(Node).init(c.gpa); - defer args.deinit(); - while (true) { - const arg = try parseCCondExpr(c, m, scope); - try args.append(arg); - const next_id = m.next().?; - switch (next_id) { - .comma => {}, - .r_paren => break, - else => { - try m.fail(c, "unable to translate C expr: expected ',' or ')' instead got '{s}'", .{next_id.symbol()}); - return error.ParseError; - }, - } - } - node = try Tag.call.create(c.arena, .{ .lhs = node, .args = try c.arena.dupe(Node, args.items) }); - } - }, - .l_brace => { - // Check for designated field initializers - if (m.peek().? == .period) { - var init_vals = std.array_list.Managed(ast.Payload.ContainerInitDot.Initializer).init(c.gpa); - defer init_vals.deinit(); - - while (true) { - try m.skip(c, .period); - try m.skip(c, .identifier); - const name = m.slice(); - try m.skip(c, .equal); - - const val = try parseCCondExpr(c, m, scope); - try init_vals.append(.{ .name = name, .value = val }); - const next_id = m.next().?; - switch (next_id) { - .comma => {}, - .r_brace => break, - else => { - try m.fail(c, "unable to translate C expr: expected ',' or '}}' instead got '{s}'", .{next_id.symbol()}); - return error.ParseError; - }, - } - } - const tuple_node = try Tag.container_init_dot.create(c.arena, try c.arena.dupe(ast.Payload.ContainerInitDot.Initializer, init_vals.items)); - node = try Tag.std_mem_zeroinit.create(c.arena, .{ .lhs = node, .rhs = tuple_node }); - continue; - } - - var init_vals = std.array_list.Managed(Node).init(c.gpa); - defer init_vals.deinit(); - - while (true) { - const val = try parseCCondExpr(c, m, scope); - try init_vals.append(val); - const next_id = m.next().?; - switch (next_id) { - .comma => {}, - .r_brace => break, - else => { - try m.fail(c, "unable to translate C expr: expected ',' or '}}' instead got '{s}'", .{next_id.symbol()}); - return error.ParseError; - }, - } - } - const tuple_node = try Tag.tuple.create(c.arena, try c.arena.dupe(Node, init_vals.items)); - node = try Tag.std_mem_zeroinit.create(c.arena, .{ .lhs = node, .rhs = tuple_node }); - }, - .plus_plus, .minus_minus => { - try m.fail(c, "TODO postfix inc/dec expr", .{}); - return error.ParseError; - }, - else => { - m.i -= 1; - return node; - }, - } - } -} - -fn parseCUnaryExpr(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!Node { - sw: switch (m.next().?) { - .bang => { - const operand = try macroIntToBool(c, try parseCCastExpr(c, m, scope)); - return Tag.not.create(c.arena, operand); - }, - .minus => { - const operand = try macroIntFromBool(c, try parseCCastExpr(c, m, scope)); - return Tag.negate.create(c.arena, operand); - }, - .plus => return try parseCCastExpr(c, m, scope), - .tilde => { - const operand = try macroIntFromBool(c, try parseCCastExpr(c, m, scope)); - return Tag.bit_not.create(c.arena, operand); - }, - .asterisk => { - const operand = try parseCCastExpr(c, m, scope); - return Tag.deref.create(c.arena, operand); - }, - .ampersand => { - const operand = try parseCCastExpr(c, m, scope); - return Tag.address_of.create(c.arena, operand); - }, - .keyword_sizeof => { - // 'sizeof' could be used as a parameter to a macro function. - if (m.checkFnParam(m.slice())) break :sw; - - const operand = if (m.peek().? == .l_paren) blk: { - _ = m.next(); - const inner = (try parseCTypeName(c, m, scope, false)).?; - try m.skip(c, .r_paren); - break :blk inner; - } else try parseCUnaryExpr(c, m, scope); - - return Tag.helpers_sizeof.create(c.arena, operand); - }, - .keyword_alignof => { - // 'alignof' could be used as a parameter to a macro function. - if (m.checkFnParam(m.slice())) break :sw; - - // TODO this won't work if using 's - // #define alignof _Alignof - try m.skip(c, .l_paren); - const operand = (try parseCTypeName(c, m, scope, false)).?; - try m.skip(c, .r_paren); - - return Tag.alignof.create(c.arena, operand); - }, - .plus_plus, .minus_minus => { - try m.fail(c, "TODO unary inc/dec expr", .{}); - return error.ParseError; - }, - else => {}, - } - - m.i -= 1; - return try parseCPostfixExpr(c, m, scope, null); -} - -fn getContainer(c: *Context, node: Node) ?Node { - switch (node.tag()) { - .@"union", - .@"struct", - .address_of, - .bit_not, - .not, - .optional_type, - .negate, - .negate_wrap, - .array_type, - .c_pointer, - .single_pointer, - => return node, - - .identifier => { - const ident = node.castTag(.identifier).?; - if (c.global_scope.sym_table.get(ident.data)) |value| { - if (value.castTag(.var_decl)) |var_decl| - return getContainer(c, var_decl.data.init.?); - if (value.castTag(.var_simple) orelse value.castTag(.pub_var_simple)) |var_decl| - return getContainer(c, var_decl.data.init); - } - }, - - .field_access => { - const field_access = node.castTag(.field_access).?; - - if (getContainerTypeOf(c, field_access.data.lhs)) |ty_node| { - if (ty_node.castTag(.@"struct") orelse ty_node.castTag(.@"union")) |container| { - for (container.data.fields) |field| { - if (mem.eql(u8, field.name, field_access.data.field_name)) { - return getContainer(c, field.type); - } - } - } - } - }, - - else => {}, - } - return null; -} - -fn getContainerTypeOf(c: *Context, ref: Node) ?Node { - if (ref.castTag(.identifier)) |ident| { - if (c.global_scope.sym_table.get(ident.data)) |value| { - if (value.castTag(.var_decl)) |var_decl| { - return getContainer(c, var_decl.data.type); - } - } - } else if (ref.castTag(.field_access)) |field_access| { - if (getContainerTypeOf(c, field_access.data.lhs)) |ty_node| { - if (ty_node.castTag(.@"struct") orelse ty_node.castTag(.@"union")) |container| { - for (container.data.fields) |field| { - if (mem.eql(u8, field.name, field_access.data.field_name)) { - return getContainer(c, field.type); - } - } - } else return ty_node; - } - } - return null; -} - -fn getFnProto(c: *Context, ref: Node) ?*ast.Payload.Func { - const init = if (ref.castTag(.var_decl)) |v| - v.data.init orelse return null - else if (ref.castTag(.var_simple) orelse ref.castTag(.pub_var_simple)) |v| - v.data.init - else - return null; - if (getContainerTypeOf(c, init)) |ty_node| { - if (ty_node.castTag(.optional_type)) |prefix| { - if (prefix.data.castTag(.single_pointer)) |sp| { - if (sp.data.elem_type.castTag(.func)) |fn_proto| { - return fn_proto; - } - } - } - } - return null; -} diff --git a/src/zig_clang.cpp b/src/zig_clang.cpp deleted file mode 100644 index 0d10fa8c9dca..000000000000 --- a/src/zig_clang.cpp +++ /dev/null @@ -1,4176 +0,0 @@ -/* - * Copyright (c) 2019 Andrew Kelley - * - * This file is part of zig, which is MIT licensed. - * See http://opensource.org/licenses/MIT - */ - - -/* - * The point of this file is to contain all the Clang C++ API interaction so that: - * 1. The compile time of other files is kept under control. - * 2. Provide a C interface to the Clang functions we need for self-hosting purposes. - * 3. Prevent C++ from infecting the rest of the project. - */ -#include "zig_clang.h" - -#if __GNUC__ >= 8 -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wclass-memaccess" -#endif - -#include -#include -#include -#include -#include -#include - -#if __GNUC__ >= 8 -#pragma GCC diagnostic pop -#endif - -// Detect additions to the enum -void ZigClang_detect_enum_BO(clang::BinaryOperatorKind op) { - switch (op) { - case clang::BO_PtrMemD: - case clang::BO_PtrMemI: - case clang::BO_Cmp: - case clang::BO_Mul: - case clang::BO_Div: - case clang::BO_Rem: - case clang::BO_Add: - case clang::BO_Sub: - case clang::BO_Shl: - case clang::BO_Shr: - case clang::BO_LT: - case clang::BO_GT: - case clang::BO_LE: - case clang::BO_GE: - case clang::BO_EQ: - case clang::BO_NE: - case clang::BO_And: - case clang::BO_Xor: - case clang::BO_Or: - case clang::BO_LAnd: - case clang::BO_LOr: - case clang::BO_Assign: - case clang::BO_Comma: - case clang::BO_MulAssign: - case clang::BO_DivAssign: - case clang::BO_RemAssign: - case clang::BO_AddAssign: - case clang::BO_SubAssign: - case clang::BO_ShlAssign: - case clang::BO_ShrAssign: - case clang::BO_AndAssign: - case clang::BO_XorAssign: - case clang::BO_OrAssign: - break; - } -} - -static_assert((clang::BinaryOperatorKind)ZigClangBO_Add == clang::BO_Add, ""); -static_assert((clang::BinaryOperatorKind)ZigClangBO_AddAssign == clang::BO_AddAssign, ""); -static_assert((clang::BinaryOperatorKind)ZigClangBO_And == clang::BO_And, ""); -static_assert((clang::BinaryOperatorKind)ZigClangBO_AndAssign == clang::BO_AndAssign, ""); -static_assert((clang::BinaryOperatorKind)ZigClangBO_Assign == clang::BO_Assign, ""); -static_assert((clang::BinaryOperatorKind)ZigClangBO_Cmp == clang::BO_Cmp, ""); -static_assert((clang::BinaryOperatorKind)ZigClangBO_Comma == clang::BO_Comma, ""); -static_assert((clang::BinaryOperatorKind)ZigClangBO_Div == clang::BO_Div, ""); -static_assert((clang::BinaryOperatorKind)ZigClangBO_DivAssign == clang::BO_DivAssign, ""); -static_assert((clang::BinaryOperatorKind)ZigClangBO_EQ == clang::BO_EQ, ""); -static_assert((clang::BinaryOperatorKind)ZigClangBO_GE == clang::BO_GE, ""); -static_assert((clang::BinaryOperatorKind)ZigClangBO_GT == clang::BO_GT, ""); -static_assert((clang::BinaryOperatorKind)ZigClangBO_LAnd == clang::BO_LAnd, ""); -static_assert((clang::BinaryOperatorKind)ZigClangBO_LE == clang::BO_LE, ""); -static_assert((clang::BinaryOperatorKind)ZigClangBO_LOr == clang::BO_LOr, ""); -static_assert((clang::BinaryOperatorKind)ZigClangBO_LT == clang::BO_LT, ""); -static_assert((clang::BinaryOperatorKind)ZigClangBO_Mul == clang::BO_Mul, ""); -static_assert((clang::BinaryOperatorKind)ZigClangBO_MulAssign == clang::BO_MulAssign, ""); -static_assert((clang::BinaryOperatorKind)ZigClangBO_NE == clang::BO_NE, ""); -static_assert((clang::BinaryOperatorKind)ZigClangBO_Or == clang::BO_Or, ""); -static_assert((clang::BinaryOperatorKind)ZigClangBO_OrAssign == clang::BO_OrAssign, ""); -static_assert((clang::BinaryOperatorKind)ZigClangBO_PtrMemD == clang::BO_PtrMemD, ""); -static_assert((clang::BinaryOperatorKind)ZigClangBO_PtrMemI == clang::BO_PtrMemI, ""); -static_assert((clang::BinaryOperatorKind)ZigClangBO_Rem == clang::BO_Rem, ""); -static_assert((clang::BinaryOperatorKind)ZigClangBO_RemAssign == clang::BO_RemAssign, ""); -static_assert((clang::BinaryOperatorKind)ZigClangBO_Shl == clang::BO_Shl, ""); -static_assert((clang::BinaryOperatorKind)ZigClangBO_ShlAssign == clang::BO_ShlAssign, ""); -static_assert((clang::BinaryOperatorKind)ZigClangBO_Shr == clang::BO_Shr, ""); -static_assert((clang::BinaryOperatorKind)ZigClangBO_ShrAssign == clang::BO_ShrAssign, ""); -static_assert((clang::BinaryOperatorKind)ZigClangBO_Sub == clang::BO_Sub, ""); -static_assert((clang::BinaryOperatorKind)ZigClangBO_SubAssign == clang::BO_SubAssign, ""); -static_assert((clang::BinaryOperatorKind)ZigClangBO_Xor == clang::BO_Xor, ""); -static_assert((clang::BinaryOperatorKind)ZigClangBO_XorAssign == clang::BO_XorAssign, ""); - -// Detect additions to the enum -void ZigClang_detect_enum_UO(clang::UnaryOperatorKind op) { - switch (op) { - case clang::UO_AddrOf: - case clang::UO_Coawait: - case clang::UO_Deref: - case clang::UO_Extension: - case clang::UO_Imag: - case clang::UO_LNot: - case clang::UO_Minus: - case clang::UO_Not: - case clang::UO_Plus: - case clang::UO_PostDec: - case clang::UO_PostInc: - case clang::UO_PreDec: - case clang::UO_PreInc: - case clang::UO_Real: - break; - } -} - -static_assert((clang::UnaryOperatorKind)ZigClangUO_AddrOf == clang::UO_AddrOf, ""); -static_assert((clang::UnaryOperatorKind)ZigClangUO_Coawait == clang::UO_Coawait, ""); -static_assert((clang::UnaryOperatorKind)ZigClangUO_Deref == clang::UO_Deref, ""); -static_assert((clang::UnaryOperatorKind)ZigClangUO_Extension == clang::UO_Extension, ""); -static_assert((clang::UnaryOperatorKind)ZigClangUO_Imag == clang::UO_Imag, ""); -static_assert((clang::UnaryOperatorKind)ZigClangUO_LNot == clang::UO_LNot, ""); -static_assert((clang::UnaryOperatorKind)ZigClangUO_Minus == clang::UO_Minus, ""); -static_assert((clang::UnaryOperatorKind)ZigClangUO_Not == clang::UO_Not, ""); -static_assert((clang::UnaryOperatorKind)ZigClangUO_Plus == clang::UO_Plus, ""); -static_assert((clang::UnaryOperatorKind)ZigClangUO_PostDec == clang::UO_PostDec, ""); -static_assert((clang::UnaryOperatorKind)ZigClangUO_PostInc == clang::UO_PostInc, ""); -static_assert((clang::UnaryOperatorKind)ZigClangUO_PreDec == clang::UO_PreDec, ""); -static_assert((clang::UnaryOperatorKind)ZigClangUO_PreInc == clang::UO_PreInc, ""); -static_assert((clang::UnaryOperatorKind)ZigClangUO_Real == clang::UO_Real, ""); - -// Detect additions to the enum -void ZigClang_detect_enum_CK(clang::CastKind x) { - switch (x) { - case clang::CK_ARCConsumeObject: - case clang::CK_ARCExtendBlockObject: - case clang::CK_ARCProduceObject: - case clang::CK_ARCReclaimReturnedObject: - case clang::CK_AddressSpaceConversion: - case clang::CK_AnyPointerToBlockPointerCast: - case clang::CK_ArrayToPointerDecay: - case clang::CK_AtomicToNonAtomic: - case clang::CK_BaseToDerived: - case clang::CK_BaseToDerivedMemberPointer: - case clang::CK_BitCast: - case clang::CK_BlockPointerToObjCPointerCast: - case clang::CK_BooleanToSignedIntegral: - case clang::CK_BuiltinFnToFnPtr: - case clang::CK_CPointerToObjCPointerCast: - case clang::CK_ConstructorConversion: - case clang::CK_CopyAndAutoreleaseBlockObject: - case clang::CK_Dependent: - case clang::CK_DerivedToBase: - case clang::CK_DerivedToBaseMemberPointer: - case clang::CK_Dynamic: - case clang::CK_FixedPointCast: - case clang::CK_FixedPointToBoolean: - case clang::CK_FixedPointToFloating: - case clang::CK_FixedPointToIntegral: - case clang::CK_FloatingCast: - case clang::CK_FloatingComplexCast: - case clang::CK_FloatingComplexToBoolean: - case clang::CK_FloatingComplexToIntegralComplex: - case clang::CK_FloatingComplexToReal: - case clang::CK_FloatingRealToComplex: - case clang::CK_FloatingToBoolean: - case clang::CK_FloatingToFixedPoint: - case clang::CK_FloatingToIntegral: - case clang::CK_FunctionToPointerDecay: - case clang::CK_IntToOCLSampler: - case clang::CK_IntegralCast: - case clang::CK_IntegralComplexCast: - case clang::CK_IntegralComplexToBoolean: - case clang::CK_IntegralComplexToFloatingComplex: - case clang::CK_IntegralComplexToReal: - case clang::CK_IntegralRealToComplex: - case clang::CK_IntegralToBoolean: - case clang::CK_IntegralToFixedPoint: - case clang::CK_IntegralToFloating: - case clang::CK_IntegralToPointer: - case clang::CK_LValueBitCast: - case clang::CK_LValueToRValue: - case clang::CK_LValueToRValueBitCast: - case clang::CK_MatrixCast: - case clang::CK_MemberPointerToBoolean: - case clang::CK_NoOp: - case clang::CK_NonAtomicToAtomic: - case clang::CK_NullToMemberPointer: - case clang::CK_NullToPointer: - case clang::CK_ObjCObjectLValueCast: - case clang::CK_PointerToBoolean: - case clang::CK_PointerToIntegral: - case clang::CK_ReinterpretMemberPointer: - case clang::CK_ToUnion: - case clang::CK_ToVoid: - case clang::CK_UncheckedDerivedToBase: - case clang::CK_UserDefinedConversion: - case clang::CK_VectorSplat: - case clang::CK_ZeroToOCLOpaqueType: - case clang::CK_HLSLVectorTruncation: - case clang::CK_HLSLArrayRValue: - break; - } -}; - -static_assert((clang::CastKind)ZigClangCK_Dependent == clang::CK_Dependent, ""); -static_assert((clang::CastKind)ZigClangCK_BitCast == clang::CK_BitCast, ""); -static_assert((clang::CastKind)ZigClangCK_LValueBitCast == clang::CK_LValueBitCast, ""); -static_assert((clang::CastKind)ZigClangCK_LValueToRValueBitCast == clang::CK_LValueToRValueBitCast, ""); -static_assert((clang::CastKind)ZigClangCK_LValueToRValue == clang::CK_LValueToRValue, ""); -static_assert((clang::CastKind)ZigClangCK_NoOp == clang::CK_NoOp, ""); -static_assert((clang::CastKind)ZigClangCK_BaseToDerived == clang::CK_BaseToDerived, ""); -static_assert((clang::CastKind)ZigClangCK_DerivedToBase == clang::CK_DerivedToBase, ""); -static_assert((clang::CastKind)ZigClangCK_UncheckedDerivedToBase == clang::CK_UncheckedDerivedToBase, ""); -static_assert((clang::CastKind)ZigClangCK_Dynamic == clang::CK_Dynamic, ""); -static_assert((clang::CastKind)ZigClangCK_ToUnion == clang::CK_ToUnion, ""); -static_assert((clang::CastKind)ZigClangCK_ArrayToPointerDecay == clang::CK_ArrayToPointerDecay, ""); -static_assert((clang::CastKind)ZigClangCK_FunctionToPointerDecay == clang::CK_FunctionToPointerDecay, ""); -static_assert((clang::CastKind)ZigClangCK_NullToPointer == clang::CK_NullToPointer, ""); -static_assert((clang::CastKind)ZigClangCK_NullToMemberPointer == clang::CK_NullToMemberPointer, ""); -static_assert((clang::CastKind)ZigClangCK_BaseToDerivedMemberPointer == clang::CK_BaseToDerivedMemberPointer, ""); -static_assert((clang::CastKind)ZigClangCK_DerivedToBaseMemberPointer == clang::CK_DerivedToBaseMemberPointer, ""); -static_assert((clang::CastKind)ZigClangCK_MemberPointerToBoolean == clang::CK_MemberPointerToBoolean, ""); -static_assert((clang::CastKind)ZigClangCK_ReinterpretMemberPointer == clang::CK_ReinterpretMemberPointer, ""); -static_assert((clang::CastKind)ZigClangCK_UserDefinedConversion == clang::CK_UserDefinedConversion, ""); -static_assert((clang::CastKind)ZigClangCK_ConstructorConversion == clang::CK_ConstructorConversion, ""); -static_assert((clang::CastKind)ZigClangCK_IntegralToPointer == clang::CK_IntegralToPointer, ""); -static_assert((clang::CastKind)ZigClangCK_PointerToIntegral == clang::CK_PointerToIntegral, ""); -static_assert((clang::CastKind)ZigClangCK_PointerToBoolean == clang::CK_PointerToBoolean, ""); -static_assert((clang::CastKind)ZigClangCK_ToVoid == clang::CK_ToVoid, ""); -static_assert((clang::CastKind)ZigClangCK_MatrixCast == clang::CK_MatrixCast, ""); -static_assert((clang::CastKind)ZigClangCK_VectorSplat == clang::CK_VectorSplat, ""); -static_assert((clang::CastKind)ZigClangCK_IntegralCast == clang::CK_IntegralCast, ""); -static_assert((clang::CastKind)ZigClangCK_IntegralToBoolean == clang::CK_IntegralToBoolean, ""); -static_assert((clang::CastKind)ZigClangCK_IntegralToFloating == clang::CK_IntegralToFloating, ""); -static_assert((clang::CastKind)ZigClangCK_FloatingToFixedPoint == clang::CK_FloatingToFixedPoint, ""); -static_assert((clang::CastKind)ZigClangCK_FixedPointToFloating == clang::CK_FixedPointToFloating, ""); -static_assert((clang::CastKind)ZigClangCK_FixedPointCast == clang::CK_FixedPointCast, ""); -static_assert((clang::CastKind)ZigClangCK_FixedPointToIntegral == clang::CK_FixedPointToIntegral, ""); -static_assert((clang::CastKind)ZigClangCK_IntegralToFixedPoint == clang::CK_IntegralToFixedPoint, ""); -static_assert((clang::CastKind)ZigClangCK_FixedPointToBoolean == clang::CK_FixedPointToBoolean, ""); -static_assert((clang::CastKind)ZigClangCK_FloatingToIntegral == clang::CK_FloatingToIntegral, ""); -static_assert((clang::CastKind)ZigClangCK_FloatingToBoolean == clang::CK_FloatingToBoolean, ""); -static_assert((clang::CastKind)ZigClangCK_BooleanToSignedIntegral == clang::CK_BooleanToSignedIntegral, ""); -static_assert((clang::CastKind)ZigClangCK_FloatingCast == clang::CK_FloatingCast, ""); -static_assert((clang::CastKind)ZigClangCK_CPointerToObjCPointerCast == clang::CK_CPointerToObjCPointerCast, ""); -static_assert((clang::CastKind)ZigClangCK_BlockPointerToObjCPointerCast == clang::CK_BlockPointerToObjCPointerCast, ""); -static_assert((clang::CastKind)ZigClangCK_AnyPointerToBlockPointerCast == clang::CK_AnyPointerToBlockPointerCast, ""); -static_assert((clang::CastKind)ZigClangCK_ObjCObjectLValueCast == clang::CK_ObjCObjectLValueCast, ""); -static_assert((clang::CastKind)ZigClangCK_FloatingRealToComplex == clang::CK_FloatingRealToComplex, ""); -static_assert((clang::CastKind)ZigClangCK_FloatingComplexToReal == clang::CK_FloatingComplexToReal, ""); -static_assert((clang::CastKind)ZigClangCK_FloatingComplexToBoolean == clang::CK_FloatingComplexToBoolean, ""); -static_assert((clang::CastKind)ZigClangCK_FloatingComplexCast == clang::CK_FloatingComplexCast, ""); -static_assert((clang::CastKind)ZigClangCK_FloatingComplexToIntegralComplex == clang::CK_FloatingComplexToIntegralComplex, ""); -static_assert((clang::CastKind)ZigClangCK_IntegralRealToComplex == clang::CK_IntegralRealToComplex, ""); -static_assert((clang::CastKind)ZigClangCK_IntegralComplexToReal == clang::CK_IntegralComplexToReal, ""); -static_assert((clang::CastKind)ZigClangCK_IntegralComplexToBoolean == clang::CK_IntegralComplexToBoolean, ""); -static_assert((clang::CastKind)ZigClangCK_IntegralComplexCast == clang::CK_IntegralComplexCast, ""); -static_assert((clang::CastKind)ZigClangCK_IntegralComplexToFloatingComplex == clang::CK_IntegralComplexToFloatingComplex, ""); -static_assert((clang::CastKind)ZigClangCK_ARCProduceObject == clang::CK_ARCProduceObject, ""); -static_assert((clang::CastKind)ZigClangCK_ARCConsumeObject == clang::CK_ARCConsumeObject, ""); -static_assert((clang::CastKind)ZigClangCK_ARCReclaimReturnedObject == clang::CK_ARCReclaimReturnedObject, ""); -static_assert((clang::CastKind)ZigClangCK_ARCExtendBlockObject == clang::CK_ARCExtendBlockObject, ""); -static_assert((clang::CastKind)ZigClangCK_AtomicToNonAtomic == clang::CK_AtomicToNonAtomic, ""); -static_assert((clang::CastKind)ZigClangCK_NonAtomicToAtomic == clang::CK_NonAtomicToAtomic, ""); -static_assert((clang::CastKind)ZigClangCK_CopyAndAutoreleaseBlockObject == clang::CK_CopyAndAutoreleaseBlockObject, ""); -static_assert((clang::CastKind)ZigClangCK_BuiltinFnToFnPtr == clang::CK_BuiltinFnToFnPtr, ""); -static_assert((clang::CastKind)ZigClangCK_ZeroToOCLOpaqueType == clang::CK_ZeroToOCLOpaqueType, ""); -static_assert((clang::CastKind)ZigClangCK_AddressSpaceConversion == clang::CK_AddressSpaceConversion, ""); -static_assert((clang::CastKind)ZigClangCK_IntToOCLSampler == clang::CK_IntToOCLSampler, ""); - -// Detect additions to the enum -void ZigClang_detect_enum_TypeClass(clang::Type::TypeClass ty) { - switch (ty) { - case clang::Type::Builtin: - case clang::Type::Complex: - case clang::Type::Pointer: - case clang::Type::BlockPointer: - case clang::Type::CountAttributed: - case clang::Type::LValueReference: - case clang::Type::RValueReference: - case clang::Type::MemberPointer: - case clang::Type::ConstantArray: - case clang::Type::ArrayParameter: - case clang::Type::IncompleteArray: - case clang::Type::VariableArray: - case clang::Type::DependentSizedArray: - case clang::Type::DependentSizedExtVector: - case clang::Type::DependentAddressSpace: - case clang::Type::DependentBitInt: - case clang::Type::Vector: - case clang::Type::DependentVector: - case clang::Type::ExtVector: - case clang::Type::FunctionProto: - case clang::Type::FunctionNoProto: - case clang::Type::UnresolvedUsing: - case clang::Type::Using: - case clang::Type::Paren: - case clang::Type::Typedef: - case clang::Type::MacroQualified: - case clang::Type::ConstantMatrix: - case clang::Type::DependentSizedMatrix: - case clang::Type::Adjusted: - case clang::Type::Decayed: - case clang::Type::TypeOfExpr: - case clang::Type::TypeOf: - case clang::Type::Decltype: - case clang::Type::UnaryTransform: - case clang::Type::Record: - case clang::Type::Enum: - case clang::Type::Elaborated: - case clang::Type::Attributed: - case clang::Type::BTFTagAttributed: - case clang::Type::BitInt: - case clang::Type::TemplateTypeParm: - case clang::Type::SubstTemplateTypeParm: - case clang::Type::SubstTemplateTypeParmPack: - case clang::Type::TemplateSpecialization: - case clang::Type::Auto: - case clang::Type::DeducedTemplateSpecialization: - case clang::Type::HLSLAttributedResource: - case clang::Type::InjectedClassName: - case clang::Type::DependentName: - case clang::Type::DependentTemplateSpecialization: - case clang::Type::PackExpansion: - case clang::Type::PackIndexing: - case clang::Type::ObjCTypeParam: - case clang::Type::ObjCObject: - case clang::Type::ObjCInterface: - case clang::Type::ObjCObjectPointer: - case clang::Type::Pipe: - case clang::Type::Atomic: - break; - } -} - -static_assert((clang::Type::TypeClass)ZigClangType_Adjusted == clang::Type::Adjusted, ""); -static_assert((clang::Type::TypeClass)ZigClangType_Decayed == clang::Type::Decayed, ""); -static_assert((clang::Type::TypeClass)ZigClangType_ConstantArray == clang::Type::ConstantArray, ""); -static_assert((clang::Type::TypeClass)ZigClangType_ArrayParameter == clang::Type::ArrayParameter, ""); -static_assert((clang::Type::TypeClass)ZigClangType_DependentSizedArray == clang::Type::DependentSizedArray, ""); -static_assert((clang::Type::TypeClass)ZigClangType_IncompleteArray == clang::Type::IncompleteArray, ""); -static_assert((clang::Type::TypeClass)ZigClangType_VariableArray == clang::Type::VariableArray, ""); -static_assert((clang::Type::TypeClass)ZigClangType_Atomic == clang::Type::Atomic, ""); -static_assert((clang::Type::TypeClass)ZigClangType_Attributed == clang::Type::Attributed, ""); -static_assert((clang::Type::TypeClass)ZigClangType_BTFTagAttributed == clang::Type::BTFTagAttributed, ""); -static_assert((clang::Type::TypeClass)ZigClangType_BitInt == clang::Type::BitInt, ""); -static_assert((clang::Type::TypeClass)ZigClangType_BlockPointer == clang::Type::BlockPointer, ""); -static_assert((clang::Type::TypeClass)ZigClangType_CountAttributed == clang::Type::CountAttributed, ""); -static_assert((clang::Type::TypeClass)ZigClangType_Builtin == clang::Type::Builtin, ""); -static_assert((clang::Type::TypeClass)ZigClangType_Complex == clang::Type::Complex, ""); -static_assert((clang::Type::TypeClass)ZigClangType_Decltype == clang::Type::Decltype, ""); -static_assert((clang::Type::TypeClass)ZigClangType_Auto == clang::Type::Auto, ""); -static_assert((clang::Type::TypeClass)ZigClangType_DeducedTemplateSpecialization == clang::Type::DeducedTemplateSpecialization, ""); -static_assert((clang::Type::TypeClass)ZigClangType_DependentAddressSpace == clang::Type::DependentAddressSpace, ""); -static_assert((clang::Type::TypeClass)ZigClangType_DependentBitInt == clang::Type::DependentBitInt, ""); -static_assert((clang::Type::TypeClass)ZigClangType_DependentName == clang::Type::DependentName, ""); -static_assert((clang::Type::TypeClass)ZigClangType_DependentSizedExtVector == clang::Type::DependentSizedExtVector, ""); -static_assert((clang::Type::TypeClass)ZigClangType_DependentTemplateSpecialization == clang::Type::DependentTemplateSpecialization, ""); -static_assert((clang::Type::TypeClass)ZigClangType_DependentVector == clang::Type::DependentVector, ""); -static_assert((clang::Type::TypeClass)ZigClangType_Elaborated == clang::Type::Elaborated, ""); -static_assert((clang::Type::TypeClass)ZigClangType_FunctionNoProto == clang::Type::FunctionNoProto, ""); -static_assert((clang::Type::TypeClass)ZigClangType_FunctionProto == clang::Type::FunctionProto, ""); -static_assert((clang::Type::TypeClass)ZigClangType_HLSLAttributedResource == clang::Type::HLSLAttributedResource, ""); -static_assert((clang::Type::TypeClass)ZigClangType_InjectedClassName == clang::Type::InjectedClassName, ""); -static_assert((clang::Type::TypeClass)ZigClangType_MacroQualified == clang::Type::MacroQualified, ""); -static_assert((clang::Type::TypeClass)ZigClangType_ConstantMatrix == clang::Type::ConstantMatrix, ""); -static_assert((clang::Type::TypeClass)ZigClangType_DependentSizedMatrix == clang::Type::DependentSizedMatrix, ""); -static_assert((clang::Type::TypeClass)ZigClangType_MemberPointer == clang::Type::MemberPointer, ""); -static_assert((clang::Type::TypeClass)ZigClangType_ObjCObjectPointer == clang::Type::ObjCObjectPointer, ""); -static_assert((clang::Type::TypeClass)ZigClangType_ObjCObject == clang::Type::ObjCObject, ""); -static_assert((clang::Type::TypeClass)ZigClangType_ObjCInterface == clang::Type::ObjCInterface, ""); -static_assert((clang::Type::TypeClass)ZigClangType_ObjCTypeParam == clang::Type::ObjCTypeParam, ""); -static_assert((clang::Type::TypeClass)ZigClangType_PackExpansion == clang::Type::PackExpansion, ""); -static_assert((clang::Type::TypeClass)ZigClangType_PackIndexing == clang::Type::PackIndexing, ""); -static_assert((clang::Type::TypeClass)ZigClangType_Paren == clang::Type::Paren, ""); -static_assert((clang::Type::TypeClass)ZigClangType_Pipe == clang::Type::Pipe, ""); -static_assert((clang::Type::TypeClass)ZigClangType_Pointer == clang::Type::Pointer, ""); -static_assert((clang::Type::TypeClass)ZigClangType_LValueReference == clang::Type::LValueReference, ""); -static_assert((clang::Type::TypeClass)ZigClangType_RValueReference == clang::Type::RValueReference, ""); -static_assert((clang::Type::TypeClass)ZigClangType_SubstTemplateTypeParmPack == clang::Type::SubstTemplateTypeParmPack, ""); -static_assert((clang::Type::TypeClass)ZigClangType_SubstTemplateTypeParm == clang::Type::SubstTemplateTypeParm, ""); -static_assert((clang::Type::TypeClass)ZigClangType_Enum == clang::Type::Enum, ""); -static_assert((clang::Type::TypeClass)ZigClangType_Record == clang::Type::Record, ""); -static_assert((clang::Type::TypeClass)ZigClangType_TemplateSpecialization == clang::Type::TemplateSpecialization, ""); -static_assert((clang::Type::TypeClass)ZigClangType_TemplateTypeParm == clang::Type::TemplateTypeParm, ""); -static_assert((clang::Type::TypeClass)ZigClangType_TypeOfExpr == clang::Type::TypeOfExpr, ""); -static_assert((clang::Type::TypeClass)ZigClangType_TypeOf == clang::Type::TypeOf, ""); -static_assert((clang::Type::TypeClass)ZigClangType_Typedef == clang::Type::Typedef, ""); -static_assert((clang::Type::TypeClass)ZigClangType_UnaryTransform == clang::Type::UnaryTransform, ""); -static_assert((clang::Type::TypeClass)ZigClangType_UnresolvedUsing == clang::Type::UnresolvedUsing, ""); -static_assert((clang::Type::TypeClass)ZigClangType_Using == clang::Type::Using, ""); -static_assert((clang::Type::TypeClass)ZigClangType_Vector == clang::Type::Vector, ""); -static_assert((clang::Type::TypeClass)ZigClangType_ExtVector == clang::Type::ExtVector, ""); - -// Detect additions to the enum -void ZigClang_detect_enum_StmtClass(clang::Stmt::StmtClass x) { - switch (x) { - case clang::Stmt::NoStmtClass: - case clang::Stmt::WhileStmtClass: - case clang::Stmt::LabelStmtClass: - case clang::Stmt::VAArgExprClass: - case clang::Stmt::UnaryOperatorClass: - case clang::Stmt::UnaryExprOrTypeTraitExprClass: - case clang::Stmt::TypoExprClass: - case clang::Stmt::TypeTraitExprClass: - case clang::Stmt::SubstNonTypeTemplateParmPackExprClass: - case clang::Stmt::SubstNonTypeTemplateParmExprClass: - case clang::Stmt::StringLiteralClass: - case clang::Stmt::StmtExprClass: - case clang::Stmt::SourceLocExprClass: - case clang::Stmt::SizeOfPackExprClass: - case clang::Stmt::ShuffleVectorExprClass: - case clang::Stmt::SYCLUniqueStableNameExprClass: - case clang::Stmt::RequiresExprClass: - case clang::Stmt::RecoveryExprClass: - case clang::Stmt::PseudoObjectExprClass: - case clang::Stmt::PredefinedExprClass: - case clang::Stmt::ParenListExprClass: - case clang::Stmt::ParenExprClass: - case clang::Stmt::PackIndexingExprClass: - case clang::Stmt::PackExpansionExprClass: - case clang::Stmt::UnresolvedMemberExprClass: - case clang::Stmt::UnresolvedLookupExprClass: - case clang::Stmt::OpenACCAsteriskSizeExprClass: - case clang::Stmt::OpaqueValueExprClass: - case clang::Stmt::OffsetOfExprClass: - case clang::Stmt::ObjCSubscriptRefExprClass: - case clang::Stmt::ObjCStringLiteralClass: - case clang::Stmt::ObjCSelectorExprClass: - case clang::Stmt::ObjCProtocolExprClass: - case clang::Stmt::ObjCPropertyRefExprClass: - case clang::Stmt::ObjCMessageExprClass: - case clang::Stmt::ObjCIvarRefExprClass: - case clang::Stmt::ObjCIsaExprClass: - case clang::Stmt::ObjCIndirectCopyRestoreExprClass: - case clang::Stmt::ObjCEncodeExprClass: - case clang::Stmt::ObjCDictionaryLiteralClass: - case clang::Stmt::ObjCBoxedExprClass: - case clang::Stmt::ObjCBoolLiteralExprClass: - case clang::Stmt::ObjCAvailabilityCheckExprClass: - case clang::Stmt::ObjCArrayLiteralClass: - case clang::Stmt::OMPIteratorExprClass: - case clang::Stmt::OMPArrayShapingExprClass: - case clang::Stmt::NoInitExprClass: - case clang::Stmt::MemberExprClass: - case clang::Stmt::MatrixSubscriptExprClass: - case clang::Stmt::MaterializeTemporaryExprClass: - case clang::Stmt::MSPropertySubscriptExprClass: - case clang::Stmt::MSPropertyRefExprClass: - case clang::Stmt::LambdaExprClass: - case clang::Stmt::IntegerLiteralClass: - case clang::Stmt::InitListExprClass: - case clang::Stmt::ImplicitValueInitExprClass: - case clang::Stmt::ImaginaryLiteralClass: - case clang::Stmt::HLSLOutArgExprClass: - case clang::Stmt::GenericSelectionExprClass: - case clang::Stmt::GNUNullExprClass: - case clang::Stmt::FunctionParmPackExprClass: - case clang::Stmt::ExprWithCleanupsClass: - case clang::Stmt::ConstantExprClass: - case clang::Stmt::FloatingLiteralClass: - case clang::Stmt::FixedPointLiteralClass: - case clang::Stmt::ExtVectorElementExprClass: - case clang::Stmt::ExpressionTraitExprClass: - case clang::Stmt::EmbedExprClass: - case clang::Stmt::DesignatedInitUpdateExprClass: - case clang::Stmt::DesignatedInitExprClass: - case clang::Stmt::DependentScopeDeclRefExprClass: - case clang::Stmt::DependentCoawaitExprClass: - case clang::Stmt::DeclRefExprClass: - case clang::Stmt::CoyieldExprClass: - case clang::Stmt::CoawaitExprClass: - case clang::Stmt::ConvertVectorExprClass: - case clang::Stmt::ConceptSpecializationExprClass: - case clang::Stmt::CompoundLiteralExprClass: - case clang::Stmt::ChooseExprClass: - case clang::Stmt::CharacterLiteralClass: - case clang::Stmt::ImplicitCastExprClass: - case clang::Stmt::ObjCBridgedCastExprClass: - case clang::Stmt::CXXStaticCastExprClass: - case clang::Stmt::CXXReinterpretCastExprClass: - case clang::Stmt::CXXDynamicCastExprClass: - case clang::Stmt::CXXConstCastExprClass: - case clang::Stmt::CXXAddrspaceCastExprClass: - case clang::Stmt::CXXFunctionalCastExprClass: - case clang::Stmt::CStyleCastExprClass: - case clang::Stmt::BuiltinBitCastExprClass: - case clang::Stmt::CallExprClass: - case clang::Stmt::UserDefinedLiteralClass: - case clang::Stmt::CXXOperatorCallExprClass: - case clang::Stmt::CXXMemberCallExprClass: - case clang::Stmt::CUDAKernelCallExprClass: - case clang::Stmt::CXXUuidofExprClass: - case clang::Stmt::CXXUnresolvedConstructExprClass: - case clang::Stmt::CXXTypeidExprClass: - case clang::Stmt::CXXThrowExprClass: - case clang::Stmt::CXXThisExprClass: - case clang::Stmt::CXXStdInitializerListExprClass: - case clang::Stmt::CXXScalarValueInitExprClass: - case clang::Stmt::CXXRewrittenBinaryOperatorClass: - case clang::Stmt::CXXPseudoDestructorExprClass: - case clang::Stmt::CXXParenListInitExprClass: - case clang::Stmt::CXXNullPtrLiteralExprClass: - case clang::Stmt::CXXNoexceptExprClass: - case clang::Stmt::CXXNewExprClass: - case clang::Stmt::CXXInheritedCtorInitExprClass: - case clang::Stmt::CXXFoldExprClass: - case clang::Stmt::CXXDependentScopeMemberExprClass: - case clang::Stmt::CXXDeleteExprClass: - case clang::Stmt::CXXDefaultInitExprClass: - case clang::Stmt::CXXDefaultArgExprClass: - case clang::Stmt::CXXConstructExprClass: - case clang::Stmt::CXXTemporaryObjectExprClass: - case clang::Stmt::CXXBoolLiteralExprClass: - case clang::Stmt::CXXBindTemporaryExprClass: - case clang::Stmt::BlockExprClass: - case clang::Stmt::BinaryOperatorClass: - case clang::Stmt::CompoundAssignOperatorClass: - case clang::Stmt::AtomicExprClass: - case clang::Stmt::AsTypeExprClass: - case clang::Stmt::ArrayTypeTraitExprClass: - case clang::Stmt::ArraySubscriptExprClass: - case clang::Stmt::ArraySectionExprClass: - case clang::Stmt::ArrayInitLoopExprClass: - case clang::Stmt::ArrayInitIndexExprClass: - case clang::Stmt::AddrLabelExprClass: - case clang::Stmt::ConditionalOperatorClass: - case clang::Stmt::BinaryConditionalOperatorClass: - case clang::Stmt::AttributedStmtClass: - case clang::Stmt::SwitchStmtClass: - case clang::Stmt::DefaultStmtClass: - case clang::Stmt::CaseStmtClass: - case clang::Stmt::SYCLKernelCallStmtClass: - case clang::Stmt::SEHTryStmtClass: - case clang::Stmt::SEHLeaveStmtClass: - case clang::Stmt::SEHFinallyStmtClass: - case clang::Stmt::SEHExceptStmtClass: - case clang::Stmt::ReturnStmtClass: - case clang::Stmt::OpenACCWaitConstructClass: - case clang::Stmt::OpenACCUpdateConstructClass: - case clang::Stmt::OpenACCShutdownConstructClass: - case clang::Stmt::OpenACCSetConstructClass: - case clang::Stmt::OpenACCInitConstructClass: - case clang::Stmt::OpenACCExitDataConstructClass: - case clang::Stmt::OpenACCEnterDataConstructClass: - case clang::Stmt::OpenACCLoopConstructClass: - case clang::Stmt::OpenACCHostDataConstructClass: - case clang::Stmt::OpenACCDataConstructClass: - case clang::Stmt::OpenACCComputeConstructClass: - case clang::Stmt::OpenACCCombinedConstructClass: - case clang::Stmt::ObjCForCollectionStmtClass: - case clang::Stmt::ObjCAutoreleasePoolStmtClass: - case clang::Stmt::ObjCAtTryStmtClass: - case clang::Stmt::ObjCAtThrowStmtClass: - case clang::Stmt::ObjCAtSynchronizedStmtClass: - case clang::Stmt::ObjCAtFinallyStmtClass: - case clang::Stmt::ObjCAtCatchStmtClass: - case clang::Stmt::OMPTeamsDirectiveClass: - case clang::Stmt::OMPTaskyieldDirectiveClass: - case clang::Stmt::OMPTaskwaitDirectiveClass: - case clang::Stmt::OMPTaskgroupDirectiveClass: - case clang::Stmt::OMPTaskDirectiveClass: - case clang::Stmt::OMPTargetUpdateDirectiveClass: - case clang::Stmt::OMPTargetTeamsDirectiveClass: - case clang::Stmt::OMPTargetParallelForDirectiveClass: - case clang::Stmt::OMPTargetParallelDirectiveClass: - case clang::Stmt::OMPTargetExitDataDirectiveClass: - case clang::Stmt::OMPTargetEnterDataDirectiveClass: - case clang::Stmt::OMPTargetDirectiveClass: - case clang::Stmt::OMPTargetDataDirectiveClass: - case clang::Stmt::OMPSingleDirectiveClass: - case clang::Stmt::OMPSectionsDirectiveClass: - case clang::Stmt::OMPSectionDirectiveClass: - case clang::Stmt::OMPScopeDirectiveClass: - case clang::Stmt::OMPScanDirectiveClass: - case clang::Stmt::OMPParallelSectionsDirectiveClass: - case clang::Stmt::OMPParallelMasterDirectiveClass: - case clang::Stmt::OMPParallelMaskedDirectiveClass: - case clang::Stmt::OMPParallelDirectiveClass: - case clang::Stmt::OMPOrderedDirectiveClass: - case clang::Stmt::OMPMetaDirectiveClass: - case clang::Stmt::OMPMasterDirectiveClass: - case clang::Stmt::OMPMaskedDirectiveClass: - case clang::Stmt::OMPUnrollDirectiveClass: - case clang::Stmt::OMPTileDirectiveClass: - case clang::Stmt::OMPReverseDirectiveClass: - case clang::Stmt::OMPInterchangeDirectiveClass: - case clang::Stmt::OMPTeamsGenericLoopDirectiveClass: - case clang::Stmt::OMPTeamsDistributeSimdDirectiveClass: - case clang::Stmt::OMPTeamsDistributeParallelForSimdDirectiveClass: - case clang::Stmt::OMPTeamsDistributeParallelForDirectiveClass: - case clang::Stmt::OMPTeamsDistributeDirectiveClass: - case clang::Stmt::OMPTaskLoopSimdDirectiveClass: - case clang::Stmt::OMPTaskLoopDirectiveClass: - case clang::Stmt::OMPTargetTeamsGenericLoopDirectiveClass: - case clang::Stmt::OMPTargetTeamsDistributeSimdDirectiveClass: - case clang::Stmt::OMPTargetTeamsDistributeParallelForSimdDirectiveClass: - case clang::Stmt::OMPTargetTeamsDistributeParallelForDirectiveClass: - case clang::Stmt::OMPTargetTeamsDistributeDirectiveClass: - case clang::Stmt::OMPTargetSimdDirectiveClass: - case clang::Stmt::OMPTargetParallelGenericLoopDirectiveClass: - case clang::Stmt::OMPTargetParallelForSimdDirectiveClass: - case clang::Stmt::OMPSimdDirectiveClass: - case clang::Stmt::OMPParallelMasterTaskLoopSimdDirectiveClass: - case clang::Stmt::OMPParallelMasterTaskLoopDirectiveClass: - case clang::Stmt::OMPParallelMaskedTaskLoopSimdDirectiveClass: - case clang::Stmt::OMPParallelMaskedTaskLoopDirectiveClass: - case clang::Stmt::OMPParallelGenericLoopDirectiveClass: - case clang::Stmt::OMPParallelForSimdDirectiveClass: - case clang::Stmt::OMPParallelForDirectiveClass: - case clang::Stmt::OMPMasterTaskLoopSimdDirectiveClass: - case clang::Stmt::OMPMasterTaskLoopDirectiveClass: - case clang::Stmt::OMPMaskedTaskLoopSimdDirectiveClass: - case clang::Stmt::OMPMaskedTaskLoopDirectiveClass: - case clang::Stmt::OMPGenericLoopDirectiveClass: - case clang::Stmt::OMPForSimdDirectiveClass: - case clang::Stmt::OMPForDirectiveClass: - case clang::Stmt::OMPDistributeSimdDirectiveClass: - case clang::Stmt::OMPDistributeParallelForSimdDirectiveClass: - case clang::Stmt::OMPDistributeParallelForDirectiveClass: - case clang::Stmt::OMPDistributeDirectiveClass: - case clang::Stmt::OMPInteropDirectiveClass: - case clang::Stmt::OMPFlushDirectiveClass: - case clang::Stmt::OMPErrorDirectiveClass: - case clang::Stmt::OMPDispatchDirectiveClass: - case clang::Stmt::OMPDepobjDirectiveClass: - case clang::Stmt::OMPCriticalDirectiveClass: - case clang::Stmt::OMPCancellationPointDirectiveClass: - case clang::Stmt::OMPCancelDirectiveClass: - case clang::Stmt::OMPBarrierDirectiveClass: - case clang::Stmt::OMPAtomicDirectiveClass: - case clang::Stmt::OMPAssumeDirectiveClass: - case clang::Stmt::OMPCanonicalLoopClass: - case clang::Stmt::NullStmtClass: - case clang::Stmt::MSDependentExistsStmtClass: - case clang::Stmt::IndirectGotoStmtClass: - case clang::Stmt::IfStmtClass: - case clang::Stmt::GotoStmtClass: - case clang::Stmt::ForStmtClass: - case clang::Stmt::DoStmtClass: - case clang::Stmt::DeclStmtClass: - case clang::Stmt::CoroutineBodyStmtClass: - case clang::Stmt::CoreturnStmtClass: - case clang::Stmt::ContinueStmtClass: - case clang::Stmt::CompoundStmtClass: - case clang::Stmt::CapturedStmtClass: - case clang::Stmt::CXXTryStmtClass: - case clang::Stmt::CXXForRangeStmtClass: - case clang::Stmt::CXXCatchStmtClass: - case clang::Stmt::BreakStmtClass: - case clang::Stmt::MSAsmStmtClass: - case clang::Stmt::GCCAsmStmtClass: - break; - } -} - -static_assert((clang::Stmt::StmtClass)ZigClangStmt_NoStmtClass == clang::Stmt::NoStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_WhileStmtClass == clang::Stmt::WhileStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_LabelStmtClass == clang::Stmt::LabelStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_VAArgExprClass == clang::Stmt::VAArgExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_UnaryOperatorClass == clang::Stmt::UnaryOperatorClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_UnaryExprOrTypeTraitExprClass == clang::Stmt::UnaryExprOrTypeTraitExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_TypoExprClass == clang::Stmt::TypoExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_TypeTraitExprClass == clang::Stmt::TypeTraitExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_SubstNonTypeTemplateParmPackExprClass == clang::Stmt::SubstNonTypeTemplateParmPackExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_SubstNonTypeTemplateParmExprClass == clang::Stmt::SubstNonTypeTemplateParmExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_StringLiteralClass == clang::Stmt::StringLiteralClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_StmtExprClass == clang::Stmt::StmtExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_SourceLocExprClass == clang::Stmt::SourceLocExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_SizeOfPackExprClass == clang::Stmt::SizeOfPackExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ShuffleVectorExprClass == clang::Stmt::ShuffleVectorExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_SYCLUniqueStableNameExprClass == clang::Stmt::SYCLUniqueStableNameExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_RequiresExprClass == clang::Stmt::RequiresExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_RecoveryExprClass == clang::Stmt::RecoveryExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_PseudoObjectExprClass == clang::Stmt::PseudoObjectExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_PredefinedExprClass == clang::Stmt::PredefinedExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ParenListExprClass == clang::Stmt::ParenListExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ParenExprClass == clang::Stmt::ParenExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_PackIndexingExprClass == clang::Stmt::PackIndexingExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_PackExpansionExprClass == clang::Stmt::PackExpansionExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_UnresolvedMemberExprClass == clang::Stmt::UnresolvedMemberExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_UnresolvedLookupExprClass == clang::Stmt::UnresolvedLookupExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OpenACCAsteriskSizeExprClass == clang::Stmt::OpenACCAsteriskSizeExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OpaqueValueExprClass == clang::Stmt::OpaqueValueExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OffsetOfExprClass == clang::Stmt::OffsetOfExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCSubscriptRefExprClass == clang::Stmt::ObjCSubscriptRefExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCStringLiteralClass == clang::Stmt::ObjCStringLiteralClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCSelectorExprClass == clang::Stmt::ObjCSelectorExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCProtocolExprClass == clang::Stmt::ObjCProtocolExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCPropertyRefExprClass == clang::Stmt::ObjCPropertyRefExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCMessageExprClass == clang::Stmt::ObjCMessageExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCIvarRefExprClass == clang::Stmt::ObjCIvarRefExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCIsaExprClass == clang::Stmt::ObjCIsaExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCIndirectCopyRestoreExprClass == clang::Stmt::ObjCIndirectCopyRestoreExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCEncodeExprClass == clang::Stmt::ObjCEncodeExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCDictionaryLiteralClass == clang::Stmt::ObjCDictionaryLiteralClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCBoxedExprClass == clang::Stmt::ObjCBoxedExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCBoolLiteralExprClass == clang::Stmt::ObjCBoolLiteralExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCAvailabilityCheckExprClass == clang::Stmt::ObjCAvailabilityCheckExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCArrayLiteralClass == clang::Stmt::ObjCArrayLiteralClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPIteratorExprClass == clang::Stmt::OMPIteratorExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPArrayShapingExprClass == clang::Stmt::OMPArrayShapingExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_NoInitExprClass == clang::Stmt::NoInitExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_MemberExprClass == clang::Stmt::MemberExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_MatrixSubscriptExprClass == clang::Stmt::MatrixSubscriptExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_MaterializeTemporaryExprClass == clang::Stmt::MaterializeTemporaryExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_MSPropertySubscriptExprClass == clang::Stmt::MSPropertySubscriptExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_MSPropertyRefExprClass == clang::Stmt::MSPropertyRefExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_LambdaExprClass == clang::Stmt::LambdaExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_IntegerLiteralClass == clang::Stmt::IntegerLiteralClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_InitListExprClass == clang::Stmt::InitListExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ImplicitValueInitExprClass == clang::Stmt::ImplicitValueInitExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ImaginaryLiteralClass == clang::Stmt::ImaginaryLiteralClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_HLSLOutArgExprClass == clang::Stmt::HLSLOutArgExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_GenericSelectionExprClass == clang::Stmt::GenericSelectionExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_GNUNullExprClass == clang::Stmt::GNUNullExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_FunctionParmPackExprClass == clang::Stmt::FunctionParmPackExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ExprWithCleanupsClass == clang::Stmt::ExprWithCleanupsClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ConstantExprClass == clang::Stmt::ConstantExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_FloatingLiteralClass == clang::Stmt::FloatingLiteralClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_FixedPointLiteralClass == clang::Stmt::FixedPointLiteralClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ExtVectorElementExprClass == clang::Stmt::ExtVectorElementExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ExpressionTraitExprClass == clang::Stmt::ExpressionTraitExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_EmbedExprClass == clang::Stmt::EmbedExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_DesignatedInitUpdateExprClass == clang::Stmt::DesignatedInitUpdateExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_DesignatedInitExprClass == clang::Stmt::DesignatedInitExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_DependentScopeDeclRefExprClass == clang::Stmt::DependentScopeDeclRefExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_DependentCoawaitExprClass == clang::Stmt::DependentCoawaitExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_DeclRefExprClass == clang::Stmt::DeclRefExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CoyieldExprClass == clang::Stmt::CoyieldExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CoawaitExprClass == clang::Stmt::CoawaitExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ConvertVectorExprClass == clang::Stmt::ConvertVectorExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ConceptSpecializationExprClass == clang::Stmt::ConceptSpecializationExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CompoundLiteralExprClass == clang::Stmt::CompoundLiteralExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ChooseExprClass == clang::Stmt::ChooseExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CharacterLiteralClass == clang::Stmt::CharacterLiteralClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ImplicitCastExprClass == clang::Stmt::ImplicitCastExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCBridgedCastExprClass == clang::Stmt::ObjCBridgedCastExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXStaticCastExprClass == clang::Stmt::CXXStaticCastExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXReinterpretCastExprClass == clang::Stmt::CXXReinterpretCastExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXDynamicCastExprClass == clang::Stmt::CXXDynamicCastExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXConstCastExprClass == clang::Stmt::CXXConstCastExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXAddrspaceCastExprClass == clang::Stmt::CXXAddrspaceCastExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXFunctionalCastExprClass == clang::Stmt::CXXFunctionalCastExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CStyleCastExprClass == clang::Stmt::CStyleCastExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_BuiltinBitCastExprClass == clang::Stmt::BuiltinBitCastExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CallExprClass == clang::Stmt::CallExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_UserDefinedLiteralClass == clang::Stmt::UserDefinedLiteralClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXOperatorCallExprClass == clang::Stmt::CXXOperatorCallExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXMemberCallExprClass == clang::Stmt::CXXMemberCallExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CUDAKernelCallExprClass == clang::Stmt::CUDAKernelCallExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXUuidofExprClass == clang::Stmt::CXXUuidofExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXUnresolvedConstructExprClass == clang::Stmt::CXXUnresolvedConstructExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXTypeidExprClass == clang::Stmt::CXXTypeidExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXThrowExprClass == clang::Stmt::CXXThrowExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXThisExprClass == clang::Stmt::CXXThisExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXStdInitializerListExprClass == clang::Stmt::CXXStdInitializerListExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXScalarValueInitExprClass == clang::Stmt::CXXScalarValueInitExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXRewrittenBinaryOperatorClass == clang::Stmt::CXXRewrittenBinaryOperatorClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXPseudoDestructorExprClass == clang::Stmt::CXXPseudoDestructorExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXParenListInitExprClass == clang::Stmt::CXXParenListInitExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXNullPtrLiteralExprClass == clang::Stmt::CXXNullPtrLiteralExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXNoexceptExprClass == clang::Stmt::CXXNoexceptExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXNewExprClass == clang::Stmt::CXXNewExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXInheritedCtorInitExprClass == clang::Stmt::CXXInheritedCtorInitExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXFoldExprClass == clang::Stmt::CXXFoldExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXDependentScopeMemberExprClass == clang::Stmt::CXXDependentScopeMemberExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXDeleteExprClass == clang::Stmt::CXXDeleteExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXDefaultInitExprClass == clang::Stmt::CXXDefaultInitExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXDefaultArgExprClass == clang::Stmt::CXXDefaultArgExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXConstructExprClass == clang::Stmt::CXXConstructExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXTemporaryObjectExprClass == clang::Stmt::CXXTemporaryObjectExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXBoolLiteralExprClass == clang::Stmt::CXXBoolLiteralExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXBindTemporaryExprClass == clang::Stmt::CXXBindTemporaryExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_BlockExprClass == clang::Stmt::BlockExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_BinaryOperatorClass == clang::Stmt::BinaryOperatorClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CompoundAssignOperatorClass == clang::Stmt::CompoundAssignOperatorClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_AtomicExprClass == clang::Stmt::AtomicExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_AsTypeExprClass == clang::Stmt::AsTypeExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ArrayTypeTraitExprClass == clang::Stmt::ArrayTypeTraitExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ArraySubscriptExprClass == clang::Stmt::ArraySubscriptExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ArraySectionExprClass == clang::Stmt::ArraySectionExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ArrayInitLoopExprClass == clang::Stmt::ArrayInitLoopExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ArrayInitIndexExprClass == clang::Stmt::ArrayInitIndexExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_AddrLabelExprClass == clang::Stmt::AddrLabelExprClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ConditionalOperatorClass == clang::Stmt::ConditionalOperatorClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_BinaryConditionalOperatorClass == clang::Stmt::BinaryConditionalOperatorClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_AttributedStmtClass == clang::Stmt::AttributedStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_SwitchStmtClass == clang::Stmt::SwitchStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_DefaultStmtClass == clang::Stmt::DefaultStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CaseStmtClass == clang::Stmt::CaseStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_SYCLKernelCallStmtClass == clang::Stmt::SYCLKernelCallStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_SEHTryStmtClass == clang::Stmt::SEHTryStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_SEHLeaveStmtClass == clang::Stmt::SEHLeaveStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_SEHFinallyStmtClass == clang::Stmt::SEHFinallyStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_SEHExceptStmtClass == clang::Stmt::SEHExceptStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ReturnStmtClass == clang::Stmt::ReturnStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OpenACCWaitConstructClass == clang::Stmt::OpenACCWaitConstructClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OpenACCUpdateConstructClass == clang::Stmt::OpenACCUpdateConstructClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OpenACCShutdownConstructClass == clang::Stmt::OpenACCShutdownConstructClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OpenACCSetConstructClass == clang::Stmt::OpenACCSetConstructClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OpenACCInitConstructClass == clang::Stmt::OpenACCInitConstructClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OpenACCExitDataConstructClass == clang::Stmt::OpenACCExitDataConstructClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OpenACCEnterDataConstructClass == clang::Stmt::OpenACCEnterDataConstructClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OpenACCLoopConstructClass == clang::Stmt::OpenACCLoopConstructClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OpenACCHostDataConstructClass == clang::Stmt::OpenACCHostDataConstructClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OpenACCDataConstructClass == clang::Stmt::OpenACCDataConstructClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OpenACCComputeConstructClass == clang::Stmt::OpenACCComputeConstructClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OpenACCCombinedConstructClass == clang::Stmt::OpenACCCombinedConstructClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCForCollectionStmtClass == clang::Stmt::ObjCForCollectionStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCAutoreleasePoolStmtClass == clang::Stmt::ObjCAutoreleasePoolStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCAtTryStmtClass == clang::Stmt::ObjCAtTryStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCAtThrowStmtClass == clang::Stmt::ObjCAtThrowStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCAtSynchronizedStmtClass == clang::Stmt::ObjCAtSynchronizedStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCAtFinallyStmtClass == clang::Stmt::ObjCAtFinallyStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ObjCAtCatchStmtClass == clang::Stmt::ObjCAtCatchStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTeamsDirectiveClass == clang::Stmt::OMPTeamsDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTaskyieldDirectiveClass == clang::Stmt::OMPTaskyieldDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTaskwaitDirectiveClass == clang::Stmt::OMPTaskwaitDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTaskgroupDirectiveClass == clang::Stmt::OMPTaskgroupDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTaskDirectiveClass == clang::Stmt::OMPTaskDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetUpdateDirectiveClass == clang::Stmt::OMPTargetUpdateDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetTeamsDirectiveClass == clang::Stmt::OMPTargetTeamsDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetParallelForDirectiveClass == clang::Stmt::OMPTargetParallelForDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetParallelDirectiveClass == clang::Stmt::OMPTargetParallelDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetExitDataDirectiveClass == clang::Stmt::OMPTargetExitDataDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetEnterDataDirectiveClass == clang::Stmt::OMPTargetEnterDataDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetDirectiveClass == clang::Stmt::OMPTargetDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetDataDirectiveClass == clang::Stmt::OMPTargetDataDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPSingleDirectiveClass == clang::Stmt::OMPSingleDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPSectionsDirectiveClass == clang::Stmt::OMPSectionsDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPSectionDirectiveClass == clang::Stmt::OMPSectionDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPScopeDirectiveClass == clang::Stmt::OMPScopeDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPScanDirectiveClass == clang::Stmt::OMPScanDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelSectionsDirectiveClass == clang::Stmt::OMPParallelSectionsDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelMasterDirectiveClass == clang::Stmt::OMPParallelMasterDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelMaskedDirectiveClass == clang::Stmt::OMPParallelMaskedDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelDirectiveClass == clang::Stmt::OMPParallelDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPOrderedDirectiveClass == clang::Stmt::OMPOrderedDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPMetaDirectiveClass == clang::Stmt::OMPMetaDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPMasterDirectiveClass == clang::Stmt::OMPMasterDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPMaskedDirectiveClass == clang::Stmt::OMPMaskedDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPUnrollDirectiveClass == clang::Stmt::OMPUnrollDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTileDirectiveClass == clang::Stmt::OMPTileDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPReverseDirectiveClass == clang::Stmt::OMPReverseDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPInterchangeDirectiveClass == clang::Stmt::OMPInterchangeDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTeamsGenericLoopDirectiveClass == clang::Stmt::OMPTeamsGenericLoopDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTeamsDistributeSimdDirectiveClass == clang::Stmt::OMPTeamsDistributeSimdDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTeamsDistributeParallelForSimdDirectiveClass == clang::Stmt::OMPTeamsDistributeParallelForSimdDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTeamsDistributeParallelForDirectiveClass == clang::Stmt::OMPTeamsDistributeParallelForDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTeamsDistributeDirectiveClass == clang::Stmt::OMPTeamsDistributeDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTaskLoopSimdDirectiveClass == clang::Stmt::OMPTaskLoopSimdDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTaskLoopDirectiveClass == clang::Stmt::OMPTaskLoopDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetTeamsGenericLoopDirectiveClass == clang::Stmt::OMPTargetTeamsGenericLoopDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetTeamsDistributeSimdDirectiveClass == clang::Stmt::OMPTargetTeamsDistributeSimdDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetTeamsDistributeParallelForSimdDirectiveClass == clang::Stmt::OMPTargetTeamsDistributeParallelForSimdDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetTeamsDistributeParallelForDirectiveClass == clang::Stmt::OMPTargetTeamsDistributeParallelForDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetTeamsDistributeDirectiveClass == clang::Stmt::OMPTargetTeamsDistributeDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetSimdDirectiveClass == clang::Stmt::OMPTargetSimdDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetParallelGenericLoopDirectiveClass == clang::Stmt::OMPTargetParallelGenericLoopDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPTargetParallelForSimdDirectiveClass == clang::Stmt::OMPTargetParallelForSimdDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPSimdDirectiveClass == clang::Stmt::OMPSimdDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelMasterTaskLoopSimdDirectiveClass == clang::Stmt::OMPParallelMasterTaskLoopSimdDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelMasterTaskLoopDirectiveClass == clang::Stmt::OMPParallelMasterTaskLoopDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelMaskedTaskLoopSimdDirectiveClass == clang::Stmt::OMPParallelMaskedTaskLoopSimdDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelMaskedTaskLoopDirectiveClass == clang::Stmt::OMPParallelMaskedTaskLoopDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelGenericLoopDirectiveClass == clang::Stmt::OMPParallelGenericLoopDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelForSimdDirectiveClass == clang::Stmt::OMPParallelForSimdDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPParallelForDirectiveClass == clang::Stmt::OMPParallelForDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPMasterTaskLoopSimdDirectiveClass == clang::Stmt::OMPMasterTaskLoopSimdDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPMasterTaskLoopDirectiveClass == clang::Stmt::OMPMasterTaskLoopDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPMaskedTaskLoopSimdDirectiveClass == clang::Stmt::OMPMaskedTaskLoopSimdDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPMaskedTaskLoopDirectiveClass == clang::Stmt::OMPMaskedTaskLoopDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPGenericLoopDirectiveClass == clang::Stmt::OMPGenericLoopDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPForSimdDirectiveClass == clang::Stmt::OMPForSimdDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPForDirectiveClass == clang::Stmt::OMPForDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPDistributeSimdDirectiveClass == clang::Stmt::OMPDistributeSimdDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPDistributeParallelForSimdDirectiveClass == clang::Stmt::OMPDistributeParallelForSimdDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPDistributeParallelForDirectiveClass == clang::Stmt::OMPDistributeParallelForDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPDistributeDirectiveClass == clang::Stmt::OMPDistributeDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPInteropDirectiveClass == clang::Stmt::OMPInteropDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPFlushDirectiveClass == clang::Stmt::OMPFlushDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPErrorDirectiveClass == clang::Stmt::OMPErrorDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPDispatchDirectiveClass == clang::Stmt::OMPDispatchDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPDepobjDirectiveClass == clang::Stmt::OMPDepobjDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPCriticalDirectiveClass == clang::Stmt::OMPCriticalDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPCancellationPointDirectiveClass == clang::Stmt::OMPCancellationPointDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPCancelDirectiveClass == clang::Stmt::OMPCancelDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPBarrierDirectiveClass == clang::Stmt::OMPBarrierDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPAtomicDirectiveClass == clang::Stmt::OMPAtomicDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPAssumeDirectiveClass == clang::Stmt::OMPAssumeDirectiveClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_OMPCanonicalLoopClass == clang::Stmt::OMPCanonicalLoopClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_NullStmtClass == clang::Stmt::NullStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_MSDependentExistsStmtClass == clang::Stmt::MSDependentExistsStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_IndirectGotoStmtClass == clang::Stmt::IndirectGotoStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_IfStmtClass == clang::Stmt::IfStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_GotoStmtClass == clang::Stmt::GotoStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ForStmtClass == clang::Stmt::ForStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_DoStmtClass == clang::Stmt::DoStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_DeclStmtClass == clang::Stmt::DeclStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CoroutineBodyStmtClass == clang::Stmt::CoroutineBodyStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CoreturnStmtClass == clang::Stmt::CoreturnStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_ContinueStmtClass == clang::Stmt::ContinueStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CompoundStmtClass == clang::Stmt::CompoundStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CapturedStmtClass == clang::Stmt::CapturedStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXTryStmtClass == clang::Stmt::CXXTryStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXForRangeStmtClass == clang::Stmt::CXXForRangeStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_CXXCatchStmtClass == clang::Stmt::CXXCatchStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_BreakStmtClass == clang::Stmt::BreakStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_MSAsmStmtClass == clang::Stmt::MSAsmStmtClass, ""); -static_assert((clang::Stmt::StmtClass)ZigClangStmt_GCCAsmStmtClass == clang::Stmt::GCCAsmStmtClass, ""); - -void ZigClang_detect_enum_APValueKind(clang::APValue::ValueKind x) { - switch (x) { - case clang::APValue::None: - case clang::APValue::Indeterminate: - case clang::APValue::Int: - case clang::APValue::Float: - case clang::APValue::FixedPoint: - case clang::APValue::ComplexInt: - case clang::APValue::ComplexFloat: - case clang::APValue::LValue: - case clang::APValue::Vector: - case clang::APValue::Array: - case clang::APValue::Struct: - case clang::APValue::Union: - case clang::APValue::MemberPointer: - case clang::APValue::AddrLabelDiff: - break; - } -} - -static_assert((clang::APValue::ValueKind)ZigClangAPValueNone == clang::APValue::None, ""); -static_assert((clang::APValue::ValueKind)ZigClangAPValueIndeterminate == clang::APValue::Indeterminate, ""); -static_assert((clang::APValue::ValueKind)ZigClangAPValueInt == clang::APValue::Int, ""); -static_assert((clang::APValue::ValueKind)ZigClangAPValueFloat == clang::APValue::Float, ""); -static_assert((clang::APValue::ValueKind)ZigClangAPValueFixedPoint == clang::APValue::FixedPoint, ""); -static_assert((clang::APValue::ValueKind)ZigClangAPValueComplexInt == clang::APValue::ComplexInt, ""); -static_assert((clang::APValue::ValueKind)ZigClangAPValueComplexFloat == clang::APValue::ComplexFloat, ""); -static_assert((clang::APValue::ValueKind)ZigClangAPValueLValue == clang::APValue::LValue, ""); -static_assert((clang::APValue::ValueKind)ZigClangAPValueVector == clang::APValue::Vector, ""); -static_assert((clang::APValue::ValueKind)ZigClangAPValueArray == clang::APValue::Array, ""); -static_assert((clang::APValue::ValueKind)ZigClangAPValueStruct == clang::APValue::Struct, ""); -static_assert((clang::APValue::ValueKind)ZigClangAPValueUnion == clang::APValue::Union, ""); -static_assert((clang::APValue::ValueKind)ZigClangAPValueMemberPointer == clang::APValue::MemberPointer, ""); -static_assert((clang::APValue::ValueKind)ZigClangAPValueAddrLabelDiff == clang::APValue::AddrLabelDiff, ""); - - -void ZigClang_detect_enum_DeclKind(clang::Decl::Kind x) { - switch (x) { - case clang::Decl::TranslationUnit: - case clang::Decl::RequiresExprBody: - case clang::Decl::OutlinedFunction: - case clang::Decl::LinkageSpec: - case clang::Decl::ExternCContext: - case clang::Decl::Export: - case clang::Decl::Captured: - case clang::Decl::Block: - case clang::Decl::TopLevelStmt: - case clang::Decl::StaticAssert: - case clang::Decl::PragmaDetectMismatch: - case clang::Decl::PragmaComment: - case clang::Decl::ObjCPropertyImpl: - case clang::Decl::OMPThreadPrivate: - case clang::Decl::OMPRequires: - case clang::Decl::OMPAllocate: - case clang::Decl::ObjCMethod: - case clang::Decl::ObjCProtocol: - case clang::Decl::ObjCInterface: - case clang::Decl::ObjCImplementation: - case clang::Decl::ObjCCategoryImpl: - case clang::Decl::ObjCCategory: - case clang::Decl::Namespace: - case clang::Decl::HLSLBuffer: - case clang::Decl::OMPDeclareReduction: - case clang::Decl::OMPDeclareMapper: - case clang::Decl::UnresolvedUsingValue: - case clang::Decl::UnnamedGlobalConstant: - case clang::Decl::TemplateParamObject: - case clang::Decl::MSGuid: - case clang::Decl::IndirectField: - case clang::Decl::EnumConstant: - case clang::Decl::Function: - case clang::Decl::CXXMethod: - case clang::Decl::CXXDestructor: - case clang::Decl::CXXConversion: - case clang::Decl::CXXConstructor: - case clang::Decl::CXXDeductionGuide: - case clang::Decl::Var: - case clang::Decl::VarTemplateSpecialization: - case clang::Decl::VarTemplatePartialSpecialization: - case clang::Decl::ParmVar: - case clang::Decl::OMPCapturedExpr: - case clang::Decl::ImplicitParam: - case clang::Decl::Decomposition: - case clang::Decl::NonTypeTemplateParm: - case clang::Decl::MSProperty: - case clang::Decl::Field: - case clang::Decl::ObjCIvar: - case clang::Decl::ObjCAtDefsField: - case clang::Decl::Binding: - case clang::Decl::UsingShadow: - case clang::Decl::ConstructorUsingShadow: - case clang::Decl::UsingPack: - case clang::Decl::UsingDirective: - case clang::Decl::UnresolvedUsingIfExists: - case clang::Decl::Record: - case clang::Decl::CXXRecord: - case clang::Decl::ClassTemplateSpecialization: - case clang::Decl::ClassTemplatePartialSpecialization: - case clang::Decl::Enum: - case clang::Decl::UnresolvedUsingTypename: - case clang::Decl::Typedef: - case clang::Decl::TypeAlias: - case clang::Decl::ObjCTypeParam: - case clang::Decl::TemplateTypeParm: - case clang::Decl::TemplateTemplateParm: - case clang::Decl::VarTemplate: - case clang::Decl::TypeAliasTemplate: - case clang::Decl::FunctionTemplate: - case clang::Decl::ClassTemplate: - case clang::Decl::Concept: - case clang::Decl::BuiltinTemplate: - case clang::Decl::ObjCProperty: - case clang::Decl::ObjCCompatibleAlias: - case clang::Decl::NamespaceAlias: - case clang::Decl::Label: - case clang::Decl::UsingEnum: - case clang::Decl::Using: - case clang::Decl::LifetimeExtendedTemporary: - case clang::Decl::Import: - case clang::Decl::ImplicitConceptSpecialization: - case clang::Decl::FriendTemplate: - case clang::Decl::Friend: - case clang::Decl::FileScopeAsm: - case clang::Decl::Empty: - case clang::Decl::AccessSpec: - break; - } -} - -static_assert((clang::Decl::Kind)ZigClangDeclTranslationUnit == clang::Decl::TranslationUnit, ""); -static_assert((clang::Decl::Kind)ZigClangDeclTopLevelStmt == clang::Decl::TopLevelStmt, ""); -static_assert((clang::Decl::Kind)ZigClangDeclRequiresExprBody == clang::Decl::RequiresExprBody, ""); -static_assert((clang::Decl::Kind)ZigClangDeclOutlinedFunction == clang::Decl::OutlinedFunction, ""); -static_assert((clang::Decl::Kind)ZigClangDeclLinkageSpec == clang::Decl::LinkageSpec, ""); -static_assert((clang::Decl::Kind)ZigClangDeclExternCContext == clang::Decl::ExternCContext, ""); -static_assert((clang::Decl::Kind)ZigClangDeclExport == clang::Decl::Export, ""); -static_assert((clang::Decl::Kind)ZigClangDeclCaptured == clang::Decl::Captured, ""); -static_assert((clang::Decl::Kind)ZigClangDeclBlock == clang::Decl::Block, ""); -static_assert((clang::Decl::Kind)ZigClangDeclStaticAssert == clang::Decl::StaticAssert, ""); -static_assert((clang::Decl::Kind)ZigClangDeclPragmaDetectMismatch == clang::Decl::PragmaDetectMismatch, ""); -static_assert((clang::Decl::Kind)ZigClangDeclPragmaComment == clang::Decl::PragmaComment, ""); -static_assert((clang::Decl::Kind)ZigClangDeclObjCPropertyImpl == clang::Decl::ObjCPropertyImpl, ""); -static_assert((clang::Decl::Kind)ZigClangDeclOMPThreadPrivate == clang::Decl::OMPThreadPrivate, ""); -static_assert((clang::Decl::Kind)ZigClangDeclOMPRequires == clang::Decl::OMPRequires, ""); -static_assert((clang::Decl::Kind)ZigClangDeclOMPAllocate == clang::Decl::OMPAllocate, ""); -static_assert((clang::Decl::Kind)ZigClangDeclObjCMethod == clang::Decl::ObjCMethod, ""); -static_assert((clang::Decl::Kind)ZigClangDeclObjCProtocol == clang::Decl::ObjCProtocol, ""); -static_assert((clang::Decl::Kind)ZigClangDeclObjCInterface == clang::Decl::ObjCInterface, ""); -static_assert((clang::Decl::Kind)ZigClangDeclObjCImplementation == clang::Decl::ObjCImplementation, ""); -static_assert((clang::Decl::Kind)ZigClangDeclObjCCategoryImpl == clang::Decl::ObjCCategoryImpl, ""); -static_assert((clang::Decl::Kind)ZigClangDeclObjCCategory == clang::Decl::ObjCCategory, ""); -static_assert((clang::Decl::Kind)ZigClangDeclNamespace == clang::Decl::Namespace, ""); -static_assert((clang::Decl::Kind)ZigClangDeclHLSLBuffer == clang::Decl::HLSLBuffer, ""); -static_assert((clang::Decl::Kind)ZigClangDeclOMPDeclareReduction == clang::Decl::OMPDeclareReduction, ""); -static_assert((clang::Decl::Kind)ZigClangDeclOMPDeclareMapper == clang::Decl::OMPDeclareMapper, ""); -static_assert((clang::Decl::Kind)ZigClangDeclUnresolvedUsingValue == clang::Decl::UnresolvedUsingValue, ""); -static_assert((clang::Decl::Kind)ZigClangDeclUnnamedGlobalConstant == clang::Decl::UnnamedGlobalConstant, ""); -static_assert((clang::Decl::Kind)ZigClangDeclTemplateParamObject == clang::Decl::TemplateParamObject, ""); -static_assert((clang::Decl::Kind)ZigClangDeclMSGuid == clang::Decl::MSGuid, ""); -static_assert((clang::Decl::Kind)ZigClangDeclIndirectField == clang::Decl::IndirectField, ""); -static_assert((clang::Decl::Kind)ZigClangDeclEnumConstant == clang::Decl::EnumConstant, ""); -static_assert((clang::Decl::Kind)ZigClangDeclFunction == clang::Decl::Function, ""); -static_assert((clang::Decl::Kind)ZigClangDeclCXXMethod == clang::Decl::CXXMethod, ""); -static_assert((clang::Decl::Kind)ZigClangDeclCXXDestructor == clang::Decl::CXXDestructor, ""); -static_assert((clang::Decl::Kind)ZigClangDeclCXXConversion == clang::Decl::CXXConversion, ""); -static_assert((clang::Decl::Kind)ZigClangDeclCXXConstructor == clang::Decl::CXXConstructor, ""); -static_assert((clang::Decl::Kind)ZigClangDeclCXXDeductionGuide == clang::Decl::CXXDeductionGuide, ""); -static_assert((clang::Decl::Kind)ZigClangDeclVar == clang::Decl::Var, ""); -static_assert((clang::Decl::Kind)ZigClangDeclVarTemplateSpecialization == clang::Decl::VarTemplateSpecialization, ""); -static_assert((clang::Decl::Kind)ZigClangDeclVarTemplatePartialSpecialization == clang::Decl::VarTemplatePartialSpecialization, ""); -static_assert((clang::Decl::Kind)ZigClangDeclParmVar == clang::Decl::ParmVar, ""); -static_assert((clang::Decl::Kind)ZigClangDeclOMPCapturedExpr == clang::Decl::OMPCapturedExpr, ""); -static_assert((clang::Decl::Kind)ZigClangDeclImplicitParam == clang::Decl::ImplicitParam, ""); -static_assert((clang::Decl::Kind)ZigClangDeclDecomposition == clang::Decl::Decomposition, ""); -static_assert((clang::Decl::Kind)ZigClangDeclNonTypeTemplateParm == clang::Decl::NonTypeTemplateParm, ""); -static_assert((clang::Decl::Kind)ZigClangDeclMSProperty == clang::Decl::MSProperty, ""); -static_assert((clang::Decl::Kind)ZigClangDeclField == clang::Decl::Field, ""); -static_assert((clang::Decl::Kind)ZigClangDeclObjCIvar == clang::Decl::ObjCIvar, ""); -static_assert((clang::Decl::Kind)ZigClangDeclObjCAtDefsField == clang::Decl::ObjCAtDefsField, ""); -static_assert((clang::Decl::Kind)ZigClangDeclBinding == clang::Decl::Binding, ""); -static_assert((clang::Decl::Kind)ZigClangDeclUsingShadow == clang::Decl::UsingShadow, ""); -static_assert((clang::Decl::Kind)ZigClangDeclConstructorUsingShadow == clang::Decl::ConstructorUsingShadow, ""); -static_assert((clang::Decl::Kind)ZigClangDeclUsingPack == clang::Decl::UsingPack, ""); -static_assert((clang::Decl::Kind)ZigClangDeclUsingDirective == clang::Decl::UsingDirective, ""); -static_assert((clang::Decl::Kind)ZigClangDeclUnresolvedUsingIfExists == clang::Decl::UnresolvedUsingIfExists, ""); -static_assert((clang::Decl::Kind)ZigClangDeclRecord == clang::Decl::Record, ""); -static_assert((clang::Decl::Kind)ZigClangDeclCXXRecord == clang::Decl::CXXRecord, ""); -static_assert((clang::Decl::Kind)ZigClangDeclClassTemplateSpecialization == clang::Decl::ClassTemplateSpecialization, ""); -static_assert((clang::Decl::Kind)ZigClangDeclClassTemplatePartialSpecialization == clang::Decl::ClassTemplatePartialSpecialization, ""); -static_assert((clang::Decl::Kind)ZigClangDeclEnum == clang::Decl::Enum, ""); -static_assert((clang::Decl::Kind)ZigClangDeclUnresolvedUsingTypename == clang::Decl::UnresolvedUsingTypename, ""); -static_assert((clang::Decl::Kind)ZigClangDeclTypedef == clang::Decl::Typedef, ""); -static_assert((clang::Decl::Kind)ZigClangDeclTypeAlias == clang::Decl::TypeAlias, ""); -static_assert((clang::Decl::Kind)ZigClangDeclObjCTypeParam == clang::Decl::ObjCTypeParam, ""); -static_assert((clang::Decl::Kind)ZigClangDeclTemplateTypeParm == clang::Decl::TemplateTypeParm, ""); -static_assert((clang::Decl::Kind)ZigClangDeclTemplateTemplateParm == clang::Decl::TemplateTemplateParm, ""); -static_assert((clang::Decl::Kind)ZigClangDeclVarTemplate == clang::Decl::VarTemplate, ""); -static_assert((clang::Decl::Kind)ZigClangDeclTypeAliasTemplate == clang::Decl::TypeAliasTemplate, ""); -static_assert((clang::Decl::Kind)ZigClangDeclFunctionTemplate == clang::Decl::FunctionTemplate, ""); -static_assert((clang::Decl::Kind)ZigClangDeclClassTemplate == clang::Decl::ClassTemplate, ""); -static_assert((clang::Decl::Kind)ZigClangDeclConcept == clang::Decl::Concept, ""); -static_assert((clang::Decl::Kind)ZigClangDeclBuiltinTemplate == clang::Decl::BuiltinTemplate, ""); -static_assert((clang::Decl::Kind)ZigClangDeclObjCProperty == clang::Decl::ObjCProperty, ""); -static_assert((clang::Decl::Kind)ZigClangDeclObjCCompatibleAlias == clang::Decl::ObjCCompatibleAlias, ""); -static_assert((clang::Decl::Kind)ZigClangDeclNamespaceAlias == clang::Decl::NamespaceAlias, ""); -static_assert((clang::Decl::Kind)ZigClangDeclLabel == clang::Decl::Label, ""); -static_assert((clang::Decl::Kind)ZigClangDeclUsingEnum == clang::Decl::UsingEnum, ""); -static_assert((clang::Decl::Kind)ZigClangDeclUsing == clang::Decl::Using, ""); -static_assert((clang::Decl::Kind)ZigClangDeclLifetimeExtendedTemporary == clang::Decl::LifetimeExtendedTemporary, ""); -static_assert((clang::Decl::Kind)ZigClangDeclImport == clang::Decl::Import, ""); -static_assert((clang::Decl::Kind)ZigClangDeclImplicitConceptSpecialization == clang::Decl::ImplicitConceptSpecialization, ""); -static_assert((clang::Decl::Kind)ZigClangDeclFriendTemplate == clang::Decl::FriendTemplate, ""); -static_assert((clang::Decl::Kind)ZigClangDeclFriend == clang::Decl::Friend, ""); -static_assert((clang::Decl::Kind)ZigClangDeclFileScopeAsm == clang::Decl::FileScopeAsm, ""); -static_assert((clang::Decl::Kind)ZigClangDeclEmpty == clang::Decl::Empty, ""); -static_assert((clang::Decl::Kind)ZigClangDeclAccessSpec == clang::Decl::AccessSpec, ""); - -void ZigClang_detect_enum_BuiltinTypeKind(clang::BuiltinType::Kind x) { - switch (x) { - case clang::BuiltinType::OCLImage1dRO: - case clang::BuiltinType::OCLImage1dArrayRO: - case clang::BuiltinType::OCLImage1dBufferRO: - case clang::BuiltinType::OCLImage2dRO: - case clang::BuiltinType::OCLImage2dArrayRO: - case clang::BuiltinType::OCLImage2dDepthRO: - case clang::BuiltinType::OCLImage2dArrayDepthRO: - case clang::BuiltinType::OCLImage2dMSAARO: - case clang::BuiltinType::OCLImage2dArrayMSAARO: - case clang::BuiltinType::OCLImage2dMSAADepthRO: - case clang::BuiltinType::OCLImage2dArrayMSAADepthRO: - case clang::BuiltinType::OCLImage3dRO: - case clang::BuiltinType::OCLImage1dWO: - case clang::BuiltinType::OCLImage1dArrayWO: - case clang::BuiltinType::OCLImage1dBufferWO: - case clang::BuiltinType::OCLImage2dWO: - case clang::BuiltinType::OCLImage2dArrayWO: - case clang::BuiltinType::OCLImage2dDepthWO: - case clang::BuiltinType::OCLImage2dArrayDepthWO: - case clang::BuiltinType::OCLImage2dMSAAWO: - case clang::BuiltinType::OCLImage2dArrayMSAAWO: - case clang::BuiltinType::OCLImage2dMSAADepthWO: - case clang::BuiltinType::OCLImage2dArrayMSAADepthWO: - case clang::BuiltinType::OCLImage3dWO: - case clang::BuiltinType::OCLImage1dRW: - case clang::BuiltinType::OCLImage1dArrayRW: - case clang::BuiltinType::OCLImage1dBufferRW: - case clang::BuiltinType::OCLImage2dRW: - case clang::BuiltinType::OCLImage2dArrayRW: - case clang::BuiltinType::OCLImage2dDepthRW: - case clang::BuiltinType::OCLImage2dArrayDepthRW: - case clang::BuiltinType::OCLImage2dMSAARW: - case clang::BuiltinType::OCLImage2dArrayMSAARW: - case clang::BuiltinType::OCLImage2dMSAADepthRW: - case clang::BuiltinType::OCLImage2dArrayMSAADepthRW: - case clang::BuiltinType::OCLImage3dRW: - case clang::BuiltinType::OCLIntelSubgroupAVCMcePayload: - case clang::BuiltinType::OCLIntelSubgroupAVCImePayload: - case clang::BuiltinType::OCLIntelSubgroupAVCRefPayload: - case clang::BuiltinType::OCLIntelSubgroupAVCSicPayload: - case clang::BuiltinType::OCLIntelSubgroupAVCMceResult: - case clang::BuiltinType::OCLIntelSubgroupAVCImeResult: - case clang::BuiltinType::OCLIntelSubgroupAVCRefResult: - case clang::BuiltinType::OCLIntelSubgroupAVCSicResult: - case clang::BuiltinType::OCLIntelSubgroupAVCImeResultSingleReferenceStreamout: - case clang::BuiltinType::OCLIntelSubgroupAVCImeResultDualReferenceStreamout: - case clang::BuiltinType::OCLIntelSubgroupAVCImeSingleReferenceStreamin: - case clang::BuiltinType::OCLIntelSubgroupAVCImeDualReferenceStreamin: - case clang::BuiltinType::SveInt8: - case clang::BuiltinType::SveInt16: - case clang::BuiltinType::SveInt32: - case clang::BuiltinType::SveInt64: - case clang::BuiltinType::SveUint8: - case clang::BuiltinType::SveUint16: - case clang::BuiltinType::SveUint32: - case clang::BuiltinType::SveUint64: - case clang::BuiltinType::SveFloat16: - case clang::BuiltinType::SveFloat32: - case clang::BuiltinType::SveFloat64: - case clang::BuiltinType::SveBFloat16: - case clang::BuiltinType::SveMFloat8: - case clang::BuiltinType::SveInt8x2: - case clang::BuiltinType::SveInt16x2: - case clang::BuiltinType::SveInt32x2: - case clang::BuiltinType::SveInt64x2: - case clang::BuiltinType::SveUint8x2: - case clang::BuiltinType::SveUint16x2: - case clang::BuiltinType::SveUint32x2: - case clang::BuiltinType::SveUint64x2: - case clang::BuiltinType::SveFloat16x2: - case clang::BuiltinType::SveFloat32x2: - case clang::BuiltinType::SveFloat64x2: - case clang::BuiltinType::SveBFloat16x2: - case clang::BuiltinType::SveMFloat8x2: - case clang::BuiltinType::SveInt8x3: - case clang::BuiltinType::SveInt16x3: - case clang::BuiltinType::SveInt32x3: - case clang::BuiltinType::SveInt64x3: - case clang::BuiltinType::SveUint8x3: - case clang::BuiltinType::SveUint16x3: - case clang::BuiltinType::SveUint32x3: - case clang::BuiltinType::SveUint64x3: - case clang::BuiltinType::SveFloat16x3: - case clang::BuiltinType::SveFloat32x3: - case clang::BuiltinType::SveFloat64x3: - case clang::BuiltinType::SveBFloat16x3: - case clang::BuiltinType::SveMFloat8x3: - case clang::BuiltinType::SveInt8x4: - case clang::BuiltinType::SveInt16x4: - case clang::BuiltinType::SveInt32x4: - case clang::BuiltinType::SveInt64x4: - case clang::BuiltinType::SveUint8x4: - case clang::BuiltinType::SveUint16x4: - case clang::BuiltinType::SveUint32x4: - case clang::BuiltinType::SveUint64x4: - case clang::BuiltinType::SveFloat16x4: - case clang::BuiltinType::SveFloat32x4: - case clang::BuiltinType::SveFloat64x4: - case clang::BuiltinType::SveBFloat16x4: - case clang::BuiltinType::SveMFloat8x4: - case clang::BuiltinType::SveBool: - case clang::BuiltinType::SveBoolx2: - case clang::BuiltinType::SveBoolx4: - case clang::BuiltinType::SveCount: - case clang::BuiltinType::MFloat8: - case clang::BuiltinType::VectorQuad: - case clang::BuiltinType::VectorPair: - case clang::BuiltinType::RvvInt8mf8: - case clang::BuiltinType::RvvInt8mf4: - case clang::BuiltinType::RvvInt8mf2: - case clang::BuiltinType::RvvInt8m1: - case clang::BuiltinType::RvvInt8m2: - case clang::BuiltinType::RvvInt8m4: - case clang::BuiltinType::RvvInt8m8: - case clang::BuiltinType::RvvUint8mf8: - case clang::BuiltinType::RvvUint8mf4: - case clang::BuiltinType::RvvUint8mf2: - case clang::BuiltinType::RvvUint8m1: - case clang::BuiltinType::RvvUint8m2: - case clang::BuiltinType::RvvUint8m4: - case clang::BuiltinType::RvvUint8m8: - case clang::BuiltinType::RvvInt16mf4: - case clang::BuiltinType::RvvInt16mf2: - case clang::BuiltinType::RvvInt16m1: - case clang::BuiltinType::RvvInt16m2: - case clang::BuiltinType::RvvInt16m4: - case clang::BuiltinType::RvvInt16m8: - case clang::BuiltinType::RvvUint16mf4: - case clang::BuiltinType::RvvUint16mf2: - case clang::BuiltinType::RvvUint16m1: - case clang::BuiltinType::RvvUint16m2: - case clang::BuiltinType::RvvUint16m4: - case clang::BuiltinType::RvvUint16m8: - case clang::BuiltinType::RvvInt32mf2: - case clang::BuiltinType::RvvInt32m1: - case clang::BuiltinType::RvvInt32m2: - case clang::BuiltinType::RvvInt32m4: - case clang::BuiltinType::RvvInt32m8: - case clang::BuiltinType::RvvUint32mf2: - case clang::BuiltinType::RvvUint32m1: - case clang::BuiltinType::RvvUint32m2: - case clang::BuiltinType::RvvUint32m4: - case clang::BuiltinType::RvvUint32m8: - case clang::BuiltinType::RvvInt64m1: - case clang::BuiltinType::RvvInt64m2: - case clang::BuiltinType::RvvInt64m4: - case clang::BuiltinType::RvvInt64m8: - case clang::BuiltinType::RvvUint64m1: - case clang::BuiltinType::RvvUint64m2: - case clang::BuiltinType::RvvUint64m4: - case clang::BuiltinType::RvvUint64m8: - case clang::BuiltinType::RvvFloat16mf4: - case clang::BuiltinType::RvvFloat16mf2: - case clang::BuiltinType::RvvFloat16m1: - case clang::BuiltinType::RvvFloat16m2: - case clang::BuiltinType::RvvFloat16m4: - case clang::BuiltinType::RvvFloat16m8: - case clang::BuiltinType::RvvBFloat16mf4: - case clang::BuiltinType::RvvBFloat16mf2: - case clang::BuiltinType::RvvBFloat16m1: - case clang::BuiltinType::RvvBFloat16m2: - case clang::BuiltinType::RvvBFloat16m4: - case clang::BuiltinType::RvvBFloat16m8: - case clang::BuiltinType::RvvFloat32mf2: - case clang::BuiltinType::RvvFloat32m1: - case clang::BuiltinType::RvvFloat32m2: - case clang::BuiltinType::RvvFloat32m4: - case clang::BuiltinType::RvvFloat32m8: - case clang::BuiltinType::RvvFloat64m1: - case clang::BuiltinType::RvvFloat64m2: - case clang::BuiltinType::RvvFloat64m4: - case clang::BuiltinType::RvvFloat64m8: - case clang::BuiltinType::RvvBool1: - case clang::BuiltinType::RvvBool2: - case clang::BuiltinType::RvvBool4: - case clang::BuiltinType::RvvBool8: - case clang::BuiltinType::RvvBool16: - case clang::BuiltinType::RvvBool32: - case clang::BuiltinType::RvvBool64: - case clang::BuiltinType::RvvInt8mf8x2: - case clang::BuiltinType::RvvInt8mf8x3: - case clang::BuiltinType::RvvInt8mf8x4: - case clang::BuiltinType::RvvInt8mf8x5: - case clang::BuiltinType::RvvInt8mf8x6: - case clang::BuiltinType::RvvInt8mf8x7: - case clang::BuiltinType::RvvInt8mf8x8: - case clang::BuiltinType::RvvInt8mf4x2: - case clang::BuiltinType::RvvInt8mf4x3: - case clang::BuiltinType::RvvInt8mf4x4: - case clang::BuiltinType::RvvInt8mf4x5: - case clang::BuiltinType::RvvInt8mf4x6: - case clang::BuiltinType::RvvInt8mf4x7: - case clang::BuiltinType::RvvInt8mf4x8: - case clang::BuiltinType::RvvInt8mf2x2: - case clang::BuiltinType::RvvInt8mf2x3: - case clang::BuiltinType::RvvInt8mf2x4: - case clang::BuiltinType::RvvInt8mf2x5: - case clang::BuiltinType::RvvInt8mf2x6: - case clang::BuiltinType::RvvInt8mf2x7: - case clang::BuiltinType::RvvInt8mf2x8: - case clang::BuiltinType::RvvInt8m1x2: - case clang::BuiltinType::RvvInt8m1x3: - case clang::BuiltinType::RvvInt8m1x4: - case clang::BuiltinType::RvvInt8m1x5: - case clang::BuiltinType::RvvInt8m1x6: - case clang::BuiltinType::RvvInt8m1x7: - case clang::BuiltinType::RvvInt8m1x8: - case clang::BuiltinType::RvvInt8m2x2: - case clang::BuiltinType::RvvInt8m2x3: - case clang::BuiltinType::RvvInt8m2x4: - case clang::BuiltinType::RvvInt8m4x2: - case clang::BuiltinType::RvvUint8mf8x2: - case clang::BuiltinType::RvvUint8mf8x3: - case clang::BuiltinType::RvvUint8mf8x4: - case clang::BuiltinType::RvvUint8mf8x5: - case clang::BuiltinType::RvvUint8mf8x6: - case clang::BuiltinType::RvvUint8mf8x7: - case clang::BuiltinType::RvvUint8mf8x8: - case clang::BuiltinType::RvvUint8mf4x2: - case clang::BuiltinType::RvvUint8mf4x3: - case clang::BuiltinType::RvvUint8mf4x4: - case clang::BuiltinType::RvvUint8mf4x5: - case clang::BuiltinType::RvvUint8mf4x6: - case clang::BuiltinType::RvvUint8mf4x7: - case clang::BuiltinType::RvvUint8mf4x8: - case clang::BuiltinType::RvvUint8mf2x2: - case clang::BuiltinType::RvvUint8mf2x3: - case clang::BuiltinType::RvvUint8mf2x4: - case clang::BuiltinType::RvvUint8mf2x5: - case clang::BuiltinType::RvvUint8mf2x6: - case clang::BuiltinType::RvvUint8mf2x7: - case clang::BuiltinType::RvvUint8mf2x8: - case clang::BuiltinType::RvvUint8m1x2: - case clang::BuiltinType::RvvUint8m1x3: - case clang::BuiltinType::RvvUint8m1x4: - case clang::BuiltinType::RvvUint8m1x5: - case clang::BuiltinType::RvvUint8m1x6: - case clang::BuiltinType::RvvUint8m1x7: - case clang::BuiltinType::RvvUint8m1x8: - case clang::BuiltinType::RvvUint8m2x2: - case clang::BuiltinType::RvvUint8m2x3: - case clang::BuiltinType::RvvUint8m2x4: - case clang::BuiltinType::RvvUint8m4x2: - case clang::BuiltinType::RvvInt16mf4x2: - case clang::BuiltinType::RvvInt16mf4x3: - case clang::BuiltinType::RvvInt16mf4x4: - case clang::BuiltinType::RvvInt16mf4x5: - case clang::BuiltinType::RvvInt16mf4x6: - case clang::BuiltinType::RvvInt16mf4x7: - case clang::BuiltinType::RvvInt16mf4x8: - case clang::BuiltinType::RvvInt16mf2x2: - case clang::BuiltinType::RvvInt16mf2x3: - case clang::BuiltinType::RvvInt16mf2x4: - case clang::BuiltinType::RvvInt16mf2x5: - case clang::BuiltinType::RvvInt16mf2x6: - case clang::BuiltinType::RvvInt16mf2x7: - case clang::BuiltinType::RvvInt16mf2x8: - case clang::BuiltinType::RvvInt16m1x2: - case clang::BuiltinType::RvvInt16m1x3: - case clang::BuiltinType::RvvInt16m1x4: - case clang::BuiltinType::RvvInt16m1x5: - case clang::BuiltinType::RvvInt16m1x6: - case clang::BuiltinType::RvvInt16m1x7: - case clang::BuiltinType::RvvInt16m1x8: - case clang::BuiltinType::RvvInt16m2x2: - case clang::BuiltinType::RvvInt16m2x3: - case clang::BuiltinType::RvvInt16m2x4: - case clang::BuiltinType::RvvInt16m4x2: - case clang::BuiltinType::RvvUint16mf4x2: - case clang::BuiltinType::RvvUint16mf4x3: - case clang::BuiltinType::RvvUint16mf4x4: - case clang::BuiltinType::RvvUint16mf4x5: - case clang::BuiltinType::RvvUint16mf4x6: - case clang::BuiltinType::RvvUint16mf4x7: - case clang::BuiltinType::RvvUint16mf4x8: - case clang::BuiltinType::RvvUint16mf2x2: - case clang::BuiltinType::RvvUint16mf2x3: - case clang::BuiltinType::RvvUint16mf2x4: - case clang::BuiltinType::RvvUint16mf2x5: - case clang::BuiltinType::RvvUint16mf2x6: - case clang::BuiltinType::RvvUint16mf2x7: - case clang::BuiltinType::RvvUint16mf2x8: - case clang::BuiltinType::RvvUint16m1x2: - case clang::BuiltinType::RvvUint16m1x3: - case clang::BuiltinType::RvvUint16m1x4: - case clang::BuiltinType::RvvUint16m1x5: - case clang::BuiltinType::RvvUint16m1x6: - case clang::BuiltinType::RvvUint16m1x7: - case clang::BuiltinType::RvvUint16m1x8: - case clang::BuiltinType::RvvUint16m2x2: - case clang::BuiltinType::RvvUint16m2x3: - case clang::BuiltinType::RvvUint16m2x4: - case clang::BuiltinType::RvvUint16m4x2: - case clang::BuiltinType::RvvInt32mf2x2: - case clang::BuiltinType::RvvInt32mf2x3: - case clang::BuiltinType::RvvInt32mf2x4: - case clang::BuiltinType::RvvInt32mf2x5: - case clang::BuiltinType::RvvInt32mf2x6: - case clang::BuiltinType::RvvInt32mf2x7: - case clang::BuiltinType::RvvInt32mf2x8: - case clang::BuiltinType::RvvInt32m1x2: - case clang::BuiltinType::RvvInt32m1x3: - case clang::BuiltinType::RvvInt32m1x4: - case clang::BuiltinType::RvvInt32m1x5: - case clang::BuiltinType::RvvInt32m1x6: - case clang::BuiltinType::RvvInt32m1x7: - case clang::BuiltinType::RvvInt32m1x8: - case clang::BuiltinType::RvvInt32m2x2: - case clang::BuiltinType::RvvInt32m2x3: - case clang::BuiltinType::RvvInt32m2x4: - case clang::BuiltinType::RvvInt32m4x2: - case clang::BuiltinType::RvvUint32mf2x2: - case clang::BuiltinType::RvvUint32mf2x3: - case clang::BuiltinType::RvvUint32mf2x4: - case clang::BuiltinType::RvvUint32mf2x5: - case clang::BuiltinType::RvvUint32mf2x6: - case clang::BuiltinType::RvvUint32mf2x7: - case clang::BuiltinType::RvvUint32mf2x8: - case clang::BuiltinType::RvvUint32m1x2: - case clang::BuiltinType::RvvUint32m1x3: - case clang::BuiltinType::RvvUint32m1x4: - case clang::BuiltinType::RvvUint32m1x5: - case clang::BuiltinType::RvvUint32m1x6: - case clang::BuiltinType::RvvUint32m1x7: - case clang::BuiltinType::RvvUint32m1x8: - case clang::BuiltinType::RvvUint32m2x2: - case clang::BuiltinType::RvvUint32m2x3: - case clang::BuiltinType::RvvUint32m2x4: - case clang::BuiltinType::RvvUint32m4x2: - case clang::BuiltinType::RvvInt64m1x2: - case clang::BuiltinType::RvvInt64m1x3: - case clang::BuiltinType::RvvInt64m1x4: - case clang::BuiltinType::RvvInt64m1x5: - case clang::BuiltinType::RvvInt64m1x6: - case clang::BuiltinType::RvvInt64m1x7: - case clang::BuiltinType::RvvInt64m1x8: - case clang::BuiltinType::RvvInt64m2x2: - case clang::BuiltinType::RvvInt64m2x3: - case clang::BuiltinType::RvvInt64m2x4: - case clang::BuiltinType::RvvInt64m4x2: - case clang::BuiltinType::RvvUint64m1x2: - case clang::BuiltinType::RvvUint64m1x3: - case clang::BuiltinType::RvvUint64m1x4: - case clang::BuiltinType::RvvUint64m1x5: - case clang::BuiltinType::RvvUint64m1x6: - case clang::BuiltinType::RvvUint64m1x7: - case clang::BuiltinType::RvvUint64m1x8: - case clang::BuiltinType::RvvUint64m2x2: - case clang::BuiltinType::RvvUint64m2x3: - case clang::BuiltinType::RvvUint64m2x4: - case clang::BuiltinType::RvvUint64m4x2: - case clang::BuiltinType::RvvFloat16mf4x2: - case clang::BuiltinType::RvvFloat16mf4x3: - case clang::BuiltinType::RvvFloat16mf4x4: - case clang::BuiltinType::RvvFloat16mf4x5: - case clang::BuiltinType::RvvFloat16mf4x6: - case clang::BuiltinType::RvvFloat16mf4x7: - case clang::BuiltinType::RvvFloat16mf4x8: - case clang::BuiltinType::RvvFloat16mf2x2: - case clang::BuiltinType::RvvFloat16mf2x3: - case clang::BuiltinType::RvvFloat16mf2x4: - case clang::BuiltinType::RvvFloat16mf2x5: - case clang::BuiltinType::RvvFloat16mf2x6: - case clang::BuiltinType::RvvFloat16mf2x7: - case clang::BuiltinType::RvvFloat16mf2x8: - case clang::BuiltinType::RvvFloat16m1x2: - case clang::BuiltinType::RvvFloat16m1x3: - case clang::BuiltinType::RvvFloat16m1x4: - case clang::BuiltinType::RvvFloat16m1x5: - case clang::BuiltinType::RvvFloat16m1x6: - case clang::BuiltinType::RvvFloat16m1x7: - case clang::BuiltinType::RvvFloat16m1x8: - case clang::BuiltinType::RvvFloat16m2x2: - case clang::BuiltinType::RvvFloat16m2x3: - case clang::BuiltinType::RvvFloat16m2x4: - case clang::BuiltinType::RvvFloat16m4x2: - case clang::BuiltinType::RvvFloat32mf2x2: - case clang::BuiltinType::RvvFloat32mf2x3: - case clang::BuiltinType::RvvFloat32mf2x4: - case clang::BuiltinType::RvvFloat32mf2x5: - case clang::BuiltinType::RvvFloat32mf2x6: - case clang::BuiltinType::RvvFloat32mf2x7: - case clang::BuiltinType::RvvFloat32mf2x8: - case clang::BuiltinType::RvvFloat32m1x2: - case clang::BuiltinType::RvvFloat32m1x3: - case clang::BuiltinType::RvvFloat32m1x4: - case clang::BuiltinType::RvvFloat32m1x5: - case clang::BuiltinType::RvvFloat32m1x6: - case clang::BuiltinType::RvvFloat32m1x7: - case clang::BuiltinType::RvvFloat32m1x8: - case clang::BuiltinType::RvvFloat32m2x2: - case clang::BuiltinType::RvvFloat32m2x3: - case clang::BuiltinType::RvvFloat32m2x4: - case clang::BuiltinType::RvvFloat32m4x2: - case clang::BuiltinType::RvvFloat64m1x2: - case clang::BuiltinType::RvvFloat64m1x3: - case clang::BuiltinType::RvvFloat64m1x4: - case clang::BuiltinType::RvvFloat64m1x5: - case clang::BuiltinType::RvvFloat64m1x6: - case clang::BuiltinType::RvvFloat64m1x7: - case clang::BuiltinType::RvvFloat64m1x8: - case clang::BuiltinType::RvvFloat64m2x2: - case clang::BuiltinType::RvvFloat64m2x3: - case clang::BuiltinType::RvvFloat64m2x4: - case clang::BuiltinType::RvvFloat64m4x2: - case clang::BuiltinType::RvvBFloat16mf4x2: - case clang::BuiltinType::RvvBFloat16mf4x3: - case clang::BuiltinType::RvvBFloat16mf4x4: - case clang::BuiltinType::RvvBFloat16mf4x5: - case clang::BuiltinType::RvvBFloat16mf4x6: - case clang::BuiltinType::RvvBFloat16mf4x7: - case clang::BuiltinType::RvvBFloat16mf4x8: - case clang::BuiltinType::RvvBFloat16mf2x2: - case clang::BuiltinType::RvvBFloat16mf2x3: - case clang::BuiltinType::RvvBFloat16mf2x4: - case clang::BuiltinType::RvvBFloat16mf2x5: - case clang::BuiltinType::RvvBFloat16mf2x6: - case clang::BuiltinType::RvvBFloat16mf2x7: - case clang::BuiltinType::RvvBFloat16mf2x8: - case clang::BuiltinType::RvvBFloat16m1x2: - case clang::BuiltinType::RvvBFloat16m1x3: - case clang::BuiltinType::RvvBFloat16m1x4: - case clang::BuiltinType::RvvBFloat16m1x5: - case clang::BuiltinType::RvvBFloat16m1x6: - case clang::BuiltinType::RvvBFloat16m1x7: - case clang::BuiltinType::RvvBFloat16m1x8: - case clang::BuiltinType::RvvBFloat16m2x2: - case clang::BuiltinType::RvvBFloat16m2x3: - case clang::BuiltinType::RvvBFloat16m2x4: - case clang::BuiltinType::RvvBFloat16m4x2: - case clang::BuiltinType::WasmExternRef: - case clang::BuiltinType::AMDGPUBufferRsrc: - case clang::BuiltinType::AMDGPUNamedWorkgroupBarrier: - case clang::BuiltinType::HLSLResource: - case clang::BuiltinType::Void: - case clang::BuiltinType::Bool: - case clang::BuiltinType::Char_U: - case clang::BuiltinType::UChar: - case clang::BuiltinType::WChar_U: - case clang::BuiltinType::Char8: - case clang::BuiltinType::Char16: - case clang::BuiltinType::Char32: - case clang::BuiltinType::UShort: - case clang::BuiltinType::UInt: - case clang::BuiltinType::ULong: - case clang::BuiltinType::ULongLong: - case clang::BuiltinType::UInt128: - case clang::BuiltinType::Char_S: - case clang::BuiltinType::SChar: - case clang::BuiltinType::WChar_S: - case clang::BuiltinType::Short: - case clang::BuiltinType::Int: - case clang::BuiltinType::Long: - case clang::BuiltinType::LongLong: - case clang::BuiltinType::Int128: - case clang::BuiltinType::ShortAccum: - case clang::BuiltinType::Accum: - case clang::BuiltinType::LongAccum: - case clang::BuiltinType::UShortAccum: - case clang::BuiltinType::UAccum: - case clang::BuiltinType::ULongAccum: - case clang::BuiltinType::ShortFract: - case clang::BuiltinType::Fract: - case clang::BuiltinType::LongFract: - case clang::BuiltinType::UShortFract: - case clang::BuiltinType::UFract: - case clang::BuiltinType::ULongFract: - case clang::BuiltinType::SatShortAccum: - case clang::BuiltinType::SatAccum: - case clang::BuiltinType::SatLongAccum: - case clang::BuiltinType::SatUShortAccum: - case clang::BuiltinType::SatUAccum: - case clang::BuiltinType::SatULongAccum: - case clang::BuiltinType::SatShortFract: - case clang::BuiltinType::SatFract: - case clang::BuiltinType::SatLongFract: - case clang::BuiltinType::SatUShortFract: - case clang::BuiltinType::SatUFract: - case clang::BuiltinType::SatULongFract: - case clang::BuiltinType::Half: - case clang::BuiltinType::Float: - case clang::BuiltinType::Double: - case clang::BuiltinType::LongDouble: - case clang::BuiltinType::Float16: - case clang::BuiltinType::BFloat16: - case clang::BuiltinType::Float128: - case clang::BuiltinType::Ibm128: - case clang::BuiltinType::NullPtr: - case clang::BuiltinType::ObjCId: - case clang::BuiltinType::ObjCClass: - case clang::BuiltinType::ObjCSel: - case clang::BuiltinType::OCLSampler: - case clang::BuiltinType::OCLEvent: - case clang::BuiltinType::OCLClkEvent: - case clang::BuiltinType::OCLQueue: - case clang::BuiltinType::OCLReserveID: - case clang::BuiltinType::Dependent: - case clang::BuiltinType::Overload: - case clang::BuiltinType::BoundMember: - case clang::BuiltinType::UnresolvedTemplate: - case clang::BuiltinType::PseudoObject: - case clang::BuiltinType::UnknownAny: - case clang::BuiltinType::BuiltinFn: - case clang::BuiltinType::ARCUnbridgedCast: - case clang::BuiltinType::IncompleteMatrixIdx: - case clang::BuiltinType::OMPArrayShaping: - case clang::BuiltinType::OMPIterator: - case clang::BuiltinType::ArraySection: - break; - } -} - -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage1dRO == clang::BuiltinType::OCLImage1dRO, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage1dArrayRO == clang::BuiltinType::OCLImage1dArrayRO, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage1dBufferRO == clang::BuiltinType::OCLImage1dBufferRO, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dRO == clang::BuiltinType::OCLImage2dRO, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dArrayRO == clang::BuiltinType::OCLImage2dArrayRO, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dDepthRO == clang::BuiltinType::OCLImage2dDepthRO, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dArrayDepthRO == clang::BuiltinType::OCLImage2dArrayDepthRO, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dMSAARO == clang::BuiltinType::OCLImage2dMSAARO, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dArrayMSAARO == clang::BuiltinType::OCLImage2dArrayMSAARO, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dMSAADepthRO == clang::BuiltinType::OCLImage2dMSAADepthRO, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dArrayMSAADepthRO == clang::BuiltinType::OCLImage2dArrayMSAADepthRO, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage3dRO == clang::BuiltinType::OCLImage3dRO, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage1dWO == clang::BuiltinType::OCLImage1dWO, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage1dArrayWO == clang::BuiltinType::OCLImage1dArrayWO, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage1dBufferWO == clang::BuiltinType::OCLImage1dBufferWO, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dWO == clang::BuiltinType::OCLImage2dWO, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dArrayWO == clang::BuiltinType::OCLImage2dArrayWO, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dDepthWO == clang::BuiltinType::OCLImage2dDepthWO, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dArrayDepthWO == clang::BuiltinType::OCLImage2dArrayDepthWO, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dMSAAWO == clang::BuiltinType::OCLImage2dMSAAWO, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dArrayMSAAWO == clang::BuiltinType::OCLImage2dArrayMSAAWO, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dMSAADepthWO == clang::BuiltinType::OCLImage2dMSAADepthWO, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dArrayMSAADepthWO == clang::BuiltinType::OCLImage2dArrayMSAADepthWO, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage3dWO == clang::BuiltinType::OCLImage3dWO, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage1dRW == clang::BuiltinType::OCLImage1dRW, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage1dArrayRW == clang::BuiltinType::OCLImage1dArrayRW, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage1dBufferRW == clang::BuiltinType::OCLImage1dBufferRW, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dRW == clang::BuiltinType::OCLImage2dRW, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dArrayRW == clang::BuiltinType::OCLImage2dArrayRW, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dDepthRW == clang::BuiltinType::OCLImage2dDepthRW, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dArrayDepthRW == clang::BuiltinType::OCLImage2dArrayDepthRW, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dMSAARW == clang::BuiltinType::OCLImage2dMSAARW, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dArrayMSAARW == clang::BuiltinType::OCLImage2dArrayMSAARW, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dMSAADepthRW == clang::BuiltinType::OCLImage2dMSAADepthRW, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage2dArrayMSAADepthRW == clang::BuiltinType::OCLImage2dArrayMSAADepthRW, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLImage3dRW == clang::BuiltinType::OCLImage3dRW, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLIntelSubgroupAVCMcePayload == clang::BuiltinType::OCLIntelSubgroupAVCMcePayload, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLIntelSubgroupAVCImePayload == clang::BuiltinType::OCLIntelSubgroupAVCImePayload, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLIntelSubgroupAVCRefPayload == clang::BuiltinType::OCLIntelSubgroupAVCRefPayload, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLIntelSubgroupAVCSicPayload == clang::BuiltinType::OCLIntelSubgroupAVCSicPayload, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLIntelSubgroupAVCMceResult == clang::BuiltinType::OCLIntelSubgroupAVCMceResult, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLIntelSubgroupAVCImeResult == clang::BuiltinType::OCLIntelSubgroupAVCImeResult, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLIntelSubgroupAVCRefResult == clang::BuiltinType::OCLIntelSubgroupAVCRefResult, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLIntelSubgroupAVCSicResult == clang::BuiltinType::OCLIntelSubgroupAVCSicResult, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLIntelSubgroupAVCImeResultSingleReferenceStreamout == clang::BuiltinType::OCLIntelSubgroupAVCImeResultSingleReferenceStreamout, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLIntelSubgroupAVCImeResultDualReferenceStreamout == clang::BuiltinType::OCLIntelSubgroupAVCImeResultDualReferenceStreamout, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLIntelSubgroupAVCImeSingleReferenceStreamin == clang::BuiltinType::OCLIntelSubgroupAVCImeSingleReferenceStreamin, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLIntelSubgroupAVCImeDualReferenceStreamin == clang::BuiltinType::OCLIntelSubgroupAVCImeDualReferenceStreamin, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveInt8 == clang::BuiltinType::SveInt8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveInt16 == clang::BuiltinType::SveInt16, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveInt32 == clang::BuiltinType::SveInt32, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveInt64 == clang::BuiltinType::SveInt64, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveUint8 == clang::BuiltinType::SveUint8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveUint16 == clang::BuiltinType::SveUint16, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveUint32 == clang::BuiltinType::SveUint32, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveUint64 == clang::BuiltinType::SveUint64, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveFloat16 == clang::BuiltinType::SveFloat16, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveFloat32 == clang::BuiltinType::SveFloat32, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveFloat64 == clang::BuiltinType::SveFloat64, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveBFloat16 == clang::BuiltinType::SveBFloat16, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveMFloat8 == clang::BuiltinType::SveMFloat8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveInt8x2 == clang::BuiltinType::SveInt8x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveInt16x2 == clang::BuiltinType::SveInt16x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveInt32x2 == clang::BuiltinType::SveInt32x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveInt64x2 == clang::BuiltinType::SveInt64x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveUint8x2 == clang::BuiltinType::SveUint8x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveUint16x2 == clang::BuiltinType::SveUint16x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveUint32x2 == clang::BuiltinType::SveUint32x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveUint64x2 == clang::BuiltinType::SveUint64x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveFloat16x2 == clang::BuiltinType::SveFloat16x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveFloat32x2 == clang::BuiltinType::SveFloat32x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveFloat64x2 == clang::BuiltinType::SveFloat64x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveBFloat16x2 == clang::BuiltinType::SveBFloat16x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveMFloat8x2 == clang::BuiltinType::SveMFloat8x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveInt8x3 == clang::BuiltinType::SveInt8x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveInt16x3 == clang::BuiltinType::SveInt16x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveInt32x3 == clang::BuiltinType::SveInt32x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveInt64x3 == clang::BuiltinType::SveInt64x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveUint8x3 == clang::BuiltinType::SveUint8x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveUint16x3 == clang::BuiltinType::SveUint16x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveUint32x3 == clang::BuiltinType::SveUint32x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveUint64x3 == clang::BuiltinType::SveUint64x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveFloat16x3 == clang::BuiltinType::SveFloat16x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveFloat32x3 == clang::BuiltinType::SveFloat32x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveFloat64x3 == clang::BuiltinType::SveFloat64x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveBFloat16x3 == clang::BuiltinType::SveBFloat16x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveMFloat8x3 == clang::BuiltinType::SveMFloat8x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveInt8x4 == clang::BuiltinType::SveInt8x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveInt16x4 == clang::BuiltinType::SveInt16x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveInt32x4 == clang::BuiltinType::SveInt32x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveInt64x4 == clang::BuiltinType::SveInt64x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveUint8x4 == clang::BuiltinType::SveUint8x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveUint16x4 == clang::BuiltinType::SveUint16x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveUint32x4 == clang::BuiltinType::SveUint32x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveUint64x4 == clang::BuiltinType::SveUint64x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveFloat16x4 == clang::BuiltinType::SveFloat16x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveFloat32x4 == clang::BuiltinType::SveFloat32x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveFloat64x4 == clang::BuiltinType::SveFloat64x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveBFloat16x4 == clang::BuiltinType::SveBFloat16x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveMFloat8x4 == clang::BuiltinType::SveMFloat8x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveBool == clang::BuiltinType::SveBool, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveBoolx2 == clang::BuiltinType::SveBoolx2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveBoolx4 == clang::BuiltinType::SveBoolx4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveCount == clang::BuiltinType::SveCount, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeMFloat8 == clang::BuiltinType::MFloat8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeVectorQuad == clang::BuiltinType::VectorQuad, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeVectorPair == clang::BuiltinType::VectorPair, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf8 == clang::BuiltinType::RvvInt8mf8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf4 == clang::BuiltinType::RvvInt8mf4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf2 == clang::BuiltinType::RvvInt8mf2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8m1 == clang::BuiltinType::RvvInt8m1, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8m2 == clang::BuiltinType::RvvInt8m2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8m4 == clang::BuiltinType::RvvInt8m4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8m8 == clang::BuiltinType::RvvInt8m8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf8 == clang::BuiltinType::RvvUint8mf8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf4 == clang::BuiltinType::RvvUint8mf4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf2 == clang::BuiltinType::RvvUint8mf2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8m1 == clang::BuiltinType::RvvUint8m1, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8m2 == clang::BuiltinType::RvvUint8m2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8m4 == clang::BuiltinType::RvvUint8m4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8m8 == clang::BuiltinType::RvvUint8m8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16mf4 == clang::BuiltinType::RvvInt16mf4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16mf2 == clang::BuiltinType::RvvInt16mf2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16m1 == clang::BuiltinType::RvvInt16m1, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16m2 == clang::BuiltinType::RvvInt16m2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16m4 == clang::BuiltinType::RvvInt16m4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16m8 == clang::BuiltinType::RvvInt16m8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16mf4 == clang::BuiltinType::RvvUint16mf4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16mf2 == clang::BuiltinType::RvvUint16mf2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16m1 == clang::BuiltinType::RvvUint16m1, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16m2 == clang::BuiltinType::RvvUint16m2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16m4 == clang::BuiltinType::RvvUint16m4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16m8 == clang::BuiltinType::RvvUint16m8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32mf2 == clang::BuiltinType::RvvInt32mf2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32m1 == clang::BuiltinType::RvvInt32m1, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32m2 == clang::BuiltinType::RvvInt32m2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32m4 == clang::BuiltinType::RvvInt32m4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32m8 == clang::BuiltinType::RvvInt32m8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32mf2 == clang::BuiltinType::RvvUint32mf2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32m1 == clang::BuiltinType::RvvUint32m1, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32m2 == clang::BuiltinType::RvvUint32m2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32m4 == clang::BuiltinType::RvvUint32m4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32m8 == clang::BuiltinType::RvvUint32m8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt64m1 == clang::BuiltinType::RvvInt64m1, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt64m2 == clang::BuiltinType::RvvInt64m2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt64m4 == clang::BuiltinType::RvvInt64m4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt64m8 == clang::BuiltinType::RvvInt64m8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint64m1 == clang::BuiltinType::RvvUint64m1, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint64m2 == clang::BuiltinType::RvvUint64m2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint64m4 == clang::BuiltinType::RvvUint64m4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint64m8 == clang::BuiltinType::RvvUint64m8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16mf4 == clang::BuiltinType::RvvFloat16mf4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16mf2 == clang::BuiltinType::RvvFloat16mf2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16m1 == clang::BuiltinType::RvvFloat16m1, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16m2 == clang::BuiltinType::RvvFloat16m2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16m4 == clang::BuiltinType::RvvFloat16m4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16m8 == clang::BuiltinType::RvvFloat16m8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16mf4 == clang::BuiltinType::RvvBFloat16mf4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16mf2 == clang::BuiltinType::RvvBFloat16mf2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16m1 == clang::BuiltinType::RvvBFloat16m1, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16m2 == clang::BuiltinType::RvvBFloat16m2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16m4 == clang::BuiltinType::RvvBFloat16m4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16m8 == clang::BuiltinType::RvvBFloat16m8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32mf2 == clang::BuiltinType::RvvFloat32mf2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32m1 == clang::BuiltinType::RvvFloat32m1, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32m2 == clang::BuiltinType::RvvFloat32m2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32m4 == clang::BuiltinType::RvvFloat32m4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32m8 == clang::BuiltinType::RvvFloat32m8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat64m1 == clang::BuiltinType::RvvFloat64m1, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat64m2 == clang::BuiltinType::RvvFloat64m2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat64m4 == clang::BuiltinType::RvvFloat64m4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat64m8 == clang::BuiltinType::RvvFloat64m8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBool1 == clang::BuiltinType::RvvBool1, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBool2 == clang::BuiltinType::RvvBool2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBool4 == clang::BuiltinType::RvvBool4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBool8 == clang::BuiltinType::RvvBool8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBool16 == clang::BuiltinType::RvvBool16, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBool32 == clang::BuiltinType::RvvBool32, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBool64 == clang::BuiltinType::RvvBool64, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf8x2 == clang::BuiltinType::RvvInt8mf8x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf8x3 == clang::BuiltinType::RvvInt8mf8x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf8x4 == clang::BuiltinType::RvvInt8mf8x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf8x5 == clang::BuiltinType::RvvInt8mf8x5, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf8x6 == clang::BuiltinType::RvvInt8mf8x6, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf8x7 == clang::BuiltinType::RvvInt8mf8x7, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf8x8 == clang::BuiltinType::RvvInt8mf8x8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf4x2 == clang::BuiltinType::RvvInt8mf4x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf4x3 == clang::BuiltinType::RvvInt8mf4x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf4x4 == clang::BuiltinType::RvvInt8mf4x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf4x5 == clang::BuiltinType::RvvInt8mf4x5, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf4x6 == clang::BuiltinType::RvvInt8mf4x6, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf4x7 == clang::BuiltinType::RvvInt8mf4x7, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf4x8 == clang::BuiltinType::RvvInt8mf4x8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf2x2 == clang::BuiltinType::RvvInt8mf2x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf2x3 == clang::BuiltinType::RvvInt8mf2x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf2x4 == clang::BuiltinType::RvvInt8mf2x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf2x5 == clang::BuiltinType::RvvInt8mf2x5, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf2x6 == clang::BuiltinType::RvvInt8mf2x6, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf2x7 == clang::BuiltinType::RvvInt8mf2x7, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8mf2x8 == clang::BuiltinType::RvvInt8mf2x8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8m1x2 == clang::BuiltinType::RvvInt8m1x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8m1x3 == clang::BuiltinType::RvvInt8m1x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8m1x4 == clang::BuiltinType::RvvInt8m1x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8m1x5 == clang::BuiltinType::RvvInt8m1x5, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8m1x6 == clang::BuiltinType::RvvInt8m1x6, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8m1x7 == clang::BuiltinType::RvvInt8m1x7, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8m1x8 == clang::BuiltinType::RvvInt8m1x8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8m2x2 == clang::BuiltinType::RvvInt8m2x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8m2x3 == clang::BuiltinType::RvvInt8m2x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8m2x4 == clang::BuiltinType::RvvInt8m2x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt8m4x2 == clang::BuiltinType::RvvInt8m4x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf8x2 == clang::BuiltinType::RvvUint8mf8x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf8x3 == clang::BuiltinType::RvvUint8mf8x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf8x4 == clang::BuiltinType::RvvUint8mf8x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf8x5 == clang::BuiltinType::RvvUint8mf8x5, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf8x6 == clang::BuiltinType::RvvUint8mf8x6, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf8x7 == clang::BuiltinType::RvvUint8mf8x7, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf8x8 == clang::BuiltinType::RvvUint8mf8x8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf4x2 == clang::BuiltinType::RvvUint8mf4x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf4x3 == clang::BuiltinType::RvvUint8mf4x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf4x4 == clang::BuiltinType::RvvUint8mf4x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf4x5 == clang::BuiltinType::RvvUint8mf4x5, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf4x6 == clang::BuiltinType::RvvUint8mf4x6, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf4x7 == clang::BuiltinType::RvvUint8mf4x7, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf4x8 == clang::BuiltinType::RvvUint8mf4x8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf2x2 == clang::BuiltinType::RvvUint8mf2x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf2x3 == clang::BuiltinType::RvvUint8mf2x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf2x4 == clang::BuiltinType::RvvUint8mf2x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf2x5 == clang::BuiltinType::RvvUint8mf2x5, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf2x6 == clang::BuiltinType::RvvUint8mf2x6, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf2x7 == clang::BuiltinType::RvvUint8mf2x7, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8mf2x8 == clang::BuiltinType::RvvUint8mf2x8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8m1x2 == clang::BuiltinType::RvvUint8m1x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8m1x3 == clang::BuiltinType::RvvUint8m1x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8m1x4 == clang::BuiltinType::RvvUint8m1x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8m1x5 == clang::BuiltinType::RvvUint8m1x5, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8m1x6 == clang::BuiltinType::RvvUint8m1x6, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8m1x7 == clang::BuiltinType::RvvUint8m1x7, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8m1x8 == clang::BuiltinType::RvvUint8m1x8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8m2x2 == clang::BuiltinType::RvvUint8m2x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8m2x3 == clang::BuiltinType::RvvUint8m2x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8m2x4 == clang::BuiltinType::RvvUint8m2x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint8m4x2 == clang::BuiltinType::RvvUint8m4x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16mf4x2 == clang::BuiltinType::RvvInt16mf4x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16mf4x3 == clang::BuiltinType::RvvInt16mf4x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16mf4x4 == clang::BuiltinType::RvvInt16mf4x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16mf4x5 == clang::BuiltinType::RvvInt16mf4x5, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16mf4x6 == clang::BuiltinType::RvvInt16mf4x6, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16mf4x7 == clang::BuiltinType::RvvInt16mf4x7, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16mf4x8 == clang::BuiltinType::RvvInt16mf4x8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16mf2x2 == clang::BuiltinType::RvvInt16mf2x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16mf2x3 == clang::BuiltinType::RvvInt16mf2x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16mf2x4 == clang::BuiltinType::RvvInt16mf2x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16mf2x5 == clang::BuiltinType::RvvInt16mf2x5, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16mf2x6 == clang::BuiltinType::RvvInt16mf2x6, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16mf2x7 == clang::BuiltinType::RvvInt16mf2x7, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16mf2x8 == clang::BuiltinType::RvvInt16mf2x8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16m1x2 == clang::BuiltinType::RvvInt16m1x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16m1x3 == clang::BuiltinType::RvvInt16m1x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16m1x4 == clang::BuiltinType::RvvInt16m1x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16m1x5 == clang::BuiltinType::RvvInt16m1x5, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16m1x6 == clang::BuiltinType::RvvInt16m1x6, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16m1x7 == clang::BuiltinType::RvvInt16m1x7, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16m1x8 == clang::BuiltinType::RvvInt16m1x8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16m2x2 == clang::BuiltinType::RvvInt16m2x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16m2x3 == clang::BuiltinType::RvvInt16m2x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16m2x4 == clang::BuiltinType::RvvInt16m2x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt16m4x2 == clang::BuiltinType::RvvInt16m4x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16mf4x2 == clang::BuiltinType::RvvUint16mf4x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16mf4x3 == clang::BuiltinType::RvvUint16mf4x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16mf4x4 == clang::BuiltinType::RvvUint16mf4x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16mf4x5 == clang::BuiltinType::RvvUint16mf4x5, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16mf4x6 == clang::BuiltinType::RvvUint16mf4x6, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16mf4x7 == clang::BuiltinType::RvvUint16mf4x7, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16mf4x8 == clang::BuiltinType::RvvUint16mf4x8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16mf2x2 == clang::BuiltinType::RvvUint16mf2x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16mf2x3 == clang::BuiltinType::RvvUint16mf2x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16mf2x4 == clang::BuiltinType::RvvUint16mf2x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16mf2x5 == clang::BuiltinType::RvvUint16mf2x5, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16mf2x6 == clang::BuiltinType::RvvUint16mf2x6, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16mf2x7 == clang::BuiltinType::RvvUint16mf2x7, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16mf2x8 == clang::BuiltinType::RvvUint16mf2x8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16m1x2 == clang::BuiltinType::RvvUint16m1x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16m1x3 == clang::BuiltinType::RvvUint16m1x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16m1x4 == clang::BuiltinType::RvvUint16m1x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16m1x5 == clang::BuiltinType::RvvUint16m1x5, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16m1x6 == clang::BuiltinType::RvvUint16m1x6, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16m1x7 == clang::BuiltinType::RvvUint16m1x7, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16m1x8 == clang::BuiltinType::RvvUint16m1x8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16m2x2 == clang::BuiltinType::RvvUint16m2x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16m2x3 == clang::BuiltinType::RvvUint16m2x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16m2x4 == clang::BuiltinType::RvvUint16m2x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint16m4x2 == clang::BuiltinType::RvvUint16m4x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32mf2x2 == clang::BuiltinType::RvvInt32mf2x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32mf2x3 == clang::BuiltinType::RvvInt32mf2x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32mf2x4 == clang::BuiltinType::RvvInt32mf2x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32mf2x5 == clang::BuiltinType::RvvInt32mf2x5, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32mf2x6 == clang::BuiltinType::RvvInt32mf2x6, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32mf2x7 == clang::BuiltinType::RvvInt32mf2x7, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32mf2x8 == clang::BuiltinType::RvvInt32mf2x8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32m1x2 == clang::BuiltinType::RvvInt32m1x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32m1x3 == clang::BuiltinType::RvvInt32m1x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32m1x4 == clang::BuiltinType::RvvInt32m1x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32m1x5 == clang::BuiltinType::RvvInt32m1x5, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32m1x6 == clang::BuiltinType::RvvInt32m1x6, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32m1x7 == clang::BuiltinType::RvvInt32m1x7, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32m1x8 == clang::BuiltinType::RvvInt32m1x8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32m2x2 == clang::BuiltinType::RvvInt32m2x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32m2x3 == clang::BuiltinType::RvvInt32m2x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32m2x4 == clang::BuiltinType::RvvInt32m2x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt32m4x2 == clang::BuiltinType::RvvInt32m4x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32mf2x2 == clang::BuiltinType::RvvUint32mf2x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32mf2x3 == clang::BuiltinType::RvvUint32mf2x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32mf2x4 == clang::BuiltinType::RvvUint32mf2x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32mf2x5 == clang::BuiltinType::RvvUint32mf2x5, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32mf2x6 == clang::BuiltinType::RvvUint32mf2x6, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32mf2x7 == clang::BuiltinType::RvvUint32mf2x7, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32mf2x8 == clang::BuiltinType::RvvUint32mf2x8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32m1x2 == clang::BuiltinType::RvvUint32m1x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32m1x3 == clang::BuiltinType::RvvUint32m1x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32m1x4 == clang::BuiltinType::RvvUint32m1x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32m1x5 == clang::BuiltinType::RvvUint32m1x5, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32m1x6 == clang::BuiltinType::RvvUint32m1x6, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32m1x7 == clang::BuiltinType::RvvUint32m1x7, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32m1x8 == clang::BuiltinType::RvvUint32m1x8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32m2x2 == clang::BuiltinType::RvvUint32m2x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32m2x3 == clang::BuiltinType::RvvUint32m2x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32m2x4 == clang::BuiltinType::RvvUint32m2x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint32m4x2 == clang::BuiltinType::RvvUint32m4x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt64m1x2 == clang::BuiltinType::RvvInt64m1x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt64m1x3 == clang::BuiltinType::RvvInt64m1x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt64m1x4 == clang::BuiltinType::RvvInt64m1x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt64m1x5 == clang::BuiltinType::RvvInt64m1x5, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt64m1x6 == clang::BuiltinType::RvvInt64m1x6, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt64m1x7 == clang::BuiltinType::RvvInt64m1x7, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt64m1x8 == clang::BuiltinType::RvvInt64m1x8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt64m2x2 == clang::BuiltinType::RvvInt64m2x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt64m2x3 == clang::BuiltinType::RvvInt64m2x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt64m2x4 == clang::BuiltinType::RvvInt64m2x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvInt64m4x2 == clang::BuiltinType::RvvInt64m4x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint64m1x2 == clang::BuiltinType::RvvUint64m1x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint64m1x3 == clang::BuiltinType::RvvUint64m1x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint64m1x4 == clang::BuiltinType::RvvUint64m1x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint64m1x5 == clang::BuiltinType::RvvUint64m1x5, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint64m1x6 == clang::BuiltinType::RvvUint64m1x6, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint64m1x7 == clang::BuiltinType::RvvUint64m1x7, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint64m1x8 == clang::BuiltinType::RvvUint64m1x8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint64m2x2 == clang::BuiltinType::RvvUint64m2x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint64m2x3 == clang::BuiltinType::RvvUint64m2x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint64m2x4 == clang::BuiltinType::RvvUint64m2x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvUint64m4x2 == clang::BuiltinType::RvvUint64m4x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16mf4x2 == clang::BuiltinType::RvvFloat16mf4x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16mf4x3 == clang::BuiltinType::RvvFloat16mf4x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16mf4x4 == clang::BuiltinType::RvvFloat16mf4x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16mf4x5 == clang::BuiltinType::RvvFloat16mf4x5, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16mf4x6 == clang::BuiltinType::RvvFloat16mf4x6, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16mf4x7 == clang::BuiltinType::RvvFloat16mf4x7, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16mf4x8 == clang::BuiltinType::RvvFloat16mf4x8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16mf2x2 == clang::BuiltinType::RvvFloat16mf2x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16mf2x3 == clang::BuiltinType::RvvFloat16mf2x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16mf2x4 == clang::BuiltinType::RvvFloat16mf2x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16mf2x5 == clang::BuiltinType::RvvFloat16mf2x5, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16mf2x6 == clang::BuiltinType::RvvFloat16mf2x6, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16mf2x7 == clang::BuiltinType::RvvFloat16mf2x7, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16mf2x8 == clang::BuiltinType::RvvFloat16mf2x8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16m1x2 == clang::BuiltinType::RvvFloat16m1x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16m1x3 == clang::BuiltinType::RvvFloat16m1x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16m1x4 == clang::BuiltinType::RvvFloat16m1x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16m1x5 == clang::BuiltinType::RvvFloat16m1x5, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16m1x6 == clang::BuiltinType::RvvFloat16m1x6, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16m1x7 == clang::BuiltinType::RvvFloat16m1x7, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16m1x8 == clang::BuiltinType::RvvFloat16m1x8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16m2x2 == clang::BuiltinType::RvvFloat16m2x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16m2x3 == clang::BuiltinType::RvvFloat16m2x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16m2x4 == clang::BuiltinType::RvvFloat16m2x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat16m4x2 == clang::BuiltinType::RvvFloat16m4x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32mf2x2 == clang::BuiltinType::RvvFloat32mf2x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32mf2x3 == clang::BuiltinType::RvvFloat32mf2x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32mf2x4 == clang::BuiltinType::RvvFloat32mf2x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32mf2x5 == clang::BuiltinType::RvvFloat32mf2x5, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32mf2x6 == clang::BuiltinType::RvvFloat32mf2x6, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32mf2x7 == clang::BuiltinType::RvvFloat32mf2x7, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32mf2x8 == clang::BuiltinType::RvvFloat32mf2x8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32m1x2 == clang::BuiltinType::RvvFloat32m1x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32m1x3 == clang::BuiltinType::RvvFloat32m1x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32m1x4 == clang::BuiltinType::RvvFloat32m1x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32m1x5 == clang::BuiltinType::RvvFloat32m1x5, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32m1x6 == clang::BuiltinType::RvvFloat32m1x6, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32m1x7 == clang::BuiltinType::RvvFloat32m1x7, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32m1x8 == clang::BuiltinType::RvvFloat32m1x8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32m2x2 == clang::BuiltinType::RvvFloat32m2x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32m2x3 == clang::BuiltinType::RvvFloat32m2x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32m2x4 == clang::BuiltinType::RvvFloat32m2x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat32m4x2 == clang::BuiltinType::RvvFloat32m4x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat64m1x2 == clang::BuiltinType::RvvFloat64m1x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat64m1x3 == clang::BuiltinType::RvvFloat64m1x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat64m1x4 == clang::BuiltinType::RvvFloat64m1x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat64m1x5 == clang::BuiltinType::RvvFloat64m1x5, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat64m1x6 == clang::BuiltinType::RvvFloat64m1x6, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat64m1x7 == clang::BuiltinType::RvvFloat64m1x7, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat64m1x8 == clang::BuiltinType::RvvFloat64m1x8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat64m2x2 == clang::BuiltinType::RvvFloat64m2x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat64m2x3 == clang::BuiltinType::RvvFloat64m2x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat64m2x4 == clang::BuiltinType::RvvFloat64m2x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvFloat64m4x2 == clang::BuiltinType::RvvFloat64m4x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16mf4x2 == clang::BuiltinType::RvvBFloat16mf4x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16mf4x3 == clang::BuiltinType::RvvBFloat16mf4x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16mf4x4 == clang::BuiltinType::RvvBFloat16mf4x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16mf4x5 == clang::BuiltinType::RvvBFloat16mf4x5, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16mf4x6 == clang::BuiltinType::RvvBFloat16mf4x6, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16mf4x7 == clang::BuiltinType::RvvBFloat16mf4x7, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16mf4x8 == clang::BuiltinType::RvvBFloat16mf4x8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16mf2x2 == clang::BuiltinType::RvvBFloat16mf2x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16mf2x3 == clang::BuiltinType::RvvBFloat16mf2x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16mf2x4 == clang::BuiltinType::RvvBFloat16mf2x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16mf2x5 == clang::BuiltinType::RvvBFloat16mf2x5, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16mf2x6 == clang::BuiltinType::RvvBFloat16mf2x6, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16mf2x7 == clang::BuiltinType::RvvBFloat16mf2x7, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16mf2x8 == clang::BuiltinType::RvvBFloat16mf2x8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16m1x2 == clang::BuiltinType::RvvBFloat16m1x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16m1x3 == clang::BuiltinType::RvvBFloat16m1x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16m1x4 == clang::BuiltinType::RvvBFloat16m1x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16m1x5 == clang::BuiltinType::RvvBFloat16m1x5, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16m1x6 == clang::BuiltinType::RvvBFloat16m1x6, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16m1x7 == clang::BuiltinType::RvvBFloat16m1x7, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16m1x8 == clang::BuiltinType::RvvBFloat16m1x8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16m2x2 == clang::BuiltinType::RvvBFloat16m2x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16m2x3 == clang::BuiltinType::RvvBFloat16m2x3, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16m2x4 == clang::BuiltinType::RvvBFloat16m2x4, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeRvvBFloat16m4x2 == clang::BuiltinType::RvvBFloat16m4x2, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeWasmExternRef == clang::BuiltinType::WasmExternRef, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeAMDGPUBufferRsrc == clang::BuiltinType::AMDGPUBufferRsrc, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeAMDGPUNamedWorkgroupBarrier == clang::BuiltinType::AMDGPUNamedWorkgroupBarrier, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeHLSLResource == clang::BuiltinType::HLSLResource, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeVoid == clang::BuiltinType::Void, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeBool == clang::BuiltinType::Bool, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeChar_U == clang::BuiltinType::Char_U, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeUChar == clang::BuiltinType::UChar, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeWChar_U == clang::BuiltinType::WChar_U, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeChar8 == clang::BuiltinType::Char8, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeChar16 == clang::BuiltinType::Char16, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeChar32 == clang::BuiltinType::Char32, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeUShort == clang::BuiltinType::UShort, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeUInt == clang::BuiltinType::UInt, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeULong == clang::BuiltinType::ULong, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeULongLong == clang::BuiltinType::ULongLong, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeUInt128 == clang::BuiltinType::UInt128, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeChar_S == clang::BuiltinType::Char_S, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSChar == clang::BuiltinType::SChar, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeWChar_S == clang::BuiltinType::WChar_S, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeShort == clang::BuiltinType::Short, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeInt == clang::BuiltinType::Int, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeLong == clang::BuiltinType::Long, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeLongLong == clang::BuiltinType::LongLong, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeInt128 == clang::BuiltinType::Int128, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeShortAccum == clang::BuiltinType::ShortAccum, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeAccum == clang::BuiltinType::Accum, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeLongAccum == clang::BuiltinType::LongAccum, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeUShortAccum == clang::BuiltinType::UShortAccum, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeUAccum == clang::BuiltinType::UAccum, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeULongAccum == clang::BuiltinType::ULongAccum, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeShortFract == clang::BuiltinType::ShortFract, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeFract == clang::BuiltinType::Fract, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeLongFract == clang::BuiltinType::LongFract, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeUShortFract == clang::BuiltinType::UShortFract, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeUFract == clang::BuiltinType::UFract, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeULongFract == clang::BuiltinType::ULongFract, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSatShortAccum == clang::BuiltinType::SatShortAccum, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSatAccum == clang::BuiltinType::SatAccum, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSatLongAccum == clang::BuiltinType::SatLongAccum, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSatUShortAccum == clang::BuiltinType::SatUShortAccum, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSatUAccum == clang::BuiltinType::SatUAccum, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSatULongAccum == clang::BuiltinType::SatULongAccum, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSatShortFract == clang::BuiltinType::SatShortFract, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSatFract == clang::BuiltinType::SatFract, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSatLongFract == clang::BuiltinType::SatLongFract, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSatUShortFract == clang::BuiltinType::SatUShortFract, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSatUFract == clang::BuiltinType::SatUFract, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSatULongFract == clang::BuiltinType::SatULongFract, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeHalf == clang::BuiltinType::Half, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeFloat == clang::BuiltinType::Float, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeDouble == clang::BuiltinType::Double, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeLongDouble == clang::BuiltinType::LongDouble, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeFloat16 == clang::BuiltinType::Float16, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeBFloat16 == clang::BuiltinType::BFloat16, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeFloat128 == clang::BuiltinType::Float128, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeIbm128 == clang::BuiltinType::Ibm128, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeNullPtr == clang::BuiltinType::NullPtr, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeObjCId == clang::BuiltinType::ObjCId, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeObjCClass == clang::BuiltinType::ObjCClass, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeObjCSel == clang::BuiltinType::ObjCSel, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLSampler == clang::BuiltinType::OCLSampler, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLEvent == clang::BuiltinType::OCLEvent, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLClkEvent == clang::BuiltinType::OCLClkEvent, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLQueue == clang::BuiltinType::OCLQueue, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOCLReserveID == clang::BuiltinType::OCLReserveID, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeDependent == clang::BuiltinType::Dependent, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOverload == clang::BuiltinType::Overload, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeBoundMember == clang::BuiltinType::BoundMember, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeUnresolvedTemplate == clang::BuiltinType::UnresolvedTemplate, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypePseudoObject == clang::BuiltinType::PseudoObject, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeUnknownAny == clang::BuiltinType::UnknownAny, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeBuiltinFn == clang::BuiltinType::BuiltinFn, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeARCUnbridgedCast == clang::BuiltinType::ARCUnbridgedCast, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeIncompleteMatrixIdx == clang::BuiltinType::IncompleteMatrixIdx, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOMPArrayShaping == clang::BuiltinType::OMPArrayShaping, ""); -static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeOMPIterator == clang::BuiltinType::OMPIterator, ""); - -void ZigClang_detect_enum_CallingConv(clang::CallingConv x) { - switch (x) { - case clang::CC_C: - case clang::CC_X86StdCall: - case clang::CC_X86FastCall: - case clang::CC_X86ThisCall: - case clang::CC_X86VectorCall: - case clang::CC_X86Pascal: - case clang::CC_Win64: - case clang::CC_X86_64SysV: - case clang::CC_X86RegCall: - case clang::CC_AAPCS: - case clang::CC_AAPCS_VFP: - case clang::CC_IntelOclBicc: - case clang::CC_SpirFunction: - case clang::CC_OpenCLKernel: - case clang::CC_Swift: - case clang::CC_SwiftAsync: - case clang::CC_PreserveMost: - case clang::CC_PreserveAll: - case clang::CC_AArch64VectorCall: - case clang::CC_AArch64SVEPCS: - case clang::CC_AMDGPUKernelCall: - case clang::CC_M68kRTD: - case clang::CC_PreserveNone: - case clang::CC_RISCVVectorCall: - break; - } -} - -static_assert((clang::CallingConv)ZigClangCallingConv_C == clang::CC_C, ""); -static_assert((clang::CallingConv)ZigClangCallingConv_X86StdCall == clang::CC_X86StdCall, ""); -static_assert((clang::CallingConv)ZigClangCallingConv_X86FastCall == clang::CC_X86FastCall, ""); -static_assert((clang::CallingConv)ZigClangCallingConv_X86ThisCall == clang::CC_X86ThisCall, ""); -static_assert((clang::CallingConv)ZigClangCallingConv_X86VectorCall == clang::CC_X86VectorCall, ""); -static_assert((clang::CallingConv)ZigClangCallingConv_X86Pascal == clang::CC_X86Pascal, ""); -static_assert((clang::CallingConv)ZigClangCallingConv_Win64 == clang::CC_Win64, ""); -static_assert((clang::CallingConv)ZigClangCallingConv_X86_64SysV == clang::CC_X86_64SysV, ""); -static_assert((clang::CallingConv)ZigClangCallingConv_X86RegCall == clang::CC_X86RegCall, ""); -static_assert((clang::CallingConv)ZigClangCallingConv_AAPCS == clang::CC_AAPCS, ""); -static_assert((clang::CallingConv)ZigClangCallingConv_AAPCS_VFP == clang::CC_AAPCS_VFP, ""); -static_assert((clang::CallingConv)ZigClangCallingConv_IntelOclBicc == clang::CC_IntelOclBicc, ""); -static_assert((clang::CallingConv)ZigClangCallingConv_SpirFunction == clang::CC_SpirFunction, ""); -static_assert((clang::CallingConv)ZigClangCallingConv_OpenCLKernel == clang::CC_OpenCLKernel, ""); -static_assert((clang::CallingConv)ZigClangCallingConv_Swift == clang::CC_Swift, ""); -static_assert((clang::CallingConv)ZigClangCallingConv_SwiftAsync == clang::CC_SwiftAsync, ""); -static_assert((clang::CallingConv)ZigClangCallingConv_PreserveMost == clang::CC_PreserveMost, ""); -static_assert((clang::CallingConv)ZigClangCallingConv_PreserveAll == clang::CC_PreserveAll, ""); -static_assert((clang::CallingConv)ZigClangCallingConv_AArch64VectorCall == clang::CC_AArch64VectorCall, ""); -static_assert((clang::CallingConv)ZigClangCallingConv_AArch64SVEPCS == clang::CC_AArch64SVEPCS, ""); -static_assert((clang::CallingConv)ZigClangCallingConv_AMDGPUKernelCall == clang::CC_AMDGPUKernelCall, ""); -static_assert((clang::CallingConv)ZigClangCallingConv_M68kRTD == clang::CC_M68kRTD, ""); -static_assert((clang::CallingConv)ZigClangCallingConv_PreserveNone == clang::CC_PreserveNone, ""); -static_assert((clang::CallingConv)ZigClangCallingConv_RISCVVectorCall == clang::CC_RISCVVectorCall, ""); - -void ZigClang_detect_enum_StorageClass(clang::StorageClass x) { - switch (x) { - case clang::SC_None: - case clang::SC_Extern: - case clang::SC_Static: - case clang::SC_PrivateExtern: - case clang::SC_Auto: - case clang::SC_Register: - break; - } -} - -static_assert((clang::StorageClass)ZigClangStorageClass_None == clang::SC_None, ""); -static_assert((clang::StorageClass)ZigClangStorageClass_Extern == clang::SC_Extern, ""); -static_assert((clang::StorageClass)ZigClangStorageClass_Static == clang::SC_Static, ""); -static_assert((clang::StorageClass)ZigClangStorageClass_PrivateExtern == clang::SC_PrivateExtern, ""); -static_assert((clang::StorageClass)ZigClangStorageClass_Auto == clang::SC_Auto, ""); -static_assert((clang::StorageClass)ZigClangStorageClass_Register == clang::SC_Register, ""); - -void ZigClang_detect_enum_RoundingMode(llvm::RoundingMode x) { - switch (x) { - case llvm::RoundingMode::TowardZero: - case llvm::RoundingMode::NearestTiesToEven: - case llvm::RoundingMode::TowardPositive: - case llvm::RoundingMode::TowardNegative: - case llvm::RoundingMode::NearestTiesToAway: - case llvm::RoundingMode::Dynamic: - case llvm::RoundingMode::Invalid: - break; - } -} -static_assert((llvm::RoundingMode)ZigClangAPFloat_roundingMode_NearestTiesToEven == llvm::RoundingMode::NearestTiesToEven, ""); -static_assert((llvm::RoundingMode)ZigClangAPFloat_roundingMode_TowardPositive == llvm::RoundingMode::TowardPositive, ""); -static_assert((llvm::RoundingMode)ZigClangAPFloat_roundingMode_TowardNegative == llvm::RoundingMode::TowardNegative, ""); -static_assert((llvm::RoundingMode)ZigClangAPFloat_roundingMode_TowardZero == llvm::RoundingMode::TowardZero, ""); -static_assert((llvm::RoundingMode)ZigClangAPFloat_roundingMode_NearestTiesToAway == llvm::RoundingMode::NearestTiesToAway, ""); -static_assert((llvm::RoundingMode)ZigClangAPFloat_roundingMode_Dynamic == llvm::RoundingMode::Dynamic, ""); -static_assert((llvm::RoundingMode)ZigClangAPFloat_roundingMode_Invalid == llvm::RoundingMode::Invalid, ""); - -void ZigClang_detect_enum_CharacterLiteralKind(clang::CharacterLiteralKind x) { - switch (x) { - case clang::CharacterLiteralKind::Ascii: - case clang::CharacterLiteralKind::Wide: - case clang::CharacterLiteralKind::UTF8: - case clang::CharacterLiteralKind::UTF16: - case clang::CharacterLiteralKind::UTF32: - break; - } -} -static_assert((clang::CharacterLiteralKind)ZigClangCharacterLiteralKind_Ascii == clang::CharacterLiteralKind::Ascii, ""); -static_assert((clang::CharacterLiteralKind)ZigClangCharacterLiteralKind_Wide == clang::CharacterLiteralKind::Wide, ""); -static_assert((clang::CharacterLiteralKind)ZigClangCharacterLiteralKind_UTF8 == clang::CharacterLiteralKind::UTF8, ""); -static_assert((clang::CharacterLiteralKind)ZigClangCharacterLiteralKind_UTF16 == clang::CharacterLiteralKind::UTF16, ""); -static_assert((clang::CharacterLiteralKind)ZigClangCharacterLiteralKind_UTF32 == clang::CharacterLiteralKind::UTF32, ""); - -void ZigClang_detect_enum_ElaboratedTypeKeyword(clang::ElaboratedTypeKeyword x) { - switch (x) { - case clang::ElaboratedTypeKeyword::Struct: - case clang::ElaboratedTypeKeyword::Interface: - case clang::ElaboratedTypeKeyword::Union: - case clang::ElaboratedTypeKeyword::Class: - case clang::ElaboratedTypeKeyword::Enum: - case clang::ElaboratedTypeKeyword::Typename: - case clang::ElaboratedTypeKeyword::None: - break; - } -} -static_assert((clang::ElaboratedTypeKeyword)ZigClangElaboratedTypeKeyword_Struct == clang::ElaboratedTypeKeyword::Struct, ""); -static_assert((clang::ElaboratedTypeKeyword)ZigClangElaboratedTypeKeyword_Interface == clang::ElaboratedTypeKeyword::Interface, ""); -static_assert((clang::ElaboratedTypeKeyword)ZigClangElaboratedTypeKeyword_Union == clang::ElaboratedTypeKeyword::Union, ""); -static_assert((clang::ElaboratedTypeKeyword)ZigClangElaboratedTypeKeyword_Class == clang::ElaboratedTypeKeyword::Class, ""); -static_assert((clang::ElaboratedTypeKeyword)ZigClangElaboratedTypeKeyword_Enum == clang::ElaboratedTypeKeyword::Enum, ""); -static_assert((clang::ElaboratedTypeKeyword)ZigClangElaboratedTypeKeyword_Typename == clang::ElaboratedTypeKeyword::Typename, ""); -static_assert((clang::ElaboratedTypeKeyword)ZigClangElaboratedTypeKeyword_None == clang::ElaboratedTypeKeyword::None, ""); - -void ZigClang_detect_enum_EntityKind(clang::PreprocessedEntity::EntityKind x) { - switch (x) { - case clang::PreprocessedEntity::InvalidKind: - case clang::PreprocessedEntity::MacroExpansionKind: - case clang::PreprocessedEntity::MacroDefinitionKind: - case clang::PreprocessedEntity::InclusionDirectiveKind: - break; - } -} -static_assert((clang::PreprocessedEntity::EntityKind)ZigClangPreprocessedEntity_InvalidKind == clang::PreprocessedEntity::InvalidKind, ""); -static_assert((clang::PreprocessedEntity::EntityKind)ZigClangPreprocessedEntity_MacroExpansionKind == clang::PreprocessedEntity::MacroExpansionKind, ""); -static_assert((clang::PreprocessedEntity::EntityKind)ZigClangPreprocessedEntity_MacroDefinitionKind == clang::PreprocessedEntity::MacroDefinitionKind, ""); -static_assert((clang::PreprocessedEntity::EntityKind)ZigClangPreprocessedEntity_InclusionDirectiveKind == clang::PreprocessedEntity::InclusionDirectiveKind, ""); - - -void ZigClang_detect_enum_ConstantExprKind(clang::Expr::ConstantExprKind x) { - switch (x) { - case clang::Expr::ConstantExprKind::Normal: - case clang::Expr::ConstantExprKind::NonClassTemplateArgument: - case clang::Expr::ConstantExprKind::ClassTemplateArgument: - case clang::Expr::ConstantExprKind::ImmediateInvocation: - break; - } -} -static_assert((clang::Expr::ConstantExprKind)ZigClangExpr_ConstantExprKind_Normal == clang::Expr::ConstantExprKind::Normal, ""); -static_assert((clang::Expr::ConstantExprKind)ZigClangExpr_ConstantExprKind_NonClassTemplateArgument == clang::Expr::ConstantExprKind::NonClassTemplateArgument, ""); -static_assert((clang::Expr::ConstantExprKind)ZigClangExpr_ConstantExprKind_ClassTemplateArgument == clang::Expr::ConstantExprKind::ClassTemplateArgument, ""); -static_assert((clang::Expr::ConstantExprKind)ZigClangExpr_ConstantExprKind_ImmediateInvocation == clang::Expr::ConstantExprKind::ImmediateInvocation, ""); - -static_assert((clang::UnaryExprOrTypeTrait)ZigClangUnaryExprOrTypeTrait_Kind::ZigClangUnaryExprOrTypeTrait_KindSizeOf == clang::UnaryExprOrTypeTrait::UETT_SizeOf, ""); -static_assert((clang::UnaryExprOrTypeTrait)ZigClangUnaryExprOrTypeTrait_Kind::ZigClangUnaryExprOrTypeTrait_KindDataSizeOf == clang::UnaryExprOrTypeTrait::UETT_DataSizeOf, ""); -static_assert((clang::UnaryExprOrTypeTrait)ZigClangUnaryExprOrTypeTrait_Kind::ZigClangUnaryExprOrTypeTrait_KindAlignOf == clang::UnaryExprOrTypeTrait::UETT_AlignOf, ""); -static_assert((clang::UnaryExprOrTypeTrait)ZigClangUnaryExprOrTypeTrait_Kind::ZigClangUnaryExprOrTypeTrait_KindPreferredAlignOf == clang::UnaryExprOrTypeTrait::UETT_PreferredAlignOf, ""); -static_assert((clang::UnaryExprOrTypeTrait)ZigClangUnaryExprOrTypeTrait_Kind::ZigClangUnaryExprOrTypeTrait_KindPtrAuthTypeDiscriminator == clang::UnaryExprOrTypeTrait::UETT_PtrAuthTypeDiscriminator, ""); -static_assert((clang::UnaryExprOrTypeTrait)ZigClangUnaryExprOrTypeTrait_Kind::ZigClangUnaryExprOrTypeTrait_KindVecStep == clang::UnaryExprOrTypeTrait::UETT_VecStep, ""); -static_assert((clang::UnaryExprOrTypeTrait)ZigClangUnaryExprOrTypeTrait_Kind::ZigClangUnaryExprOrTypeTrait_KindOpenMPRequiredSimdAlign == clang::UnaryExprOrTypeTrait::UETT_OpenMPRequiredSimdAlign, ""); - -static_assert(sizeof(ZigClangAPValue) == sizeof(clang::APValue), ""); -static_assert(alignof(ZigClangAPValue) == alignof(clang::APValue), ""); - -static_assert(sizeof(ZigClangSourceLocation) == sizeof(clang::SourceLocation), ""); -static ZigClangSourceLocation bitcast(clang::SourceLocation src) { - ZigClangSourceLocation dest; - memcpy(&dest, static_cast(&src), sizeof(ZigClangSourceLocation)); - return dest; -} -static clang::SourceLocation bitcast(ZigClangSourceLocation src) { - clang::SourceLocation dest; - memcpy(&dest, static_cast(&src), sizeof(ZigClangSourceLocation)); - return dest; -} - -static_assert(sizeof(ZigClangQualType) == sizeof(clang::QualType), ""); -static ZigClangQualType bitcast(clang::QualType src) { - ZigClangQualType dest; - memcpy(&dest, static_cast(&src), sizeof(ZigClangQualType)); - return dest; -} -static clang::QualType bitcast(ZigClangQualType src) { - clang::QualType dest; - memcpy(&dest, static_cast(&src), sizeof(ZigClangQualType)); - return dest; -} - -static_assert(sizeof(ZigClangExprEvalResult) == sizeof(clang::Expr::EvalResult), ""); -static ZigClangExprEvalResult bitcast(clang::Expr::EvalResult src) { - ZigClangExprEvalResult dest; - memcpy(&dest, static_cast(&src), sizeof(ZigClangExprEvalResult)); - return dest; -} - -static_assert(sizeof(ZigClangAPValueLValueBase) == sizeof(clang::APValue::LValueBase), ""); -static ZigClangAPValueLValueBase bitcast(clang::APValue::LValueBase src) { - ZigClangAPValueLValueBase dest; - memcpy(&dest, static_cast(&src), sizeof(ZigClangAPValueLValueBase)); - return dest; -} -static clang::APValue::LValueBase bitcast(ZigClangAPValueLValueBase src) { - clang::APValue::LValueBase dest; - memcpy(&dest, static_cast(&src), sizeof(ZigClangAPValueLValueBase)); - return dest; -} - -static_assert(sizeof(ZigClangCompoundStmt_const_body_iterator) == sizeof(clang::CompoundStmt::const_body_iterator), ""); -static ZigClangCompoundStmt_const_body_iterator bitcast(clang::CompoundStmt::const_body_iterator src) { - ZigClangCompoundStmt_const_body_iterator dest; - memcpy(&dest, static_cast(&src), sizeof(ZigClangCompoundStmt_const_body_iterator)); - return dest; -} - -static_assert(sizeof(ZigClangDeclStmt_const_decl_iterator) == sizeof(clang::DeclStmt::const_decl_iterator), ""); -static ZigClangDeclStmt_const_decl_iterator bitcast(clang::DeclStmt::const_decl_iterator src) { - ZigClangDeclStmt_const_decl_iterator dest; - memcpy(&dest, static_cast(&src), sizeof(ZigClangDeclStmt_const_decl_iterator)); - return dest; -} - -static_assert(sizeof(ZigClangPreprocessingRecord_iterator) == sizeof(clang::PreprocessingRecord::iterator), ""); -static ZigClangPreprocessingRecord_iterator bitcast(clang::PreprocessingRecord::iterator src) { - ZigClangPreprocessingRecord_iterator dest; - memcpy(&dest, static_cast(&src), sizeof(ZigClangPreprocessingRecord_iterator)); - return dest; -} -static clang::PreprocessingRecord::iterator bitcast(ZigClangPreprocessingRecord_iterator src) { - clang::PreprocessingRecord::iterator dest; - memcpy(&dest, static_cast(&src), sizeof(ZigClangPreprocessingRecord_iterator)); - return dest; -} - -static_assert(sizeof(ZigClangRecordDecl_field_iterator) == sizeof(clang::RecordDecl::field_iterator), ""); -static ZigClangRecordDecl_field_iterator bitcast(clang::RecordDecl::field_iterator src) { - ZigClangRecordDecl_field_iterator dest; - memcpy(&dest, static_cast(&src), sizeof(ZigClangRecordDecl_field_iterator)); - return dest; -} -static clang::RecordDecl::field_iterator bitcast(ZigClangRecordDecl_field_iterator src) { - clang::RecordDecl::field_iterator dest; - memcpy(&dest, static_cast(&src), sizeof(ZigClangRecordDecl_field_iterator)); - return dest; -} - -static_assert(sizeof(ZigClangEnumDecl_enumerator_iterator) == sizeof(clang::EnumDecl::enumerator_iterator), ""); -static ZigClangEnumDecl_enumerator_iterator bitcast(clang::EnumDecl::enumerator_iterator src) { - ZigClangEnumDecl_enumerator_iterator dest; - memcpy(&dest, static_cast(&src), sizeof(ZigClangEnumDecl_enumerator_iterator)); - return dest; -} -static clang::EnumDecl::enumerator_iterator bitcast(ZigClangEnumDecl_enumerator_iterator src) { - clang::EnumDecl::enumerator_iterator dest; - memcpy(&dest, static_cast(&src), sizeof(ZigClangEnumDecl_enumerator_iterator)); - return dest; -} - - -ZigClangSourceLocation ZigClangSourceManager_getSpellingLoc(const ZigClangSourceManager *self, - ZigClangSourceLocation Loc) -{ - return bitcast(reinterpret_cast(self)->getSpellingLoc(bitcast(Loc))); -} - -const char *ZigClangSourceManager_getFilename(const ZigClangSourceManager *self, - ZigClangSourceLocation SpellingLoc) -{ - llvm::StringRef s = reinterpret_cast(self)->getFilename(bitcast(SpellingLoc)); - return (const char *)s.bytes_begin(); -} - -unsigned ZigClangSourceManager_getSpellingLineNumber(const ZigClangSourceManager *self, - ZigClangSourceLocation Loc) -{ - return reinterpret_cast(self)->getSpellingLineNumber(bitcast(Loc)); -} - -unsigned ZigClangSourceManager_getSpellingColumnNumber(const ZigClangSourceManager *self, - ZigClangSourceLocation Loc) -{ - return reinterpret_cast(self)->getSpellingColumnNumber(bitcast(Loc)); -} - -const char* ZigClangSourceManager_getCharacterData(const ZigClangSourceManager *self, - ZigClangSourceLocation SL) -{ - return reinterpret_cast(self)->getCharacterData(bitcast(SL)); -} - -ZigClangQualType ZigClangASTContext_getPointerType(const ZigClangASTContext* self, ZigClangQualType T) { - return bitcast(reinterpret_cast(self)->getPointerType(bitcast(T))); -} - -unsigned ZigClangASTContext_getTypeAlign(const ZigClangASTContext* self, ZigClangQualType T) { - return reinterpret_cast(self)->getTypeAlign(bitcast(T)); -} - -ZigClangASTContext *ZigClangASTUnit_getASTContext(ZigClangASTUnit *self) { - clang::ASTContext *result = &reinterpret_cast(self)->getASTContext(); - return reinterpret_cast(result); -} - -ZigClangSourceManager *ZigClangASTUnit_getSourceManager(ZigClangASTUnit *self) { - clang::SourceManager *result = &reinterpret_cast(self)->getSourceManager(); - return reinterpret_cast(result); -} - -bool ZigClangASTUnit_visitLocalTopLevelDecls(ZigClangASTUnit *self, void *context, - bool (*Fn)(void *context, const ZigClangDecl *decl)) -{ - return reinterpret_cast(self)->visitLocalTopLevelDecls(context, - reinterpret_cast(Fn)); -} - -struct ZigClangPreprocessingRecord_iterator ZigClangASTUnit_getLocalPreprocessingEntities_begin( - struct ZigClangASTUnit *self) -{ - auto casted = reinterpret_cast(self); - return bitcast(casted->getLocalPreprocessingEntities().begin()); -} - -struct ZigClangPreprocessingRecord_iterator ZigClangASTUnit_getLocalPreprocessingEntities_end( - struct ZigClangASTUnit *self) -{ - auto casted = reinterpret_cast(self); - return bitcast(casted->getLocalPreprocessingEntities().end()); -} - -struct ZigClangPreprocessedEntity *ZigClangPreprocessingRecord_iterator_deref( - struct ZigClangPreprocessingRecord_iterator self) -{ - clang::PreprocessingRecord::iterator casted = bitcast(self); - clang::PreprocessedEntity *result = *casted; - return reinterpret_cast(result); -} - -const ZigClangRecordDecl *ZigClangRecordType_getDecl(const ZigClangRecordType *record_ty) { - const clang::RecordDecl *record_decl = reinterpret_cast(record_ty)->getDecl(); - return reinterpret_cast(record_decl); -} - -const ZigClangEnumDecl *ZigClangEnumType_getDecl(const ZigClangEnumType *enum_ty) { - const clang::EnumDecl *enum_decl = reinterpret_cast(enum_ty)->getDecl(); - return reinterpret_cast(enum_decl); -} - -const ZigClangTagDecl *ZigClangRecordDecl_getCanonicalDecl(const ZigClangRecordDecl *record_decl) { - const clang::TagDecl *tag_decl = reinterpret_cast(record_decl)->getCanonicalDecl(); - return reinterpret_cast(tag_decl); -} - -const ZigClangFieldDecl *ZigClangFieldDecl_getCanonicalDecl(const ZigClangFieldDecl *field_decl) { - const clang::FieldDecl *canon_decl = reinterpret_cast(field_decl)->getCanonicalDecl(); - return reinterpret_cast(canon_decl); -} - -const ZigClangTagDecl *ZigClangEnumDecl_getCanonicalDecl(const ZigClangEnumDecl *enum_decl) { - const clang::TagDecl *tag_decl = reinterpret_cast(enum_decl)->getCanonicalDecl(); - return reinterpret_cast(tag_decl); -} - -const ZigClangTypedefNameDecl *ZigClangTypedefNameDecl_getCanonicalDecl(const ZigClangTypedefNameDecl *self) { - const clang::TypedefNameDecl *decl = reinterpret_cast(self)->getCanonicalDecl(); - return reinterpret_cast(decl); -} - -const ZigClangFunctionDecl *ZigClangFunctionDecl_getCanonicalDecl(const ZigClangFunctionDecl *self) { - const clang::FunctionDecl *decl = reinterpret_cast(self)->getCanonicalDecl(); - return reinterpret_cast(decl); -} - -const ZigClangVarDecl *ZigClangVarDecl_getCanonicalDecl(const ZigClangVarDecl *self) { - const clang::VarDecl *decl = reinterpret_cast(self)->getCanonicalDecl(); - return reinterpret_cast(decl); -} - -const char* ZigClangVarDecl_getSectionAttribute(const struct ZigClangVarDecl *self, size_t *len) { - auto casted = reinterpret_cast(self); - if (const clang::SectionAttr *SA = casted->getAttr()) { - llvm::StringRef str_ref = SA->getName(); - *len = str_ref.size(); - return (const char *)str_ref.bytes_begin(); - } - return nullptr; -} - -bool ZigClangRecordDecl_getPackedAttribute(const ZigClangRecordDecl *zig_record_decl) { - const clang::RecordDecl *record_decl = reinterpret_cast(zig_record_decl); - return record_decl->hasAttr(); -} - -unsigned ZigClangVarDecl_getAlignedAttribute(const struct ZigClangVarDecl *self, const ZigClangASTContext* ctx) { - auto casted_self = reinterpret_cast(self); - auto casted_ctx = const_cast(reinterpret_cast(ctx)); - if (const clang::AlignedAttr *AA = casted_self->getAttr()) { - return AA->getAlignment(*casted_ctx); - } - // Zero means no explicit alignment factor was specified - return 0; -} - -const struct ZigClangFunctionDecl *ZigClangVarDecl_getCleanupAttribute(const struct ZigClangVarDecl *self) { - auto casted_self = reinterpret_cast(self); - if (const clang::CleanupAttr *CA = casted_self->getAttr()) { - return reinterpret_cast(CA->getFunctionDecl()); - } - return nullptr; -} - -unsigned ZigClangFieldDecl_getAlignedAttribute(const struct ZigClangFieldDecl *self, const ZigClangASTContext* ctx) { - auto casted_self = reinterpret_cast(self); - auto casted_ctx = const_cast(reinterpret_cast(ctx)); - if (const clang::AlignedAttr *AA = casted_self->getAttr()) { - return AA->getAlignment(*casted_ctx); - } - // Zero means no explicit alignment factor was specified - return 0; -} - -unsigned ZigClangFunctionDecl_getAlignedAttribute(const struct ZigClangFunctionDecl *self, const ZigClangASTContext* ctx) { - auto casted_self = reinterpret_cast(self); - auto casted_ctx = const_cast(reinterpret_cast(ctx)); - if (const clang::AlignedAttr *AA = casted_self->getAttr()) { - return AA->getAlignment(*casted_ctx); - } - // Zero means no explicit alignment factor was specified - return 0; -} - -bool ZigClangVarDecl_getPackedAttribute(const struct ZigClangVarDecl *self) { - auto casted_self = reinterpret_cast(self); - return casted_self->hasAttr(); -} - -bool ZigClangFieldDecl_getPackedAttribute(const struct ZigClangFieldDecl *self) { - auto casted_self = reinterpret_cast(self); - return casted_self->hasAttr(); -} - -ZigClangQualType ZigClangParmVarDecl_getOriginalType(const struct ZigClangParmVarDecl *self) { - return bitcast(reinterpret_cast(self)->getOriginalType()); -} - -const ZigClangRecordDecl *ZigClangRecordDecl_getDefinition(const ZigClangRecordDecl *zig_record_decl) { - const clang::RecordDecl *record_decl = reinterpret_cast(zig_record_decl); - const clang::RecordDecl *definition = record_decl->getDefinition(); - return reinterpret_cast(definition); -} - -const ZigClangEnumDecl *ZigClangEnumDecl_getDefinition(const ZigClangEnumDecl *zig_enum_decl) { - const clang::EnumDecl *enum_decl = reinterpret_cast(zig_enum_decl); - const clang::EnumDecl *definition = enum_decl->getDefinition(); - return reinterpret_cast(definition); -} - -const ZigClangStringLiteral *ZigClangFileScopeAsmDecl_getAsmString(const ZigClangFileScopeAsmDecl *self) { - const clang::StringLiteral *result = reinterpret_cast(self)->getAsmString(); - return reinterpret_cast(result); -} - -bool ZigClangRecordDecl_isUnion(const ZigClangRecordDecl *record_decl) { - return reinterpret_cast(record_decl)->isUnion(); -} - -bool ZigClangRecordDecl_isStruct(const ZigClangRecordDecl *record_decl) { - return reinterpret_cast(record_decl)->isStruct(); -} - -bool ZigClangRecordDecl_isAnonymousStructOrUnion(const ZigClangRecordDecl *record_decl) { - return reinterpret_cast(record_decl)->isAnonymousStructOrUnion(); -} - -const ZigClangNamedDecl* ZigClangDecl_castToNamedDecl(const ZigClangDecl *self) { - auto casted = reinterpret_cast(self); - auto cast = clang::dyn_cast(casted); - return reinterpret_cast(cast); -} - -const char *ZigClangNamedDecl_getName_bytes_begin(const ZigClangNamedDecl *self) { - auto casted = reinterpret_cast(self); - return (const char *)casted->getName().bytes_begin(); -} - -ZigClangDeclKind ZigClangDecl_getKind(const struct ZigClangDecl *self) { - auto casted = reinterpret_cast(self); - return (ZigClangDeclKind)casted->getKind(); -} - -const char *ZigClangDecl_getDeclKindName(const struct ZigClangDecl *self) { - auto casted = reinterpret_cast(self); - return casted->getDeclKindName(); -} - -ZigClangSourceLocation ZigClangRecordDecl_getLocation(const ZigClangRecordDecl *zig_record_decl) { - const clang::RecordDecl *record_decl = reinterpret_cast(zig_record_decl); - return bitcast(record_decl->getLocation()); -} - -ZigClangSourceLocation ZigClangEnumDecl_getLocation(const ZigClangEnumDecl *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getLocation()); -} - -ZigClangSourceLocation ZigClangTypedefNameDecl_getLocation(const ZigClangTypedefNameDecl *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getLocation()); -} - -ZigClangSourceLocation ZigClangDecl_getLocation(const ZigClangDecl *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getLocation()); -} - -bool ZigClangSourceLocation_eq(ZigClangSourceLocation zig_a, ZigClangSourceLocation zig_b) { - clang::SourceLocation a = bitcast(zig_a); - clang::SourceLocation b = bitcast(zig_b); - return a == b; -} - -ZigClangQualType ZigClangEnumDecl_getIntegerType(const ZigClangEnumDecl *self) { - return bitcast(reinterpret_cast(self)->getIntegerType()); -} - -struct ZigClangQualType ZigClangFunctionDecl_getType(const struct ZigClangFunctionDecl *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getType()); -} - -struct ZigClangSourceLocation ZigClangFunctionDecl_getLocation(const struct ZigClangFunctionDecl *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getLocation()); -} - -bool ZigClangFunctionDecl_hasBody(const struct ZigClangFunctionDecl *self) { - auto casted = reinterpret_cast(self); - return casted->hasBody(); -} - -enum ZigClangStorageClass ZigClangFunctionDecl_getStorageClass(const struct ZigClangFunctionDecl *self) { - auto casted = reinterpret_cast(self); - return (ZigClangStorageClass)casted->getStorageClass(); -} - -const struct ZigClangParmVarDecl *ZigClangFunctionDecl_getParamDecl(const struct ZigClangFunctionDecl *self, - unsigned i) -{ - auto casted = reinterpret_cast(self); - const clang::ParmVarDecl *parm_var_decl = casted->getParamDecl(i); - return reinterpret_cast(parm_var_decl); -} - -const struct ZigClangStmt *ZigClangFunctionDecl_getBody(const struct ZigClangFunctionDecl *self) { - auto casted = reinterpret_cast(self); - const clang::Stmt *stmt = casted->getBody(); - return reinterpret_cast(stmt); -} - -bool ZigClangFunctionDecl_doesDeclarationForceExternallyVisibleDefinition(const struct ZigClangFunctionDecl *self) { - auto casted = reinterpret_cast(self); - return casted->doesDeclarationForceExternallyVisibleDefinition(); -} - -bool ZigClangFunctionDecl_isThisDeclarationADefinition(const struct ZigClangFunctionDecl *self) { - auto casted = reinterpret_cast(self); - return casted->isThisDeclarationADefinition(); -} - -bool ZigClangFunctionDecl_doesThisDeclarationHaveABody(const struct ZigClangFunctionDecl *self) { - auto casted = reinterpret_cast(self); - return casted->doesThisDeclarationHaveABody(); -} - -bool ZigClangFunctionDecl_isDefined(const struct ZigClangFunctionDecl *self) { - auto casted = reinterpret_cast(self); - return casted->isDefined(); -} - -const ZigClangFunctionDecl* ZigClangFunctionDecl_getDefinition(const struct ZigClangFunctionDecl *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getDefinition()); -} - -bool ZigClangTagDecl_isThisDeclarationADefinition(const struct ZigClangTagDecl *self) { - auto casted = reinterpret_cast(self); - return casted->isThisDeclarationADefinition(); -} - -bool ZigClangFunctionDecl_isInlineSpecified(const struct ZigClangFunctionDecl *self) { - auto casted = reinterpret_cast(self); - return casted->isInlineSpecified(); -} - -bool ZigClangFunctionDecl_hasAlwaysInlineAttr(const struct ZigClangFunctionDecl *self) { - auto casted = reinterpret_cast(self); - return casted->hasAttr(); -} - -const char* ZigClangFunctionDecl_getSectionAttribute(const struct ZigClangFunctionDecl *self, size_t *len) { - auto casted = reinterpret_cast(self); - if (const clang::SectionAttr *SA = casted->getAttr()) { - llvm::StringRef str_ref = SA->getName(); - *len = str_ref.size(); - return (const char *)str_ref.bytes_begin(); - } - return nullptr; -} - -const ZigClangExpr *ZigClangOpaqueValueExpr_getSourceExpr(const ZigClangOpaqueValueExpr *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getSourceExpr()); -} - -const ZigClangTypedefNameDecl *ZigClangTypedefType_getDecl(const ZigClangTypedefType *self) { - auto casted = reinterpret_cast(self); - const clang::TypedefNameDecl *name_decl = casted->getDecl(); - return reinterpret_cast(name_decl); -} - -ZigClangQualType ZigClangTypedefNameDecl_getUnderlyingType(const ZigClangTypedefNameDecl *self) { - auto casted = reinterpret_cast(self); - clang::QualType ty = casted->getUnderlyingType(); - return bitcast(ty); -} - -ZigClangQualType ZigClangQualType_getCanonicalType(ZigClangQualType self) { - clang::QualType qt = bitcast(self); - return bitcast(qt.getCanonicalType()); -} - -const ZigClangType *ZigClangQualType_getTypePtr(ZigClangQualType self) { - clang::QualType qt = bitcast(self); - const clang::Type *ty = qt.getTypePtr(); - return reinterpret_cast(ty); -} - -ZigClangTypeClass ZigClangQualType_getTypeClass(ZigClangQualType self) { - clang::QualType ty = bitcast(self); - return (ZigClangTypeClass)(ty->getTypeClass()); -} - -void ZigClangQualType_addConst(ZigClangQualType *self) { - reinterpret_cast(self)->addConst(); -} - -bool ZigClangQualType_eq(ZigClangQualType zig_t1, ZigClangQualType zig_t2) { - clang::QualType t1 = bitcast(zig_t1); - clang::QualType t2 = bitcast(zig_t2); - if (t1.isConstQualified() != t2.isConstQualified()) { - return false; - } - if (t1.isVolatileQualified() != t2.isVolatileQualified()) { - return false; - } - if (t1.isRestrictQualified() != t2.isRestrictQualified()) { - return false; - } - return t1.getTypePtr() == t2.getTypePtr(); -} - -bool ZigClangQualType_isConstQualified(ZigClangQualType self) { - clang::QualType qt = bitcast(self); - return qt.isConstQualified(); -} - -bool ZigClangQualType_isVolatileQualified(ZigClangQualType self) { - clang::QualType qt = bitcast(self); - return qt.isVolatileQualified(); -} - -bool ZigClangQualType_isRestrictQualified(ZigClangQualType self) { - clang::QualType qt = bitcast(self); - return qt.isRestrictQualified(); -} - -ZigClangTypeClass ZigClangType_getTypeClass(const ZigClangType *self) { - auto casted = reinterpret_cast(self); - clang::Type::TypeClass tc = casted->getTypeClass(); - return (ZigClangTypeClass)tc; -} - -ZigClangQualType ZigClangType_getPointeeType(const ZigClangType *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getPointeeType()); -} - -bool ZigClangType_isBooleanType(const ZigClangType *self) { - auto casted = reinterpret_cast(self); - return casted->isBooleanType(); -} - -bool ZigClangType_isVoidType(const ZigClangType *self) { - auto casted = reinterpret_cast(self); - return casted->isVoidType(); -} - -bool ZigClangType_isArrayType(const ZigClangType *self) { - auto casted = reinterpret_cast(self); - return casted->isArrayType(); -} - -bool ZigClangType_isRecordType(const ZigClangType *self) { - auto casted = reinterpret_cast(self); - return casted->isRecordType(); -} - -bool ZigClangType_isVectorType(const ZigClangType *self) { - auto casted = reinterpret_cast(self); - return casted->isVectorType(); -} - -bool ZigClangType_isIncompleteOrZeroLengthArrayType(const ZigClangQualType *self, - const struct ZigClangASTContext *ctx) -{ - auto casted_ctx = reinterpret_cast(ctx); - auto casted = reinterpret_cast(self); - auto casted_type = reinterpret_cast(self); - if (casted_type->isIncompleteArrayType()) - return true; - - clang::QualType elem_type = *casted; - while (const clang::ConstantArrayType *ArrayT = casted_ctx->getAsConstantArrayType(elem_type)) { - if (ArrayT->getSize() == 0) - return true; - - elem_type = ArrayT->getElementType(); - } - - return false; -} - -bool ZigClangType_isConstantArrayType(const ZigClangType *self) { - auto casted = reinterpret_cast(self); - return casted->isConstantArrayType(); -} - -const char *ZigClangType_getTypeClassName(const ZigClangType *self) { - auto casted = reinterpret_cast(self); - return casted->getTypeClassName(); -} - -const ZigClangArrayType *ZigClangType_getAsArrayTypeUnsafe(const ZigClangType *self) { - auto casted = reinterpret_cast(self); - const clang::ArrayType *result = casted->getAsArrayTypeUnsafe(); - return reinterpret_cast(result); -} - -const ZigClangRecordType *ZigClangType_getAsRecordType(const ZigClangType *self) { - auto casted = reinterpret_cast(self); - const clang::RecordType *result = casted->getAsStructureType(); - return reinterpret_cast(result); -} - -const ZigClangRecordType *ZigClangType_getAsUnionType(const ZigClangType *self) { - auto casted = reinterpret_cast(self); - const clang::RecordType *result = casted->getAsUnionType(); - return reinterpret_cast(result); -} - -ZigClangSourceLocation ZigClangStmt_getBeginLoc(const ZigClangStmt *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getBeginLoc()); -} - -bool ZigClangStmt_classof_Expr(const ZigClangStmt *self) { - auto casted = reinterpret_cast(self); - return clang::Expr::classof(casted); -} - -ZigClangStmtClass ZigClangStmt_getStmtClass(const ZigClangStmt *self) { - auto casted = reinterpret_cast(self); - return (ZigClangStmtClass)casted->getStmtClass(); -} - -ZigClangStmtClass ZigClangExpr_getStmtClass(const ZigClangExpr *self) { - auto casted = reinterpret_cast(self); - return (ZigClangStmtClass)casted->getStmtClass(); -} - -ZigClangQualType ZigClangExpr_getType(const ZigClangExpr *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getType()); -} - -ZigClangSourceLocation ZigClangExpr_getBeginLoc(const ZigClangExpr *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getBeginLoc()); -} - -bool ZigClangExpr_EvaluateAsBooleanCondition(const ZigClangExpr *self, bool *result, - const struct ZigClangASTContext *ctx, bool in_constant_context) -{ - auto casted = reinterpret_cast(self); - auto casted_ctx = reinterpret_cast(ctx); - return casted->EvaluateAsBooleanCondition(*result, *casted_ctx, in_constant_context); -} - -bool ZigClangExpr_EvaluateAsFloat(const ZigClangExpr *self, ZigClangAPFloat **result, - const struct ZigClangASTContext *ctx) -{ - llvm::APFloat *ap_float = new llvm::APFloat(0.0f); - *result = reinterpret_cast(ap_float); - auto casted = reinterpret_cast(self); - auto casted_ctx = reinterpret_cast(ctx); - return casted->EvaluateAsFloat(*ap_float, *casted_ctx); -} - -bool ZigClangExpr_EvaluateAsConstantExpr(const ZigClangExpr *self, ZigClangExprEvalResult *result, - ZigClangExpr_ConstantExprKind kind, const struct ZigClangASTContext *ctx) -{ - auto casted_self = reinterpret_cast(self); - auto casted_ctx = reinterpret_cast(ctx); - clang::Expr::EvalResult eval_result; - if (!casted_self->EvaluateAsConstantExpr(eval_result, *casted_ctx, (clang::Expr::ConstantExprKind)kind)) { - return false; - } - *result = bitcast(eval_result); - return true; -} - -const ZigClangStringLiteral *ZigClangExpr_castToStringLiteral(const struct ZigClangExpr *self) { - auto casted_self = reinterpret_cast(self); - auto cast = clang::dyn_cast(casted_self); - return reinterpret_cast(cast); -} - -const ZigClangExpr *ZigClangInitListExpr_getInit(const ZigClangInitListExpr *self, unsigned i) { - auto casted = reinterpret_cast(self); - const clang::Expr *result = casted->getInit(i); - return reinterpret_cast(result); -} - -const ZigClangExpr *ZigClangInitListExpr_getArrayFiller(const ZigClangInitListExpr *self) { - auto casted = reinterpret_cast(self); - const clang::Expr *result = casted->getArrayFiller(); - return reinterpret_cast(result); -} - -bool ZigClangInitListExpr_hasArrayFiller(const ZigClangInitListExpr *self) { - auto casted = reinterpret_cast(self); - return casted->hasArrayFiller(); -} - -bool ZigClangInitListExpr_isStringLiteralInit(const ZigClangInitListExpr *self) { - auto casted = reinterpret_cast(self); - return casted->isStringLiteralInit(); -} - -const ZigClangFieldDecl *ZigClangInitListExpr_getInitializedFieldInUnion(const ZigClangInitListExpr *self) { - auto casted = reinterpret_cast(self); - const clang::FieldDecl *result = casted->getInitializedFieldInUnion(); - return reinterpret_cast(result); -} - -unsigned ZigClangInitListExpr_getNumInits(const ZigClangInitListExpr *self) { - auto casted = reinterpret_cast(self); - return casted->getNumInits(); -} - -ZigClangAPValueKind ZigClangAPValue_getKind(const ZigClangAPValue *self) { - auto casted = reinterpret_cast(self); - return (ZigClangAPValueKind)casted->getKind(); -} - -const ZigClangAPSInt *ZigClangAPValue_getInt(const ZigClangAPValue *self) { - auto casted = reinterpret_cast(self); - const llvm::APSInt *result = &casted->getInt(); - return reinterpret_cast(result); -} - -unsigned ZigClangAPValue_getArrayInitializedElts(const ZigClangAPValue *self) { - auto casted = reinterpret_cast(self); - return casted->getArrayInitializedElts(); -} - -const ZigClangAPValue *ZigClangAPValue_getArrayInitializedElt(const ZigClangAPValue *self, unsigned i) { - auto casted = reinterpret_cast(self); - const clang::APValue *result = &casted->getArrayInitializedElt(i); - return reinterpret_cast(result); -} - -const ZigClangAPValue *ZigClangAPValue_getArrayFiller(const ZigClangAPValue *self) { - auto casted = reinterpret_cast(self); - const clang::APValue *result = &casted->getArrayFiller(); - return reinterpret_cast(result); -} - -unsigned ZigClangAPValue_getArraySize(const ZigClangAPValue *self) { - auto casted = reinterpret_cast(self); - return casted->getArraySize(); -} - -const ZigClangAPSInt *ZigClangAPSInt_negate(const ZigClangAPSInt *self) { - auto casted = reinterpret_cast(self); - llvm::APSInt *result = new llvm::APSInt(); - *result = *casted; - *result = -*result; - return reinterpret_cast(result); -} - -void ZigClangAPSInt_free(const ZigClangAPSInt *self) { - auto casted = reinterpret_cast(self); - delete casted; -} - -bool ZigClangAPSInt_isSigned(const ZigClangAPSInt *self) { - auto casted = reinterpret_cast(self); - return casted->isSigned(); -} - -bool ZigClangAPSInt_isNegative(const ZigClangAPSInt *self) { - auto casted = reinterpret_cast(self); - return casted->isNegative(); -} - -const uint64_t *ZigClangAPSInt_getRawData(const ZigClangAPSInt *self) { - auto casted = reinterpret_cast(self); - return casted->getRawData(); -} - -unsigned ZigClangAPSInt_getNumWords(const ZigClangAPSInt *self) { - auto casted = reinterpret_cast(self); - return casted->getNumWords(); -} - -bool ZigClangAPSInt_lessThanEqual(const ZigClangAPSInt *self, uint64_t rhs) { - auto casted = reinterpret_cast(self); - return casted->ule(rhs); -} - -void ZigClangAPInt_free(const ZigClangAPInt *self) { - auto casted = reinterpret_cast(self); - delete casted; -} - -uint64_t ZigClangAPInt_getLimitedValue(const ZigClangAPInt *self, uint64_t limit) { - auto casted = reinterpret_cast(self); - return casted->getLimitedValue(limit); -} - -const ZigClangExpr *ZigClangAPValueLValueBase_dyn_cast_Expr(ZigClangAPValueLValueBase self) { - clang::APValue::LValueBase casted = bitcast(self); - const clang::Expr *expr = casted.dyn_cast(); - return reinterpret_cast(expr); -} - -ZigClangAPValueLValueBase ZigClangAPValue_getLValueBase(const ZigClangAPValue *self) { - auto casted = reinterpret_cast(self); - clang::APValue::LValueBase lval_base = casted->getLValueBase(); - return bitcast(lval_base); -} - -ZigClangASTUnit *ZigClangLoadFromCommandLine(const char **args_begin, const char **args_end, - struct Stage2ErrorMsg **errors_ptr, size_t *errors_len, const char *resources_path) -{ - llvm::IntrusiveRefCntPtr VFS = llvm::vfs::getRealFileSystem(); - clang::IntrusiveRefCntPtr diags(clang::CompilerInstance::createDiagnostics(*VFS, new clang::DiagnosticOptions)); - - std::shared_ptr pch_container_ops = std::make_shared(); - - bool only_local_decls = true; - bool user_files_are_volatile = true; - bool allow_pch_with_compiler_errors = false; - bool single_file_parse = false; - bool for_serialization = false; - bool retain_excluded_conditional_blocks = false; - bool store_preambles_in_memory = false; - llvm::StringRef preamble_storage_path = llvm::StringRef(); - clang::ArrayRef remapped_files = std::nullopt; - std::unique_ptr err_unit; - std::optional ModuleFormat = std::nullopt; - std::unique_ptr ast_unit_unique_ptr = clang::ASTUnit::LoadFromCommandLine( - args_begin, args_end, - pch_container_ops, - diags, - resources_path, - store_preambles_in_memory, - preamble_storage_path, - only_local_decls, - clang::CaptureDiagsKind::All, - remapped_files, - true, // remapped files keep original name - 0, // precompiled preable after n parses - clang::TU_Complete, - false, // cache code completion results - false, // include brief comments in code completion - allow_pch_with_compiler_errors, - clang::SkipFunctionBodiesScope::None, - single_file_parse, - user_files_are_volatile, - for_serialization, - retain_excluded_conditional_blocks, - ModuleFormat, - &err_unit, - VFS); - clang::ASTUnit * ast_unit = ast_unit_unique_ptr.release(); - - *errors_len = 0; - - // Early failures in LoadFromCommandLine may return with ErrUnit unset. - if (!ast_unit && !err_unit) { - return nullptr; - } - - if (diags->hasErrorOccurred()) { - // Take ownership of the err_unit ASTUnit object so that it won't be - // free'd when we return, invalidating the error message pointers - clang::ASTUnit *unit = ast_unit ? ast_unit : err_unit.release(); - Stage2ErrorMsg *errors = nullptr; - - for (clang::ASTUnit::stored_diag_iterator it = unit->stored_diag_begin(), - it_end = unit->stored_diag_end(); it != it_end; ++it) - { - switch (it->getLevel()) { - case clang::DiagnosticsEngine::Ignored: - case clang::DiagnosticsEngine::Note: - case clang::DiagnosticsEngine::Remark: - case clang::DiagnosticsEngine::Warning: - continue; - case clang::DiagnosticsEngine::Error: - case clang::DiagnosticsEngine::Fatal: - break; - } - - llvm::StringRef msg_str_ref = it->getMessage(); - - *errors_len += 1; - errors = reinterpret_cast(realloc(errors, sizeof(Stage2ErrorMsg) * *errors_len)); - if (errors == nullptr) abort(); - Stage2ErrorMsg *msg = &errors[*errors_len - 1]; - memset(msg, 0, sizeof(*msg)); - - msg->msg_ptr = (const char *)msg_str_ref.bytes_begin(); - msg->msg_len = msg_str_ref.size(); - - clang::FullSourceLoc fsl = it->getLocation(); - - // Ensure the source location is valid before expanding it - if (fsl.isInvalid()) { - continue; - } - // Expand the location if possible - fsl = fsl.getFileLoc(); - - // The only known way to obtain a Loc without a manager associated - // to it is if you have a lot of errors clang emits "too many errors - // emitted, stopping now" - if (fsl.hasManager()) { - const clang::SourceManager &SM = fsl.getManager(); - - clang::PresumedLoc presumed_loc = SM.getPresumedLoc(fsl); - assert(!presumed_loc.isInvalid()); - - msg->line = presumed_loc.getLine() - 1; - msg->column = presumed_loc.getColumn() - 1; - - clang::StringRef filename = presumed_loc.getFilename(); - if (!filename.empty()) { - msg->filename_ptr = (const char *)filename.bytes_begin(); - msg->filename_len = filename.size(); - } - - bool invalid; - clang::StringRef buffer = fsl.getBufferData(&invalid); - - if (!invalid) { - msg->source = (const char *)buffer.bytes_begin(); - msg->offset = SM.getFileOffset(fsl); - } - } - } - - *errors_ptr = errors; - - return nullptr; - } - - return reinterpret_cast(ast_unit); -} - -void ZigClangErrorMsg_delete(Stage2ErrorMsg *ptr, size_t len) { - free(ptr); -} - -void ZigClangASTUnit_delete(struct ZigClangASTUnit *self) { - delete reinterpret_cast(self); -} - -struct ZigClangQualType ZigClangVarDecl_getType(const struct ZigClangVarDecl *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getType()); -} - -struct ZigClangQualType ZigClangVarDecl_getTypeSourceInfo_getType(const struct ZigClangVarDecl *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getTypeSourceInfo()->getType()); -} - -const struct ZigClangExpr *ZigClangVarDecl_getInit(const struct ZigClangVarDecl *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getInit()); -} - -enum ZigClangVarDecl_TLSKind ZigClangVarDecl_getTLSKind(const ZigClangVarDecl *self) { - auto casted = reinterpret_cast(self); - return (ZigClangVarDecl_TLSKind)casted->getTLSKind(); -} - -struct ZigClangSourceLocation ZigClangVarDecl_getLocation(const struct ZigClangVarDecl *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getLocation()); -} - -bool ZigClangVarDecl_hasExternalStorage(const struct ZigClangVarDecl *self) { - auto casted = reinterpret_cast(self); - return casted->hasExternalStorage(); -} - -bool ZigClangVarDecl_isFileVarDecl(const struct ZigClangVarDecl *self) { - auto casted = reinterpret_cast(self); - return casted->isFileVarDecl(); -} - -bool ZigClangVarDecl_hasInit(const struct ZigClangVarDecl *self) { - auto casted = reinterpret_cast(self); - return casted->hasInit(); -} - -const ZigClangAPValue * ZigClangVarDecl_evaluateValue(const struct ZigClangVarDecl *self) { - auto casted = reinterpret_cast(self); - const clang::APValue *result = casted->evaluateValue(); - return reinterpret_cast(result); -} - -enum ZigClangStorageClass ZigClangVarDecl_getStorageClass(const struct ZigClangVarDecl *self) { - auto casted = reinterpret_cast(self); - return (ZigClangStorageClass)casted->getStorageClass(); -} - -bool ZigClangVarDecl_isStaticLocal(const struct ZigClangVarDecl *self) { - auto casted = reinterpret_cast(self); - return casted->isStaticLocal(); -} - -enum ZigClangBuiltinTypeKind ZigClangBuiltinType_getKind(const struct ZigClangBuiltinType *self) { - auto casted = reinterpret_cast(self); - return (ZigClangBuiltinTypeKind)casted->getKind(); -} - -bool ZigClangFunctionType_getNoReturnAttr(const struct ZigClangFunctionType *self) { - auto casted = reinterpret_cast(self); - return casted->getNoReturnAttr(); -} - -enum ZigClangCallingConv ZigClangFunctionType_getCallConv(const struct ZigClangFunctionType *self) { - auto casted = reinterpret_cast(self); - return (ZigClangCallingConv)casted->getCallConv(); -} - -struct ZigClangQualType ZigClangFunctionType_getReturnType(const struct ZigClangFunctionType *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getReturnType()); -} - -const struct ZigClangExpr *ZigClangGenericSelectionExpr_getResultExpr(const struct ZigClangGenericSelectionExpr *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getResultExpr()); -} - -bool ZigClangFunctionProtoType_isVariadic(const struct ZigClangFunctionProtoType *self) { - auto casted = reinterpret_cast(self); - return casted->isVariadic(); -} - -unsigned ZigClangFunctionProtoType_getNumParams(const struct ZigClangFunctionProtoType *self) { - auto casted = reinterpret_cast(self); - return casted->getNumParams(); -} - -struct ZigClangQualType ZigClangFunctionProtoType_getParamType(const struct ZigClangFunctionProtoType *self, - unsigned index) -{ - auto casted = reinterpret_cast(self); - return bitcast(casted->getParamType(index)); -} - -struct ZigClangQualType ZigClangFunctionProtoType_getReturnType(const struct ZigClangFunctionProtoType *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getReturnType()); -} - -ZigClangCompoundStmt_const_body_iterator ZigClangCompoundStmt_body_begin(const struct ZigClangCompoundStmt *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->body_begin()); -} - -ZigClangCompoundStmt_const_body_iterator ZigClangCompoundStmt_body_end(const struct ZigClangCompoundStmt *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->body_end()); -} - -ZigClangDeclStmt_const_decl_iterator ZigClangDeclStmt_decl_begin(const struct ZigClangDeclStmt *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->decl_begin()); -} - -ZigClangDeclStmt_const_decl_iterator ZigClangDeclStmt_decl_end(const struct ZigClangDeclStmt *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->decl_end()); -} - -ZigClangSourceLocation ZigClangDeclStmt_getBeginLoc(const struct ZigClangDeclStmt *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getBeginLoc()); -} - -unsigned ZigClangAPFloat_convertToHexString(const ZigClangAPFloat *self, char *DST, - unsigned HexDigits, bool UpperCase, enum ZigClangAPFloat_roundingMode RM) -{ - auto casted = reinterpret_cast(self); - return casted->convertToHexString(DST, HexDigits, UpperCase, (llvm::APFloat::roundingMode)RM); -} - -double ZigClangFloatingLiteral_getValueAsApproximateDouble(const ZigClangFloatingLiteral *self) { - auto casted = reinterpret_cast(self); - return casted->getValueAsApproximateDouble(); -} - -void ZigClangFloatingLiteral_getValueAsApproximateQuadBits(const ZigClangFloatingLiteral *self, uint64_t *low, uint64_t *high) { - auto casted = reinterpret_cast(self); - llvm::APFloat apf = casted->getValue(); - bool ignored; - apf.convert(llvm::APFloat::IEEEquad(), llvm::APFloat::rmNearestTiesToEven, &ignored); - const llvm::APInt api = apf.bitcastToAPInt(); - const uint64_t *api_data = api.getRawData(); - *low = api_data[0]; - *high = api_data[1]; -} - -struct ZigClangSourceLocation ZigClangFloatingLiteral_getBeginLoc(const struct ZigClangFloatingLiteral *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getBeginLoc()); -} - -ZigClangAPFloatBase_Semantics ZigClangFloatingLiteral_getRawSemantics(const ZigClangFloatingLiteral *self) { - auto casted = reinterpret_cast(self); - return static_cast(casted->getRawSemantics()); -} - -enum ZigClangCharacterLiteralKind ZigClangStringLiteral_getKind(const struct ZigClangStringLiteral *self) { - auto casted = reinterpret_cast(self); - return (ZigClangCharacterLiteralKind)casted->getKind(); -} - -uint32_t ZigClangStringLiteral_getCodeUnit(const struct ZigClangStringLiteral *self, size_t i) { - auto casted = reinterpret_cast(self); - return casted->getCodeUnit(i); -} - -unsigned ZigClangStringLiteral_getLength(const struct ZigClangStringLiteral *self) { - auto casted = reinterpret_cast(self); - return casted->getLength(); -} - -unsigned ZigClangStringLiteral_getCharByteWidth(const struct ZigClangStringLiteral *self) { - auto casted = reinterpret_cast(self); - return casted->getCharByteWidth(); -} - -const char *ZigClangStringLiteral_getString_bytes_begin_size(const struct ZigClangStringLiteral *self, size_t *len) { - auto casted = reinterpret_cast(self); - llvm::StringRef str_ref = casted->getString(); - *len = str_ref.size(); - return (const char *)str_ref.bytes_begin(); -} - -const struct ZigClangStringLiteral *ZigClangPredefinedExpr_getFunctionName( - const struct ZigClangPredefinedExpr *self) -{ - auto casted = reinterpret_cast(self); - const clang::StringLiteral *result = casted->getFunctionName(); - return reinterpret_cast(result); -} - -ZigClangSourceLocation ZigClangImplicitCastExpr_getBeginLoc(const struct ZigClangImplicitCastExpr *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getBeginLoc()); -} - -enum ZigClangCK ZigClangImplicitCastExpr_getCastKind(const struct ZigClangImplicitCastExpr *self) { - auto casted = reinterpret_cast(self); - return (ZigClangCK)casted->getCastKind(); -} - -const struct ZigClangExpr *ZigClangImplicitCastExpr_getSubExpr(const struct ZigClangImplicitCastExpr *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getSubExpr()); -} - -struct ZigClangQualType ZigClangArrayType_getElementType(const struct ZigClangArrayType *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getElementType()); -} - -struct ZigClangQualType ZigClangIncompleteArrayType_getElementType(const struct ZigClangIncompleteArrayType *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getElementType()); -} - -struct ZigClangQualType ZigClangConstantArrayType_getElementType(const struct ZigClangConstantArrayType *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getElementType()); -} - -void ZigClangConstantArrayType_getSize(const struct ZigClangConstantArrayType *self, const struct ZigClangAPInt **result) { - auto casted = reinterpret_cast(self); - llvm::APInt *ap_int = new llvm::APInt(casted->getSize()); - *result = reinterpret_cast(ap_int); -} - -const struct ZigClangValueDecl *ZigClangDeclRefExpr_getDecl(const struct ZigClangDeclRefExpr *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getDecl()); -} - -const struct ZigClangNamedDecl *ZigClangDeclRefExpr_getFoundDecl(const struct ZigClangDeclRefExpr *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getFoundDecl()); -} - -struct ZigClangQualType ZigClangParenType_getInnerType(const struct ZigClangParenType *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getInnerType()); -} - -struct ZigClangQualType ZigClangAttributedType_getEquivalentType(const struct ZigClangAttributedType *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getEquivalentType()); -} - -struct ZigClangQualType ZigClangMacroQualifiedType_getModifiedType(const struct ZigClangMacroQualifiedType *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getModifiedType()); -} - -struct ZigClangQualType ZigClangTypeOfType_getUnmodifiedType(const struct ZigClangTypeOfType *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getUnmodifiedType()); -} - -const struct ZigClangExpr *ZigClangTypeOfExprType_getUnderlyingExpr(const struct ZigClangTypeOfExprType *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getUnderlyingExpr()); -} - -enum ZigClangOffsetOfNode_Kind ZigClangOffsetOfNode_getKind(const struct ZigClangOffsetOfNode *self) { - auto casted = reinterpret_cast(self); - return (ZigClangOffsetOfNode_Kind)casted->getKind(); -} - -unsigned ZigClangOffsetOfNode_getArrayExprIndex(const struct ZigClangOffsetOfNode *self) { - auto casted = reinterpret_cast(self); - return casted->getArrayExprIndex(); -} - -struct ZigClangFieldDecl *ZigClangOffsetOfNode_getField(const struct ZigClangOffsetOfNode *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getField()); -} - -unsigned ZigClangOffsetOfExpr_getNumComponents(const struct ZigClangOffsetOfExpr *self) { - auto casted = reinterpret_cast(self); - return casted->getNumComponents(); -} - -unsigned ZigClangOffsetOfExpr_getNumExpressions(const struct ZigClangOffsetOfExpr *self) { - auto casted = reinterpret_cast(self); - return casted->getNumExpressions(); -} - -const struct ZigClangExpr *ZigClangOffsetOfExpr_getIndexExpr(const struct ZigClangOffsetOfExpr *self, unsigned idx) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getIndexExpr(idx)); -} - -const struct ZigClangOffsetOfNode *ZigClangOffsetOfExpr_getComponent(const struct ZigClangOffsetOfExpr *self, unsigned idx) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(&casted->getComponent(idx)); -} - -ZigClangSourceLocation ZigClangOffsetOfExpr_getBeginLoc(const ZigClangOffsetOfExpr *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getBeginLoc()); -} - -struct ZigClangQualType ZigClangElaboratedType_getNamedType(const struct ZigClangElaboratedType *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getNamedType()); -} - -enum ZigClangElaboratedTypeKeyword ZigClangElaboratedType_getKeyword(const struct ZigClangElaboratedType *self) { - auto casted = reinterpret_cast(self); - return (ZigClangElaboratedTypeKeyword)casted->getKeyword(); -} - -struct ZigClangSourceLocation ZigClangCStyleCastExpr_getBeginLoc(const struct ZigClangCStyleCastExpr *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getBeginLoc()); -} - -const struct ZigClangExpr *ZigClangCStyleCastExpr_getSubExpr(const struct ZigClangCStyleCastExpr *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getSubExpr()); -} - -struct ZigClangQualType ZigClangCStyleCastExpr_getType(const struct ZigClangCStyleCastExpr *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getType()); -} - -const struct ZigClangASTRecordLayout *ZigClangRecordDecl_getASTRecordLayout(const struct ZigClangRecordDecl *self, const struct ZigClangASTContext *ctx) { - auto casted_self = reinterpret_cast(self); - auto casted_ctx = reinterpret_cast(ctx); - const clang::ASTRecordLayout &layout = casted_ctx->getASTRecordLayout(casted_self); - return reinterpret_cast(&layout); -} - -uint64_t ZigClangASTRecordLayout_getFieldOffset(const struct ZigClangASTRecordLayout *self, unsigned field_no) { - return reinterpret_cast(self)->getFieldOffset(field_no); -} - -int64_t ZigClangASTRecordLayout_getAlignment(const struct ZigClangASTRecordLayout *self) { - auto casted_self = reinterpret_cast(self); - return casted_self->getAlignment().getQuantity(); -} - -bool ZigClangIntegerLiteral_EvaluateAsInt(const struct ZigClangIntegerLiteral *self, struct ZigClangExprEvalResult *result, const struct ZigClangASTContext *ctx) { - auto casted_self = reinterpret_cast(self); - auto casted_ctx = reinterpret_cast(ctx); - clang::Expr::EvalResult eval_result; - if (!casted_self->EvaluateAsInt(eval_result, *casted_ctx)) { - return false; - } - *result = bitcast(eval_result); - return true; -} - -struct ZigClangSourceLocation ZigClangIntegerLiteral_getBeginLoc(const struct ZigClangIntegerLiteral *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getBeginLoc()); -} - -bool ZigClangIntegerLiteral_getSignum(const struct ZigClangIntegerLiteral *self, int *result, const struct ZigClangASTContext *ctx) { - auto casted_self = reinterpret_cast(self); - auto casted_ctx = reinterpret_cast(ctx); - clang::Expr::EvalResult eval_result; - if (!casted_self->EvaluateAsInt(eval_result, *casted_ctx)) { - return false; - } - const llvm::APSInt result_int = eval_result.Val.getInt(); - const llvm::APSInt zero(result_int.getBitWidth(), result_int.isUnsigned()); - - if (zero == result_int) { - *result = 0; - } else if (result_int < zero) { - *result = -1; - } else if (result_int > zero) { - *result = 1; - } else { - return false; - } - - return true; -} - -const struct ZigClangExpr *ZigClangReturnStmt_getRetValue(const struct ZigClangReturnStmt *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getRetValue()); -} - -enum ZigClangBO ZigClangBinaryOperator_getOpcode(const struct ZigClangBinaryOperator *self) { - auto casted = reinterpret_cast(self); - return (ZigClangBO)casted->getOpcode(); -} - -struct ZigClangSourceLocation ZigClangBinaryOperator_getBeginLoc(const struct ZigClangBinaryOperator *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getBeginLoc()); -} - -const struct ZigClangExpr *ZigClangBinaryOperator_getLHS(const struct ZigClangBinaryOperator *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getLHS()); -} - -const struct ZigClangExpr *ZigClangBinaryOperator_getRHS(const struct ZigClangBinaryOperator *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getRHS()); -} - -struct ZigClangQualType ZigClangBinaryOperator_getType(const struct ZigClangBinaryOperator *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getType()); -} - -const struct ZigClangExpr *ZigClangConvertVectorExpr_getSrcExpr(const struct ZigClangConvertVectorExpr *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getSrcExpr()); -} - -struct ZigClangQualType ZigClangConvertVectorExpr_getTypeSourceInfo_getType(const struct ZigClangConvertVectorExpr *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getTypeSourceInfo()->getType()); -} - -struct ZigClangQualType ZigClangDecayedType_getDecayedType(const struct ZigClangDecayedType *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getDecayedType()); -} - -const struct ZigClangCompoundStmt *ZigClangStmtExpr_getSubStmt(const struct ZigClangStmtExpr *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getSubStmt()); -} - -enum ZigClangCK ZigClangCastExpr_getCastKind(const struct ZigClangCastExpr *self) { - auto casted = reinterpret_cast(self); - return (ZigClangCK)casted->getCastKind(); -} - -const struct ZigClangFieldDecl *ZigClangCastExpr_getTargetFieldForToUnionCast(const struct ZigClangCastExpr *self, ZigClangQualType union_type, ZigClangQualType op_type) { - clang::QualType union_qt = bitcast(union_type); - clang::QualType op_qt = bitcast(op_type); - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getTargetFieldForToUnionCast(union_qt, op_qt)); -} - -struct ZigClangSourceLocation ZigClangCharacterLiteral_getBeginLoc(const struct ZigClangCharacterLiteral *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getBeginLoc()); -} - -enum ZigClangCharacterLiteralKind ZigClangCharacterLiteral_getKind(const struct ZigClangCharacterLiteral *self) { - auto casted = reinterpret_cast(self); - return (ZigClangCharacterLiteralKind)casted->getKind(); -} - -unsigned ZigClangCharacterLiteral_getValue(const struct ZigClangCharacterLiteral *self) { - auto casted = reinterpret_cast(self); - return casted->getValue(); -} - -const struct ZigClangExpr *ZigClangChooseExpr_getChosenSubExpr(const struct ZigClangChooseExpr *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getChosenSubExpr()); -} - -const struct ZigClangExpr *ZigClangAbstractConditionalOperator_getCond(const struct ZigClangAbstractConditionalOperator *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getCond()); -} - -const struct ZigClangExpr *ZigClangAbstractConditionalOperator_getTrueExpr(const struct ZigClangAbstractConditionalOperator *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getTrueExpr()); -} - -const struct ZigClangExpr *ZigClangAbstractConditionalOperator_getFalseExpr(const struct ZigClangAbstractConditionalOperator *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getFalseExpr()); -} - -struct ZigClangQualType ZigClangCompoundAssignOperator_getType(const struct ZigClangCompoundAssignOperator *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getType()); -} - -struct ZigClangQualType ZigClangCompoundAssignOperator_getComputationLHSType(const struct ZigClangCompoundAssignOperator *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getComputationLHSType()); -} - -struct ZigClangQualType ZigClangCompoundAssignOperator_getComputationResultType(const struct ZigClangCompoundAssignOperator *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getComputationResultType()); -} - -struct ZigClangSourceLocation ZigClangCompoundAssignOperator_getBeginLoc(const struct ZigClangCompoundAssignOperator *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getBeginLoc()); -} - -enum ZigClangBO ZigClangCompoundAssignOperator_getOpcode(const struct ZigClangCompoundAssignOperator *self) { - auto casted = reinterpret_cast(self); - return (ZigClangBO)casted->getOpcode(); -} - -const struct ZigClangExpr *ZigClangCompoundAssignOperator_getLHS(const struct ZigClangCompoundAssignOperator *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getLHS()); -} - -const struct ZigClangExpr *ZigClangCompoundAssignOperator_getRHS(const struct ZigClangCompoundAssignOperator *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getRHS()); -} - -const struct ZigClangExpr *ZigClangCompoundLiteralExpr_getInitializer(const ZigClangCompoundLiteralExpr *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getInitializer()); -} - -enum ZigClangUO ZigClangUnaryOperator_getOpcode(const struct ZigClangUnaryOperator *self) { - auto casted = reinterpret_cast(self); - return (ZigClangUO)casted->getOpcode(); -} - -struct ZigClangQualType ZigClangUnaryOperator_getType(const struct ZigClangUnaryOperator *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getType()); -} - -const struct ZigClangExpr *ZigClangUnaryOperator_getSubExpr(const struct ZigClangUnaryOperator *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getSubExpr()); -} - -struct ZigClangSourceLocation ZigClangUnaryOperator_getBeginLoc(const struct ZigClangUnaryOperator *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getBeginLoc()); -} - -struct ZigClangQualType ZigClangValueDecl_getType(const struct ZigClangValueDecl *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getType()); -} - -struct ZigClangQualType ZigClangVectorType_getElementType(const struct ZigClangVectorType *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getElementType()); -} - -unsigned ZigClangVectorType_getNumElements(const struct ZigClangVectorType *self) { - auto casted = reinterpret_cast(self); - return casted->getNumElements(); -} - -const struct ZigClangExpr *ZigClangWhileStmt_getCond(const struct ZigClangWhileStmt *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getCond()); -} - -const struct ZigClangStmt *ZigClangWhileStmt_getBody(const struct ZigClangWhileStmt *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getBody()); -} - -const struct ZigClangStmt *ZigClangIfStmt_getThen(const struct ZigClangIfStmt *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getThen()); -} - -const struct ZigClangStmt *ZigClangIfStmt_getElse(const struct ZigClangIfStmt *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getElse()); -} - -const struct ZigClangExpr *ZigClangIfStmt_getCond(const struct ZigClangIfStmt *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getCond()); -} - -const struct ZigClangExpr *ZigClangCallExpr_getCallee(const struct ZigClangCallExpr *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getCallee()); -} - -unsigned ZigClangCallExpr_getNumArgs(const struct ZigClangCallExpr *self) { - auto casted = reinterpret_cast(self); - return casted->getNumArgs(); -} - -const struct ZigClangExpr * const * ZigClangCallExpr_getArgs(const struct ZigClangCallExpr *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getArgs()); -} - -const struct ZigClangExpr * ZigClangMemberExpr_getBase(const struct ZigClangMemberExpr *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getBase()); -} - -bool ZigClangMemberExpr_isArrow(const struct ZigClangMemberExpr *self) { - auto casted = reinterpret_cast(self); - return casted->isArrow(); -} - -const struct ZigClangValueDecl * ZigClangMemberExpr_getMemberDecl(const struct ZigClangMemberExpr *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getMemberDecl()); -} - -const struct ZigClangExpr *ZigClangArraySubscriptExpr_getBase(const struct ZigClangArraySubscriptExpr *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getBase()); -} - -const struct ZigClangExpr *ZigClangArraySubscriptExpr_getIdx(const struct ZigClangArraySubscriptExpr *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getIdx()); -} - -struct ZigClangQualType ZigClangUnaryExprOrTypeTraitExpr_getTypeOfArgument( - const struct ZigClangUnaryExprOrTypeTraitExpr *self) -{ - auto casted = reinterpret_cast(self); - return bitcast(casted->getTypeOfArgument()); -} - -struct ZigClangSourceLocation ZigClangUnaryExprOrTypeTraitExpr_getBeginLoc( - const struct ZigClangUnaryExprOrTypeTraitExpr *self) -{ - auto casted = reinterpret_cast(self); - return bitcast(casted->getBeginLoc()); -} - -unsigned ZigClangShuffleVectorExpr_getNumSubExprs(const ZigClangShuffleVectorExpr *self) { - auto casted = reinterpret_cast(self); - return casted->getNumSubExprs(); -} - -const struct ZigClangExpr *ZigClangShuffleVectorExpr_getExpr(const struct ZigClangShuffleVectorExpr *self, unsigned idx) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getExpr(idx)); -} - -enum ZigClangUnaryExprOrTypeTrait_Kind ZigClangUnaryExprOrTypeTraitExpr_getKind( - const struct ZigClangUnaryExprOrTypeTraitExpr *self) -{ - auto casted = reinterpret_cast(self); - return (ZigClangUnaryExprOrTypeTrait_Kind)casted->getKind(); -} - -const struct ZigClangStmt *ZigClangDoStmt_getBody(const struct ZigClangDoStmt *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getBody()); -} - -const struct ZigClangExpr *ZigClangDoStmt_getCond(const struct ZigClangDoStmt *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getCond()); -} - -const struct ZigClangStmt *ZigClangForStmt_getInit(const struct ZigClangForStmt *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getInit()); -} - -const struct ZigClangExpr *ZigClangForStmt_getCond(const struct ZigClangForStmt *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getCond()); -} - -const struct ZigClangExpr *ZigClangForStmt_getInc(const struct ZigClangForStmt *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getInc()); -} - -const struct ZigClangStmt *ZigClangForStmt_getBody(const struct ZigClangForStmt *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getBody()); -} - -const struct ZigClangDeclStmt *ZigClangSwitchStmt_getConditionVariableDeclStmt( - const struct ZigClangSwitchStmt *self) -{ - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getConditionVariableDeclStmt()); -} - -const struct ZigClangExpr *ZigClangSwitchStmt_getCond(const struct ZigClangSwitchStmt *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getCond()); -} - -const struct ZigClangStmt *ZigClangSwitchStmt_getBody(const struct ZigClangSwitchStmt *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getBody()); -} - -bool ZigClangSwitchStmt_isAllEnumCasesCovered(const struct ZigClangSwitchStmt *self) { - auto casted = reinterpret_cast(self); - return casted->isAllEnumCasesCovered(); -} - -const struct ZigClangExpr *ZigClangCaseStmt_getLHS(const struct ZigClangCaseStmt *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getLHS()); -} - -const struct ZigClangExpr *ZigClangCaseStmt_getRHS(const struct ZigClangCaseStmt *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getRHS()); -} - -struct ZigClangSourceLocation ZigClangCaseStmt_getBeginLoc(const struct ZigClangCaseStmt *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getBeginLoc()); -} - -const struct ZigClangStmt *ZigClangCaseStmt_getSubStmt(const struct ZigClangCaseStmt *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getSubStmt()); -} - -const struct ZigClangStmt *ZigClangDefaultStmt_getSubStmt(const struct ZigClangDefaultStmt *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getSubStmt()); -} - -const struct ZigClangExpr *ZigClangParenExpr_getSubExpr(const struct ZigClangParenExpr *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getSubExpr()); -} - -enum ZigClangPreprocessedEntity_EntityKind ZigClangPreprocessedEntity_getKind( - const struct ZigClangPreprocessedEntity *self) -{ - auto casted = reinterpret_cast(self); - return (ZigClangPreprocessedEntity_EntityKind)casted->getKind(); -} - -const char *ZigClangMacroDefinitionRecord_getName_getNameStart(const struct ZigClangMacroDefinitionRecord *self) { - auto casted = reinterpret_cast(self); - return casted->getName()->getNameStart(); -} - -struct ZigClangSourceLocation ZigClangMacroDefinitionRecord_getSourceRange_getBegin(const struct ZigClangMacroDefinitionRecord *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getSourceRange().getBegin()); -} - -struct ZigClangSourceLocation ZigClangMacroDefinitionRecord_getSourceRange_getEnd(const struct ZigClangMacroDefinitionRecord *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getSourceRange().getEnd()); -} - -struct ZigClangSourceLocation ZigClangLexer_getLocForEndOfToken(ZigClangSourceLocation loc, const ZigClangSourceManager *sm, const ZigClangASTUnit *unit) { - const clang::SourceManager *casted_sm = reinterpret_cast(sm); - const clang::ASTUnit *casted_unit = reinterpret_cast(unit); - clang::SourceLocation endloc = clang::Lexer::getLocForEndOfToken(bitcast(loc), 0, *casted_sm, casted_unit->getLangOpts()); - return bitcast(endloc); -} - -ZigClangRecordDecl_field_iterator ZigClangRecordDecl_field_begin(const struct ZigClangRecordDecl *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->field_begin()); -} - -ZigClangRecordDecl_field_iterator ZigClangRecordDecl_field_end(const struct ZigClangRecordDecl *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->field_end()); -} - -bool ZigClangFieldDecl_isBitField(const struct ZigClangFieldDecl *self) { - auto casted = reinterpret_cast(self); - return casted->isBitField(); -} - -bool ZigClangFieldDecl_isAnonymousStructOrUnion(const ZigClangFieldDecl *field_decl) { - return reinterpret_cast(field_decl)->isAnonymousStructOrUnion(); -} - -ZigClangSourceLocation ZigClangFieldDecl_getLocation(const struct ZigClangFieldDecl *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getLocation()); -} - -const struct ZigClangRecordDecl *ZigClangFieldDecl_getParent(const struct ZigClangFieldDecl *self) { - auto casted = reinterpret_cast(self); - return reinterpret_cast(casted->getParent()); -} - -unsigned ZigClangFieldDecl_getFieldIndex(const struct ZigClangFieldDecl *self) { - auto casted = reinterpret_cast(self); - return casted->getFieldIndex(); -} - -ZigClangQualType ZigClangFieldDecl_getType(const struct ZigClangFieldDecl *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->getType()); -} - -ZigClangRecordDecl_field_iterator ZigClangRecordDecl_field_iterator_next( - struct ZigClangRecordDecl_field_iterator self) -{ - clang::RecordDecl::field_iterator casted = bitcast(self); - ++casted; - return bitcast(casted); -} - -const struct ZigClangFieldDecl * ZigClangRecordDecl_field_iterator_deref( - struct ZigClangRecordDecl_field_iterator self) -{ - clang::RecordDecl::field_iterator casted = bitcast(self); - const clang::FieldDecl *result = *casted; - return reinterpret_cast(result); -} - -bool ZigClangRecordDecl_field_iterator_neq( - struct ZigClangRecordDecl_field_iterator a, - struct ZigClangRecordDecl_field_iterator b) -{ - clang::RecordDecl::field_iterator casted_a = bitcast(a); - clang::RecordDecl::field_iterator casted_b = bitcast(b); - return casted_a != casted_b; -} - -ZigClangEnumDecl_enumerator_iterator ZigClangEnumDecl_enumerator_begin(const struct ZigClangEnumDecl *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->enumerator_begin()); -} - -ZigClangEnumDecl_enumerator_iterator ZigClangEnumDecl_enumerator_end(const struct ZigClangEnumDecl *self) { - auto casted = reinterpret_cast(self); - return bitcast(casted->enumerator_end()); -} - -ZigClangEnumDecl_enumerator_iterator ZigClangEnumDecl_enumerator_iterator_next( - struct ZigClangEnumDecl_enumerator_iterator self) -{ - clang::EnumDecl::enumerator_iterator casted = bitcast(self); - ++casted; - return bitcast(casted); -} - -const struct ZigClangEnumConstantDecl * ZigClangEnumDecl_enumerator_iterator_deref( - struct ZigClangEnumDecl_enumerator_iterator self) -{ - clang::EnumDecl::enumerator_iterator casted = bitcast(self); - const clang::EnumConstantDecl *result = *casted; - return reinterpret_cast(result); -} - -bool ZigClangEnumDecl_enumerator_iterator_neq( - struct ZigClangEnumDecl_enumerator_iterator a, - struct ZigClangEnumDecl_enumerator_iterator b) -{ - clang::EnumDecl::enumerator_iterator casted_a = bitcast(a); - clang::EnumDecl::enumerator_iterator casted_b = bitcast(b); - return casted_a != casted_b; -} - -const struct ZigClangAPSInt *ZigClangEnumConstantDecl_getInitVal(const struct ZigClangEnumConstantDecl *self) { - auto casted = reinterpret_cast(self); - llvm::APSInt *result = new llvm::APSInt(); - *result = casted->getInitVal(); - return reinterpret_cast(result); -} - -// Get a pointer to a static variable in libc++ from LLVM and make sure that -// it matches our own. -// -// This check is needed because if static/dynamic linking is mixed incorrectly, -// it's possible for Clang and LLVM to end up with duplicate "copies" of libc++. -// -// This is not benign: Static variables are not shared, so equality comparisons -// that depend on pointers to static variables will fail. One such failure is -// std::generic_category(), which causes POSIX error codes to compare as unequal -// when passed between LLVM and Clang. -// -// See also: https://github.com/ziglang/zig/issues/11168 -bool ZigClangIsLLVMUsingSeparateLibcxx() { - - // Temporarily create an InMemoryFileSystem, so that we can perform a file - // lookup that is guaranteed to fail. - auto FS = new llvm::vfs::InMemoryFileSystem(true); - auto StatusOrErr = FS->status("foo.txt"); - delete FS; - - // This should return a POSIX (generic_category) error code, but if LLVM has - // its own copy of libc++ this will actually be a separate category instance. - assert(!StatusOrErr); - auto EC = StatusOrErr.getError(); - return EC.category() != std::generic_category(); -} - -static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_IEEEhalf == llvm::APFloatBase::S_IEEEhalf, ""); -static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_BFloat == llvm::APFloatBase::S_BFloat); -static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_IEEEsingle == llvm::APFloatBase::S_IEEEsingle); -static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_IEEEdouble == llvm::APFloatBase::S_IEEEdouble); -static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_IEEEquad == llvm::APFloatBase::S_IEEEquad); -static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_PPCDoubleDouble == llvm::APFloatBase::S_PPCDoubleDouble); -static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_PPCDoubleDoubleLegacy == llvm::APFloatBase::S_PPCDoubleDoubleLegacy); -static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_Float8E5M2 == llvm::APFloatBase::S_Float8E5M2); -static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_Float8E5M2FNUZ == llvm::APFloatBase::S_Float8E5M2FNUZ); -static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_Float8E4M3 == llvm::APFloatBase::S_Float8E4M3); -static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_Float8E4M3FN == llvm::APFloatBase::S_Float8E4M3FN); -static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_Float8E4M3FNUZ == llvm::APFloatBase::S_Float8E4M3FNUZ); -static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_Float8E4M3B11FNUZ == llvm::APFloatBase::S_Float8E4M3B11FNUZ); -static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_Float8E3M4 == llvm::APFloatBase::S_Float8E3M4); -static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_FloatTF32 == llvm::APFloatBase::S_FloatTF32); -static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_Float8E8M0FNU == llvm::APFloatBase::S_Float8E8M0FNU); -static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_Float6E3M2FN == llvm::APFloatBase::S_Float6E3M2FN); -static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_Float6E2M3FN == llvm::APFloatBase::S_Float6E2M3FN); -static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_Float4E2M1FN == llvm::APFloatBase::S_Float4E2M1FN); -static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_x87DoubleExtended == llvm::APFloatBase::S_x87DoubleExtended); -static_assert((llvm::APFloatBase::Semantics)ZigClangAPFloatBase_Semantics_MaxSemantics == llvm::APFloatBase::S_MaxSemantics); diff --git a/src/zig_clang.h b/src/zig_clang.h deleted file mode 100644 index 1c929ff8974f..000000000000 --- a/src/zig_clang.h +++ /dev/null @@ -1,1764 +0,0 @@ -/* - * Copyright (c) 2019 Andrew Kelley - * - * This file is part of zig, which is MIT licensed. - * See http://opensource.org/licenses/MIT - */ - -#ifndef ZIG_ZIG_CLANG_H -#define ZIG_ZIG_CLANG_H - -#include -#include -#include -#include - -#ifdef __cplusplus -#define ZIG_EXTERN_C extern "C" -#else -#define ZIG_EXTERN_C -#endif - -// ATTENTION: If you modify this file, be sure to update the corresponding -// extern function declarations in the self-hosted compiler file -// src/clang.zig. - -// ABI warning -struct Stage2ErrorMsg { - const char *filename_ptr; // can be null - size_t filename_len; - const char *msg_ptr; - size_t msg_len; - const char *source; // valid until the ASTUnit is freed. can be null - unsigned line; // 0 based - unsigned column; // 0 based - unsigned offset; // byte offset into source -}; - -struct ZigClangSourceLocation { - unsigned ID; -}; - -struct ZigClangQualType { - void *ptr; -}; - -struct ZigClangAPValueLValueBase { - void *Ptr; - unsigned CallIndex; - unsigned Version; -}; - -enum ZigClangAPValueKind { - ZigClangAPValueNone, - ZigClangAPValueIndeterminate, - ZigClangAPValueInt, - ZigClangAPValueFloat, - ZigClangAPValueFixedPoint, - ZigClangAPValueComplexInt, - ZigClangAPValueComplexFloat, - ZigClangAPValueLValue, - ZigClangAPValueVector, - ZigClangAPValueArray, - ZigClangAPValueStruct, - ZigClangAPValueUnion, - ZigClangAPValueMemberPointer, - ZigClangAPValueAddrLabelDiff, -}; - -#if defined(__i386__) && !defined(_WIN32) -# define ZIG_CLANG_APVALUE_SIZE 44 -# define ZIG_CLANG_APVALUE_ALIGN 4 -#else -# define ZIG_CLANG_APVALUE_SIZE 52 -# define ZIG_CLANG_APVALUE_ALIGN 8 -#endif - -struct alignas(ZIG_CLANG_APVALUE_ALIGN) ZigClangAPValue { - enum ZigClangAPValueKind Kind; - // experimentally-derived size of clang::APValue::DataType - char Data[ZIG_CLANG_APVALUE_SIZE]; -}; - -struct ZigClangExprEvalResult { - bool HasSideEffects; - bool HasUndefinedBehavior; - void *SmallVectorImpl; - ZigClangAPValue Val; -}; - -struct ZigClangAbstractConditionalOperator; -struct ZigClangAPFloat; -struct ZigClangAPInt; -struct ZigClangAPSInt; -struct ZigClangASTContext; -struct ZigClangASTRecordLayout; -struct ZigClangASTUnit; -struct ZigClangArraySubscriptExpr; -struct ZigClangArrayType; -struct ZigClangAttributedType; -struct ZigClangBinaryOperator; -struct ZigClangBinaryConditionalOperator; -struct ZigClangBreakStmt; -struct ZigClangBuiltinType; -struct ZigClangCStyleCastExpr; -struct ZigClangCallExpr; -struct ZigClangCaseStmt; -struct ZigClangCastExpr; -struct ZigClangCharacterLiteral; -struct ZigClangChooseExpr; -struct ZigClangCompoundAssignOperator; -struct ZigClangCompoundStmt; -struct ZigClangConditionalOperator; -struct ZigClangConstantArrayType; -struct ZigClangConstantExpr; -struct ZigClangContinueStmt; -struct ZigClangDecayedType; -struct ZigClangDecl; -struct ZigClangDeclRefExpr; -struct ZigClangDeclStmt; -struct ZigClangDefaultStmt; -struct ZigClangDiagnosticOptions; -struct ZigClangDiagnosticsEngine; -struct ZigClangDoStmt; -struct ZigClangElaboratedType; -struct ZigClangEnumConstantDecl; -struct ZigClangEnumDecl; -struct ZigClangEnumType; -struct ZigClangExpr; -struct ZigClangFieldDecl; -struct ZigClangFileID; -struct ZigClangFileScopeAsmDecl; -struct ZigClangFloatingLiteral; -struct ZigClangForStmt; -struct ZigClangFullSourceLoc; -struct ZigClangFunctionDecl; -struct ZigClangFunctionProtoType; -struct ZigClangFunctionType; -struct ZigClangIfStmt; -struct ZigClangImplicitCastExpr; -struct ZigClangIncompleteArrayType; -struct ZigClangIntegerLiteral; -struct ZigClangMacroDefinitionRecord; -struct ZigClangMacroQualifiedType; -struct ZigClangMemberExpr; -struct ZigClangNamedDecl; -struct ZigClangNone; -struct ZigClangOpaqueValueExpr; -struct ZigClangPCHContainerOperations; -struct ZigClangParenExpr; -struct ZigClangParenType; -struct ZigClangParmVarDecl; -struct ZigClangPointerType; -struct ZigClangPredefinedExpr; -struct ZigClangPreprocessedEntity; -struct ZigClangPreprocessingRecord; -struct ZigClangRecordDecl; -struct ZigClangRecordType; -struct ZigClangReturnStmt; -struct ZigClangSkipFunctionBodiesScope; -struct ZigClangSourceManager; -struct ZigClangSourceRange; -struct ZigClangStmt; -struct ZigClangStmtExpr; -struct ZigClangStringLiteral; -struct ZigClangStringRef; -struct ZigClangSwitchStmt; -struct ZigClangTagDecl; -struct ZigClangType; -struct ZigClangTypedefNameDecl; -struct ZigClangTypedefType; -struct ZigClangUnaryExprOrTypeTraitExpr; -struct ZigClangUnaryOperator; -struct ZigClangValueDecl; -struct ZigClangVarDecl; -struct ZigClangWhileStmt; -struct ZigClangInitListExpr; - -typedef struct ZigClangStmt *const * ZigClangCompoundStmt_const_body_iterator; -typedef struct ZigClangDecl *const * ZigClangDeclStmt_const_decl_iterator; - -struct ZigClangRecordDecl_field_iterator { - void *opaque; -}; - -struct ZigClangEnumDecl_enumerator_iterator { - void *opaque; -}; - -struct ZigClangPreprocessingRecord_iterator { - int I; - struct ZigClangPreprocessingRecord *Self; -}; - -enum ZigClangBO { - ZigClangBO_PtrMemD, - ZigClangBO_PtrMemI, - ZigClangBO_Mul, - ZigClangBO_Div, - ZigClangBO_Rem, - ZigClangBO_Add, - ZigClangBO_Sub, - ZigClangBO_Shl, - ZigClangBO_Shr, - ZigClangBO_Cmp, - ZigClangBO_LT, - ZigClangBO_GT, - ZigClangBO_LE, - ZigClangBO_GE, - ZigClangBO_EQ, - ZigClangBO_NE, - ZigClangBO_And, - ZigClangBO_Xor, - ZigClangBO_Or, - ZigClangBO_LAnd, - ZigClangBO_LOr, - ZigClangBO_Assign, - ZigClangBO_MulAssign, - ZigClangBO_DivAssign, - ZigClangBO_RemAssign, - ZigClangBO_AddAssign, - ZigClangBO_SubAssign, - ZigClangBO_ShlAssign, - ZigClangBO_ShrAssign, - ZigClangBO_AndAssign, - ZigClangBO_XorAssign, - ZigClangBO_OrAssign, - ZigClangBO_Comma, -}; - -enum ZigClangUO { - ZigClangUO_PostInc, - ZigClangUO_PostDec, - ZigClangUO_PreInc, - ZigClangUO_PreDec, - ZigClangUO_AddrOf, - ZigClangUO_Deref, - ZigClangUO_Plus, - ZigClangUO_Minus, - ZigClangUO_Not, - ZigClangUO_LNot, - ZigClangUO_Real, - ZigClangUO_Imag, - ZigClangUO_Extension, - ZigClangUO_Coawait, -}; - -enum ZigClangTypeClass { - ZigClangType_Adjusted, - ZigClangType_Decayed, - ZigClangType_ConstantArray, - ZigClangType_ArrayParameter, - ZigClangType_DependentSizedArray, - ZigClangType_IncompleteArray, - ZigClangType_VariableArray, - ZigClangType_Atomic, - ZigClangType_Attributed, - ZigClangType_BTFTagAttributed, - ZigClangType_BitInt, - ZigClangType_BlockPointer, - ZigClangType_CountAttributed, - ZigClangType_Builtin, - ZigClangType_Complex, - ZigClangType_Decltype, - ZigClangType_Auto, - ZigClangType_DeducedTemplateSpecialization, - ZigClangType_DependentAddressSpace, - ZigClangType_DependentBitInt, - ZigClangType_DependentName, - ZigClangType_DependentSizedExtVector, - ZigClangType_DependentTemplateSpecialization, - ZigClangType_DependentVector, - ZigClangType_Elaborated, - ZigClangType_FunctionNoProto, - ZigClangType_FunctionProto, - ZigClangType_HLSLAttributedResource, - ZigClangType_InjectedClassName, - ZigClangType_MacroQualified, - ZigClangType_ConstantMatrix, - ZigClangType_DependentSizedMatrix, - ZigClangType_MemberPointer, - ZigClangType_ObjCObjectPointer, - ZigClangType_ObjCObject, - ZigClangType_ObjCInterface, - ZigClangType_ObjCTypeParam, - ZigClangType_PackExpansion, - ZigClangType_PackIndexing, - ZigClangType_Paren, - ZigClangType_Pipe, - ZigClangType_Pointer, - ZigClangType_LValueReference, - ZigClangType_RValueReference, - ZigClangType_SubstTemplateTypeParmPack, - ZigClangType_SubstTemplateTypeParm, - ZigClangType_Enum, - ZigClangType_Record, - ZigClangType_TemplateSpecialization, - ZigClangType_TemplateTypeParm, - ZigClangType_TypeOfExpr, - ZigClangType_TypeOf, - ZigClangType_Typedef, - ZigClangType_UnaryTransform, - ZigClangType_UnresolvedUsing, - ZigClangType_Using, - ZigClangType_Vector, - ZigClangType_ExtVector, -}; - -enum ZigClangStmtClass { - ZigClangStmt_NoStmtClass, - ZigClangStmt_WhileStmtClass, - ZigClangStmt_LabelStmtClass, - ZigClangStmt_VAArgExprClass, - ZigClangStmt_UnaryOperatorClass, - ZigClangStmt_UnaryExprOrTypeTraitExprClass, - ZigClangStmt_TypoExprClass, - ZigClangStmt_TypeTraitExprClass, - ZigClangStmt_SubstNonTypeTemplateParmPackExprClass, - ZigClangStmt_SubstNonTypeTemplateParmExprClass, - ZigClangStmt_StringLiteralClass, - ZigClangStmt_StmtExprClass, - ZigClangStmt_SourceLocExprClass, - ZigClangStmt_SizeOfPackExprClass, - ZigClangStmt_ShuffleVectorExprClass, - ZigClangStmt_SYCLUniqueStableNameExprClass, - ZigClangStmt_RequiresExprClass, - ZigClangStmt_RecoveryExprClass, - ZigClangStmt_PseudoObjectExprClass, - ZigClangStmt_PredefinedExprClass, - ZigClangStmt_ParenListExprClass, - ZigClangStmt_ParenExprClass, - ZigClangStmt_PackIndexingExprClass, - ZigClangStmt_PackExpansionExprClass, - ZigClangStmt_UnresolvedMemberExprClass, - ZigClangStmt_UnresolvedLookupExprClass, - ZigClangStmt_OpenACCAsteriskSizeExprClass, - ZigClangStmt_OpaqueValueExprClass, - ZigClangStmt_OffsetOfExprClass, - ZigClangStmt_ObjCSubscriptRefExprClass, - ZigClangStmt_ObjCStringLiteralClass, - ZigClangStmt_ObjCSelectorExprClass, - ZigClangStmt_ObjCProtocolExprClass, - ZigClangStmt_ObjCPropertyRefExprClass, - ZigClangStmt_ObjCMessageExprClass, - ZigClangStmt_ObjCIvarRefExprClass, - ZigClangStmt_ObjCIsaExprClass, - ZigClangStmt_ObjCIndirectCopyRestoreExprClass, - ZigClangStmt_ObjCEncodeExprClass, - ZigClangStmt_ObjCDictionaryLiteralClass, - ZigClangStmt_ObjCBoxedExprClass, - ZigClangStmt_ObjCBoolLiteralExprClass, - ZigClangStmt_ObjCAvailabilityCheckExprClass, - ZigClangStmt_ObjCArrayLiteralClass, - ZigClangStmt_OMPIteratorExprClass, - ZigClangStmt_OMPArrayShapingExprClass, - ZigClangStmt_NoInitExprClass, - ZigClangStmt_MemberExprClass, - ZigClangStmt_MatrixSubscriptExprClass, - ZigClangStmt_MaterializeTemporaryExprClass, - ZigClangStmt_MSPropertySubscriptExprClass, - ZigClangStmt_MSPropertyRefExprClass, - ZigClangStmt_LambdaExprClass, - ZigClangStmt_IntegerLiteralClass, - ZigClangStmt_InitListExprClass, - ZigClangStmt_ImplicitValueInitExprClass, - ZigClangStmt_ImaginaryLiteralClass, - ZigClangStmt_HLSLOutArgExprClass, - ZigClangStmt_GenericSelectionExprClass, - ZigClangStmt_GNUNullExprClass, - ZigClangStmt_FunctionParmPackExprClass, - ZigClangStmt_ExprWithCleanupsClass, - ZigClangStmt_ConstantExprClass, - ZigClangStmt_FloatingLiteralClass, - ZigClangStmt_FixedPointLiteralClass, - ZigClangStmt_ExtVectorElementExprClass, - ZigClangStmt_ExpressionTraitExprClass, - ZigClangStmt_EmbedExprClass, - ZigClangStmt_DesignatedInitUpdateExprClass, - ZigClangStmt_DesignatedInitExprClass, - ZigClangStmt_DependentScopeDeclRefExprClass, - ZigClangStmt_DependentCoawaitExprClass, - ZigClangStmt_DeclRefExprClass, - ZigClangStmt_CoyieldExprClass, - ZigClangStmt_CoawaitExprClass, - ZigClangStmt_ConvertVectorExprClass, - ZigClangStmt_ConceptSpecializationExprClass, - ZigClangStmt_CompoundLiteralExprClass, - ZigClangStmt_ChooseExprClass, - ZigClangStmt_CharacterLiteralClass, - ZigClangStmt_ImplicitCastExprClass, - ZigClangStmt_ObjCBridgedCastExprClass, - ZigClangStmt_CXXStaticCastExprClass, - ZigClangStmt_CXXReinterpretCastExprClass, - ZigClangStmt_CXXDynamicCastExprClass, - ZigClangStmt_CXXConstCastExprClass, - ZigClangStmt_CXXAddrspaceCastExprClass, - ZigClangStmt_CXXFunctionalCastExprClass, - ZigClangStmt_CStyleCastExprClass, - ZigClangStmt_BuiltinBitCastExprClass, - ZigClangStmt_CallExprClass, - ZigClangStmt_UserDefinedLiteralClass, - ZigClangStmt_CXXOperatorCallExprClass, - ZigClangStmt_CXXMemberCallExprClass, - ZigClangStmt_CUDAKernelCallExprClass, - ZigClangStmt_CXXUuidofExprClass, - ZigClangStmt_CXXUnresolvedConstructExprClass, - ZigClangStmt_CXXTypeidExprClass, - ZigClangStmt_CXXThrowExprClass, - ZigClangStmt_CXXThisExprClass, - ZigClangStmt_CXXStdInitializerListExprClass, - ZigClangStmt_CXXScalarValueInitExprClass, - ZigClangStmt_CXXRewrittenBinaryOperatorClass, - ZigClangStmt_CXXPseudoDestructorExprClass, - ZigClangStmt_CXXParenListInitExprClass, - ZigClangStmt_CXXNullPtrLiteralExprClass, - ZigClangStmt_CXXNoexceptExprClass, - ZigClangStmt_CXXNewExprClass, - ZigClangStmt_CXXInheritedCtorInitExprClass, - ZigClangStmt_CXXFoldExprClass, - ZigClangStmt_CXXDependentScopeMemberExprClass, - ZigClangStmt_CXXDeleteExprClass, - ZigClangStmt_CXXDefaultInitExprClass, - ZigClangStmt_CXXDefaultArgExprClass, - ZigClangStmt_CXXConstructExprClass, - ZigClangStmt_CXXTemporaryObjectExprClass, - ZigClangStmt_CXXBoolLiteralExprClass, - ZigClangStmt_CXXBindTemporaryExprClass, - ZigClangStmt_BlockExprClass, - ZigClangStmt_BinaryOperatorClass, - ZigClangStmt_CompoundAssignOperatorClass, - ZigClangStmt_AtomicExprClass, - ZigClangStmt_AsTypeExprClass, - ZigClangStmt_ArrayTypeTraitExprClass, - ZigClangStmt_ArraySubscriptExprClass, - ZigClangStmt_ArraySectionExprClass, - ZigClangStmt_ArrayInitLoopExprClass, - ZigClangStmt_ArrayInitIndexExprClass, - ZigClangStmt_AddrLabelExprClass, - ZigClangStmt_ConditionalOperatorClass, - ZigClangStmt_BinaryConditionalOperatorClass, - ZigClangStmt_AttributedStmtClass, - ZigClangStmt_SwitchStmtClass, - ZigClangStmt_DefaultStmtClass, - ZigClangStmt_CaseStmtClass, - ZigClangStmt_SYCLKernelCallStmtClass, - ZigClangStmt_SEHTryStmtClass, - ZigClangStmt_SEHLeaveStmtClass, - ZigClangStmt_SEHFinallyStmtClass, - ZigClangStmt_SEHExceptStmtClass, - ZigClangStmt_ReturnStmtClass, - ZigClangStmt_OpenACCWaitConstructClass, - ZigClangStmt_OpenACCUpdateConstructClass, - ZigClangStmt_OpenACCShutdownConstructClass, - ZigClangStmt_OpenACCSetConstructClass, - ZigClangStmt_OpenACCInitConstructClass, - ZigClangStmt_OpenACCExitDataConstructClass, - ZigClangStmt_OpenACCEnterDataConstructClass, - ZigClangStmt_OpenACCLoopConstructClass, - ZigClangStmt_OpenACCHostDataConstructClass, - ZigClangStmt_OpenACCDataConstructClass, - ZigClangStmt_OpenACCComputeConstructClass, - ZigClangStmt_OpenACCCombinedConstructClass, - ZigClangStmt_ObjCForCollectionStmtClass, - ZigClangStmt_ObjCAutoreleasePoolStmtClass, - ZigClangStmt_ObjCAtTryStmtClass, - ZigClangStmt_ObjCAtThrowStmtClass, - ZigClangStmt_ObjCAtSynchronizedStmtClass, - ZigClangStmt_ObjCAtFinallyStmtClass, - ZigClangStmt_ObjCAtCatchStmtClass, - ZigClangStmt_OMPTeamsDirectiveClass, - ZigClangStmt_OMPTaskyieldDirectiveClass, - ZigClangStmt_OMPTaskwaitDirectiveClass, - ZigClangStmt_OMPTaskgroupDirectiveClass, - ZigClangStmt_OMPTaskDirectiveClass, - ZigClangStmt_OMPTargetUpdateDirectiveClass, - ZigClangStmt_OMPTargetTeamsDirectiveClass, - ZigClangStmt_OMPTargetParallelForDirectiveClass, - ZigClangStmt_OMPTargetParallelDirectiveClass, - ZigClangStmt_OMPTargetExitDataDirectiveClass, - ZigClangStmt_OMPTargetEnterDataDirectiveClass, - ZigClangStmt_OMPTargetDirectiveClass, - ZigClangStmt_OMPTargetDataDirectiveClass, - ZigClangStmt_OMPSingleDirectiveClass, - ZigClangStmt_OMPSectionsDirectiveClass, - ZigClangStmt_OMPSectionDirectiveClass, - ZigClangStmt_OMPScopeDirectiveClass, - ZigClangStmt_OMPScanDirectiveClass, - ZigClangStmt_OMPParallelSectionsDirectiveClass, - ZigClangStmt_OMPParallelMasterDirectiveClass, - ZigClangStmt_OMPParallelMaskedDirectiveClass, - ZigClangStmt_OMPParallelDirectiveClass, - ZigClangStmt_OMPOrderedDirectiveClass, - ZigClangStmt_OMPMetaDirectiveClass, - ZigClangStmt_OMPMasterDirectiveClass, - ZigClangStmt_OMPMaskedDirectiveClass, - ZigClangStmt_OMPUnrollDirectiveClass, - ZigClangStmt_OMPTileDirectiveClass, - ZigClangStmt_OMPReverseDirectiveClass, - ZigClangStmt_OMPInterchangeDirectiveClass, - ZigClangStmt_OMPTeamsGenericLoopDirectiveClass, - ZigClangStmt_OMPTeamsDistributeSimdDirectiveClass, - ZigClangStmt_OMPTeamsDistributeParallelForSimdDirectiveClass, - ZigClangStmt_OMPTeamsDistributeParallelForDirectiveClass, - ZigClangStmt_OMPTeamsDistributeDirectiveClass, - ZigClangStmt_OMPTaskLoopSimdDirectiveClass, - ZigClangStmt_OMPTaskLoopDirectiveClass, - ZigClangStmt_OMPTargetTeamsGenericLoopDirectiveClass, - ZigClangStmt_OMPTargetTeamsDistributeSimdDirectiveClass, - ZigClangStmt_OMPTargetTeamsDistributeParallelForSimdDirectiveClass, - ZigClangStmt_OMPTargetTeamsDistributeParallelForDirectiveClass, - ZigClangStmt_OMPTargetTeamsDistributeDirectiveClass, - ZigClangStmt_OMPTargetSimdDirectiveClass, - ZigClangStmt_OMPTargetParallelGenericLoopDirectiveClass, - ZigClangStmt_OMPTargetParallelForSimdDirectiveClass, - ZigClangStmt_OMPSimdDirectiveClass, - ZigClangStmt_OMPParallelMasterTaskLoopSimdDirectiveClass, - ZigClangStmt_OMPParallelMasterTaskLoopDirectiveClass, - ZigClangStmt_OMPParallelMaskedTaskLoopSimdDirectiveClass, - ZigClangStmt_OMPParallelMaskedTaskLoopDirectiveClass, - ZigClangStmt_OMPParallelGenericLoopDirectiveClass, - ZigClangStmt_OMPParallelForSimdDirectiveClass, - ZigClangStmt_OMPParallelForDirectiveClass, - ZigClangStmt_OMPMasterTaskLoopSimdDirectiveClass, - ZigClangStmt_OMPMasterTaskLoopDirectiveClass, - ZigClangStmt_OMPMaskedTaskLoopSimdDirectiveClass, - ZigClangStmt_OMPMaskedTaskLoopDirectiveClass, - ZigClangStmt_OMPGenericLoopDirectiveClass, - ZigClangStmt_OMPForSimdDirectiveClass, - ZigClangStmt_OMPForDirectiveClass, - ZigClangStmt_OMPDistributeSimdDirectiveClass, - ZigClangStmt_OMPDistributeParallelForSimdDirectiveClass, - ZigClangStmt_OMPDistributeParallelForDirectiveClass, - ZigClangStmt_OMPDistributeDirectiveClass, - ZigClangStmt_OMPInteropDirectiveClass, - ZigClangStmt_OMPFlushDirectiveClass, - ZigClangStmt_OMPErrorDirectiveClass, - ZigClangStmt_OMPDispatchDirectiveClass, - ZigClangStmt_OMPDepobjDirectiveClass, - ZigClangStmt_OMPCriticalDirectiveClass, - ZigClangStmt_OMPCancellationPointDirectiveClass, - ZigClangStmt_OMPCancelDirectiveClass, - ZigClangStmt_OMPBarrierDirectiveClass, - ZigClangStmt_OMPAtomicDirectiveClass, - ZigClangStmt_OMPAssumeDirectiveClass, - ZigClangStmt_OMPCanonicalLoopClass, - ZigClangStmt_NullStmtClass, - ZigClangStmt_MSDependentExistsStmtClass, - ZigClangStmt_IndirectGotoStmtClass, - ZigClangStmt_IfStmtClass, - ZigClangStmt_GotoStmtClass, - ZigClangStmt_ForStmtClass, - ZigClangStmt_DoStmtClass, - ZigClangStmt_DeclStmtClass, - ZigClangStmt_CoroutineBodyStmtClass, - ZigClangStmt_CoreturnStmtClass, - ZigClangStmt_ContinueStmtClass, - ZigClangStmt_CompoundStmtClass, - ZigClangStmt_CapturedStmtClass, - ZigClangStmt_CXXTryStmtClass, - ZigClangStmt_CXXForRangeStmtClass, - ZigClangStmt_CXXCatchStmtClass, - ZigClangStmt_BreakStmtClass, - ZigClangStmt_MSAsmStmtClass, - ZigClangStmt_GCCAsmStmtClass, -}; - -enum ZigClangCK { - ZigClangCK_Dependent, - ZigClangCK_BitCast, - ZigClangCK_LValueBitCast, - ZigClangCK_LValueToRValueBitCast, - ZigClangCK_LValueToRValue, - ZigClangCK_NoOp, - ZigClangCK_BaseToDerived, - ZigClangCK_DerivedToBase, - ZigClangCK_UncheckedDerivedToBase, - ZigClangCK_Dynamic, - ZigClangCK_ToUnion, - ZigClangCK_ArrayToPointerDecay, - ZigClangCK_FunctionToPointerDecay, - ZigClangCK_NullToPointer, - ZigClangCK_NullToMemberPointer, - ZigClangCK_BaseToDerivedMemberPointer, - ZigClangCK_DerivedToBaseMemberPointer, - ZigClangCK_MemberPointerToBoolean, - ZigClangCK_ReinterpretMemberPointer, - ZigClangCK_UserDefinedConversion, - ZigClangCK_ConstructorConversion, - ZigClangCK_IntegralToPointer, - ZigClangCK_PointerToIntegral, - ZigClangCK_PointerToBoolean, - ZigClangCK_ToVoid, - ZigClangCK_MatrixCast, - ZigClangCK_VectorSplat, - ZigClangCK_IntegralCast, - ZigClangCK_IntegralToBoolean, - ZigClangCK_IntegralToFloating, - ZigClangCK_FloatingToFixedPoint, - ZigClangCK_FixedPointToFloating, - ZigClangCK_FixedPointCast, - ZigClangCK_FixedPointToIntegral, - ZigClangCK_IntegralToFixedPoint, - ZigClangCK_FixedPointToBoolean, - ZigClangCK_FloatingToIntegral, - ZigClangCK_FloatingToBoolean, - ZigClangCK_BooleanToSignedIntegral, - ZigClangCK_FloatingCast, - ZigClangCK_CPointerToObjCPointerCast, - ZigClangCK_BlockPointerToObjCPointerCast, - ZigClangCK_AnyPointerToBlockPointerCast, - ZigClangCK_ObjCObjectLValueCast, - ZigClangCK_FloatingRealToComplex, - ZigClangCK_FloatingComplexToReal, - ZigClangCK_FloatingComplexToBoolean, - ZigClangCK_FloatingComplexCast, - ZigClangCK_FloatingComplexToIntegralComplex, - ZigClangCK_IntegralRealToComplex, - ZigClangCK_IntegralComplexToReal, - ZigClangCK_IntegralComplexToBoolean, - ZigClangCK_IntegralComplexCast, - ZigClangCK_IntegralComplexToFloatingComplex, - ZigClangCK_ARCProduceObject, - ZigClangCK_ARCConsumeObject, - ZigClangCK_ARCReclaimReturnedObject, - ZigClangCK_ARCExtendBlockObject, - ZigClangCK_AtomicToNonAtomic, - ZigClangCK_NonAtomicToAtomic, - ZigClangCK_CopyAndAutoreleaseBlockObject, - ZigClangCK_BuiltinFnToFnPtr, - ZigClangCK_ZeroToOCLOpaqueType, - ZigClangCK_AddressSpaceConversion, - ZigClangCK_IntToOCLSampler, -}; - -enum ZigClangDeclKind { - ZigClangDeclTranslationUnit, - ZigClangDeclTopLevelStmt, - ZigClangDeclRequiresExprBody, - ZigClangDeclOutlinedFunction, - ZigClangDeclLinkageSpec, - ZigClangDeclExternCContext, - ZigClangDeclExport, - ZigClangDeclCaptured, - ZigClangDeclBlock, - ZigClangDeclStaticAssert, - ZigClangDeclPragmaDetectMismatch, - ZigClangDeclPragmaComment, - ZigClangDeclObjCPropertyImpl, - ZigClangDeclOMPThreadPrivate, - ZigClangDeclOMPRequires, - ZigClangDeclOMPAllocate, - ZigClangDeclObjCMethod, - ZigClangDeclObjCProtocol, - ZigClangDeclObjCInterface, - ZigClangDeclObjCImplementation, - ZigClangDeclObjCCategoryImpl, - ZigClangDeclObjCCategory, - ZigClangDeclNamespace, - ZigClangDeclHLSLBuffer, - ZigClangDeclOMPDeclareReduction, - ZigClangDeclOMPDeclareMapper, - ZigClangDeclUnresolvedUsingValue, - ZigClangDeclUnnamedGlobalConstant, - ZigClangDeclTemplateParamObject, - ZigClangDeclMSGuid, - ZigClangDeclIndirectField, - ZigClangDeclEnumConstant, - ZigClangDeclFunction, - ZigClangDeclCXXMethod, - ZigClangDeclCXXDestructor, - ZigClangDeclCXXConversion, - ZigClangDeclCXXConstructor, - ZigClangDeclCXXDeductionGuide, - ZigClangDeclVar, - ZigClangDeclVarTemplateSpecialization, - ZigClangDeclVarTemplatePartialSpecialization, - ZigClangDeclParmVar, - ZigClangDeclOMPCapturedExpr, - ZigClangDeclImplicitParam, - ZigClangDeclDecomposition, - ZigClangDeclNonTypeTemplateParm, - ZigClangDeclMSProperty, - ZigClangDeclField, - ZigClangDeclObjCIvar, - ZigClangDeclObjCAtDefsField, - ZigClangDeclBinding, - ZigClangDeclUsingShadow, - ZigClangDeclConstructorUsingShadow, - ZigClangDeclUsingPack, - ZigClangDeclUsingDirective, - ZigClangDeclUnresolvedUsingIfExists, - ZigClangDeclRecord, - ZigClangDeclCXXRecord, - ZigClangDeclClassTemplateSpecialization, - ZigClangDeclClassTemplatePartialSpecialization, - ZigClangDeclEnum, - ZigClangDeclUnresolvedUsingTypename, - ZigClangDeclTypedef, - ZigClangDeclTypeAlias, - ZigClangDeclObjCTypeParam, - ZigClangDeclTemplateTypeParm, - ZigClangDeclTemplateTemplateParm, - ZigClangDeclVarTemplate, - ZigClangDeclTypeAliasTemplate, - ZigClangDeclFunctionTemplate, - ZigClangDeclClassTemplate, - ZigClangDeclConcept, - ZigClangDeclBuiltinTemplate, - ZigClangDeclObjCProperty, - ZigClangDeclObjCCompatibleAlias, - ZigClangDeclNamespaceAlias, - ZigClangDeclLabel, - ZigClangDeclUsingEnum, - ZigClangDeclUsing, - ZigClangDeclLifetimeExtendedTemporary, - ZigClangDeclImport, - ZigClangDeclImplicitConceptSpecialization, - ZigClangDeclFriendTemplate, - ZigClangDeclFriend, - ZigClangDeclFileScopeAsm, - ZigClangDeclEmpty, - ZigClangDeclAccessSpec, -}; - -enum ZigClangBuiltinTypeKind { - ZigClangBuiltinTypeOCLImage1dRO, - ZigClangBuiltinTypeOCLImage1dArrayRO, - ZigClangBuiltinTypeOCLImage1dBufferRO, - ZigClangBuiltinTypeOCLImage2dRO, - ZigClangBuiltinTypeOCLImage2dArrayRO, - ZigClangBuiltinTypeOCLImage2dDepthRO, - ZigClangBuiltinTypeOCLImage2dArrayDepthRO, - ZigClangBuiltinTypeOCLImage2dMSAARO, - ZigClangBuiltinTypeOCLImage2dArrayMSAARO, - ZigClangBuiltinTypeOCLImage2dMSAADepthRO, - ZigClangBuiltinTypeOCLImage2dArrayMSAADepthRO, - ZigClangBuiltinTypeOCLImage3dRO, - ZigClangBuiltinTypeOCLImage1dWO, - ZigClangBuiltinTypeOCLImage1dArrayWO, - ZigClangBuiltinTypeOCLImage1dBufferWO, - ZigClangBuiltinTypeOCLImage2dWO, - ZigClangBuiltinTypeOCLImage2dArrayWO, - ZigClangBuiltinTypeOCLImage2dDepthWO, - ZigClangBuiltinTypeOCLImage2dArrayDepthWO, - ZigClangBuiltinTypeOCLImage2dMSAAWO, - ZigClangBuiltinTypeOCLImage2dArrayMSAAWO, - ZigClangBuiltinTypeOCLImage2dMSAADepthWO, - ZigClangBuiltinTypeOCLImage2dArrayMSAADepthWO, - ZigClangBuiltinTypeOCLImage3dWO, - ZigClangBuiltinTypeOCLImage1dRW, - ZigClangBuiltinTypeOCLImage1dArrayRW, - ZigClangBuiltinTypeOCLImage1dBufferRW, - ZigClangBuiltinTypeOCLImage2dRW, - ZigClangBuiltinTypeOCLImage2dArrayRW, - ZigClangBuiltinTypeOCLImage2dDepthRW, - ZigClangBuiltinTypeOCLImage2dArrayDepthRW, - ZigClangBuiltinTypeOCLImage2dMSAARW, - ZigClangBuiltinTypeOCLImage2dArrayMSAARW, - ZigClangBuiltinTypeOCLImage2dMSAADepthRW, - ZigClangBuiltinTypeOCLImage2dArrayMSAADepthRW, - ZigClangBuiltinTypeOCLImage3dRW, - ZigClangBuiltinTypeOCLIntelSubgroupAVCMcePayload, - ZigClangBuiltinTypeOCLIntelSubgroupAVCImePayload, - ZigClangBuiltinTypeOCLIntelSubgroupAVCRefPayload, - ZigClangBuiltinTypeOCLIntelSubgroupAVCSicPayload, - ZigClangBuiltinTypeOCLIntelSubgroupAVCMceResult, - ZigClangBuiltinTypeOCLIntelSubgroupAVCImeResult, - ZigClangBuiltinTypeOCLIntelSubgroupAVCRefResult, - ZigClangBuiltinTypeOCLIntelSubgroupAVCSicResult, - ZigClangBuiltinTypeOCLIntelSubgroupAVCImeResultSingleReferenceStreamout, - ZigClangBuiltinTypeOCLIntelSubgroupAVCImeResultDualReferenceStreamout, - ZigClangBuiltinTypeOCLIntelSubgroupAVCImeSingleReferenceStreamin, - ZigClangBuiltinTypeOCLIntelSubgroupAVCImeDualReferenceStreamin, - ZigClangBuiltinTypeSveInt8, - ZigClangBuiltinTypeSveInt16, - ZigClangBuiltinTypeSveInt32, - ZigClangBuiltinTypeSveInt64, - ZigClangBuiltinTypeSveUint8, - ZigClangBuiltinTypeSveUint16, - ZigClangBuiltinTypeSveUint32, - ZigClangBuiltinTypeSveUint64, - ZigClangBuiltinTypeSveFloat16, - ZigClangBuiltinTypeSveFloat32, - ZigClangBuiltinTypeSveFloat64, - ZigClangBuiltinTypeSveBFloat16, - ZigClangBuiltinTypeSveMFloat8, - ZigClangBuiltinTypeSveInt8x2, - ZigClangBuiltinTypeSveInt16x2, - ZigClangBuiltinTypeSveInt32x2, - ZigClangBuiltinTypeSveInt64x2, - ZigClangBuiltinTypeSveUint8x2, - ZigClangBuiltinTypeSveUint16x2, - ZigClangBuiltinTypeSveUint32x2, - ZigClangBuiltinTypeSveUint64x2, - ZigClangBuiltinTypeSveFloat16x2, - ZigClangBuiltinTypeSveFloat32x2, - ZigClangBuiltinTypeSveFloat64x2, - ZigClangBuiltinTypeSveBFloat16x2, - ZigClangBuiltinTypeSveMFloat8x2, - ZigClangBuiltinTypeSveInt8x3, - ZigClangBuiltinTypeSveInt16x3, - ZigClangBuiltinTypeSveInt32x3, - ZigClangBuiltinTypeSveInt64x3, - ZigClangBuiltinTypeSveUint8x3, - ZigClangBuiltinTypeSveUint16x3, - ZigClangBuiltinTypeSveUint32x3, - ZigClangBuiltinTypeSveUint64x3, - ZigClangBuiltinTypeSveFloat16x3, - ZigClangBuiltinTypeSveFloat32x3, - ZigClangBuiltinTypeSveFloat64x3, - ZigClangBuiltinTypeSveBFloat16x3, - ZigClangBuiltinTypeSveMFloat8x3, - ZigClangBuiltinTypeSveInt8x4, - ZigClangBuiltinTypeSveInt16x4, - ZigClangBuiltinTypeSveInt32x4, - ZigClangBuiltinTypeSveInt64x4, - ZigClangBuiltinTypeSveUint8x4, - ZigClangBuiltinTypeSveUint16x4, - ZigClangBuiltinTypeSveUint32x4, - ZigClangBuiltinTypeSveUint64x4, - ZigClangBuiltinTypeSveFloat16x4, - ZigClangBuiltinTypeSveFloat32x4, - ZigClangBuiltinTypeSveFloat64x4, - ZigClangBuiltinTypeSveBFloat16x4, - ZigClangBuiltinTypeSveMFloat8x4, - ZigClangBuiltinTypeSveBool, - ZigClangBuiltinTypeSveBoolx2, - ZigClangBuiltinTypeSveBoolx4, - ZigClangBuiltinTypeSveCount, - ZigClangBuiltinTypeMFloat8, - ZigClangBuiltinTypeVectorQuad, - ZigClangBuiltinTypeVectorPair, - ZigClangBuiltinTypeRvvInt8mf8, - ZigClangBuiltinTypeRvvInt8mf4, - ZigClangBuiltinTypeRvvInt8mf2, - ZigClangBuiltinTypeRvvInt8m1, - ZigClangBuiltinTypeRvvInt8m2, - ZigClangBuiltinTypeRvvInt8m4, - ZigClangBuiltinTypeRvvInt8m8, - ZigClangBuiltinTypeRvvUint8mf8, - ZigClangBuiltinTypeRvvUint8mf4, - ZigClangBuiltinTypeRvvUint8mf2, - ZigClangBuiltinTypeRvvUint8m1, - ZigClangBuiltinTypeRvvUint8m2, - ZigClangBuiltinTypeRvvUint8m4, - ZigClangBuiltinTypeRvvUint8m8, - ZigClangBuiltinTypeRvvInt16mf4, - ZigClangBuiltinTypeRvvInt16mf2, - ZigClangBuiltinTypeRvvInt16m1, - ZigClangBuiltinTypeRvvInt16m2, - ZigClangBuiltinTypeRvvInt16m4, - ZigClangBuiltinTypeRvvInt16m8, - ZigClangBuiltinTypeRvvUint16mf4, - ZigClangBuiltinTypeRvvUint16mf2, - ZigClangBuiltinTypeRvvUint16m1, - ZigClangBuiltinTypeRvvUint16m2, - ZigClangBuiltinTypeRvvUint16m4, - ZigClangBuiltinTypeRvvUint16m8, - ZigClangBuiltinTypeRvvInt32mf2, - ZigClangBuiltinTypeRvvInt32m1, - ZigClangBuiltinTypeRvvInt32m2, - ZigClangBuiltinTypeRvvInt32m4, - ZigClangBuiltinTypeRvvInt32m8, - ZigClangBuiltinTypeRvvUint32mf2, - ZigClangBuiltinTypeRvvUint32m1, - ZigClangBuiltinTypeRvvUint32m2, - ZigClangBuiltinTypeRvvUint32m4, - ZigClangBuiltinTypeRvvUint32m8, - ZigClangBuiltinTypeRvvInt64m1, - ZigClangBuiltinTypeRvvInt64m2, - ZigClangBuiltinTypeRvvInt64m4, - ZigClangBuiltinTypeRvvInt64m8, - ZigClangBuiltinTypeRvvUint64m1, - ZigClangBuiltinTypeRvvUint64m2, - ZigClangBuiltinTypeRvvUint64m4, - ZigClangBuiltinTypeRvvUint64m8, - ZigClangBuiltinTypeRvvFloat16mf4, - ZigClangBuiltinTypeRvvFloat16mf2, - ZigClangBuiltinTypeRvvFloat16m1, - ZigClangBuiltinTypeRvvFloat16m2, - ZigClangBuiltinTypeRvvFloat16m4, - ZigClangBuiltinTypeRvvFloat16m8, - ZigClangBuiltinTypeRvvBFloat16mf4, - ZigClangBuiltinTypeRvvBFloat16mf2, - ZigClangBuiltinTypeRvvBFloat16m1, - ZigClangBuiltinTypeRvvBFloat16m2, - ZigClangBuiltinTypeRvvBFloat16m4, - ZigClangBuiltinTypeRvvBFloat16m8, - ZigClangBuiltinTypeRvvFloat32mf2, - ZigClangBuiltinTypeRvvFloat32m1, - ZigClangBuiltinTypeRvvFloat32m2, - ZigClangBuiltinTypeRvvFloat32m4, - ZigClangBuiltinTypeRvvFloat32m8, - ZigClangBuiltinTypeRvvFloat64m1, - ZigClangBuiltinTypeRvvFloat64m2, - ZigClangBuiltinTypeRvvFloat64m4, - ZigClangBuiltinTypeRvvFloat64m8, - ZigClangBuiltinTypeRvvBool1, - ZigClangBuiltinTypeRvvBool2, - ZigClangBuiltinTypeRvvBool4, - ZigClangBuiltinTypeRvvBool8, - ZigClangBuiltinTypeRvvBool16, - ZigClangBuiltinTypeRvvBool32, - ZigClangBuiltinTypeRvvBool64, - ZigClangBuiltinTypeRvvInt8mf8x2, - ZigClangBuiltinTypeRvvInt8mf8x3, - ZigClangBuiltinTypeRvvInt8mf8x4, - ZigClangBuiltinTypeRvvInt8mf8x5, - ZigClangBuiltinTypeRvvInt8mf8x6, - ZigClangBuiltinTypeRvvInt8mf8x7, - ZigClangBuiltinTypeRvvInt8mf8x8, - ZigClangBuiltinTypeRvvInt8mf4x2, - ZigClangBuiltinTypeRvvInt8mf4x3, - ZigClangBuiltinTypeRvvInt8mf4x4, - ZigClangBuiltinTypeRvvInt8mf4x5, - ZigClangBuiltinTypeRvvInt8mf4x6, - ZigClangBuiltinTypeRvvInt8mf4x7, - ZigClangBuiltinTypeRvvInt8mf4x8, - ZigClangBuiltinTypeRvvInt8mf2x2, - ZigClangBuiltinTypeRvvInt8mf2x3, - ZigClangBuiltinTypeRvvInt8mf2x4, - ZigClangBuiltinTypeRvvInt8mf2x5, - ZigClangBuiltinTypeRvvInt8mf2x6, - ZigClangBuiltinTypeRvvInt8mf2x7, - ZigClangBuiltinTypeRvvInt8mf2x8, - ZigClangBuiltinTypeRvvInt8m1x2, - ZigClangBuiltinTypeRvvInt8m1x3, - ZigClangBuiltinTypeRvvInt8m1x4, - ZigClangBuiltinTypeRvvInt8m1x5, - ZigClangBuiltinTypeRvvInt8m1x6, - ZigClangBuiltinTypeRvvInt8m1x7, - ZigClangBuiltinTypeRvvInt8m1x8, - ZigClangBuiltinTypeRvvInt8m2x2, - ZigClangBuiltinTypeRvvInt8m2x3, - ZigClangBuiltinTypeRvvInt8m2x4, - ZigClangBuiltinTypeRvvInt8m4x2, - ZigClangBuiltinTypeRvvUint8mf8x2, - ZigClangBuiltinTypeRvvUint8mf8x3, - ZigClangBuiltinTypeRvvUint8mf8x4, - ZigClangBuiltinTypeRvvUint8mf8x5, - ZigClangBuiltinTypeRvvUint8mf8x6, - ZigClangBuiltinTypeRvvUint8mf8x7, - ZigClangBuiltinTypeRvvUint8mf8x8, - ZigClangBuiltinTypeRvvUint8mf4x2, - ZigClangBuiltinTypeRvvUint8mf4x3, - ZigClangBuiltinTypeRvvUint8mf4x4, - ZigClangBuiltinTypeRvvUint8mf4x5, - ZigClangBuiltinTypeRvvUint8mf4x6, - ZigClangBuiltinTypeRvvUint8mf4x7, - ZigClangBuiltinTypeRvvUint8mf4x8, - ZigClangBuiltinTypeRvvUint8mf2x2, - ZigClangBuiltinTypeRvvUint8mf2x3, - ZigClangBuiltinTypeRvvUint8mf2x4, - ZigClangBuiltinTypeRvvUint8mf2x5, - ZigClangBuiltinTypeRvvUint8mf2x6, - ZigClangBuiltinTypeRvvUint8mf2x7, - ZigClangBuiltinTypeRvvUint8mf2x8, - ZigClangBuiltinTypeRvvUint8m1x2, - ZigClangBuiltinTypeRvvUint8m1x3, - ZigClangBuiltinTypeRvvUint8m1x4, - ZigClangBuiltinTypeRvvUint8m1x5, - ZigClangBuiltinTypeRvvUint8m1x6, - ZigClangBuiltinTypeRvvUint8m1x7, - ZigClangBuiltinTypeRvvUint8m1x8, - ZigClangBuiltinTypeRvvUint8m2x2, - ZigClangBuiltinTypeRvvUint8m2x3, - ZigClangBuiltinTypeRvvUint8m2x4, - ZigClangBuiltinTypeRvvUint8m4x2, - ZigClangBuiltinTypeRvvInt16mf4x2, - ZigClangBuiltinTypeRvvInt16mf4x3, - ZigClangBuiltinTypeRvvInt16mf4x4, - ZigClangBuiltinTypeRvvInt16mf4x5, - ZigClangBuiltinTypeRvvInt16mf4x6, - ZigClangBuiltinTypeRvvInt16mf4x7, - ZigClangBuiltinTypeRvvInt16mf4x8, - ZigClangBuiltinTypeRvvInt16mf2x2, - ZigClangBuiltinTypeRvvInt16mf2x3, - ZigClangBuiltinTypeRvvInt16mf2x4, - ZigClangBuiltinTypeRvvInt16mf2x5, - ZigClangBuiltinTypeRvvInt16mf2x6, - ZigClangBuiltinTypeRvvInt16mf2x7, - ZigClangBuiltinTypeRvvInt16mf2x8, - ZigClangBuiltinTypeRvvInt16m1x2, - ZigClangBuiltinTypeRvvInt16m1x3, - ZigClangBuiltinTypeRvvInt16m1x4, - ZigClangBuiltinTypeRvvInt16m1x5, - ZigClangBuiltinTypeRvvInt16m1x6, - ZigClangBuiltinTypeRvvInt16m1x7, - ZigClangBuiltinTypeRvvInt16m1x8, - ZigClangBuiltinTypeRvvInt16m2x2, - ZigClangBuiltinTypeRvvInt16m2x3, - ZigClangBuiltinTypeRvvInt16m2x4, - ZigClangBuiltinTypeRvvInt16m4x2, - ZigClangBuiltinTypeRvvUint16mf4x2, - ZigClangBuiltinTypeRvvUint16mf4x3, - ZigClangBuiltinTypeRvvUint16mf4x4, - ZigClangBuiltinTypeRvvUint16mf4x5, - ZigClangBuiltinTypeRvvUint16mf4x6, - ZigClangBuiltinTypeRvvUint16mf4x7, - ZigClangBuiltinTypeRvvUint16mf4x8, - ZigClangBuiltinTypeRvvUint16mf2x2, - ZigClangBuiltinTypeRvvUint16mf2x3, - ZigClangBuiltinTypeRvvUint16mf2x4, - ZigClangBuiltinTypeRvvUint16mf2x5, - ZigClangBuiltinTypeRvvUint16mf2x6, - ZigClangBuiltinTypeRvvUint16mf2x7, - ZigClangBuiltinTypeRvvUint16mf2x8, - ZigClangBuiltinTypeRvvUint16m1x2, - ZigClangBuiltinTypeRvvUint16m1x3, - ZigClangBuiltinTypeRvvUint16m1x4, - ZigClangBuiltinTypeRvvUint16m1x5, - ZigClangBuiltinTypeRvvUint16m1x6, - ZigClangBuiltinTypeRvvUint16m1x7, - ZigClangBuiltinTypeRvvUint16m1x8, - ZigClangBuiltinTypeRvvUint16m2x2, - ZigClangBuiltinTypeRvvUint16m2x3, - ZigClangBuiltinTypeRvvUint16m2x4, - ZigClangBuiltinTypeRvvUint16m4x2, - ZigClangBuiltinTypeRvvInt32mf2x2, - ZigClangBuiltinTypeRvvInt32mf2x3, - ZigClangBuiltinTypeRvvInt32mf2x4, - ZigClangBuiltinTypeRvvInt32mf2x5, - ZigClangBuiltinTypeRvvInt32mf2x6, - ZigClangBuiltinTypeRvvInt32mf2x7, - ZigClangBuiltinTypeRvvInt32mf2x8, - ZigClangBuiltinTypeRvvInt32m1x2, - ZigClangBuiltinTypeRvvInt32m1x3, - ZigClangBuiltinTypeRvvInt32m1x4, - ZigClangBuiltinTypeRvvInt32m1x5, - ZigClangBuiltinTypeRvvInt32m1x6, - ZigClangBuiltinTypeRvvInt32m1x7, - ZigClangBuiltinTypeRvvInt32m1x8, - ZigClangBuiltinTypeRvvInt32m2x2, - ZigClangBuiltinTypeRvvInt32m2x3, - ZigClangBuiltinTypeRvvInt32m2x4, - ZigClangBuiltinTypeRvvInt32m4x2, - ZigClangBuiltinTypeRvvUint32mf2x2, - ZigClangBuiltinTypeRvvUint32mf2x3, - ZigClangBuiltinTypeRvvUint32mf2x4, - ZigClangBuiltinTypeRvvUint32mf2x5, - ZigClangBuiltinTypeRvvUint32mf2x6, - ZigClangBuiltinTypeRvvUint32mf2x7, - ZigClangBuiltinTypeRvvUint32mf2x8, - ZigClangBuiltinTypeRvvUint32m1x2, - ZigClangBuiltinTypeRvvUint32m1x3, - ZigClangBuiltinTypeRvvUint32m1x4, - ZigClangBuiltinTypeRvvUint32m1x5, - ZigClangBuiltinTypeRvvUint32m1x6, - ZigClangBuiltinTypeRvvUint32m1x7, - ZigClangBuiltinTypeRvvUint32m1x8, - ZigClangBuiltinTypeRvvUint32m2x2, - ZigClangBuiltinTypeRvvUint32m2x3, - ZigClangBuiltinTypeRvvUint32m2x4, - ZigClangBuiltinTypeRvvUint32m4x2, - ZigClangBuiltinTypeRvvInt64m1x2, - ZigClangBuiltinTypeRvvInt64m1x3, - ZigClangBuiltinTypeRvvInt64m1x4, - ZigClangBuiltinTypeRvvInt64m1x5, - ZigClangBuiltinTypeRvvInt64m1x6, - ZigClangBuiltinTypeRvvInt64m1x7, - ZigClangBuiltinTypeRvvInt64m1x8, - ZigClangBuiltinTypeRvvInt64m2x2, - ZigClangBuiltinTypeRvvInt64m2x3, - ZigClangBuiltinTypeRvvInt64m2x4, - ZigClangBuiltinTypeRvvInt64m4x2, - ZigClangBuiltinTypeRvvUint64m1x2, - ZigClangBuiltinTypeRvvUint64m1x3, - ZigClangBuiltinTypeRvvUint64m1x4, - ZigClangBuiltinTypeRvvUint64m1x5, - ZigClangBuiltinTypeRvvUint64m1x6, - ZigClangBuiltinTypeRvvUint64m1x7, - ZigClangBuiltinTypeRvvUint64m1x8, - ZigClangBuiltinTypeRvvUint64m2x2, - ZigClangBuiltinTypeRvvUint64m2x3, - ZigClangBuiltinTypeRvvUint64m2x4, - ZigClangBuiltinTypeRvvUint64m4x2, - ZigClangBuiltinTypeRvvFloat16mf4x2, - ZigClangBuiltinTypeRvvFloat16mf4x3, - ZigClangBuiltinTypeRvvFloat16mf4x4, - ZigClangBuiltinTypeRvvFloat16mf4x5, - ZigClangBuiltinTypeRvvFloat16mf4x6, - ZigClangBuiltinTypeRvvFloat16mf4x7, - ZigClangBuiltinTypeRvvFloat16mf4x8, - ZigClangBuiltinTypeRvvFloat16mf2x2, - ZigClangBuiltinTypeRvvFloat16mf2x3, - ZigClangBuiltinTypeRvvFloat16mf2x4, - ZigClangBuiltinTypeRvvFloat16mf2x5, - ZigClangBuiltinTypeRvvFloat16mf2x6, - ZigClangBuiltinTypeRvvFloat16mf2x7, - ZigClangBuiltinTypeRvvFloat16mf2x8, - ZigClangBuiltinTypeRvvFloat16m1x2, - ZigClangBuiltinTypeRvvFloat16m1x3, - ZigClangBuiltinTypeRvvFloat16m1x4, - ZigClangBuiltinTypeRvvFloat16m1x5, - ZigClangBuiltinTypeRvvFloat16m1x6, - ZigClangBuiltinTypeRvvFloat16m1x7, - ZigClangBuiltinTypeRvvFloat16m1x8, - ZigClangBuiltinTypeRvvFloat16m2x2, - ZigClangBuiltinTypeRvvFloat16m2x3, - ZigClangBuiltinTypeRvvFloat16m2x4, - ZigClangBuiltinTypeRvvFloat16m4x2, - ZigClangBuiltinTypeRvvFloat32mf2x2, - ZigClangBuiltinTypeRvvFloat32mf2x3, - ZigClangBuiltinTypeRvvFloat32mf2x4, - ZigClangBuiltinTypeRvvFloat32mf2x5, - ZigClangBuiltinTypeRvvFloat32mf2x6, - ZigClangBuiltinTypeRvvFloat32mf2x7, - ZigClangBuiltinTypeRvvFloat32mf2x8, - ZigClangBuiltinTypeRvvFloat32m1x2, - ZigClangBuiltinTypeRvvFloat32m1x3, - ZigClangBuiltinTypeRvvFloat32m1x4, - ZigClangBuiltinTypeRvvFloat32m1x5, - ZigClangBuiltinTypeRvvFloat32m1x6, - ZigClangBuiltinTypeRvvFloat32m1x7, - ZigClangBuiltinTypeRvvFloat32m1x8, - ZigClangBuiltinTypeRvvFloat32m2x2, - ZigClangBuiltinTypeRvvFloat32m2x3, - ZigClangBuiltinTypeRvvFloat32m2x4, - ZigClangBuiltinTypeRvvFloat32m4x2, - ZigClangBuiltinTypeRvvFloat64m1x2, - ZigClangBuiltinTypeRvvFloat64m1x3, - ZigClangBuiltinTypeRvvFloat64m1x4, - ZigClangBuiltinTypeRvvFloat64m1x5, - ZigClangBuiltinTypeRvvFloat64m1x6, - ZigClangBuiltinTypeRvvFloat64m1x7, - ZigClangBuiltinTypeRvvFloat64m1x8, - ZigClangBuiltinTypeRvvFloat64m2x2, - ZigClangBuiltinTypeRvvFloat64m2x3, - ZigClangBuiltinTypeRvvFloat64m2x4, - ZigClangBuiltinTypeRvvFloat64m4x2, - ZigClangBuiltinTypeRvvBFloat16mf4x2, - ZigClangBuiltinTypeRvvBFloat16mf4x3, - ZigClangBuiltinTypeRvvBFloat16mf4x4, - ZigClangBuiltinTypeRvvBFloat16mf4x5, - ZigClangBuiltinTypeRvvBFloat16mf4x6, - ZigClangBuiltinTypeRvvBFloat16mf4x7, - ZigClangBuiltinTypeRvvBFloat16mf4x8, - ZigClangBuiltinTypeRvvBFloat16mf2x2, - ZigClangBuiltinTypeRvvBFloat16mf2x3, - ZigClangBuiltinTypeRvvBFloat16mf2x4, - ZigClangBuiltinTypeRvvBFloat16mf2x5, - ZigClangBuiltinTypeRvvBFloat16mf2x6, - ZigClangBuiltinTypeRvvBFloat16mf2x7, - ZigClangBuiltinTypeRvvBFloat16mf2x8, - ZigClangBuiltinTypeRvvBFloat16m1x2, - ZigClangBuiltinTypeRvvBFloat16m1x3, - ZigClangBuiltinTypeRvvBFloat16m1x4, - ZigClangBuiltinTypeRvvBFloat16m1x5, - ZigClangBuiltinTypeRvvBFloat16m1x6, - ZigClangBuiltinTypeRvvBFloat16m1x7, - ZigClangBuiltinTypeRvvBFloat16m1x8, - ZigClangBuiltinTypeRvvBFloat16m2x2, - ZigClangBuiltinTypeRvvBFloat16m2x3, - ZigClangBuiltinTypeRvvBFloat16m2x4, - ZigClangBuiltinTypeRvvBFloat16m4x2, - ZigClangBuiltinTypeWasmExternRef, - ZigClangBuiltinTypeAMDGPUBufferRsrc, - ZigClangBuiltinTypeAMDGPUNamedWorkgroupBarrier, - ZigClangBuiltinTypeHLSLResource, - ZigClangBuiltinTypeVoid, - ZigClangBuiltinTypeBool, - ZigClangBuiltinTypeChar_U, - ZigClangBuiltinTypeUChar, - ZigClangBuiltinTypeWChar_U, - ZigClangBuiltinTypeChar8, - ZigClangBuiltinTypeChar16, - ZigClangBuiltinTypeChar32, - ZigClangBuiltinTypeUShort, - ZigClangBuiltinTypeUInt, - ZigClangBuiltinTypeULong, - ZigClangBuiltinTypeULongLong, - ZigClangBuiltinTypeUInt128, - ZigClangBuiltinTypeChar_S, - ZigClangBuiltinTypeSChar, - ZigClangBuiltinTypeWChar_S, - ZigClangBuiltinTypeShort, - ZigClangBuiltinTypeInt, - ZigClangBuiltinTypeLong, - ZigClangBuiltinTypeLongLong, - ZigClangBuiltinTypeInt128, - ZigClangBuiltinTypeShortAccum, - ZigClangBuiltinTypeAccum, - ZigClangBuiltinTypeLongAccum, - ZigClangBuiltinTypeUShortAccum, - ZigClangBuiltinTypeUAccum, - ZigClangBuiltinTypeULongAccum, - ZigClangBuiltinTypeShortFract, - ZigClangBuiltinTypeFract, - ZigClangBuiltinTypeLongFract, - ZigClangBuiltinTypeUShortFract, - ZigClangBuiltinTypeUFract, - ZigClangBuiltinTypeULongFract, - ZigClangBuiltinTypeSatShortAccum, - ZigClangBuiltinTypeSatAccum, - ZigClangBuiltinTypeSatLongAccum, - ZigClangBuiltinTypeSatUShortAccum, - ZigClangBuiltinTypeSatUAccum, - ZigClangBuiltinTypeSatULongAccum, - ZigClangBuiltinTypeSatShortFract, - ZigClangBuiltinTypeSatFract, - ZigClangBuiltinTypeSatLongFract, - ZigClangBuiltinTypeSatUShortFract, - ZigClangBuiltinTypeSatUFract, - ZigClangBuiltinTypeSatULongFract, - ZigClangBuiltinTypeHalf, - ZigClangBuiltinTypeFloat, - ZigClangBuiltinTypeDouble, - ZigClangBuiltinTypeLongDouble, - ZigClangBuiltinTypeFloat16, - ZigClangBuiltinTypeBFloat16, - ZigClangBuiltinTypeFloat128, - ZigClangBuiltinTypeIbm128, - ZigClangBuiltinTypeNullPtr, - ZigClangBuiltinTypeObjCId, - ZigClangBuiltinTypeObjCClass, - ZigClangBuiltinTypeObjCSel, - ZigClangBuiltinTypeOCLSampler, - ZigClangBuiltinTypeOCLEvent, - ZigClangBuiltinTypeOCLClkEvent, - ZigClangBuiltinTypeOCLQueue, - ZigClangBuiltinTypeOCLReserveID, - ZigClangBuiltinTypeDependent, - ZigClangBuiltinTypeOverload, - ZigClangBuiltinTypeBoundMember, - ZigClangBuiltinTypeUnresolvedTemplate, - ZigClangBuiltinTypePseudoObject, - ZigClangBuiltinTypeUnknownAny, - ZigClangBuiltinTypeBuiltinFn, - ZigClangBuiltinTypeARCUnbridgedCast, - ZigClangBuiltinTypeIncompleteMatrixIdx, - ZigClangBuiltinTypeOMPArraySection, - ZigClangBuiltinTypeOMPArrayShaping, - ZigClangBuiltinTypeOMPIterator, -}; - -enum ZigClangCallingConv { - ZigClangCallingConv_C, - ZigClangCallingConv_X86StdCall, - ZigClangCallingConv_X86FastCall, - ZigClangCallingConv_X86ThisCall, - ZigClangCallingConv_X86VectorCall, - ZigClangCallingConv_X86Pascal, - ZigClangCallingConv_Win64, - ZigClangCallingConv_X86_64SysV, - ZigClangCallingConv_X86RegCall, - ZigClangCallingConv_AAPCS, - ZigClangCallingConv_AAPCS_VFP, - ZigClangCallingConv_IntelOclBicc, - ZigClangCallingConv_SpirFunction, - ZigClangCallingConv_OpenCLKernel, - ZigClangCallingConv_Swift, - ZigClangCallingConv_SwiftAsync, - ZigClangCallingConv_PreserveMost, - ZigClangCallingConv_PreserveAll, - ZigClangCallingConv_AArch64VectorCall, - ZigClangCallingConv_AArch64SVEPCS, - ZigClangCallingConv_AMDGPUKernelCall, - ZigClangCallingConv_M68kRTD, - ZigClangCallingConv_PreserveNone, - ZigClangCallingConv_RISCVVectorCall, -}; - -enum ZigClangStorageClass { - // These are legal on both functions and variables. - ZigClangStorageClass_None, - ZigClangStorageClass_Extern, - ZigClangStorageClass_Static, - ZigClangStorageClass_PrivateExtern, - - // These are only legal on variables. - ZigClangStorageClass_Auto, - ZigClangStorageClass_Register, -}; - -/// IEEE-754R 4.3: Rounding-direction attributes. -enum ZigClangAPFloat_roundingMode { - ZigClangAPFloat_roundingMode_TowardZero = 0, - ZigClangAPFloat_roundingMode_NearestTiesToEven = 1, - ZigClangAPFloat_roundingMode_TowardPositive = 2, - ZigClangAPFloat_roundingMode_TowardNegative = 3, - ZigClangAPFloat_roundingMode_NearestTiesToAway = 4, - - ZigClangAPFloat_roundingMode_Dynamic = 7, - ZigClangAPFloat_roundingMode_Invalid = -1, -}; - -enum ZigClangAPFloatBase_Semantics { - ZigClangAPFloatBase_Semantics_IEEEhalf, - ZigClangAPFloatBase_Semantics_BFloat, - ZigClangAPFloatBase_Semantics_IEEEsingle, - ZigClangAPFloatBase_Semantics_IEEEdouble, - ZigClangAPFloatBase_Semantics_IEEEquad, - ZigClangAPFloatBase_Semantics_PPCDoubleDouble, - ZigClangAPFloatBase_Semantics_PPCDoubleDoubleLegacy, - ZigClangAPFloatBase_Semantics_Float8E5M2, - ZigClangAPFloatBase_Semantics_Float8E5M2FNUZ, - ZigClangAPFloatBase_Semantics_Float8E4M3, - ZigClangAPFloatBase_Semantics_Float8E4M3FN, - ZigClangAPFloatBase_Semantics_Float8E4M3FNUZ, - ZigClangAPFloatBase_Semantics_Float8E4M3B11FNUZ, - ZigClangAPFloatBase_Semantics_Float8E3M4, - ZigClangAPFloatBase_Semantics_FloatTF32, - ZigClangAPFloatBase_Semantics_Float8E8M0FNU, - ZigClangAPFloatBase_Semantics_Float6E3M2FN, - ZigClangAPFloatBase_Semantics_Float6E2M3FN, - ZigClangAPFloatBase_Semantics_Float4E2M1FN, - ZigClangAPFloatBase_Semantics_x87DoubleExtended, - ZigClangAPFloatBase_Semantics_MaxSemantics = ZigClangAPFloatBase_Semantics_x87DoubleExtended, -}; - -enum ZigClangStringLiteral_StringKind { - ZigClangStringLiteral_StringKind_Ascii, - ZigClangStringLiteral_StringKind_Wide, - ZigClangStringLiteral_StringKind_UTF8, - ZigClangStringLiteral_StringKind_UTF16, - ZigClangStringLiteral_StringKind_UTF32, -}; - -enum ZigClangCharacterLiteralKind { - ZigClangCharacterLiteralKind_Ascii, - ZigClangCharacterLiteralKind_Wide, - ZigClangCharacterLiteralKind_UTF8, - ZigClangCharacterLiteralKind_UTF16, - ZigClangCharacterLiteralKind_UTF32, -}; - -enum ZigClangVarDecl_TLSKind { - ZigClangVarDecl_TLSKind_None, - ZigClangVarDecl_TLSKind_Static, - ZigClangVarDecl_TLSKind_Dynamic, -}; - -enum ZigClangElaboratedTypeKeyword { - ZigClangElaboratedTypeKeyword_Struct, - ZigClangElaboratedTypeKeyword_Interface, - ZigClangElaboratedTypeKeyword_Union, - ZigClangElaboratedTypeKeyword_Class, - ZigClangElaboratedTypeKeyword_Enum, - ZigClangElaboratedTypeKeyword_Typename, - ZigClangElaboratedTypeKeyword_None, -}; - -enum ZigClangPreprocessedEntity_EntityKind { - ZigClangPreprocessedEntity_InvalidKind, - ZigClangPreprocessedEntity_MacroExpansionKind, - ZigClangPreprocessedEntity_MacroDefinitionKind, - ZigClangPreprocessedEntity_InclusionDirectiveKind, -}; - -enum ZigClangExpr_ConstantExprKind { - ZigClangExpr_ConstantExprKind_Normal, - ZigClangExpr_ConstantExprKind_NonClassTemplateArgument, - ZigClangExpr_ConstantExprKind_ClassTemplateArgument, - ZigClangExpr_ConstantExprKind_ImmediateInvocation, -}; - -enum ZigClangUnaryExprOrTypeTrait_Kind { - ZigClangUnaryExprOrTypeTrait_KindSizeOf, - ZigClangUnaryExprOrTypeTrait_KindDataSizeOf, - ZigClangUnaryExprOrTypeTrait_KindAlignOf, - ZigClangUnaryExprOrTypeTrait_KindPreferredAlignOf, - ZigClangUnaryExprOrTypeTrait_KindPtrAuthTypeDiscriminator, - ZigClangUnaryExprOrTypeTrait_KindVecStep, - ZigClangUnaryExprOrTypeTrait_KindOpenMPRequiredSimdAlign, -}; - -enum ZigClangOffsetOfNode_Kind { - ZigClangOffsetOfNode_KindArray, - ZigClangOffsetOfNode_KindField, - ZigClangOffsetOfNode_KindIdentifier, - ZigClangOffsetOfNode_KindBase, -}; - -ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangSourceManager_getSpellingLoc(const struct ZigClangSourceManager *, - struct ZigClangSourceLocation Loc); -ZIG_EXTERN_C const char *ZigClangSourceManager_getFilename(const struct ZigClangSourceManager *, - struct ZigClangSourceLocation SpellingLoc); -ZIG_EXTERN_C unsigned ZigClangSourceManager_getSpellingLineNumber(const struct ZigClangSourceManager *, - struct ZigClangSourceLocation Loc); -ZIG_EXTERN_C unsigned ZigClangSourceManager_getSpellingColumnNumber(const struct ZigClangSourceManager *, - struct ZigClangSourceLocation Loc); -ZIG_EXTERN_C const char* ZigClangSourceManager_getCharacterData(const struct ZigClangSourceManager *, - struct ZigClangSourceLocation SL); - -ZIG_EXTERN_C struct ZigClangQualType ZigClangASTContext_getPointerType(const struct ZigClangASTContext*, struct ZigClangQualType T); - -ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangLexer_getLocForEndOfToken(struct ZigClangSourceLocation, - const ZigClangSourceManager *, const ZigClangASTUnit *); - -// Can return null. -ZIG_EXTERN_C struct ZigClangASTUnit *ZigClangLoadFromCommandLine( - const char **args_begin, const char **args_end, - struct Stage2ErrorMsg **errors_ptr, size_t *errors_len, const char *resources_path); -ZIG_EXTERN_C void ZigClangASTUnit_delete(struct ZigClangASTUnit *); -ZIG_EXTERN_C void ZigClangErrorMsg_delete(struct Stage2ErrorMsg *ptr, size_t len); - -ZIG_EXTERN_C struct ZigClangASTContext *ZigClangASTUnit_getASTContext(struct ZigClangASTUnit *); -ZIG_EXTERN_C struct ZigClangSourceManager *ZigClangASTUnit_getSourceManager(struct ZigClangASTUnit *); -ZIG_EXTERN_C bool ZigClangASTUnit_visitLocalTopLevelDecls(struct ZigClangASTUnit *, void *context, - bool (*Fn)(void *context, const struct ZigClangDecl *decl)); -ZIG_EXTERN_C struct ZigClangPreprocessingRecord_iterator ZigClangASTUnit_getLocalPreprocessingEntities_begin(struct ZigClangASTUnit *); -ZIG_EXTERN_C struct ZigClangPreprocessingRecord_iterator ZigClangASTUnit_getLocalPreprocessingEntities_end(struct ZigClangASTUnit *); - -ZIG_EXTERN_C struct ZigClangPreprocessedEntity *ZigClangPreprocessingRecord_iterator_deref( - struct ZigClangPreprocessingRecord_iterator); - -ZIG_EXTERN_C enum ZigClangPreprocessedEntity_EntityKind ZigClangPreprocessedEntity_getKind(const struct ZigClangPreprocessedEntity *); - -ZIG_EXTERN_C const struct ZigClangRecordDecl *ZigClangRecordType_getDecl(const struct ZigClangRecordType *record_ty); -ZIG_EXTERN_C const struct ZigClangEnumDecl *ZigClangEnumType_getDecl(const struct ZigClangEnumType *record_ty); - -ZIG_EXTERN_C bool ZigClangTagDecl_isThisDeclarationADefinition(const struct ZigClangTagDecl *); - -ZIG_EXTERN_C const struct ZigClangTagDecl *ZigClangRecordDecl_getCanonicalDecl(const struct ZigClangRecordDecl *record_decl); -ZIG_EXTERN_C const struct ZigClangTagDecl *ZigClangEnumDecl_getCanonicalDecl(const struct ZigClangEnumDecl *); -ZIG_EXTERN_C const struct ZigClangFieldDecl *ZigClangFieldDecl_getCanonicalDecl(const ZigClangFieldDecl *); -ZIG_EXTERN_C const struct ZigClangTypedefNameDecl *ZigClangTypedefNameDecl_getCanonicalDecl(const struct ZigClangTypedefNameDecl *); -ZIG_EXTERN_C const struct ZigClangFunctionDecl *ZigClangFunctionDecl_getCanonicalDecl(const ZigClangFunctionDecl *self); -ZIG_EXTERN_C const struct ZigClangVarDecl *ZigClangVarDecl_getCanonicalDecl(const ZigClangVarDecl *self); -ZIG_EXTERN_C const char* ZigClangVarDecl_getSectionAttribute(const struct ZigClangVarDecl *self, size_t *len); -ZIG_EXTERN_C const struct ZigClangFunctionDecl *ZigClangVarDecl_getCleanupAttribute(const struct ZigClangVarDecl *self); -ZIG_EXTERN_C unsigned ZigClangVarDecl_getAlignedAttribute(const struct ZigClangVarDecl *self, const ZigClangASTContext* ctx); -ZIG_EXTERN_C unsigned ZigClangFunctionDecl_getAlignedAttribute(const struct ZigClangFunctionDecl *self, const ZigClangASTContext* ctx); -ZIG_EXTERN_C unsigned ZigClangFieldDecl_getAlignedAttribute(const struct ZigClangFieldDecl *self, const ZigClangASTContext* ctx); -ZIG_EXTERN_C bool ZigClangVarDecl_getPackedAttribute(const struct ZigClangVarDecl *self); -ZIG_EXTERN_C bool ZigClangFieldDecl_getPackedAttribute(const struct ZigClangFieldDecl *self); - -ZIG_EXTERN_C const struct ZigClangStringLiteral *ZigClangFileScopeAsmDecl_getAsmString(const struct ZigClangFileScopeAsmDecl *self); - -ZIG_EXTERN_C struct ZigClangQualType ZigClangParmVarDecl_getOriginalType(const struct ZigClangParmVarDecl *self); - -ZIG_EXTERN_C bool ZigClangRecordDecl_getPackedAttribute(const struct ZigClangRecordDecl *); -ZIG_EXTERN_C const struct ZigClangRecordDecl *ZigClangRecordDecl_getDefinition(const struct ZigClangRecordDecl *); -ZIG_EXTERN_C const struct ZigClangEnumDecl *ZigClangEnumDecl_getDefinition(const struct ZigClangEnumDecl *); - -ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangRecordDecl_getLocation(const struct ZigClangRecordDecl *); -ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangEnumDecl_getLocation(const struct ZigClangEnumDecl *); -ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangTypedefNameDecl_getLocation(const struct ZigClangTypedefNameDecl *); -ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangDecl_getLocation(const struct ZigClangDecl *); - -ZIG_EXTERN_C const struct ZigClangASTRecordLayout *ZigClangRecordDecl_getASTRecordLayout(const struct ZigClangRecordDecl *, const struct ZigClangASTContext *); - -ZIG_EXTERN_C uint64_t ZigClangASTRecordLayout_getFieldOffset(const struct ZigClangASTRecordLayout *, unsigned); -ZIG_EXTERN_C int64_t ZigClangASTRecordLayout_getAlignment(const struct ZigClangASTRecordLayout *); - -ZIG_EXTERN_C struct ZigClangQualType ZigClangFunctionDecl_getType(const struct ZigClangFunctionDecl *); -ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangFunctionDecl_getLocation(const struct ZigClangFunctionDecl *); -ZIG_EXTERN_C bool ZigClangFunctionDecl_hasBody(const struct ZigClangFunctionDecl *); -ZIG_EXTERN_C enum ZigClangStorageClass ZigClangFunctionDecl_getStorageClass(const struct ZigClangFunctionDecl *); -ZIG_EXTERN_C const struct ZigClangParmVarDecl *ZigClangFunctionDecl_getParamDecl(const struct ZigClangFunctionDecl *, unsigned i); -ZIG_EXTERN_C const struct ZigClangStmt *ZigClangFunctionDecl_getBody(const struct ZigClangFunctionDecl *); -ZIG_EXTERN_C bool ZigClangFunctionDecl_doesDeclarationForceExternallyVisibleDefinition(const struct ZigClangFunctionDecl *); -ZIG_EXTERN_C bool ZigClangFunctionDecl_isThisDeclarationADefinition(const struct ZigClangFunctionDecl *); -ZIG_EXTERN_C bool ZigClangFunctionDecl_doesThisDeclarationHaveABody(const struct ZigClangFunctionDecl *); -ZIG_EXTERN_C bool ZigClangFunctionDecl_isInlineSpecified(const struct ZigClangFunctionDecl *); -ZIG_EXTERN_C bool ZigClangFunctionDecl_hasAlwaysInlineAttr(const struct ZigClangFunctionDecl *); -ZIG_EXTERN_C bool ZigClangFunctionDecl_isDefined(const struct ZigClangFunctionDecl *); -ZIG_EXTERN_C const struct ZigClangFunctionDecl* ZigClangFunctionDecl_getDefinition(const struct ZigClangFunctionDecl *); -ZIG_EXTERN_C const char* ZigClangFunctionDecl_getSectionAttribute(const struct ZigClangFunctionDecl *, size_t *); - -ZIG_EXTERN_C bool ZigClangRecordDecl_isUnion(const struct ZigClangRecordDecl *record_decl); -ZIG_EXTERN_C bool ZigClangRecordDecl_isStruct(const struct ZigClangRecordDecl *record_decl); -ZIG_EXTERN_C bool ZigClangRecordDecl_isAnonymousStructOrUnion(const struct ZigClangRecordDecl *record_decl); -ZIG_EXTERN_C ZigClangRecordDecl_field_iterator ZigClangRecordDecl_field_begin(const struct ZigClangRecordDecl *); -ZIG_EXTERN_C ZigClangRecordDecl_field_iterator ZigClangRecordDecl_field_end(const struct ZigClangRecordDecl *); -ZIG_EXTERN_C ZigClangRecordDecl_field_iterator ZigClangRecordDecl_field_iterator_next(struct ZigClangRecordDecl_field_iterator); -ZIG_EXTERN_C const struct ZigClangFieldDecl * ZigClangRecordDecl_field_iterator_deref(struct ZigClangRecordDecl_field_iterator); -ZIG_EXTERN_C bool ZigClangRecordDecl_field_iterator_neq( - struct ZigClangRecordDecl_field_iterator a, - struct ZigClangRecordDecl_field_iterator b); - -ZIG_EXTERN_C struct ZigClangQualType ZigClangEnumDecl_getIntegerType(const struct ZigClangEnumDecl *); -ZIG_EXTERN_C ZigClangEnumDecl_enumerator_iterator ZigClangEnumDecl_enumerator_begin(const struct ZigClangEnumDecl *); -ZIG_EXTERN_C ZigClangEnumDecl_enumerator_iterator ZigClangEnumDecl_enumerator_end(const struct ZigClangEnumDecl *); -ZIG_EXTERN_C ZigClangEnumDecl_enumerator_iterator ZigClangEnumDecl_enumerator_iterator_next(struct ZigClangEnumDecl_enumerator_iterator); -ZIG_EXTERN_C const struct ZigClangEnumConstantDecl * ZigClangEnumDecl_enumerator_iterator_deref(struct ZigClangEnumDecl_enumerator_iterator); -ZIG_EXTERN_C bool ZigClangEnumDecl_enumerator_iterator_neq( - struct ZigClangEnumDecl_enumerator_iterator a, - struct ZigClangEnumDecl_enumerator_iterator b); - -ZIG_EXTERN_C const ZigClangNamedDecl* ZigClangDecl_castToNamedDecl(const ZigClangDecl *self); -ZIG_EXTERN_C const char *ZigClangNamedDecl_getName_bytes_begin(const struct ZigClangNamedDecl *self); -ZIG_EXTERN_C enum ZigClangDeclKind ZigClangDecl_getKind(const struct ZigClangDecl *decl); -ZIG_EXTERN_C const char *ZigClangDecl_getDeclKindName(const struct ZigClangDecl *decl); - -ZIG_EXTERN_C struct ZigClangQualType ZigClangVarDecl_getType(const struct ZigClangVarDecl *); -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangVarDecl_getInit(const struct ZigClangVarDecl *var_decl); -ZIG_EXTERN_C enum ZigClangVarDecl_TLSKind ZigClangVarDecl_getTLSKind(const struct ZigClangVarDecl *var_decl); -ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangVarDecl_getLocation(const struct ZigClangVarDecl *); -ZIG_EXTERN_C bool ZigClangVarDecl_hasExternalStorage(const struct ZigClangVarDecl *); -ZIG_EXTERN_C bool ZigClangVarDecl_isFileVarDecl(const struct ZigClangVarDecl *); -ZIG_EXTERN_C bool ZigClangVarDecl_hasInit(const struct ZigClangVarDecl *); -ZIG_EXTERN_C const struct ZigClangAPValue *ZigClangVarDecl_evaluateValue(const struct ZigClangVarDecl *); -ZIG_EXTERN_C struct ZigClangQualType ZigClangVarDecl_getTypeSourceInfo_getType(const struct ZigClangVarDecl *); -ZIG_EXTERN_C enum ZigClangStorageClass ZigClangVarDecl_getStorageClass(const struct ZigClangVarDecl *self); -ZIG_EXTERN_C bool ZigClangVarDecl_isStaticLocal(const struct ZigClangVarDecl *self); - -ZIG_EXTERN_C bool ZigClangSourceLocation_eq(struct ZigClangSourceLocation a, struct ZigClangSourceLocation b); - -ZIG_EXTERN_C const struct ZigClangTypedefNameDecl *ZigClangTypedefType_getDecl(const struct ZigClangTypedefType *); -ZIG_EXTERN_C struct ZigClangQualType ZigClangTypedefNameDecl_getUnderlyingType(const struct ZigClangTypedefNameDecl *); - -ZIG_EXTERN_C struct ZigClangQualType ZigClangQualType_getCanonicalType(struct ZigClangQualType); -ZIG_EXTERN_C const struct ZigClangType *ZigClangQualType_getTypePtr(struct ZigClangQualType); -ZIG_EXTERN_C enum ZigClangTypeClass ZigClangQualType_getTypeClass(struct ZigClangQualType); -ZIG_EXTERN_C void ZigClangQualType_addConst(struct ZigClangQualType *); -ZIG_EXTERN_C bool ZigClangQualType_eq(struct ZigClangQualType, struct ZigClangQualType); -ZIG_EXTERN_C bool ZigClangQualType_isConstQualified(struct ZigClangQualType); -ZIG_EXTERN_C bool ZigClangQualType_isVolatileQualified(struct ZigClangQualType); -ZIG_EXTERN_C bool ZigClangQualType_isRestrictQualified(struct ZigClangQualType); - -ZIG_EXTERN_C enum ZigClangTypeClass ZigClangType_getTypeClass(const struct ZigClangType *self); -ZIG_EXTERN_C struct ZigClangQualType ZigClangType_getPointeeType(const struct ZigClangType *self); -ZIG_EXTERN_C bool ZigClangType_isBooleanType(const struct ZigClangType *self); -ZIG_EXTERN_C bool ZigClangType_isVoidType(const struct ZigClangType *self); -ZIG_EXTERN_C bool ZigClangType_isArrayType(const struct ZigClangType *self); -ZIG_EXTERN_C bool ZigClangType_isRecordType(const struct ZigClangType *self); -ZIG_EXTERN_C bool ZigClangType_isVectorType(const struct ZigClangType *self); -ZIG_EXTERN_C bool ZigClangType_isIncompleteOrZeroLengthArrayType(const ZigClangQualType *self, const struct ZigClangASTContext *ctx); -ZIG_EXTERN_C bool ZigClangType_isConstantArrayType(const ZigClangType *self); -ZIG_EXTERN_C const char *ZigClangType_getTypeClassName(const struct ZigClangType *self); -ZIG_EXTERN_C const struct ZigClangArrayType *ZigClangType_getAsArrayTypeUnsafe(const struct ZigClangType *self); -ZIG_EXTERN_C const ZigClangRecordType *ZigClangType_getAsRecordType(const ZigClangType *self); -ZIG_EXTERN_C const ZigClangRecordType *ZigClangType_getAsUnionType(const ZigClangType *self); - -ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangStmt_getBeginLoc(const struct ZigClangStmt *self); -ZIG_EXTERN_C enum ZigClangStmtClass ZigClangStmt_getStmtClass(const struct ZigClangStmt *self); -ZIG_EXTERN_C bool ZigClangStmt_classof_Expr(const struct ZigClangStmt *self); - -ZIG_EXTERN_C enum ZigClangStmtClass ZigClangExpr_getStmtClass(const struct ZigClangExpr *self); -ZIG_EXTERN_C struct ZigClangQualType ZigClangExpr_getType(const struct ZigClangExpr *self); -ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangExpr_getBeginLoc(const struct ZigClangExpr *self); -ZIG_EXTERN_C bool ZigClangExpr_EvaluateAsBooleanCondition(const struct ZigClangExpr *self, - bool *result, const struct ZigClangASTContext *ctx, bool in_constant_context); -ZIG_EXTERN_C bool ZigClangExpr_EvaluateAsFloat(const struct ZigClangExpr *self, - ZigClangAPFloat **result, const struct ZigClangASTContext *ctx); -ZIG_EXTERN_C bool ZigClangExpr_EvaluateAsConstantExpr(const struct ZigClangExpr *, - struct ZigClangExprEvalResult *, ZigClangExpr_ConstantExprKind, const struct ZigClangASTContext *); -ZIG_EXTERN_C const struct ZigClangStringLiteral *ZigClangExpr_castToStringLiteral(const struct ZigClangExpr *self); - -ZIG_EXTERN_C const ZigClangExpr *ZigClangInitListExpr_getInit(const ZigClangInitListExpr *, unsigned); -ZIG_EXTERN_C const ZigClangExpr *ZigClangInitListExpr_getArrayFiller(const ZigClangInitListExpr *); -ZIG_EXTERN_C bool ZigClangInitListExpr_hasArrayFiller(const ZigClangInitListExpr *); -ZIG_EXTERN_C bool ZigClangInitListExpr_isStringLiteralInit(const ZigClangInitListExpr *); -ZIG_EXTERN_C unsigned ZigClangInitListExpr_getNumInits(const ZigClangInitListExpr *); -ZIG_EXTERN_C const ZigClangFieldDecl *ZigClangInitListExpr_getInitializedFieldInUnion(const ZigClangInitListExpr *self); - -ZIG_EXTERN_C enum ZigClangAPValueKind ZigClangAPValue_getKind(const struct ZigClangAPValue *self); -ZIG_EXTERN_C const struct ZigClangAPSInt *ZigClangAPValue_getInt(const struct ZigClangAPValue *self); -ZIG_EXTERN_C unsigned ZigClangAPValue_getArrayInitializedElts(const struct ZigClangAPValue *self); -ZIG_EXTERN_C const struct ZigClangAPValue *ZigClangAPValue_getArrayInitializedElt(const struct ZigClangAPValue *self, unsigned i); -ZIG_EXTERN_C const struct ZigClangAPValue *ZigClangAPValue_getArrayFiller(const struct ZigClangAPValue *self); -ZIG_EXTERN_C unsigned ZigClangAPValue_getArraySize(const struct ZigClangAPValue *self); -ZIG_EXTERN_C struct ZigClangAPValueLValueBase ZigClangAPValue_getLValueBase(const struct ZigClangAPValue *self); - -ZIG_EXTERN_C bool ZigClangAPSInt_isSigned(const struct ZigClangAPSInt *self); -ZIG_EXTERN_C bool ZigClangAPSInt_isNegative(const struct ZigClangAPSInt *self); -ZIG_EXTERN_C const struct ZigClangAPSInt *ZigClangAPSInt_negate(const struct ZigClangAPSInt *self); -ZIG_EXTERN_C void ZigClangAPSInt_free(const struct ZigClangAPSInt *self); -ZIG_EXTERN_C const uint64_t *ZigClangAPSInt_getRawData(const struct ZigClangAPSInt *self); -ZIG_EXTERN_C unsigned ZigClangAPSInt_getNumWords(const struct ZigClangAPSInt *self); -ZIG_EXTERN_C bool ZigClangAPSInt_lessThanEqual(const struct ZigClangAPSInt *self, uint64_t rhs); - -ZIG_EXTERN_C void ZigClangAPInt_free(const struct ZigClangAPInt *self); -ZIG_EXTERN_C uint64_t ZigClangAPInt_getLimitedValue(const struct ZigClangAPInt *self, uint64_t limit); - -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangAPValueLValueBase_dyn_cast_Expr(struct ZigClangAPValueLValueBase self); - -ZIG_EXTERN_C enum ZigClangBuiltinTypeKind ZigClangBuiltinType_getKind(const struct ZigClangBuiltinType *self); - -ZIG_EXTERN_C bool ZigClangFunctionType_getNoReturnAttr(const struct ZigClangFunctionType *self); -ZIG_EXTERN_C enum ZigClangCallingConv ZigClangFunctionType_getCallConv(const struct ZigClangFunctionType *self); -ZIG_EXTERN_C struct ZigClangQualType ZigClangFunctionType_getReturnType(const struct ZigClangFunctionType *self); - -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangGenericSelectionExpr_getResultExpr(const struct ZigClangGenericSelectionExpr *self); - -ZIG_EXTERN_C bool ZigClangFunctionProtoType_isVariadic(const struct ZigClangFunctionProtoType *self); -ZIG_EXTERN_C unsigned ZigClangFunctionProtoType_getNumParams(const struct ZigClangFunctionProtoType *self); -ZIG_EXTERN_C struct ZigClangQualType ZigClangFunctionProtoType_getParamType(const struct ZigClangFunctionProtoType *self, unsigned i); -ZIG_EXTERN_C struct ZigClangQualType ZigClangFunctionProtoType_getReturnType(const struct ZigClangFunctionProtoType *self); - - -ZIG_EXTERN_C ZigClangCompoundStmt_const_body_iterator ZigClangCompoundStmt_body_begin(const struct ZigClangCompoundStmt *self); -ZIG_EXTERN_C ZigClangCompoundStmt_const_body_iterator ZigClangCompoundStmt_body_end(const struct ZigClangCompoundStmt *self); - -ZIG_EXTERN_C ZigClangDeclStmt_const_decl_iterator ZigClangDeclStmt_decl_begin(const struct ZigClangDeclStmt *self); -ZIG_EXTERN_C ZigClangDeclStmt_const_decl_iterator ZigClangDeclStmt_decl_end(const struct ZigClangDeclStmt *self); -ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangDeclStmt_getBeginLoc(const struct ZigClangDeclStmt *self); - -ZIG_EXTERN_C unsigned ZigClangAPFloat_convertToHexString(const struct ZigClangAPFloat *self, char *DST, - unsigned HexDigits, bool UpperCase, enum ZigClangAPFloat_roundingMode RM); -ZIG_EXTERN_C double ZigClangFloatingLiteral_getValueAsApproximateDouble(const ZigClangFloatingLiteral *self); -ZIG_EXTERN_C void ZigClangFloatingLiteral_getValueAsApproximateQuadBits(const ZigClangFloatingLiteral *self, uint64_t *low, uint64_t *high); -ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangFloatingLiteral_getBeginLoc(const struct ZigClangFloatingLiteral *); -ZIG_EXTERN_C ZigClangAPFloatBase_Semantics ZigClangFloatingLiteral_getRawSemantics(const ZigClangFloatingLiteral *self); - - -ZIG_EXTERN_C enum ZigClangCharacterLiteralKind ZigClangStringLiteral_getKind( - const struct ZigClangStringLiteral *self); -ZIG_EXTERN_C uint32_t ZigClangStringLiteral_getCodeUnit(const struct ZigClangStringLiteral *self, size_t i); -ZIG_EXTERN_C unsigned ZigClangStringLiteral_getLength(const struct ZigClangStringLiteral *self); -ZIG_EXTERN_C unsigned ZigClangStringLiteral_getCharByteWidth(const struct ZigClangStringLiteral *self); - -ZIG_EXTERN_C const char *ZigClangStringLiteral_getString_bytes_begin_size(const struct ZigClangStringLiteral *self, - size_t *len); - -ZIG_EXTERN_C const struct ZigClangStringLiteral *ZigClangPredefinedExpr_getFunctionName( - const struct ZigClangPredefinedExpr *self); - -ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangImplicitCastExpr_getBeginLoc(const struct ZigClangImplicitCastExpr *); -ZIG_EXTERN_C enum ZigClangCK ZigClangImplicitCastExpr_getCastKind(const struct ZigClangImplicitCastExpr *); -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangImplicitCastExpr_getSubExpr(const struct ZigClangImplicitCastExpr *); - -ZIG_EXTERN_C struct ZigClangQualType ZigClangArrayType_getElementType(const struct ZigClangArrayType *); - -ZIG_EXTERN_C struct ZigClangQualType ZigClangIncompleteArrayType_getElementType(const struct ZigClangIncompleteArrayType *); - -ZIG_EXTERN_C struct ZigClangQualType ZigClangConstantArrayType_getElementType(const struct ZigClangConstantArrayType *); -ZIG_EXTERN_C void ZigClangConstantArrayType_getSize(const struct ZigClangConstantArrayType *, const struct ZigClangAPInt **result); - -ZIG_EXTERN_C const struct ZigClangValueDecl *ZigClangDeclRefExpr_getDecl(const struct ZigClangDeclRefExpr *); -ZIG_EXTERN_C const struct ZigClangNamedDecl *ZigClangDeclRefExpr_getFoundDecl(const struct ZigClangDeclRefExpr *); - -ZIG_EXTERN_C struct ZigClangQualType ZigClangParenType_getInnerType(const struct ZigClangParenType *); - -ZIG_EXTERN_C struct ZigClangQualType ZigClangAttributedType_getEquivalentType(const struct ZigClangAttributedType *); - -ZIG_EXTERN_C struct ZigClangQualType ZigClangMacroQualifiedType_getModifiedType(const struct ZigClangMacroQualifiedType *); - -ZIG_EXTERN_C struct ZigClangQualType ZigClangTypeOfType_getUnmodifiedType(const struct ZigClangTypeOfType *); - -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangTypeOfExprType_getUnderlyingExpr(const struct ZigClangTypeOfExprType *); - -ZIG_EXTERN_C enum ZigClangOffsetOfNode_Kind ZigClangOffsetOfNode_getKind(const struct ZigClangOffsetOfNode *); -ZIG_EXTERN_C unsigned ZigClangOffsetOfNode_getArrayExprIndex(const struct ZigClangOffsetOfNode *); -ZIG_EXTERN_C struct ZigClangFieldDecl * ZigClangOffsetOfNode_getField(const struct ZigClangOffsetOfNode *); - -ZIG_EXTERN_C unsigned ZigClangOffsetOfExpr_getNumComponents(const struct ZigClangOffsetOfExpr *); -ZIG_EXTERN_C unsigned ZigClangOffsetOfExpr_getNumExpressions(const struct ZigClangOffsetOfExpr *); -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangOffsetOfExpr_getIndexExpr(const struct ZigClangOffsetOfExpr *, unsigned idx); -ZIG_EXTERN_C const struct ZigClangOffsetOfNode *ZigClangOffsetOfExpr_getComponent(const struct ZigClangOffsetOfExpr *, unsigned idx); -ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangOffsetOfExpr_getBeginLoc(const struct ZigClangOffsetOfExpr *); - -ZIG_EXTERN_C struct ZigClangQualType ZigClangElaboratedType_getNamedType(const struct ZigClangElaboratedType *); -ZIG_EXTERN_C enum ZigClangElaboratedTypeKeyword ZigClangElaboratedType_getKeyword(const struct ZigClangElaboratedType *); - -ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangCStyleCastExpr_getBeginLoc(const struct ZigClangCStyleCastExpr *); -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangCStyleCastExpr_getSubExpr(const struct ZigClangCStyleCastExpr *); -ZIG_EXTERN_C struct ZigClangQualType ZigClangCStyleCastExpr_getType(const struct ZigClangCStyleCastExpr *); - -ZIG_EXTERN_C bool ZigClangIntegerLiteral_EvaluateAsInt(const struct ZigClangIntegerLiteral *, struct ZigClangExprEvalResult *, const struct ZigClangASTContext *); -ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangIntegerLiteral_getBeginLoc(const struct ZigClangIntegerLiteral *); -ZIG_EXTERN_C bool ZigClangIntegerLiteral_getSignum(const struct ZigClangIntegerLiteral *, int *, const struct ZigClangASTContext *); - -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangReturnStmt_getRetValue(const struct ZigClangReturnStmt *); - -ZIG_EXTERN_C enum ZigClangBO ZigClangBinaryOperator_getOpcode(const struct ZigClangBinaryOperator *); -ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangBinaryOperator_getBeginLoc(const struct ZigClangBinaryOperator *); -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangBinaryOperator_getLHS(const struct ZigClangBinaryOperator *); -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangBinaryOperator_getRHS(const struct ZigClangBinaryOperator *); -ZIG_EXTERN_C struct ZigClangQualType ZigClangBinaryOperator_getType(const struct ZigClangBinaryOperator *); - -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangConvertVectorExpr_getSrcExpr(const struct ZigClangConvertVectorExpr *); -ZIG_EXTERN_C struct ZigClangQualType ZigClangConvertVectorExpr_getTypeSourceInfo_getType(const struct ZigClangConvertVectorExpr *); - -ZIG_EXTERN_C struct ZigClangQualType ZigClangDecayedType_getDecayedType(const struct ZigClangDecayedType *); - -ZIG_EXTERN_C const struct ZigClangCompoundStmt *ZigClangStmtExpr_getSubStmt(const struct ZigClangStmtExpr *); - -ZIG_EXTERN_C enum ZigClangCK ZigClangCastExpr_getCastKind(const struct ZigClangCastExpr *); -ZIG_EXTERN_C const struct ZigClangFieldDecl *ZigClangCastExpr_getTargetFieldForToUnionCast(const struct ZigClangCastExpr *, struct ZigClangQualType, struct ZigClangQualType); - -ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangCharacterLiteral_getBeginLoc(const struct ZigClangCharacterLiteral *); -ZIG_EXTERN_C enum ZigClangCharacterLiteralKind ZigClangCharacterLiteral_getKind(const struct ZigClangCharacterLiteral *); -ZIG_EXTERN_C unsigned ZigClangCharacterLiteral_getValue(const struct ZigClangCharacterLiteral *); - -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangChooseExpr_getChosenSubExpr(const struct ZigClangChooseExpr *); - -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangAbstractConditionalOperator_getCond(const struct ZigClangAbstractConditionalOperator *); -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangAbstractConditionalOperator_getTrueExpr(const struct ZigClangAbstractConditionalOperator *); -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangAbstractConditionalOperator_getFalseExpr(const struct ZigClangAbstractConditionalOperator *); - -ZIG_EXTERN_C struct ZigClangQualType ZigClangCompoundAssignOperator_getType(const struct ZigClangCompoundAssignOperator *); -ZIG_EXTERN_C struct ZigClangQualType ZigClangCompoundAssignOperator_getComputationLHSType(const struct ZigClangCompoundAssignOperator *); -ZIG_EXTERN_C struct ZigClangQualType ZigClangCompoundAssignOperator_getComputationResultType(const struct ZigClangCompoundAssignOperator *); -ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangCompoundAssignOperator_getBeginLoc(const struct ZigClangCompoundAssignOperator *); -ZIG_EXTERN_C enum ZigClangBO ZigClangCompoundAssignOperator_getOpcode(const struct ZigClangCompoundAssignOperator *); -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangCompoundAssignOperator_getLHS(const struct ZigClangCompoundAssignOperator *); -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangCompoundAssignOperator_getRHS(const struct ZigClangCompoundAssignOperator *); - -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangCompoundLiteralExpr_getInitializer(const struct ZigClangCompoundLiteralExpr *); - -ZIG_EXTERN_C enum ZigClangUO ZigClangUnaryOperator_getOpcode(const struct ZigClangUnaryOperator *); -ZIG_EXTERN_C struct ZigClangQualType ZigClangUnaryOperator_getType(const struct ZigClangUnaryOperator *); -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangUnaryOperator_getSubExpr(const struct ZigClangUnaryOperator *); -ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangUnaryOperator_getBeginLoc(const struct ZigClangUnaryOperator *); - -ZIG_EXTERN_C struct ZigClangQualType ZigClangValueDecl_getType(const struct ZigClangValueDecl *); - -ZIG_EXTERN_C struct ZigClangQualType ZigClangVectorType_getElementType(const struct ZigClangVectorType *); -ZIG_EXTERN_C unsigned ZigClangVectorType_getNumElements(const struct ZigClangVectorType *); - -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangWhileStmt_getCond(const struct ZigClangWhileStmt *); -ZIG_EXTERN_C const struct ZigClangStmt *ZigClangWhileStmt_getBody(const struct ZigClangWhileStmt *); - -ZIG_EXTERN_C const struct ZigClangStmt *ZigClangIfStmt_getThen(const struct ZigClangIfStmt *); -ZIG_EXTERN_C const struct ZigClangStmt *ZigClangIfStmt_getElse(const struct ZigClangIfStmt *); -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangIfStmt_getCond(const struct ZigClangIfStmt *); - -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangCallExpr_getCallee(const struct ZigClangCallExpr *); -ZIG_EXTERN_C unsigned ZigClangCallExpr_getNumArgs(const struct ZigClangCallExpr *); -ZIG_EXTERN_C const struct ZigClangExpr * const * ZigClangCallExpr_getArgs(const struct ZigClangCallExpr *); - -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangMemberExpr_getBase(const struct ZigClangMemberExpr *); -ZIG_EXTERN_C bool ZigClangMemberExpr_isArrow(const struct ZigClangMemberExpr *); -ZIG_EXTERN_C const struct ZigClangValueDecl * ZigClangMemberExpr_getMemberDecl(const struct ZigClangMemberExpr *); - -ZIG_EXTERN_C const ZigClangExpr *ZigClangOpaqueValueExpr_getSourceExpr(const struct ZigClangOpaqueValueExpr *); - -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangArraySubscriptExpr_getBase(const struct ZigClangArraySubscriptExpr *); -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangArraySubscriptExpr_getIdx(const struct ZigClangArraySubscriptExpr *); - -ZIG_EXTERN_C struct ZigClangQualType ZigClangUnaryExprOrTypeTraitExpr_getTypeOfArgument(const struct ZigClangUnaryExprOrTypeTraitExpr *); -ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangUnaryExprOrTypeTraitExpr_getBeginLoc(const struct ZigClangUnaryExprOrTypeTraitExpr *); -ZIG_EXTERN_C enum ZigClangUnaryExprOrTypeTrait_Kind ZigClangUnaryExprOrTypeTraitExpr_getKind(const struct ZigClangUnaryExprOrTypeTraitExpr *); - -ZIG_EXTERN_C unsigned ZigClangShuffleVectorExpr_getNumSubExprs(const struct ZigClangShuffleVectorExpr *); -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangShuffleVectorExpr_getExpr(const struct ZigClangShuffleVectorExpr *, unsigned); - -ZIG_EXTERN_C const struct ZigClangStmt *ZigClangDoStmt_getBody(const struct ZigClangDoStmt *); -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangDoStmt_getCond(const struct ZigClangDoStmt *); - -ZIG_EXTERN_C const struct ZigClangStmt *ZigClangForStmt_getInit(const struct ZigClangForStmt *); -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangForStmt_getCond(const struct ZigClangForStmt *); -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangForStmt_getInc(const struct ZigClangForStmt *); -ZIG_EXTERN_C const struct ZigClangStmt *ZigClangForStmt_getBody(const struct ZigClangForStmt *); - -ZIG_EXTERN_C const struct ZigClangDeclStmt *ZigClangSwitchStmt_getConditionVariableDeclStmt(const struct ZigClangSwitchStmt *); -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangSwitchStmt_getCond(const struct ZigClangSwitchStmt *); -ZIG_EXTERN_C const struct ZigClangStmt *ZigClangSwitchStmt_getBody(const struct ZigClangSwitchStmt *); -ZIG_EXTERN_C bool ZigClangSwitchStmt_isAllEnumCasesCovered(const struct ZigClangSwitchStmt *); - -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangCaseStmt_getLHS(const struct ZigClangCaseStmt *); -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangCaseStmt_getRHS(const struct ZigClangCaseStmt *); -ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangCaseStmt_getBeginLoc(const struct ZigClangCaseStmt *); -ZIG_EXTERN_C const struct ZigClangStmt *ZigClangCaseStmt_getSubStmt(const struct ZigClangCaseStmt *); - -ZIG_EXTERN_C const struct ZigClangStmt *ZigClangDefaultStmt_getSubStmt(const struct ZigClangDefaultStmt *); - -ZIG_EXTERN_C const struct ZigClangExpr *ZigClangParenExpr_getSubExpr(const struct ZigClangParenExpr *); - -ZIG_EXTERN_C const char *ZigClangMacroDefinitionRecord_getName_getNameStart(const struct ZigClangMacroDefinitionRecord *); -ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangMacroDefinitionRecord_getSourceRange_getBegin(const struct ZigClangMacroDefinitionRecord *); -ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangMacroDefinitionRecord_getSourceRange_getEnd(const struct ZigClangMacroDefinitionRecord *); - -ZIG_EXTERN_C bool ZigClangFieldDecl_isBitField(const struct ZigClangFieldDecl *); -ZIG_EXTERN_C bool ZigClangFieldDecl_isAnonymousStructOrUnion(const ZigClangFieldDecl *); -ZIG_EXTERN_C struct ZigClangQualType ZigClangFieldDecl_getType(const struct ZigClangFieldDecl *); -ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangFieldDecl_getLocation(const struct ZigClangFieldDecl *); -ZIG_EXTERN_C const struct ZigClangRecordDecl *ZigClangFieldDecl_getParent(const struct ZigClangFieldDecl *); -ZIG_EXTERN_C unsigned ZigClangFieldDecl_getFieldIndex(const struct ZigClangFieldDecl *); - -ZIG_EXTERN_C const struct ZigClangAPSInt *ZigClangEnumConstantDecl_getInitVal(const struct ZigClangEnumConstantDecl *); -ZIG_EXTERN_C bool ZigClangIsLLVMUsingSeparateLibcxx(); -#endif diff --git a/test/behavior/vector.zig b/test/behavior/vector.zig index d90f48d86de7..904ec8b0d14c 100644 --- a/test/behavior/vector.zig +++ b/test/behavior/vector.zig @@ -918,28 +918,6 @@ test "vector @reduce comptime" { try expect(is_all_true == false); } -test "mask parameter of @shuffle is comptime scope" { - if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; - if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; - - const __v4hi = @Vector(4, i16); - var v4_a = __v4hi{ 1, 2, 3, 4 }; - var v4_b = __v4hi{ 5, 6, 7, 8 }; - _ = .{ &v4_a, &v4_b }; - const shuffled: __v4hi = @shuffle(i16, v4_a, v4_b, @Vector(4, i32){ - std.zig.c_translation.shuffleVectorIndex(0, @typeInfo(@TypeOf(v4_a)).vector.len), - std.zig.c_translation.shuffleVectorIndex(2, @typeInfo(@TypeOf(v4_a)).vector.len), - std.zig.c_translation.shuffleVectorIndex(4, @typeInfo(@TypeOf(v4_a)).vector.len), - std.zig.c_translation.shuffleVectorIndex(6, @typeInfo(@TypeOf(v4_a)).vector.len), - }); - try expect(shuffled[0] == 1); - try expect(shuffled[1] == 3); - try expect(shuffled[2] == 5); - try expect(shuffled[3] == 7); -} - test "saturating add" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO diff --git a/test/c_import.zig b/test/c_import.zig deleted file mode 100644 index 3252648d18e7..000000000000 --- a/test/c_import.zig +++ /dev/null @@ -1,4 +0,0 @@ -test { - _ = @import("c_import/c_char_signedness.zig"); - _ = @import("c_import/macros.zig"); -} diff --git a/test/c_import/c_char_signedness.zig b/test/c_import/c_char_signedness.zig deleted file mode 100644 index eda53e49d217..000000000000 --- a/test/c_import/c_char_signedness.zig +++ /dev/null @@ -1,13 +0,0 @@ -const std = @import("std"); -const builtin = @import("builtin"); -const expectEqual = std.testing.expectEqual; -const c = @cImport({ - @cInclude("limits.h"); -}); - -test "c_char signedness" { - if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; - - try expectEqual(@as(c_char, c.CHAR_MIN), std.math.minInt(c_char)); - try expectEqual(@as(c_char, c.CHAR_MAX), std.math.maxInt(c_char)); -} diff --git a/test/c_import/macros.h b/test/c_import/macros.h deleted file mode 100644 index c6e2e381e2d8..000000000000 --- a/test/c_import/macros.h +++ /dev/null @@ -1,70 +0,0 @@ -// initializer list expression -typedef struct Color { - unsigned char r; - unsigned char g; - unsigned char b; - unsigned char a; -} Color; -#define CLITERAL(type) (type) -#define LIGHTGRAY CLITERAL(Color){ 200, 200, 200, 255 } // Light Gray - -#define MY_SIZEOF(x) ((int)sizeof(x)) -#define MY_SIZEOF2(x) ((int)sizeof x) - -struct Foo { - int a; -}; - -union U { - long l; - double d; -}; - -#define SIZE_OF_FOO sizeof(struct Foo) - -#define MAP_FAILED ((void *) -1) - -#define IGNORE_ME_1(x) ((void)(x)) -#define IGNORE_ME_2(x) ((const void)(x)) -#define IGNORE_ME_3(x) ((volatile void)(x)) -#define IGNORE_ME_4(x) ((const volatile void)(x)) -#define IGNORE_ME_5(x) ((volatile const void)(x)) - -#define IGNORE_ME_6(x) (void)(x) -#define IGNORE_ME_7(x) (const void)(x) -#define IGNORE_ME_8(x) (volatile void)(x) -#define IGNORE_ME_9(x) (const volatile void)(x) -#define IGNORE_ME_10(x) (volatile const void)(x) - -#define UNION_CAST(X) (union U)(X) -#define CAST_OR_CALL_WITH_PARENS(type_or_fn, val) ((type_or_fn)(val)) - -#define NESTED_COMMA_OPERATOR (1, (2, 3)) -#define NESTED_COMMA_OPERATOR_LHS (1, 2), 3 - -#include -#if !defined(__UINTPTR_MAX__) -typedef _Bool uintptr_t; -#endif - -#define CAST_TO_BOOL(X) (_Bool)(X) -#define CAST_TO_UINTPTR(X) (uintptr_t)(X) - -#define LARGE_INT 18446744073709550592 - -#define EMBEDDED_TAB "hello " - -#define DIVIDE_CONSTANT(version) (version / 1000) -#define DIVIDE_ARGS(A, B) (A / B) - -#define REMAINDER_CONSTANT(version) (version % 10000) -#define REMAINDER_ARGS(A, B) (A % B) - -#define LONG(x) x##L -#define X LONG(10) - -#define BLANK_MACRO -#define BLANK_CHILD_MACRO BLANK_MACRO BLANK_MACRO BLANK_MACRO -#define MACRO_VALUE 0 -typedef long def_type; -#define BLANK_MACRO_CAST (BLANK_CHILD_MACRO def_type BLANK_CHILD_MACRO)MACRO_VALUE diff --git a/test/c_import/macros.zig b/test/c_import/macros.zig deleted file mode 100644 index 2efdeb4672bb..000000000000 --- a/test/c_import/macros.zig +++ /dev/null @@ -1,239 +0,0 @@ -const builtin = @import("builtin"); -const std = @import("std"); -const expect = std.testing.expect; -const expectEqual = std.testing.expectEqual; -const expectEqualStrings = std.testing.expectEqualStrings; - -const h = @cImport(@cInclude("macros.h")); -const latin1 = @cImport(@cInclude("macros_not_utf8.h")); - -test "casting to void with a macro" { - if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; - - h.IGNORE_ME_1(42); - h.IGNORE_ME_2(42); - h.IGNORE_ME_3(42); - h.IGNORE_ME_4(42); - h.IGNORE_ME_5(42); - h.IGNORE_ME_6(42); - h.IGNORE_ME_7(42); - h.IGNORE_ME_8(42); - h.IGNORE_ME_9(42); - h.IGNORE_ME_10(42); -} - -test "initializer list expression" { - if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; - - try expectEqual(h.Color{ - .r = 200, - .g = 200, - .b = 200, - .a = 255, - }, h.LIGHTGRAY); -} - -test "sizeof in macros" { - if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; - - try expect(@as(c_int, @sizeOf(u32)) == h.MY_SIZEOF(u32)); - try expect(@as(c_int, @sizeOf(u32)) == h.MY_SIZEOF2(u32)); -} - -test "reference to a struct type" { - if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; - - try expect(@sizeOf(h.struct_Foo) == h.SIZE_OF_FOO); -} - -test "cast negative integer to pointer" { - if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; - - try expectEqual(@as(?*anyopaque, @ptrFromInt(@as(usize, @bitCast(@as(isize, -1))))), h.MAP_FAILED); -} - -test "casting to union with a macro" { - if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; - - const l: c_long = 42; - const d: f64 = 2.0; - - var casted = h.UNION_CAST(l); - try expect(l == casted.l); - - casted = h.UNION_CAST(d); - try expect(d == casted.d); -} - -test "casting or calling a value with a paren-surrounded macro" { - if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; - - const l: c_long = 42; - const casted = h.CAST_OR_CALL_WITH_PARENS(c_int, l); - try expect(casted == @as(c_int, @intCast(l))); - - const Helper = struct { - fn foo(n: c_int) !void { - try expect(n == 42); - } - }; - - try h.CAST_OR_CALL_WITH_PARENS(Helper.foo, 42); -} - -test "nested comma operator" { - if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; - - try expectEqual(@as(c_int, 3), h.NESTED_COMMA_OPERATOR); - try expectEqual(@as(c_int, 3), h.NESTED_COMMA_OPERATOR_LHS); -} - -test "cast functions" { - if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; - - const S = struct { - fn foo() void {} - }; - try expectEqual(true, h.CAST_TO_BOOL(S.foo)); - try expect(h.CAST_TO_UINTPTR(S.foo) != 0); -} - -test "large integer macro" { - if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; - - try expectEqual(@as(c_ulonglong, 18446744073709550592), h.LARGE_INT); -} - -test "string literal macro with embedded tab character" { - if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; - - try expectEqualStrings("hello\t", h.EMBEDDED_TAB); -} - -test "string and char literals that are not UTF-8 encoded. Issue #12784" { - if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; - - try expectEqual(@as(u8, '\xA9'), latin1.UNPRINTABLE_CHAR); - try expectEqualStrings("\xA9\xA9\xA9", latin1.UNPRINTABLE_STRING); -} - -test "Macro that uses division operator. Issue #13162" { - if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; - if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest; - - try expectEqual(@as(c_int, 42), h.DIVIDE_CONSTANT(@as(c_int, 42_000))); - try expectEqual(@as(c_uint, 42), h.DIVIDE_CONSTANT(@as(c_uint, 42_000))); - - try expectEqual( - @as(f64, 42.0), - h.DIVIDE_ARGS( - @as(f64, 42.0), - true, - ), - ); - - try expectEqual( - @as(c_int, 21), - h.DIVIDE_ARGS( - @as(i8, 42), - @as(i8, 2), - ), - ); - - try expectEqual( - @as(c_uint, 21), - h.DIVIDE_ARGS( - @as(u32, 42), - @as(u32, 2), - ), - ); - - try expectEqual( - @as(c_int, 21), - h.DIVIDE_ARGS( - @as(c_ushort, 42), - @as(c_ushort, 2), - ), - ); -} - -test "Macro that uses remainder operator. Issue #13346" { - if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; - - try expectEqual(@as(c_int, 2_010), h.REMAINDER_CONSTANT(@as(c_int, 42_010))); - try expectEqual(@as(c_uint, 2_030), h.REMAINDER_CONSTANT(@as(c_uint, 42_030))); - - try expectEqual( - @as(c_int, 7), - h.REMAINDER_ARGS( - @as(i8, 17), - @as(i8, 10), - ), - ); - - try expectEqual( - @as(c_int, 5), - h.REMAINDER_ARGS( - @as(c_ushort, 25), - @as(c_ushort, 20), - ), - ); - - try expectEqual( - @as(c_int, 1), - h.REMAINDER_ARGS( - @as(c_int, 5), - @as(c_int, -2), - ), - ); -} - -test "@typeInfo on @cImport result" { - if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; - - try expect(@typeInfo(h).@"struct".decls.len > 1); -} - -test "Macro that uses Long type concatenation casting" { - if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; - - try expect((@TypeOf(h.X)) == c_long); - try expectEqual(h.X, @as(c_long, 10)); -} - -test "Blank macros" { - if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; - - try expectEqual(h.BLANK_MACRO, ""); - try expectEqual(h.BLANK_CHILD_MACRO, ""); - try expect(@TypeOf(h.BLANK_MACRO_CAST) == h.def_type); - try expectEqual(h.BLANK_MACRO_CAST, @as(c_long, 0)); -} diff --git a/test/c_import/macros_not_utf8.h b/test/c_import/macros_not_utf8.h deleted file mode 100644 index 0a7fa4cc6bb5..000000000000 --- a/test/c_import/macros_not_utf8.h +++ /dev/null @@ -1,5 +0,0 @@ -// Note: This file is encoded with ISO/IEC 8859-1 (latin1), not UTF-8. -// Do not change the encoding - -#define UNPRINTABLE_STRING "©©©" -#define UNPRINTABLE_CHAR '©' diff --git a/test/cases/README.md b/test/cases/README.md index 97c82dae96fd..bdb6e34971d0 100644 --- a/test/cases/README.md +++ b/test/cases/README.md @@ -22,33 +22,6 @@ This will do `zig run` on the code and expect exit code 0. // run ``` -## Translate-c - -If you want to test translating C code to Zig use `translate-c`: - -```c -// translate-c -// c_frontend=aro,clang -// target=x86_64-linux -// -// pub const foo = 1; -// pub const immediately_after_foo = 2; -// -// pub const somewhere_else_in_the_file = 3: -``` - -## Run Translated C - -If you want to test translating C code to Zig and then executing it use `run-translated-c`: - -```c -// run-translated-c -// c_frontend=aro,clang -// target=x86_64-linux -// -// Hello world! -``` - ## Incremental Compilation Make multiple files that have ".", and then an integer, before the ".zig" diff --git a/test/cases/run_translated_c/compound_assignments_with_implicit_casts.c b/test/cases/run_translated_c/compound_assignments_with_implicit_casts.c deleted file mode 100644 index 79029d490330..000000000000 --- a/test/cases/run_translated_c/compound_assignments_with_implicit_casts.c +++ /dev/null @@ -1,20 +0,0 @@ -int main() { - int i = 2; - float f = 3.2f; - - i += 1.7; - if (i != 3) return 1; - i += f; - if (i != 6) return 2; - - - f += 2UL; - if (f <= 5.1999 || f >= 5.2001) return 3; - f += i; - if (f <= 11.1999 || f >= 11.2001) return 4; - - return 0; -} - -// run-translated-c -// c_frontend=clang diff --git a/test/cases/run_translated_c/compound_assignments_with_pointer_arithmetic.c b/test/cases/run_translated_c/compound_assignments_with_pointer_arithmetic.c deleted file mode 100644 index 2dea66970813..000000000000 --- a/test/cases/run_translated_c/compound_assignments_with_pointer_arithmetic.c +++ /dev/null @@ -1,21 +0,0 @@ -int main() { - const char *s = "forgreatjustice"; - unsigned int add = 1; - - s += add; - if (*s != 'o') return 1; - - s += 1UL; - if (*s != 'r') return 2; - - const char *s2 = (s += add); - if (*s2 != 'g') return 3; - - s2 -= add; - if (*s2 != 'r') return 4; - - return 0; -} - -// run-translated-c -// c_frontend=clang diff --git a/test/cases/run_translated_c/dereference address of.c b/test/cases/run_translated_c/dereference address of.c deleted file mode 100644 index 15b9777c7ae7..000000000000 --- a/test/cases/run_translated_c/dereference address of.c +++ /dev/null @@ -1,11 +0,0 @@ -#include -int main(void) { - int i = 0; - *&i = 42; - if (i != 42) abort(); - return 0; -} - -// run-translated-c -// c_frontend=clang -// link_libc=true diff --git a/test/cases/run_translated_c/explicit_cast_bool_from_float.c b/test/cases/run_translated_c/explicit_cast_bool_from_float.c deleted file mode 100644 index 79bb88cc4b96..000000000000 --- a/test/cases/run_translated_c/explicit_cast_bool_from_float.c +++ /dev/null @@ -1,10 +0,0 @@ -#include - -int main() { - float f = 2.0f; - bool b = (bool) f; - return 0; -} - -// run-translated-c -// c_frontend=clang diff --git a/test/cases/run_translated_c/extern_typedef_variables_in_functions.c b/test/cases/run_translated_c/extern_typedef_variables_in_functions.c deleted file mode 100644 index 5b8cf2b19543..000000000000 --- a/test/cases/run_translated_c/extern_typedef_variables_in_functions.c +++ /dev/null @@ -1,22 +0,0 @@ -const int ev = 40; - -static int func(void) -{ - typedef int test_type_t; - extern const test_type_t ev; - // Ensure mangled name is also being used for conditions and loops, see #20828 - if (ev == 0); - while (ev == 0); - do; while (ev == 0); - return ev + 2; -} - -int main() -{ - if (func() != 42) - return 1; - return 0; -} - -// run-translated-c -// c_frontend=clang diff --git a/test/cases/run_translated_c/float_from_bool_expr_cast.c b/test/cases/run_translated_c/float_from_bool_expr_cast.c deleted file mode 100644 index 294e5e1d83a8..000000000000 --- a/test/cases/run_translated_c/float_from_bool_expr_cast.c +++ /dev/null @@ -1,8 +0,0 @@ -int main() { - float f = (float)(10.0f > 1.0f); - return 0; -} - -// run-translated-c -// c_frontend=clang -// diff --git a/test/cases/run_translated_c/sub_scope_extern_local_var_ref.c b/test/cases/run_translated_c/sub_scope_extern_local_var_ref.c deleted file mode 100644 index f3461f8559f0..000000000000 --- a/test/cases/run_translated_c/sub_scope_extern_local_var_ref.c +++ /dev/null @@ -1,23 +0,0 @@ -#include -int a = 42; -int foo(int bar) { - extern int a; - if (bar) { - return a; - } - return 0; -} -int main() { - int result1 = foo(0); - if (result1 != 0) abort(); - int result2 = foo(1); - if (result2 != 42) abort(); - a = 100; - int result3 = foo(1); - if (result3 != 100) abort(); - return 0; -} - -// run-translated-c -// c_frontend=clang -// link_libc=true diff --git a/test/cases/translate_c/_Static_assert.c b/test/cases/translate_c/_Static_assert.c deleted file mode 100644 index 8ecc639e9dbb..000000000000 --- a/test/cases/translate_c/_Static_assert.c +++ /dev/null @@ -1,7 +0,0 @@ -_Static_assert(1 == 1, ""); - -// translate-c -// target=x86_64-linux -// c_frontend=aro -// -// tmp.c:1:1: warning: ignoring _Static_assert declaration diff --git a/test/cases/translate_c/align() attribute.c b/test/cases/translate_c/align() attribute.c deleted file mode 100644 index 600e8251fbdd..000000000000 --- a/test/cases/translate_c/align() attribute.c +++ /dev/null @@ -1,17 +0,0 @@ -__attribute__ ((aligned(128))) -extern char my_array[16]; -__attribute__ ((aligned(128))) -void my_fn(void) { } -void other_fn(void) { - char ARR[16] __attribute__ ((aligned (16))); -} - -// translate-c -// c_frontend=clang -// -// pub extern var my_array: [16]u8 align(128); -// pub export fn my_fn() align(128) void {} -// pub export fn other_fn() void { -// var ARR: [16]u8 align(16) = undefined; -// _ = &ARR; -// } diff --git a/test/cases/translate_c/assert_with_strlit.c b/test/cases/translate_c/assert_with_strlit.c deleted file mode 100644 index 445428bcf143..000000000000 --- a/test/cases/translate_c/assert_with_strlit.c +++ /dev/null @@ -1,8 +0,0 @@ - -void assert(int x) {} -#define FOO assert(0 && "error message") - -// translate-c -// c_frontend=clang -// -// pub const FOO = assert((@as(c_int, 0) != 0) and (@intFromPtr("error message") != 0)); diff --git a/test/cases/translate_c/atomic types.c b/test/cases/translate_c/atomic types.c deleted file mode 100644 index ad1af598c424..000000000000 --- a/test/cases/translate_c/atomic types.c +++ /dev/null @@ -1,8 +0,0 @@ -typedef _Atomic(int) AtomicInt; - -// translate-c -// target=x86_64-linux -// c_frontend=aro -// -// tmp.c:1:22: warning: unsupported type: '_Atomic(int)' -// pub const AtomicInt = @compileError("unable to resolve typedef child type"); diff --git a/test/cases/translate_c/c_keywords_as_macro_function_parameters.c b/test/cases/translate_c/c_keywords_as_macro_function_parameters.c deleted file mode 100644 index 8485909a94d6..000000000000 --- a/test/cases/translate_c/c_keywords_as_macro_function_parameters.c +++ /dev/null @@ -1,82 +0,0 @@ -#define GUARDED_INT_ADDITION(int) ((int) + 1) - -#define UNGUARDED_INT_SUBTRACTION(int) (int - 2) - -#define GUARDED_INT_MULTIPLY(int) ((int) * 3) - -#define UNGUARDED_INT_DIVIDE(int) (int / 4) - -#define WRAPPED_RETURN(return) ((return) % 2) - -#define UNWRAPPED_RETURN(return) (return ^ 0x7F) - -#define WITH_TWO_PARAMETERS(signed, x) ((signed) + (x) + 9) - -#define GUARDED_ALIGNOF(_Alignof) ((_Alignof) & 0x55) - -#define UNGUARDED_ALIGNOF(_Alignof) (_Alignof | 0x80) - -#define GUARDED_SIZEOF(sizeof) ((sizeof) == 64) - -#define UNGUARDED_SIZEOF(sizeof) (sizeof < 64) - -#define SIZEOF(x) ((int)sizeof(x)) - -#define SIZEOF2(x) ((int)sizeof x) - -// translate-c -// c_frontend=clang -// -// pub inline fn GUARDED_INT_ADDITION(int: anytype) @TypeOf(int + @as(c_int, 1)) { -// _ = ∫ -// return int + @as(c_int, 1); -// } -// pub inline fn UNGUARDED_INT_SUBTRACTION(int: anytype) @TypeOf(int - @as(c_int, 2)) { -// _ = ∫ -// return int - @as(c_int, 2); -// } -// pub inline fn GUARDED_INT_MULTIPLY(int: anytype) @TypeOf(int * @as(c_int, 3)) { -// _ = ∫ -// return int * @as(c_int, 3); -// } -// pub inline fn UNGUARDED_INT_DIVIDE(int: anytype) @TypeOf(@import("std").zig.c_translation.MacroArithmetic.div(int, @as(c_int, 4))) { -// _ = ∫ -// return @import("std").zig.c_translation.MacroArithmetic.div(int, @as(c_int, 4)); -// } -// pub inline fn WRAPPED_RETURN(@"return": anytype) @TypeOf(@import("std").zig.c_translation.MacroArithmetic.rem(@"return", @as(c_int, 2))) { -// _ = &@"return"; -// return @import("std").zig.c_translation.MacroArithmetic.rem(@"return", @as(c_int, 2)); -// } -// pub inline fn UNWRAPPED_RETURN(@"return": anytype) @TypeOf(@"return" ^ @as(c_int, 0x7F)) { -// _ = &@"return"; -// return @"return" ^ @as(c_int, 0x7F); -// } -// pub inline fn WITH_TWO_PARAMETERS(signed: anytype, x: anytype) @TypeOf((signed + x) + @as(c_int, 9)) { -// _ = &signed; -// _ = &x; -// return (signed + x) + @as(c_int, 9); -// } -// pub inline fn GUARDED_ALIGNOF(_Alignof: anytype) @TypeOf(_Alignof & @as(c_int, 0x55)) { -// _ = &_Alignof; -// return _Alignof & @as(c_int, 0x55); -// } -// pub inline fn UNGUARDED_ALIGNOF(_Alignof: anytype) @TypeOf(_Alignof | @as(c_int, 0x80)) { -// _ = &_Alignof; -// return _Alignof | @as(c_int, 0x80); -// } -// pub inline fn GUARDED_SIZEOF(sizeof: anytype) @TypeOf(sizeof == @as(c_int, 64)) { -// _ = &sizeof; -// return sizeof == @as(c_int, 64); -// } -// pub inline fn UNGUARDED_SIZEOF(sizeof: anytype) @TypeOf(sizeof < @as(c_int, 64)) { -// _ = &sizeof; -// return sizeof < @as(c_int, 64); -// } -// pub inline fn SIZEOF(x: anytype) c_int { -// _ = &x; -// return @import("std").zig.c_translation.cast(c_int, @import("std").zig.c_translation.sizeof(x)); -// } -// pub inline fn SIZEOF2(x: anytype) c_int { -// _ = &x; -// return @import("std").zig.c_translation.cast(c_int, @import("std").zig.c_translation.sizeof(x)); -// } diff --git a/test/cases/translate_c/circular_struct_definitions.c b/test/cases/translate_c/circular_struct_definitions.c deleted file mode 100644 index 696066b059d8..000000000000 --- a/test/cases/translate_c/circular_struct_definitions.c +++ /dev/null @@ -1,20 +0,0 @@ -struct Bar; - -struct Foo { - struct Bar *next; -}; - -struct Bar { - struct Foo *next; -}; - -// translate-c -// c_frontend=clang -// -// pub const struct_Bar = extern struct { -// next: [*c]struct_Foo = @import("std").mem.zeroes([*c]struct_Foo), -// }; -// -// pub const struct_Foo = extern struct { -// next: [*c]struct_Bar = @import("std").mem.zeroes([*c]struct_Bar), -// }; diff --git a/test/cases/translate_c/continue_from_while.c b/test/cases/translate_c/continue_from_while.c deleted file mode 100644 index 2e2237f752f4..000000000000 --- a/test/cases/translate_c/continue_from_while.c +++ /dev/null @@ -1,14 +0,0 @@ -void foo() { - for (;;) { - continue; - } -} - -// translate-c -// c_frontend=clang -// -// pub export fn foo() void { -// while (true) { -// continue; -// } -// } diff --git a/test/cases/translate_c/double_define_struct.c b/test/cases/translate_c/double_define_struct.c deleted file mode 100644 index e608154d7d17..000000000000 --- a/test/cases/translate_c/double_define_struct.c +++ /dev/null @@ -1,25 +0,0 @@ -typedef struct Bar Bar; -typedef struct Foo Foo; - -struct Foo { - Foo *a; -}; - -struct Bar { - Foo *a; -}; - -// translate-c -// c_frontend=clang -// -// pub const struct_Foo = extern struct { -// a: [*c]Foo = @import("std").mem.zeroes([*c]Foo), -// }; -// -// pub const Foo = struct_Foo; -// -// pub const struct_Bar = extern struct { -// a: [*c]Foo = @import("std").mem.zeroes([*c]Foo), -// }; -// -// pub const Bar = struct_Bar; diff --git a/test/cases/translate_c/empty declaration.c b/test/cases/translate_c/empty declaration.c deleted file mode 100644 index 5f19328acf39..000000000000 --- a/test/cases/translate_c/empty declaration.c +++ /dev/null @@ -1,6 +0,0 @@ -; - -// translate-c -// c_frontend=clang,aro -// -// \ No newline at end of file diff --git a/test/cases/translate_c/empty union initializer list.c b/test/cases/translate_c/empty union initializer list.c deleted file mode 100644 index 33238d2ed8d2..000000000000 --- a/test/cases/translate_c/empty union initializer list.c +++ /dev/null @@ -1,20 +0,0 @@ -union U { - int x; - long y; -}; - -void foo(void) { - union U u = {}; -} -// translate-c -// target=x86_64-linux -// c_frontend=clang -// -// pub const union_U = extern union { -// x: c_int, -// y: c_long, -// }; -// pub export fn foo() void { -// var u: union_U = @import("std").mem.zeroes(union_U); -// _ = &u; -// } diff --git a/test/cases/translate_c/enums msvc.c b/test/cases/translate_c/enums msvc.c deleted file mode 100644 index ab7242512f40..000000000000 --- a/test/cases/translate_c/enums msvc.c +++ /dev/null @@ -1,16 +0,0 @@ -enum Foo { - FooA = 2, - FooB = 5, - Foo1, -}; - -// translate-c -// target=x86_64-windows-msvc -// c_frontend=clang -// -// pub const FooA: c_int = 2; -// pub const FooB: c_int = 5; -// pub const Foo1: c_int = 6; -// pub const enum_Foo = c_int; -// -// pub const Foo = enum_Foo; diff --git a/test/cases/translate_c/enums.c b/test/cases/translate_c/enums.c deleted file mode 100644 index 528ae60190bb..000000000000 --- a/test/cases/translate_c/enums.c +++ /dev/null @@ -1,16 +0,0 @@ -enum Foo { - FooA = 2, - FooB = 5, - Foo1, -}; - -// translate-c -// target=x86_64-linux -// c_frontend=clang,aro -// -// pub const FooA: c_int = 2; -// pub const FooB: c_int = 5; -// pub const Foo1: c_int = 6; -// pub const enum_Foo = c_uint; -// -// pub const Foo = enum_Foo; diff --git a/test/cases/translate_c/field_access_is_grouped_if_necessary.c b/test/cases/translate_c/field_access_is_grouped_if_necessary.c deleted file mode 100644 index dc46ab5dd618..000000000000 --- a/test/cases/translate_c/field_access_is_grouped_if_necessary.c +++ /dev/null @@ -1,18 +0,0 @@ -unsigned long foo(unsigned long x) { - return ((union{unsigned long _x}){x})._x; -} - -// translate-c -// c_frontend=clang -// -// pub export fn foo(arg_x: c_ulong) c_ulong { -// var x = arg_x; -// _ = &x; -// const union_unnamed_1 = extern union { -// _x: c_ulong, -// }; -// _ = &union_unnamed_1; -// return (union_unnamed_1{ -// ._x = x, -// })._x; -// } diff --git a/test/cases/translate_c/function prototype with parenthesis.c b/test/cases/translate_c/function prototype with parenthesis.c deleted file mode 100644 index 7b93e3fa931c..000000000000 --- a/test/cases/translate_c/function prototype with parenthesis.c +++ /dev/null @@ -1,10 +0,0 @@ -void (f0) (void *L); -void ((f1)) (void *L); -void (((f2))) (void *L); - -// translate-c -// c_frontend=clang,aro -// -// pub extern fn f0(L: ?*anyopaque) void; -// pub extern fn f1(L: ?*anyopaque) void; -// pub extern fn f2(L: ?*anyopaque) void; diff --git a/test/cases/translate_c/global_struct_whose_default_name_conflicts_with_global_is_mangled.c b/test/cases/translate_c/global_struct_whose_default_name_conflicts_with_global_is_mangled.c deleted file mode 100644 index fe06fd88fd7b..000000000000 --- a/test/cases/translate_c/global_struct_whose_default_name_conflicts_with_global_is_mangled.c +++ /dev/null @@ -1,15 +0,0 @@ -struct foo { - int x; -}; -const char *struct_foo = "hello world"; - -// translate-c -// c_frontend=clang -// -// pub const struct_foo_1 = extern struct { -// x: c_int = @import("std").mem.zeroes(c_int), -// }; -// -// pub const foo = struct_foo_1; -// -// pub export var struct_foo: [*c]const u8 = "hello world"; diff --git a/test/cases/translate_c/large_packed_struct.c b/test/cases/translate_c/large_packed_struct.c deleted file mode 100644 index b18ccb3cde69..000000000000 --- a/test/cases/translate_c/large_packed_struct.c +++ /dev/null @@ -1,20 +0,0 @@ -struct __attribute__((packed)) bar { - short a; - float b; - double c; - short x; - float y; - double z; -}; - -// translate-c -// c_frontend=aro,clang -// -// pub const struct_bar = extern struct { -// a: c_short align(1) = @import("std").mem.zeroes(c_short), -// b: f32 align(1) = @import("std").mem.zeroes(f32), -// c: f64 align(1) = @import("std").mem.zeroes(f64), -// x: c_short align(1) = @import("std").mem.zeroes(c_short), -// y: f32 align(1) = @import("std").mem.zeroes(f32), -// z: f64 align(1) = @import("std").mem.zeroes(f64), -// }; diff --git a/test/cases/translate_c/macro_calling_convention.c b/test/cases/translate_c/macro_calling_convention.c deleted file mode 100644 index 01331e572c09..000000000000 --- a/test/cases/translate_c/macro_calling_convention.c +++ /dev/null @@ -1,9 +0,0 @@ -#define SYSV_ABI __attribute__((sysv_abi)) -void SYSV_ABI foo(void); - - -// translate-c -// c_frontend=clang -// target=x86_64-windows -// -// pub extern fn foo() callconv(.{ .x86_64_sysv = .{} }) void; diff --git a/test/cases/translate_c/macro_function_string_concat.c b/test/cases/translate_c/macro_function_string_concat.c deleted file mode 100644 index cf9c2365933b..000000000000 --- a/test/cases/translate_c/macro_function_string_concat.c +++ /dev/null @@ -1,11 +0,0 @@ -#define bar() "" -#define FOO bar() "," bar() - -// translate-c -// target=x86_64-linux -// c_frontend=clang -// -// pub inline fn bar() @TypeOf("") { -// return ""; -// } -// pub const FOO = bar() ++ "," ++ bar(); diff --git a/test/cases/translate_c/macro_referencing_var.c b/test/cases/translate_c/macro_referencing_var.c deleted file mode 100644 index 5675d06edaf6..000000000000 --- a/test/cases/translate_c/macro_referencing_var.c +++ /dev/null @@ -1,21 +0,0 @@ -extern float foo; -#define FOO_TWICE foo * 2.0f -#define FOO_NEGATIVE -foo - -#define BAR 10.0f -#define BAR_TWICE BAR * 2.0f - -// translate-c -// c_frontend=clang -// -// pub extern var foo: f32; -// -// pub inline fn FOO_TWICE() @TypeOf(foo * @as(f32, 2.0)) { -// return foo * @as(f32, 2.0); -// } -// -// pub inline fn FOO_NEGATIVE() @TypeOf(-foo) { -// return -foo; -// } -// pub const BAR = @as(f32, 10.0); -// pub const BAR_TWICE = BAR * @as(f32, 2.0); diff --git a/test/cases/translate_c/noreturn attribute.c b/test/cases/translate_c/noreturn attribute.c deleted file mode 100644 index 9564fd00923a..000000000000 --- a/test/cases/translate_c/noreturn attribute.c +++ /dev/null @@ -1,6 +0,0 @@ -void foo(void) __attribute__((noreturn)); - -// translate-c -// c_frontend=aro,clang -// -// pub extern fn foo() noreturn; diff --git a/test/cases/translate_c/packed_union_nested_unpacked.c b/test/cases/translate_c/packed_union_nested_unpacked.c deleted file mode 100644 index a2e2c2f5ceb2..000000000000 --- a/test/cases/translate_c/packed_union_nested_unpacked.c +++ /dev/null @@ -1,25 +0,0 @@ -// NOTE: The nested struct is *not* packed/aligned, -// even though the parent struct is -// this is consistent with GCC docs -union Foo{ - short x; - double y; - struct { - int b; - } z; -} __attribute__((packed)); - -// translate-c -// c_frontend=aro,clang -// -// const struct_unnamed_1 = extern struct { -// b: c_int = @import("std").mem.zeroes(c_int), -// }; -// -// pub const union_Foo = extern union { -// x: c_short align(1), -// y: f64 align(1), -// z: struct_unnamed_1 align(1), -// }; -// -// pub const Foo = union_Foo; diff --git a/test/cases/translate_c/packed_union_simple.c b/test/cases/translate_c/packed_union_simple.c deleted file mode 100644 index f69e3cb86517..000000000000 --- a/test/cases/translate_c/packed_union_simple.c +++ /dev/null @@ -1,14 +0,0 @@ -union Foo { - short x; - double y; -} __attribute__((packed)); - -// translate-c -// c_frontend=aro,clang -// -// pub const union_Foo = extern union { -// x: c_short align(1), -// y: f64 align(1), -// }; -// -// pub const Foo = union_Foo; diff --git a/test/cases/translate_c/pointer_to_struct_demoted_opaque_due_to_bit_fields.c b/test/cases/translate_c/pointer_to_struct_demoted_opaque_due_to_bit_fields.c deleted file mode 100644 index 320368749783..000000000000 --- a/test/cases/translate_c/pointer_to_struct_demoted_opaque_due_to_bit_fields.c +++ /dev/null @@ -1,15 +0,0 @@ -struct Foo { - unsigned int: 1; -}; -struct Bar { - struct Foo *foo; -}; - -// translate-c -// c_frontend=clang -// -// pub const struct_Foo = opaque {}; -// -// pub const struct_Bar = extern struct { -// foo: ?*struct_Foo = @import("std").mem.zeroes(?*struct_Foo), -// }; diff --git a/test/cases/translate_c/qualified_struct_and_enum.c b/test/cases/translate_c/qualified_struct_and_enum.c deleted file mode 100644 index 19c4214c14de..000000000000 --- a/test/cases/translate_c/qualified_struct_and_enum.c +++ /dev/null @@ -1,25 +0,0 @@ -struct Foo { - int x; - int y; -}; -enum Bar { - BarA, - BarB, -}; -void func(struct Foo *a, enum Bar **b); - -// translate-c -// c_frontend=clang -// target=x86_64-linux,x86_64-macos -// -// pub const struct_Foo = extern struct { -// x: c_int = @import("std").mem.zeroes(c_int), -// y: c_int = @import("std").mem.zeroes(c_int), -// }; -// pub const BarA: c_int = 0; -// pub const BarB: c_int = 1; -// pub const enum_Bar = c_uint; -// pub extern fn func(a: [*c]struct_Foo, b: [*c][*c]enum_Bar) void; -// -// pub const Foo = struct_Foo; -// pub const Bar = enum_Bar; diff --git a/test/cases/translate_c/qualified_struct_and_enum_msvc.c b/test/cases/translate_c/qualified_struct_and_enum_msvc.c deleted file mode 100644 index b2bff8def7e7..000000000000 --- a/test/cases/translate_c/qualified_struct_and_enum_msvc.c +++ /dev/null @@ -1,25 +0,0 @@ -struct Foo { - int x; - int y; -}; -enum Bar { - BarA, - BarB, -}; -void func(struct Foo *a, enum Bar **b); - -// translate-c -// c_frontend=clang -// target=x86_64-windows-msvc -// -// pub const struct_Foo = extern struct { -// x: c_int = @import("std").mem.zeroes(c_int), -// y: c_int = @import("std").mem.zeroes(c_int), -// }; -// pub const BarA: c_int = 0; -// pub const BarB: c_int = 1; -// pub const enum_Bar = c_int; -// pub extern fn func(a: [*c]struct_Foo, b: [*c][*c]enum_Bar) void; -// -// pub const Foo = struct_Foo; -// pub const Bar = enum_Bar; diff --git a/test/cases/translate_c/scoped_record.c b/test/cases/translate_c/scoped_record.c deleted file mode 100644 index fe24000b3427..000000000000 --- a/test/cases/translate_c/scoped_record.c +++ /dev/null @@ -1,49 +0,0 @@ -void foo() { - struct Foo { - int A; - int B; - int C; - }; - struct Foo a = {0}; - { - struct Foo { - int A; - int B; - int C; - }; - struct Foo a = {0}; - } -} - -// translate-c -// c_frontend=clang -// -// pub export fn foo() void { -// const struct_Foo = extern struct { -// A: c_int = @import("std").mem.zeroes(c_int), -// B: c_int = @import("std").mem.zeroes(c_int), -// C: c_int = @import("std").mem.zeroes(c_int), -// }; -// _ = &struct_Foo; -// var a: struct_Foo = struct_Foo{ -// .A = @as(c_int, 0), -// .B = 0, -// .C = 0, -// }; -// _ = &a; -// { -// const struct_Foo_1 = extern struct { -// A: c_int = @import("std").mem.zeroes(c_int), -// B: c_int = @import("std").mem.zeroes(c_int), -// C: c_int = @import("std").mem.zeroes(c_int), -// }; -// _ = &struct_Foo_1; -// var a_2: struct_Foo_1 = struct_Foo_1{ -// .A = @as(c_int, 0), -// .B = 0, -// .C = 0, -// }; -// _ = &a_2; -// } -// } - diff --git a/test/cases/translate_c/simple function prototypes.c b/test/cases/translate_c/simple function prototypes.c deleted file mode 100644 index ee1e2bad3220..000000000000 --- a/test/cases/translate_c/simple function prototypes.c +++ /dev/null @@ -1,8 +0,0 @@ -void __attribute__((noreturn)) foo(void); -int bar(void); - -// translate-c -// c_frontend=clang,aro -// -// pub extern fn foo() noreturn; -// pub extern fn bar() c_int; diff --git a/test/cases/translate_c/simple_struct.c b/test/cases/translate_c/simple_struct.c deleted file mode 100644 index d3e2745ee392..000000000000 --- a/test/cases/translate_c/simple_struct.c +++ /dev/null @@ -1,12 +0,0 @@ -struct Foo { - int x; -}; - -// translate-c -// c_frontend=aro,clang -// -// const struct_Foo = extern struct { -// x: c_int = @import("std").mem.zeroes(c_int), -// }; -// -// pub const Foo = struct_Foo; diff --git a/test/cases/translate_c/simple_union.c b/test/cases/translate_c/simple_union.c deleted file mode 100644 index 29940a2ab2a3..000000000000 --- a/test/cases/translate_c/simple_union.c +++ /dev/null @@ -1,12 +0,0 @@ -union Foo { - int x; -}; - -// translate-c -// c_frontend=aro,clang -// -// pub const union_Foo = extern union { -// x: c_int, -// }; -// -// pub const Foo = union_Foo; diff --git a/test/cases/translate_c/static empty struct.c b/test/cases/translate_c/static empty struct.c deleted file mode 100644 index 222fa487071d..000000000000 --- a/test/cases/translate_c/static empty struct.c +++ /dev/null @@ -1,17 +0,0 @@ -struct empty_struct {}; - -static inline void foo() { - static struct empty_struct bar = {}; -} - -// translate-c -// target=x86_64-linux -// c_frontend=clang -// -// pub const struct_empty_struct = extern struct {}; -// pub fn foo() callconv(.c) void { -// const bar = struct { -// var static: struct_empty_struct = @import("std").mem.zeroes(struct_empty_struct); -// }; -// _ = &bar; -// } diff --git a/test/cases/translate_c/strlit_as_bool.c b/test/cases/translate_c/strlit_as_bool.c deleted file mode 100644 index 4ba0cfe2a4b2..000000000000 --- a/test/cases/translate_c/strlit_as_bool.c +++ /dev/null @@ -1,8 +0,0 @@ -void foo() { if(0 && "error message") {} } - -// translate-c -// c_frontend=clang -// -// pub export fn foo() void { -// if (false and (@intFromPtr("error message") != 0)) {} -// } diff --git a/test/cases/translate_c/struct prototype used in func.c b/test/cases/translate_c/struct prototype used in func.c deleted file mode 100644 index b688e6e742d0..000000000000 --- a/test/cases/translate_c/struct prototype used in func.c +++ /dev/null @@ -1,10 +0,0 @@ -struct Foo; -struct Foo *some_func(struct Foo *foo, int x); - -// translate-c -// c_frontend=clang,aro -// -// pub const struct_Foo = opaque {}; -// pub extern fn some_func(foo: ?*struct_Foo, x: c_int) ?*struct_Foo; -// -// pub const Foo = struct_Foo; diff --git a/test/cases/translate_c/struct_in_struct_init_to_zero.c b/test/cases/translate_c/struct_in_struct_init_to_zero.c deleted file mode 100644 index 688a2448d1f5..000000000000 --- a/test/cases/translate_c/struct_in_struct_init_to_zero.c +++ /dev/null @@ -1,24 +0,0 @@ -struct Foo { - int a; - struct Bar { - int a; - } b; -} a = {}; -#define PTR void * - -// translate-c -// c_frontend=clang -// -// pub const struct_Bar_1 = extern struct { -// a: c_int = @import("std").mem.zeroes(c_int), -// }; -// pub const struct_Foo = extern struct { -// a: c_int = @import("std").mem.zeroes(c_int), -// b: struct_Bar_1 = @import("std").mem.zeroes(struct_Bar_1), -// }; -// pub export var a: struct_Foo = struct_Foo{ -// .a = 0, -// .b = @import("std").mem.zeroes(struct_Bar_1), -// }; -// -// pub const PTR = ?*anyopaque; diff --git a/test/cases/translate_c/struct_with_aligned_fields.c b/test/cases/translate_c/struct_with_aligned_fields.c deleted file mode 100644 index 37a25ff49ac2..000000000000 --- a/test/cases/translate_c/struct_with_aligned_fields.c +++ /dev/null @@ -1,10 +0,0 @@ -struct foo { - __attribute__((aligned(4))) short bar; -}; - -// translate-c -// c_frontend=aro,clang -// -// pub const struct_foo = extern struct { -// bar: c_short align(4) = @import("std").mem.zeroes(c_short), -// }; diff --git a/test/cases/translate_c/struct_with_invalid_field_alignment.c b/test/cases/translate_c/struct_with_invalid_field_alignment.c deleted file mode 100644 index 6b3fc55b6ddb..000000000000 --- a/test/cases/translate_c/struct_with_invalid_field_alignment.c +++ /dev/null @@ -1,35 +0,0 @@ -// The aligned attribute cannot decrease the alignment of a field. The packed attribute is required -// for decreasing the alignment. gcc and clang will compile these structs without error -// (and possibly without warning), but checking the alignment will reveal a different value than -// what was requested. This is consistent with the gcc documentation on type attributes. -// -// This test is currently broken for the clang frontend. See issue #19307. - -struct foo { - __attribute__((aligned(1)))int x; -}; - -struct bar { - __attribute__((aligned(2)))float y; -}; - -struct baz { - __attribute__((aligned(4)))double z; -}; - -// translate-c -// c_frontend=aro -// target=x86_64-linux -// -// pub const struct_foo = extern struct { -// x: c_int = @import("std").mem.zeroes(c_int), -// }; -// -// pub const struct_bar = extern struct { -// y: f32 = @import("std").mem.zeroes(f32), -// }; -// -// pub const struct_baz = extern struct { -// z: f64 = @import("std").mem.zeroes(f64), -// }; -// diff --git a/test/cases/translate_c/type_referenced_struct.c b/test/cases/translate_c/type_referenced_struct.c deleted file mode 100644 index 597d37329ec9..000000000000 --- a/test/cases/translate_c/type_referenced_struct.c +++ /dev/null @@ -1,19 +0,0 @@ -// When clang uses the -windows-none, triple it behaves as MSVC and -// interprets the inner `struct Bar` as an anonymous structure -struct Foo { - struct Bar{ - int b; - }; - struct Bar c; -}; - -// translate-c -// c_frontend=aro,clang -// target=x86_64-linux-gnu -// -// pub const struct_Bar_1 = extern struct { -// b: c_int = @import("std").mem.zeroes(c_int), -// }; -// pub const struct_Foo = extern struct { -// c: struct_Bar_1 = @import("std").mem.zeroes(struct_Bar_1), -// }; diff --git a/test/cases/translate_c/union_initializer.c b/test/cases/translate_c/union_initializer.c deleted file mode 100644 index 010e4932524c..000000000000 --- a/test/cases/translate_c/union_initializer.c +++ /dev/null @@ -1,22 +0,0 @@ -union { int x; char c[4]; } - ua = {1}, - ub = {.c={'a','b','b','a'}}; - -// translate-c -// c_frontend=clang -// -// const union_unnamed_1 = extern union { -// x: c_int, -// c: [4]u8, -// }; -// pub export var ua: union_unnamed_1 = union_unnamed_1{ -// .x = @as(c_int, 1), -// }; -// pub export var ub: union_unnamed_1 = union_unnamed_1{ -// .c = [4]u8{ -// 'a', -// 'b', -// 'b', -// 'a', -// }, -// }; diff --git a/test/cases/translate_c/union_struct_forward_decl.c b/test/cases/translate_c/union_struct_forward_decl.c deleted file mode 100644 index d2c721804a91..000000000000 --- a/test/cases/translate_c/union_struct_forward_decl.c +++ /dev/null @@ -1,37 +0,0 @@ -struct A; -union B; -enum C; - -struct A { - short x; - double y; -}; - -union B { - short x; - double y; -}; - -struct Foo { - struct A a; - union B b; -}; - - -// translate-c -// c_frontend=aro,clang -// -// pub const struct_A = extern struct { -// x: c_short = @import("std").mem.zeroes(c_short), -// y: f64 = @import("std").mem.zeroes(f64), -// }; -// -// pub const union_B = extern union { -// x: c_short, -// y: f64, -// }; -// -// pub const struct_Foo = extern struct { -// a: struct_A = @import("std").mem.zeroes(struct_A), -// b: union_B = @import("std").mem.zeroes(union_B), -// }; diff --git a/test/cases/translate_c/unnamed_fields_have_predictable_names.c b/test/cases/translate_c/unnamed_fields_have_predictable_names.c deleted file mode 100644 index 1517bf1327c8..000000000000 --- a/test/cases/translate_c/unnamed_fields_have_predictable_names.c +++ /dev/null @@ -1,22 +0,0 @@ -struct a { - struct { int x; }; -}; -struct b { - struct { int y; }; -}; - -// translate-c -// c_frontend=aro,clang -// -// const struct_unnamed_1 = extern struct { -// x: c_int = @import("std").mem.zeroes(c_int), -// }; -// pub const struct_a = extern struct { -// unnamed_0: struct_unnamed_1 = @import("std").mem.zeroes(struct_unnamed_1), -// }; -// const struct_unnamed_2 = extern struct { -// y: c_int = @import("std").mem.zeroes(c_int), -// }; -// pub const struct_b = extern struct { -// unnamed_0: struct_unnamed_2 = @import("std").mem.zeroes(struct_unnamed_2), -// }; diff --git a/test/cases/translate_c/void_pointer_subtraction.c b/test/cases/translate_c/void_pointer_subtraction.c deleted file mode 100644 index 69ce5a9d4d2d..000000000000 --- a/test/cases/translate_c/void_pointer_subtraction.c +++ /dev/null @@ -1,16 +0,0 @@ -#include -ptrdiff_t sub_ptr(void *a, void *b) { - return a - b; -} - -// translate-c -// c_frontend=clang -// target=x86_64-linux -// -// pub export fn sub_ptr(arg_a: ?*anyopaque, arg_b: ?*anyopaque) ptrdiff_t { -// var a = arg_a; -// _ = &a; -// var b = arg_b; -// _ = &b; -// return @as(c_long, @bitCast(@intFromPtr(a) -% @intFromPtr(b))); -// } diff --git a/test/cases/translate_c/zero_width_field_alignment.c b/test/cases/translate_c/zero_width_field_alignment.c deleted file mode 100644 index c50bb668fd62..000000000000 --- a/test/cases/translate_c/zero_width_field_alignment.c +++ /dev/null @@ -1,18 +0,0 @@ -struct __attribute__((packed)) foo { - int x; - struct {}; - float y; - union {}; -}; - -// translate-c -// c_frontend=aro -// -// const struct_unnamed_1 = extern struct {}; -// const union_unnamed_2 = extern union {}; -// pub const struct_foo = extern struct { -// x: c_int align(1) = @import("std").mem.zeroes(c_int), -// unnamed_0: struct_unnamed_1 align(1) = @import("std").mem.zeroes(struct_unnamed_1), -// y: f32 align(1) = @import("std").mem.zeroes(f32), -// unnamed_1: union_unnamed_2 align(1) = @import("std").mem.zeroes(union_unnamed_2), -// }; diff --git a/test/cases/translate_c/zig_keywords_in_c_code.c b/test/cases/translate_c/zig_keywords_in_c_code.c deleted file mode 100644 index 5ec80ec26ebd..000000000000 --- a/test/cases/translate_c/zig_keywords_in_c_code.c +++ /dev/null @@ -1,12 +0,0 @@ -struct comptime { - int defer; -}; - -// translate-c -// c_frontend=aro,clang -// -// pub const struct_comptime = extern struct { -// @"defer": c_int = @import("std").mem.zeroes(c_int), -// }; -// -// pub const @"comptime" = struct_comptime; diff --git a/test/run_translated_c.zig b/test/run_translated_c.zig deleted file mode 100644 index 73aa7d01f434..000000000000 --- a/test/run_translated_c.zig +++ /dev/null @@ -1,1929 +0,0 @@ -const std = @import("std"); -const tests = @import("tests.zig"); -const nl = if (@import("builtin").os.tag == .windows) "\r\n" else "\n"; - -// ********************************************************* -// * * -// * DO NOT ADD NEW CASES HERE * -// * instead add a file to test/cases/run_translated_c * -// * * -// ********************************************************* - -pub fn addCases(cases: *tests.RunTranslatedCContext) void { - cases.add("division of floating literals", - \\#define _NO_CRT_STDIO_INLINE 1 - \\#include - \\#define PI 3.14159265358979323846f - \\#define DEG2RAD (PI/180.0f) - \\int main(void) { - \\ printf("DEG2RAD is: %f\n", DEG2RAD); - \\ return 0; - \\} - , "DEG2RAD is: 0.017453" ++ nl); - - cases.add("use global scope for record/enum/typedef type translation if needed", - \\void bar(void); - \\void baz(void); - \\struct foo { int x; }; - \\void bar() { - \\ struct foo tmp; - \\} - \\ - \\void baz() { - \\ struct foo tmp; - \\} - \\ - \\int main(void) { - \\ bar(); - \\ baz(); - \\ return 0; - \\} - , ""); - - cases.add("failed macros are only declared once", - \\#define FOO = - \\#define FOO = - \\#define PtrToPtr64(p) ((void *POINTER_64) p) - \\#define STRUC_ALIGNED_STACK_COPY(t,s) ((CONST t *)(s)) - \\#define bar = 0x - \\#define baz = 0b - \\int main(void) {} - , ""); - - cases.add("parenthesized string literal", - \\void foo(const char *s) {} - \\int main(void) { - \\ foo(("bar")); - \\} - , ""); - - cases.add("variable shadowing type type", - \\#include - \\int main() { - \\ int type = 1; - \\ if (type != 1) abort(); - \\} - , ""); - - cases.add("assignment as expression", - \\#include - \\int main() { - \\ int a, b, c, d = 5; - \\ int e = a = b = c = d; - \\ if (e != 5) abort(); - \\} - , ""); - - cases.add("static variable in block scope", - \\#include - \\int foo() { - \\ static int bar; - \\ bar += 1; - \\ return bar; - \\} - \\int main() { - \\ foo(); - \\ foo(); - \\ if (foo() != 3) abort(); - \\} - , ""); - - cases.add("array initializer", - \\#include - \\int main(int argc, char **argv) { - \\ int a0[4] = {1}; - \\ int a1[4] = {1,2,3,4}; - \\ int s0 = 0, s1 = 0; - \\ for (int i = 0; i < 4; i++) { - \\ s0 += a0[i]; - \\ s1 += a1[i]; - \\ } - \\ if (s0 != 1) abort(); - \\ if (s1 != 10) abort(); - \\} - , ""); - - cases.add("forward declarations", - \\#include - \\int foo(int); - \\int foo(int x) { return x + 1; } - \\int main(int argc, char **argv) { - \\ if (foo(2) != 3) abort(); - \\ return 0; - \\} - , ""); - - cases.add("typedef and function pointer", - \\#include - \\typedef struct _Foo Foo; - \\typedef int Ret; - \\typedef int Param; - \\struct _Foo { Ret (*func)(Param p); }; - \\static Ret add1(Param p) { - \\ return p + 1; - \\} - \\int main(int argc, char **argv) { - \\ Foo strct = { .func = add1 }; - \\ if (strct.func(16) != 17) abort(); - \\ return 0; - \\} - , ""); - - cases.add("ternary operator", - \\#include - \\static int cnt = 0; - \\int foo() { cnt++; return 42; } - \\int main(int argc, char **argv) { - \\ short q = 3; - \\ signed char z0 = q?:1; - \\ if (z0 != 3) abort(); - \\ int z1 = 3?:1; - \\ if (z1 != 3) abort(); - \\ int z2 = foo()?:-1; - \\ if (z2 != 42) abort(); - \\ if (cnt != 1) abort(); - \\ return 0; - \\} - , ""); - - cases.add("switch case", - \\#include - \\int lottery(unsigned int x) { - \\ switch (x) { - \\ case 3: return 0; - \\ case -1: return 3; - \\ case 8 ... 10: return x; - \\ default: return -1; - \\ } - \\} - \\int main(int argc, char **argv) { - \\ if (lottery(2) != -1) abort(); - \\ if (lottery(3) != 0) abort(); - \\ if (lottery(-1) != 3) abort(); - \\ if (lottery(9) != 9) abort(); - \\ return 0; - \\} - , ""); - - cases.add("boolean values and expressions", - \\#include - \\static const _Bool false_val = 0; - \\static const _Bool true_val = 1; - \\void foo(int x, int y) { - \\ _Bool r = x < y; - \\ if (!r) abort(); - \\ _Bool self = foo; - \\ if (self == false_val) abort(); - \\ if (((r) ? 'a' : 'b') != 'a') abort(); - \\} - \\int main(int argc, char **argv) { - \\ foo(2, 5); - \\ if (false_val == true_val) abort(); - \\ return 0; - \\} - , ""); - - cases.add("hello world", - \\#define _NO_CRT_STDIO_INLINE 1 - \\#include - \\int main(int argc, char **argv) { - \\ printf("hello, world!\n"); - \\ return 0; - \\} - , "hello, world!" ++ nl); - - cases.add("anon struct init", - \\#include - \\struct {int a; int b;} x = {1, 2}; - \\int main(int argc, char **argv) { - \\ x.a += 2; - \\ x.b += 1; - \\ if (x.a != 3) abort(); - \\ if (x.b != 3) abort(); - \\ return 0; - \\} - , ""); - - cases.add("casting away const and volatile", - \\void foo(int *a) {} - \\void bar(const int *a) { - \\ foo((int *)a); - \\} - \\void baz(volatile int *a) { - \\ foo((int *)a); - \\} - \\int main(int argc, char **argv) { - \\ int a = 0; - \\ bar((const int *)&a); - \\ baz((volatile int *)&a); - \\ return 0; - \\} - , ""); - - cases.add("anonymous struct & unions", - \\#include - \\#include - \\static struct { struct { uint16_t x, y; }; } x = { 1 }; - \\static struct { union { uint32_t x; uint8_t y; }; } y = { 0x55AA55AA }; - \\int main(int argc, char **argv) { - \\ if (x.x != 1) abort(); - \\ if (x.y != 0) abort(); - \\ if (y.x != 0x55AA55AA) abort(); - \\ if (y.y != 0xAA) abort(); - \\ return 0; - \\} - , ""); - - cases.add("array to pointer decay", - \\#include - \\int main(int argc, char **argv) { - \\ char data[3] = {'a','b','c'}; - \\ if (2[data] != data[2]) abort(); - \\ if ("abc"[1] != data[1]) abort(); - \\ char *as_ptr = data; - \\ if (2[as_ptr] != as_ptr[2]) abort(); - \\ if ("abc"[1] != as_ptr[1]) abort(); - \\ return 0; - \\} - , ""); - - cases.add("struct initializer - packed", - \\#define _NO_CRT_STDIO_INLINE 1 - \\#include - \\#include - \\struct s {uint8_t x,y; - \\ uint32_t z;} __attribute__((packed)) s0 = {1, 2}; - \\int main() { - \\ /* sizeof nor offsetof currently supported */ - \\ if (((intptr_t)&s0.z - (intptr_t)&s0.x) != 2) abort(); - \\ return 0; - \\} - , ""); - - cases.add("cast signed array index to unsigned", - \\#include - \\int main(int argc, char **argv) { - \\ int a[10], i = 0; - \\ a[i] = 0; - \\ if (a[i] != 0) abort(); - \\ return 0; - \\} - , ""); - - cases.add("cast long long array index to unsigned", - \\#include - \\int main(int argc, char **argv) { - \\ long long a[10], i = 0; - \\ a[i] = 0; - \\ if (a[i] != 0) abort(); - \\ return 0; - \\} - , ""); - - cases.add("case boolean expression converted to int", - \\#include - \\int main(int argc, char **argv) { - \\ int value = 1 + 2 * 3 + 4 * 5 + 6 << 7 | 8 == 9; - \\ if (value != 4224) abort(); - \\ return 0; - \\} - , ""); - - cases.add("case boolean expression on left converted to int", - \\#include - \\int main(int argc, char **argv) { - \\ int value = 8 == 9 | 1 + 2 * 3 + 4 * 5 + 6 << 7; - \\ if (value != 4224) abort(); - \\ return 0; - \\} - , ""); - - cases.add("case boolean and operator+ converts bool to int", - \\#include - \\int main(int argc, char **argv) { - \\ int value = (8 == 9) + 3; - \\ int value2 = 3 + (8 == 9); - \\ if (value != value2) abort(); - \\ return 0; - \\} - , ""); - - cases.add("case boolean and operator<", - \\#include - \\int main(int argc, char **argv) { - \\ int value = (8 == 9) < 3; - \\ if (value == 0) abort(); - \\ return 0; - \\} - , ""); - - cases.add("case boolean and operator*", - \\#include - \\int main(int argc, char **argv) { - \\ int value = (8 == 9) * 3; - \\ int value2 = 3 * (9 == 9); - \\ if (value != 0) abort(); - \\ if (value2 == 0) abort(); - \\ return 0; - \\} - , ""); - - cases.add("scoped typedef", - \\int main(int argc, char **argv) { - \\ typedef int Foo; - \\ typedef Foo Bar; - \\ typedef void (*func)(int); - \\ typedef int uint32_t; - \\ uint32_t a; - \\ Foo i; - \\ Bar j; - \\ return 0; - \\} - , ""); - - cases.add("scoped for loops with shadowing", - \\#include - \\int main() { - \\ int count = 0; - \\ for (int x = 0; x < 2; x++) - \\ for (int x = 0; x < 2; x++) - \\ count++; - \\ - \\ if (count != 4) abort(); - \\ return 0; - \\} - , ""); - - cases.add("array value type casts properly", - \\#include - \\unsigned int choose[53][10]; - \\static int hash_binary(int k) - \\{ - \\ choose[0][k] = 3; - \\ int sum = 0; - \\ sum += choose[0][k]; - \\ return sum; - \\} - \\ - \\int main() { - \\ int s = hash_binary(4); - \\ if (s != 3) abort(); - \\ return 0; - \\} - , ""); - - cases.add("array value type casts properly use +=", - \\#include - \\static int hash_binary(int k) - \\{ - \\ unsigned int choose[1][1] = {{3}}; - \\ int sum = -1; - \\ int prev = 0; - \\ prev = sum += choose[0][0]; - \\ if (sum != 2) abort(); - \\ return sum + prev; - \\} - \\ - \\int main() { - \\ int x = hash_binary(4); - \\ if (x != 4) abort(); - \\ return 0; - \\} - , ""); - - cases.add("ensure array casts outside +=", - \\#include - \\static int hash_binary(int k) - \\{ - \\ unsigned int choose[3] = {1, 2, 3}; - \\ int sum = -2; - \\ int prev = sum + choose[k]; - \\ if (prev != 0) abort(); - \\ return sum + prev; - \\} - \\ - \\int main() { - \\ int x = hash_binary(1); - \\ if (x != -2) abort(); - \\ return 0; - \\} - , ""); - - cases.add("array cast int to uint", - \\#include - \\static unsigned int hash_binary(int k) - \\{ - \\ int choose[3] = {-1, -2, 3}; - \\ unsigned int sum = 2; - \\ sum += choose[k]; - \\ return sum; - \\} - \\ - \\int main() { - \\ unsigned int x = hash_binary(1); - \\ if (x != 0) abort(); - \\ return 0; - \\} - , ""); - - cases.add("assign enum to uint, no explicit cast", - \\#include - \\typedef enum { - \\ ENUM_0 = 0, - \\ ENUM_1 = 1, - \\} my_enum_t; - \\ - \\int main() { - \\ my_enum_t val = ENUM_1; - \\ unsigned int x = val; - \\ if (x != 1) abort(); - \\ return 0; - \\} - , ""); - - cases.add("assign enum to int", - \\#include - \\typedef enum { - \\ ENUM_0 = 0, - \\ ENUM_1 = 1, - \\} my_enum_t; - \\ - \\int main() { - \\ my_enum_t val = ENUM_1; - \\ int x = val; - \\ if (x != 1) abort(); - \\ return 0; - \\} - , ""); - - cases.add("cast enum to smaller uint", - \\#include - \\#include - \\typedef enum { - \\ ENUM_0 = 0, - \\ ENUM_257 = 257, - \\} my_enum_t; - \\ - \\int main() { - \\ my_enum_t val = ENUM_257; - \\ uint8_t x = (uint8_t)val; - \\ if (x != (uint8_t)257) abort(); - \\ return 0; - \\} - , ""); - - cases.add("cast enum to smaller signed int", - \\#include - \\#include - \\typedef enum { - \\ ENUM_0 = 0, - \\ ENUM_384 = 384, - \\} my_enum_t; - \\ - \\int main() { - \\ my_enum_t val = ENUM_384; - \\ int8_t x = (int8_t)val; - \\ if (x != (int8_t)384) abort(); - \\ return 0; - \\} - , ""); - - cases.add("cast negative enum to smaller signed int", - \\#include - \\#include - \\typedef enum { - \\ ENUM_MINUS_1 = -1, - \\ ENUM_384 = 384, - \\} my_enum_t; - \\ - \\int main() { - \\ my_enum_t val = ENUM_MINUS_1; - \\ int8_t x = (int8_t)val; - \\ if (x != -1) abort(); - \\ return 0; - \\} - , ""); - - cases.add("cast negative enum to smaller unsigned int", - \\#include - \\#include - \\typedef enum { - \\ ENUM_MINUS_1 = -1, - \\ ENUM_384 = 384, - \\} my_enum_t; - \\ - \\int main() { - \\ my_enum_t val = ENUM_MINUS_1; - \\ uint8_t x = (uint8_t)val; - \\ if (x != (uint8_t)-1) abort(); - \\ return 0; - \\} - , ""); - - cases.add("implicit enum cast in boolean expression", - \\#include - \\enum Foo { - \\ FooA, - \\ FooB, - \\ FooC, - \\}; - \\int main() { - \\ int a = 0; - \\ float b = 0; - \\ void *c = 0; - \\ enum Foo d = FooA; - \\ if (a || d) abort(); - \\ if (d && b) abort(); - \\ if (c || d) abort(); - \\ return 0; - \\} - , ""); - - cases.add("issue #6707 cast builtin call result to opaque struct pointer", - \\#include - \\struct foo* make_foo(void) - \\{ - \\ return (struct foo*)__builtin_strlen("0123456789ABCDEF"); - \\} - \\int main(void) { - \\ struct foo *foo_pointer = make_foo(); - \\ if (foo_pointer != (struct foo*)16) abort(); - \\ return 0; - \\} - , ""); - - cases.add("C built-ins", - \\#include - \\#include - \\#include - \\#define M_E 2.71828182845904523536 - \\#define M_PI_2 1.57079632679489661923 - \\bool check_clz(unsigned int pos) { - \\ return (__builtin_clz(1 << pos) == (8 * sizeof(unsigned int) - pos - 1)); - \\} - \\int main(void) { - \\ if (__builtin_bswap16(0x0102) != 0x0201) abort(); - \\ if (__builtin_bswap32(0x01020304) != 0x04030201) abort(); - \\ if (__builtin_bswap64(0x0102030405060708) != 0x0807060504030201) abort(); - \\ - \\ if (__builtin_signbit(0.0) != 0) abort(); - \\ if (__builtin_signbitf(0.0f) != 0) abort(); - \\ if (__builtin_signbit(1.0) != 0) abort(); - \\ if (__builtin_signbitf(1.0f) != 0) abort(); - \\ if (__builtin_signbit(-1.0) != 1) abort(); - \\ if (__builtin_signbitf(-1.0f) != 1) abort(); - \\ - \\ if (__builtin_popcount(0) != 0) abort(); - \\ if (__builtin_popcount(0b1) != 1) abort(); - \\ if (__builtin_popcount(0b11) != 2) abort(); - \\ if (__builtin_popcount(0b1111) != 4) abort(); - \\ if (__builtin_popcount(0b11111111) != 8) abort(); - \\ - \\ if (__builtin_ctz(0b1) != 0) abort(); - \\ if (__builtin_ctz(0b10) != 1) abort(); - \\ if (__builtin_ctz(0b100) != 2) abort(); - \\ if (__builtin_ctz(0b10000) != 4) abort(); - \\ if (__builtin_ctz(0b100000000) != 8) abort(); - \\ - \\ if (!check_clz(0)) abort(); - \\ if (!check_clz(1)) abort(); - \\ if (!check_clz(2)) abort(); - \\ if (!check_clz(4)) abort(); - \\ if (!check_clz(8)) abort(); - \\ - \\ if (__builtin_sqrt(__builtin_sqrt(__builtin_sqrt(256))) != 2.0) abort(); - \\ if (__builtin_sqrt(__builtin_sqrt(__builtin_sqrt(256.0))) != 2.0) abort(); - \\ if (__builtin_sqrt(__builtin_sqrt(__builtin_sqrt(256.0f))) != 2.0) abort(); - \\ if (__builtin_sqrtf(__builtin_sqrtf(__builtin_sqrtf(256.0f))) != 2.0f) abort(); - \\ - \\ if (__builtin_sin(1.0) != -__builtin_sin(-1.0)) abort(); - \\ if (__builtin_sinf(1.0f) != -__builtin_sinf(-1.0f)) abort(); - \\ if (__builtin_sin(M_PI_2) != 1.0) abort(); - \\ if (__builtin_sinf(M_PI_2) != 1.0f) abort(); - \\ - \\ if (__builtin_cos(1.0) != __builtin_cos(-1.0)) abort(); - \\ if (__builtin_cosf(1.0f) != __builtin_cosf(-1.0f)) abort(); - \\ if (__builtin_cos(0.0) != 1.0) abort(); - \\ if (__builtin_cosf(0.0f) != 1.0f) abort(); - \\ - \\ if (__builtin_exp(0) != 1.0) abort(); - \\ if (__builtin_fabs(__builtin_exp(1.0) - M_E) > 0.00000001) abort(); - \\ if (__builtin_exp(0.0f) != 1.0f) abort(); - \\ - \\ if (__builtin_exp2(0) != 1.0) abort(); - \\ if (__builtin_exp2(4.0) != 16.0) abort(); - \\ if (__builtin_exp2f(0.0f) != 1.0f) abort(); - \\ if (__builtin_exp2f(4.0f) != 16.0f) abort(); - \\ - \\ if (__builtin_log(M_E) != 1.0) abort(); - \\ if (__builtin_log(1.0) != 0.0) abort(); - \\ if (__builtin_logf(1.0f) != 0.0f) abort(); - \\ - \\ if (__builtin_log2(8.0) != 3.0) abort(); - \\ if (__builtin_log2(1.0) != 0.0) abort(); - \\ if (__builtin_log2f(8.0f) != 3.0f) abort(); - \\ if (__builtin_log2f(1.0f) != 0.0f) abort(); - \\ - \\ if (__builtin_log10(1000.0) != 3.0) abort(); - \\ if (__builtin_log10(1.0) != 0.0) abort(); - \\ if (__builtin_log10f(1000.0f) != 3.0f) abort(); - \\ if (__builtin_log10f(1.0f) != 0.0f) abort(); - \\ - \\ if (__builtin_fabs(-42.0f) != 42.0) abort(); - \\ if (__builtin_fabs(-42.0) != 42.0) abort(); - \\ if (__builtin_fabs(-42) != 42.0) abort(); - \\ if (__builtin_fabsf(-42.0f) != 42.0f) abort(); - \\ - \\ if (__builtin_fabs(-42.0f) != 42.0) abort(); - \\ if (__builtin_fabs(-42.0) != 42.0) abort(); - \\ if (__builtin_fabs(-42) != 42.0) abort(); - \\ if (__builtin_fabsf(-42.0f) != 42.0f) abort(); - \\ - \\ if (__builtin_abs(42) != 42) abort(); - \\ if (__builtin_abs(-42) != 42) abort(); - \\ if (__builtin_abs(INT_MIN) != INT_MIN) abort(); - \\ - \\ if (__builtin_floor(42.9) != 42.0) abort(); - \\ if (__builtin_floor(-42.9) != -43.0) abort(); - \\ if (__builtin_floorf(42.9f) != 42.0f) abort(); - \\ if (__builtin_floorf(-42.9f) != -43.0f) abort(); - \\ - \\ if (__builtin_ceil(42.9) != 43.0) abort(); - \\ if (__builtin_ceil(-42.9) != -42) abort(); - \\ if (__builtin_ceilf(42.9f) != 43.0f) abort(); - \\ if (__builtin_ceilf(-42.9f) != -42.0f) abort(); - \\ - \\ if (__builtin_trunc(42.9) != 42.0) abort(); - \\ if (__builtin_truncf(42.9f) != 42.0f) abort(); - \\ if (__builtin_trunc(-42.9) != -42.0) abort(); - \\ if (__builtin_truncf(-42.9f) != -42.0f) abort(); - \\ - \\ if (__builtin_round(0.5) != 1.0) abort(); - \\ if (__builtin_round(-0.5) != -1.0) abort(); - \\ if (__builtin_roundf(0.5f) != 1.0f) abort(); - \\ if (__builtin_roundf(-0.5f) != -1.0f) abort(); - \\ - \\ if (__builtin_strcmp("abc", "abc") != 0) abort(); - \\ if (__builtin_strcmp("abc", "def") >= 0 ) abort(); - \\ if (__builtin_strcmp("def", "abc") <= 0) abort(); - \\ - \\ if (__builtin_strlen("this is a string") != 16) abort(); - \\ - \\ char *s = malloc(6); - \\ __builtin_memcpy(s, "hello", 5); - \\ s[5] = '\0'; - \\ if (__builtin_strlen(s) != 5) abort(); - \\ - \\ __builtin_memset(s, 42, __builtin_strlen(s)); - \\ if (s[0] != 42 || s[1] != 42 || s[2] != 42 || s[3] != 42 || s[4] != 42) abort(); - \\ - \\ free(s); - \\ - \\ return 0; - \\} - , ""); - - cases.add("function macro that uses builtin", - \\#include - \\#define FOO(x, y) (__builtin_popcount((x)) + __builtin_strlen((y))) - \\int main() { - \\ if (FOO(7, "hello!") != 9) abort(); - \\ return 0; - \\} - , ""); - - cases.add("assign bool result to int or char", - \\#include - \\#include - \\bool foo() { return true; } - \\int main() { - \\ int x = foo(); - \\ if (x != 1) abort(); - \\ signed char c = foo(); - \\ if (c != 1) abort(); - \\ return 0; - \\} - , ""); - - cases.add("static K&R-style no prototype function declaration (empty parameter list)", - \\#include - \\static int foo() { - \\ return 42; - \\} - \\int main() { - \\ if (foo() != 42) abort(); - \\ return 0; - \\} - , ""); - - cases.add("K&R-style static function prototype for unused function", - \\static int foo(); - \\int main() { - \\ return 0; - \\} - , ""); - - cases.add("K&R-style static function prototype + separate definition", - \\#include - \\static int foo(); - \\static int foo(int a, int b) { - \\ return a + b; - \\} - \\int main() { - \\ if (foo(40, 2) != 42) abort(); - \\ return 0; - \\} - , ""); - - cases.add("dollar sign in identifiers", - \\#include - \\#define $FOO 2 - \\#define $foo bar$ - \\#define $baz($x) ($x + $FOO) - \\int $$$(int $x$) { return $x$ + $FOO; } - \\int main() { - \\ int bar$ = 42; - \\ if ($foo != 42) abort(); - \\ if (bar$ != 42) abort(); - \\ if ($baz(bar$) != 44) abort(); - \\ if ($$$(bar$) != 44) abort(); - \\ return 0; - \\} - , ""); - - cases.add("Cast boolean expression result to int", - \\#include - \\char foo(char c) { return c; } - \\int bar(int i) { return i; } - \\long baz(long l) { return l; } - \\int main() { - \\ if (foo(1 == 2)) abort(); - \\ if (!foo(1 == 1)) abort(); - \\ if (bar(1 == 2)) abort(); - \\ if (!bar(1 == 1)) abort(); - \\ if (baz(1 == 2)) abort(); - \\ if (!baz(1 == 1)) abort(); - \\ return 0; - \\} - , ""); - - cases.add("Wide, UTF-16, and UTF-32 character literals", - \\#include - \\#include - \\int main() { - \\ wchar_t wc = L'™'; - \\ int utf16_char = u'™'; - \\ int utf32_char = U'💯'; - \\ if (wc != 8482) abort(); - \\ if (utf16_char != 8482) abort(); - \\ if (utf32_char != 128175) abort(); - \\ unsigned char c = wc; - \\ if (c != 0x22) abort(); - \\ c = utf32_char; - \\ if (c != 0xaf) abort(); - \\ return 0; - \\} - , ""); - - cases.add("Variadic function call", - \\#define _NO_CRT_STDIO_INLINE 1 - \\#include - \\int main(void) { - \\ printf("%d %d\n", 1, 2); - \\ return 0; - \\} - , "1 2" ++ nl); - - cases.add("multi-character character constant", - \\#include - \\int main(void) { - \\ int foo = 'abcd'; - \\ switch (foo) { - \\ case 'abcd': break; - \\ default: abort(); - \\ } - \\ return 0; - \\} - , ""); - - cases.add("Array initializers (string literals, incomplete arrays)", - \\#include - \\#include - \\extern int foo[]; - \\int global_arr[] = {1, 2, 3}; - \\char global_string[] = "hello"; - \\int main(int argc, char *argv[]) { - \\ if (global_arr[2] != 3) abort(); - \\ if (strlen(global_string) != 5) abort(); - \\ const char *const_str = "hello"; - \\ if (strcmp(const_str, "hello") != 0) abort(); - \\ char empty_str[] = ""; - \\ if (strlen(empty_str) != 0) abort(); - \\ char hello[] = "hello"; - \\ if (strlen(hello) != 5 || sizeof(hello) != 6) abort(); - \\ int empty[] = {}; - \\ if (sizeof(empty) != 0) abort(); - \\ int bar[] = {42}; - \\ if (bar[0] != 42) abort(); - \\ bar[0] = 43; - \\ if (bar[0] != 43) abort(); - \\ int baz[] = {1, [42] = 123, 456}; - \\ if (baz[42] != 123 || baz[43] != 456) abort(); - \\ if (sizeof(baz) != sizeof(int) * 44) abort(); - \\ const char *const names[] = {"first", "second", "third"}; - \\ if (strcmp(names[2], "third") != 0) abort(); - \\ char catted_str[] = "abc" "def"; - \\ if (strlen(catted_str) != 6 || sizeof(catted_str) != 7) abort(); - \\ char catted_trunc_str[2] = "abc" "def"; - \\ if (sizeof(catted_trunc_str) != 2 || catted_trunc_str[0] != 'a' || catted_trunc_str[1] != 'b') abort(); - \\ char big_array_utf8lit[10] = "💯"; - \\ if (strcmp(big_array_utf8lit, "💯") != 0 || big_array_utf8lit[9] != 0) abort(); - \\ return 0; - \\} - , ""); - - cases.add("Wide, UTF-16, and UTF-32 string literals", - \\#include - \\#include - \\#include - \\int main(void) { - \\ const wchar_t *wide_str = L"wide"; - \\ const wchar_t wide_hello[] = L"hello"; - \\ if (wcslen(wide_str) != 4) abort(); - \\ if (wcslen(L"literal") != 7) abort(); - \\ if (wcscmp(wide_hello, L"hello") != 0) abort(); - \\ - \\ const uint16_t *u16_str = u"wide"; - \\ const uint16_t u16_hello[] = u"hello"; - \\ if (u16_str[3] != u'e' || u16_str[4] != 0) abort(); - \\ if (u16_hello[4] != u'o' || u16_hello[5] != 0) abort(); - \\ - \\ const uint32_t *u32_str = U"wide"; - \\ const uint32_t u32_hello[] = U"hello"; - \\ if (u32_str[3] != U'e' || u32_str[4] != 0) abort(); - \\ if (u32_hello[4] != U'o' || u32_hello[5] != 0) abort(); - \\ return 0; - \\} - , ""); - - cases.add("Address of function is no-op", - \\#include - \\#include - \\typedef int (*myfunc)(int); - \\int a(int arg) { return arg + 1;} - \\int b(int arg) { return arg + 2;} - \\int caller(myfunc fn, int arg) { - \\ return fn(arg); - \\} - \\int main() { - \\ myfunc arr[3] = {&a, &b, a}; - \\ myfunc foo = a; - \\ myfunc bar = &(a); - \\ if (foo != bar) abort(); - \\ if (arr[0] == arr[1]) abort(); - \\ if (arr[0] != arr[2]) abort(); - \\ if (caller(b, 40) != 42) abort(); - \\ if (caller(&b, 40) != 42) abort(); - \\ return 0; - \\} - , ""); - - cases.add("Obscure ways of calling functions; issue #4124", - \\#include - \\static int add(int a, int b) { - \\ return a + b; - \\} - \\typedef int (*adder)(int, int); - \\typedef void (*funcptr)(void); - \\int main() { - \\ if ((add)(1, 2) != 3) abort(); - \\ if ((&add)(1, 2) != 3) abort(); - \\ if (add(3, 1) != 4) abort(); - \\ if ((*add)(2, 3) != 5) abort(); - \\ if ((**add)(7, -1) != 6) abort(); - \\ if ((***add)(-2, 9) != 7) abort(); - \\ - \\ int (*ptr)(int a, int b); - \\ ptr = add; - \\ - \\ if (ptr(1, 2) != 3) abort(); - \\ if ((*ptr)(3, 1) != 4) abort(); - \\ if ((**ptr)(2, 3) != 5) abort(); - \\ if ((***ptr)(7, -1) != 6) abort(); - \\ if ((****ptr)(-2, 9) != 7) abort(); - \\ - \\ funcptr addr1 = (funcptr)(add); - \\ funcptr addr2 = (funcptr)(&add); - \\ - \\ if (addr1 != addr2) abort(); - \\ if (((int(*)(int, int))addr1)(1, 2) != 3) abort(); - \\ if (((adder)addr2)(1, 2) != 3) abort(); - \\ return 0; - \\} - , ""); - - cases.add("Return boolean expression as int; issue #6215", - \\#include - \\#include - \\bool actual_bool(void) { return 4 - 1 < 4;} - \\char char_bool_ret(void) { return 0 || 1; } - \\short short_bool_ret(void) { return 0 < 1; } - \\int int_bool_ret(void) { return 1 && 1; } - \\long long_bool_ret(void) { return !(0 > 1); } - \\static int GLOBAL = 1; - \\int nested_scopes(int a, int b) { - \\ if (a == 1) { - \\ int target = 1; - \\ return b == target; - \\ } else { - \\ int target = 2; - \\ if (b == target) { - \\ return GLOBAL == 1; - \\ } - \\ return target == 2; - \\ } - \\} - \\int main(void) { - \\ if (!actual_bool()) abort(); - \\ if (!char_bool_ret()) abort(); - \\ if (!short_bool_ret()) abort(); - \\ if (!int_bool_ret()) abort(); - \\ if (!long_bool_ret()) abort(); - \\ if (!nested_scopes(1, 1)) abort(); - \\ if (nested_scopes(1, 2)) abort(); - \\ if (!nested_scopes(0, 2)) abort(); - \\ if (!nested_scopes(0, 3)) abort(); - \\ return 1 != 1; - \\} - , ""); - - cases.add("Comma operator should create new scope; issue #7989", - \\#include - \\#include - \\int main(void) { - \\ if (1 || (abort(), 1)) {} - \\ if (0 && (1, printf("do not print\n"))) {} - \\ int x = 0; - \\ x = (x = 3, 4, x + 1); - \\ if (x != 4) abort(); - \\ return 0; - \\} - , ""); - - cases.add("Use correct break label for statement expression in nested scope", - \\#include - \\int main(void) { - \\ int x = ({1, ({2; 3;});}); - \\ if (x != 3) abort(); - \\ return 0; - \\} - , ""); - - cases.add("pointer difference: scalar array w/ size truncation or negative result. Issue #7216", - \\#include - \\#include - \\#define SIZE 10 - \\int main() { - \\ int foo[SIZE]; - \\ int *start = &foo[0]; - \\ int *one_past_end = start + SIZE; - \\ ptrdiff_t diff = one_past_end - start; - \\ char diff_char = one_past_end - start; - \\ if (diff != SIZE || diff_char != SIZE) abort(); - \\ diff = start - one_past_end; - \\ if (diff != -SIZE) abort(); - \\ if (one_past_end - foo != SIZE) abort(); - \\ if ((one_past_end - 1) - foo != SIZE - 1) abort(); - \\ if ((start + 1) - foo != 1) abort(); - \\ return 0; - \\} - , ""); - - // C standard: if the expression P points either to an element of an array object or one - // past the last element of an array object, and the expression Q points to the last - // element of the same array object, the expression ((Q)+1)-(P) has the same value as - // ((Q)-(P))+1 and as -((P)-((Q)+1)), and has the value zero if the expression P points - // one past the last element of the array object, even though the expression (Q)+1 - // does not point to an element of the array object - cases.add("pointer difference: C standard edge case", - \\#include - \\#include - \\#define SIZE 10 - \\int main() { - \\ int foo[SIZE]; - \\ int *start = &foo[0]; - \\ int *P = start + SIZE; - \\ int *Q = &foo[SIZE - 1]; - \\ if ((Q + 1) - P != 0) abort(); - \\ if ((Q + 1) - P != (Q - P) + 1) abort(); - \\ if ((Q + 1) - P != -(P - (Q + 1))) abort(); - \\ return 0; - \\} - , ""); - - cases.add("pointer difference: unary operators", - \\#include - \\int main() { - \\ int foo[10]; - \\ int *x = &foo[1]; - \\ const int *y = &foo[5]; - \\ if (y - x++ != 4) abort(); - \\ if (y - x != 3) abort(); - \\ if (y - ++x != 2) abort(); - \\ if (y - x-- != 2) abort(); - \\ if (y - x != 3) abort(); - \\ if (y - --x != 4) abort(); - \\ if (y - &foo[0] != 5) abort(); - \\ return 0; - \\} - , ""); - - cases.add("pointer difference: struct array with padding", - \\#include - \\#include - \\#define SIZE 10 - \\typedef struct my_struct { - \\ int x; - \\ char c; - \\ int y; - \\} my_struct_t; - \\int main() { - \\ my_struct_t foo[SIZE]; - \\ my_struct_t *start = &foo[0]; - \\ my_struct_t *one_past_end = start + SIZE; - \\ ptrdiff_t diff = one_past_end - start; - \\ int diff_int = one_past_end - start; - \\ if (diff != SIZE || diff_int != SIZE) abort(); - \\ diff = start - one_past_end; - \\ if (diff != -SIZE) abort(); - \\ return 0; - \\} - , ""); - - cases.add("pointer difference: array of function pointers", - \\#include - \\int a(void) { return 1;} - \\int b(void) { return 2;} - \\int c(void) { return 3;} - \\typedef int (*myfunc)(void); - \\int main() { - \\ myfunc arr[] = {a, b, c, a, b, c}; - \\ myfunc *f1 = &arr[1]; - \\ myfunc *f4 = &arr[4]; - \\ if (f4 - f1 != 3) abort(); - \\ return 0; - \\} - , ""); - - cases.add("typeof operator", - \\#include - \\static int FOO = 42; - \\typedef typeof(FOO) foo_type; - \\typeof(foo_type) myfunc(typeof(FOO) x) { return (typeof(FOO)) x; } - \\int main(void) { - \\ int x = FOO; - \\ typeof(x) y = x; - \\ foo_type z = y; - \\ if (x != y) abort(); - \\ if (myfunc(z) != x) abort(); - \\ - \\ const char *my_string = "bar"; - \\ typeof (typeof (my_string)[4]) string_arr = {"a","b","c","d"}; - \\ if (string_arr[0][0] != 'a' || string_arr[3][0] != 'd') abort(); - \\ return 0; - \\} - , ""); - - cases.add("offsetof", - \\#include - \\#include - \\#define container_of(ptr, type, member) ({ \ - \\ const typeof( ((type *)0)->member ) *__mptr = (ptr); \ - \\ (type *)( (char *)__mptr - offsetof(type,member) );}) - \\typedef struct { - \\ int i; - \\ struct { int x; char y; int z; } s; - \\ float f; - \\} container; - \\int main(void) { - \\ if (offsetof(container, i) != 0) abort(); - \\ if (offsetof(container, s) <= offsetof(container, i)) abort(); - \\ if (offsetof(container, f) <= offsetof(container, s)) abort(); - \\ - \\ container my_container; - \\ typeof(my_container.s) *inner_member_pointer = &my_container.s; - \\ float *float_member_pointer = &my_container.f; - \\ int *anon_member_pointer = &my_container.s.z; - \\ container *my_container_p; - \\ - \\ my_container_p = container_of(inner_member_pointer, container, s); - \\ if (my_container_p != &my_container) abort(); - \\ - \\ my_container_p = container_of(float_member_pointer, container, f); - \\ if (my_container_p != &my_container) abort(); - \\ - \\ if (container_of(anon_member_pointer, typeof(my_container.s), z) != inner_member_pointer) abort(); - \\ return 0; - \\} - , ""); - - cases.add("handle assert.h", - \\#include - \\int main() { - \\ int x = 1; - \\ int *xp = &x; - \\ assert(1); - \\ assert(x != 0); - \\ assert(xp); - \\ assert(*xp); - \\ return 0; - \\} - , ""); - - cases.add("NDEBUG disables assert", - \\#define NDEBUG - \\#include - \\int main() { - \\ assert(0); - \\ assert(NULL); - \\ return 0; - \\} - , ""); - - cases.add("pointer arithmetic with signed operand", - \\#include - \\int main() { - \\ int array[10]; - \\ int *x = &array[5]; - \\ int *y; - \\ int idx = 0; - \\ y = x + ++idx; - \\ if (y != x + 1 || y != &array[6]) abort(); - \\ y = idx + x; - \\ if (y != x + 1 || y != &array[6]) abort(); - \\ y = x - idx; - \\ if (y != x - 1 || y != &array[4]) abort(); - \\ - \\ idx = 0; - \\ y = --idx + x; - \\ if (y != x - 1 || y != &array[4]) abort(); - \\ y = idx + x; - \\ if (y != x - 1 || y != &array[4]) abort(); - \\ y = x - idx; - \\ if (y != x + 1 || y != &array[6]) abort(); - \\ - \\ idx = 1; - \\ x += idx; - \\ if (x != &array[6]) abort(); - \\ x -= idx; - \\ if (x != &array[5]) abort(); - \\ y = (x += idx); - \\ if (y != x || y != &array[6]) abort(); - \\ y = (x -= idx); - \\ if (y != x || y != &array[5]) abort(); - \\ - \\ if (array + idx != &array[1] || array + 1 != &array[1]) abort(); - \\ idx = -1; - \\ if (array - idx != &array[1]) abort(); - \\ - \\ return 0; - \\} - , ""); - - cases.add("Compound literals", - \\#include - \\struct Foo { - \\ int a; - \\ char b[2]; - \\ float c; - \\}; - \\int main() { - \\ struct Foo foo; - \\ int x = 1, y = 2; - \\ foo = (struct Foo) {x + y, {'a', 'b'}, 42.0f}; - \\ if (foo.a != x + y || foo.b[0] != 'a' || foo.b[1] != 'b' || foo.c != 42.0f) abort(); - \\ return 0; - \\} - , ""); - - cases.add("Generic selections", - \\#include - \\#include - \\#include - \\#define my_generic_fn(X) _Generic((X), \ - \\ int: abs, \ - \\ char *: strlen, \ - \\ size_t: malloc, \ - \\ default: free \ - \\)(X) - \\#define my_generic_val(X) _Generic((X), \ - \\ int: 1, \ - \\ const char *: "bar" \ - \\) - \\int main(void) { - \\ if (my_generic_val(100) != 1) abort(); - \\ - \\ const char *foo = "foo"; - \\ const char *bar = my_generic_val(foo); - \\ if (strcmp(bar, "bar") != 0) abort(); - \\ - \\ if (my_generic_fn(-42) != 42) abort(); - \\ if (my_generic_fn("hello") != 5) abort(); - \\ - \\ size_t size = 8192; - \\ uint8_t *mem = my_generic_fn(size); - \\ memset(mem, 42, size); - \\ if (mem[size - 1] != 42) abort(); - \\ my_generic_fn(mem); - \\ - \\ return 0; - \\} - , ""); - - // See __builtin_alloca_with_align comment in std.zig.c_builtins - cases.add("use of unimplemented builtin in unused function does not prevent compilation", - \\#include - \\void unused() { - \\ __builtin_alloca_with_align(1, 8); - \\} - \\int main(void) { - \\ if (__builtin_sqrt(1.0) != 1.0) abort(); - \\ return 0; - \\} - , ""); - - cases.add("convert single-statement bodies into blocks for if/else/for/while. issue #8159", - \\#include - \\int foo() { return 1; } - \\int main(void) { - \\ int i = 0; - \\ if (i == 0) if (i == 0) if (i != 0) i = 1; - \\ if (i != 0) i = 1; else if (i == 0) if (i == 0) i += 1; - \\ for (; i < 10;) for (; i < 10;) i++; - \\ while (i == 100) while (i == 100) foo(); - \\ if (0) do do "string"; while(1); while(1); - \\ return 0; - \\} - , ""); - - cases.add("cast RHS of compound assignment if necessary, unused result", - \\#include - \\int main(void) { - \\ signed short val = -1; - \\ val += 1; if (val != 0) abort(); - \\ val -= 1; if (val != -1) abort(); - \\ val *= 2; if (val != -2) abort(); - \\ val /= 2; if (val != -1) abort(); - \\ val %= 2; if (val != -1) abort(); - \\ val <<= 1; if (val != -2) abort(); - \\ val >>= 1; if (val != -1) abort(); - \\ val += 100000000; // compile error if @truncate() not inserted - \\ unsigned short uval = 1; - \\ uval += 1; if (uval != 2) abort(); - \\ uval -= 1; if (uval != 1) abort(); - \\ uval *= 2; if (uval != 2) abort(); - \\ uval /= 2; if (uval != 1) abort(); - \\ uval %= 2; if (uval != 1) abort(); - \\ uval <<= 1; if (uval != 2) abort(); - \\ uval >>= 1; if (uval != 1) abort(); - \\ uval += 100000000; // compile error if @truncate() not inserted - \\} - , ""); - - cases.add("cast RHS of compound assignment if necessary, used result", - \\#include - \\int main(void) { - \\ signed short foo; - \\ signed short val = -1; - \\ foo = (val += 1); if (foo != 0) abort(); - \\ foo = (val -= 1); if (foo != -1) abort(); - \\ foo = (val *= 2); if (foo != -2) abort(); - \\ foo = (val /= 2); if (foo != -1) abort(); - \\ foo = (val %= 2); if (foo != -1) abort(); - \\ foo = (val <<= 1); if (foo != -2) abort(); - \\ foo = (val >>= 1); if (foo != -1) abort(); - \\ foo = (val += 100000000); // compile error if @truncate() not inserted - \\ unsigned short ufoo; - \\ unsigned short uval = 1; - \\ ufoo = (uval += 1); if (ufoo != 2) abort(); - \\ ufoo = (uval -= 1); if (ufoo != 1) abort(); - \\ ufoo = (uval *= 2); if (ufoo != 2) abort(); - \\ ufoo = (uval /= 2); if (ufoo != 1) abort(); - \\ ufoo = (uval %= 2); if (ufoo != 1) abort(); - \\ ufoo = (uval <<= 1); if (ufoo != 2) abort(); - \\ ufoo = (uval >>= 1); if (ufoo != 1) abort(); - \\ ufoo = (uval += 100000000); // compile error if @truncate() not inserted - \\} - , ""); - - cases.add("basic vector expressions", - \\#include - \\#include - \\typedef int16_t __v8hi __attribute__((__vector_size__(16))); - \\int main(int argc, char**argv) { - \\ __v8hi uninitialized; - \\ __v8hi empty_init = {}; - \\ for (int i = 0; i < 8; i++) { - \\ if (empty_init[i] != 0) abort(); - \\ } - \\ __v8hi partial_init = {0, 1, 2, 3}; - \\ - \\ __v8hi a = {0, 1, 2, 3, 4, 5, 6, 7}; - \\ __v8hi b = (__v8hi) {100, 200, 300, 400, 500, 600, 700, 800}; - \\ - \\ __v8hi sum = a + b; - \\ for (int i = 0; i < 8; i++) { - \\ if (sum[i] != a[i] + b[i]) abort(); - \\ } - \\ return 0; - \\} - , ""); - - cases.add("__builtin_shufflevector", - \\#include - \\#include - \\typedef int16_t __v4hi __attribute__((__vector_size__(8))); - \\typedef int16_t __v8hi __attribute__((__vector_size__(16))); - \\int main(int argc, char**argv) { - \\ __v8hi v8_a = {0, 1, 2, 3, 4, 5, 6, 7}; - \\ __v8hi v8_b = {100, 200, 300, 400, 500, 600, 700, 800}; - \\ __v8hi shuffled = __builtin_shufflevector(v8_a, v8_b, 0, 1, 2, 3, 8, 9, 10, 11); - \\ for (int i = 0; i < 8; i++) { - \\ if (i < 4) { - \\ if (shuffled[i] != v8_a[i]) abort(); - \\ } else { - \\ if (shuffled[i] != v8_b[i - 4]) abort(); - \\ } - \\ } - \\ shuffled = __builtin_shufflevector( - \\ (__v8hi) {-1, -1, -1, -1, -1, -1, -1, -1}, - \\ (__v8hi) {42, 42, 42, 42, 42, 42, 42, 42}, - \\ 0, 1, 2, 3, 8, 9, 10, 11 - \\ ); - \\ for (int i = 0; i < 8; i++) { - \\ if (i < 4) { - \\ if (shuffled[i] != -1) abort(); - \\ } else { - \\ if (shuffled[i] != 42) abort(); - \\ } - \\ } - \\ __v4hi shuffled_to_fewer_elements = __builtin_shufflevector(v8_a, v8_b, 0, 1, 8, 9); - \\ for (int i = 0; i < 4; i++) { - \\ if (i < 2) { - \\ if (shuffled_to_fewer_elements[i] != v8_a[i]) abort(); - \\ } else { - \\ if (shuffled_to_fewer_elements[i] != v8_b[i - 2]) abort(); - \\ } - \\ } - \\ __v4hi v4_a = {0, 1, 2, 3}; - \\ __v4hi v4_b = {100, 200, 300, 400}; - \\ __v8hi shuffled_to_more_elements = __builtin_shufflevector(v4_a, v4_b, 0, 1, 2, 3, 4, 5, 6, 7); - \\ for (int i = 0; i < 4; i++) { - \\ if (shuffled_to_more_elements[i] != v4_a[i]) abort(); - \\ if (shuffled_to_more_elements[i + 4] != v4_b[i]) abort(); - \\ } - \\ return 0; - \\} - , ""); - - cases.add("__builtin_convertvector", - \\#include - \\#include - \\typedef int16_t __v8hi __attribute__((__vector_size__(16))); - \\typedef uint16_t __v8hu __attribute__((__vector_size__(16))); - \\int main(int argc, char**argv) { - \\ __v8hi signed_vector = { 1, 2, 3, 4, -1, -2, -3,-4}; - \\ __v8hu unsigned_vector = __builtin_convertvector(signed_vector, __v8hu); - \\ - \\ for (int i = 0; i < 8; i++) { - \\ if (unsigned_vector[i] != (uint16_t)signed_vector[i]) abort(); - \\ } - \\ return 0; - \\} - , ""); - - cases.add("vector casting", - \\#include - \\#include - \\typedef int8_t __v8qi __attribute__((__vector_size__(8))); - \\typedef uint8_t __v8qu __attribute__((__vector_size__(8))); - \\int main(int argc, char**argv) { - \\ __v8qi signed_vector = { 1, 2, 3, 4, -1, -2, -3,-4}; - \\ - \\ uint64_t big_int = (uint64_t) signed_vector; - \\ if (big_int != 0x01020304FFFEFDFCULL && big_int != 0xFCFDFEFF04030201ULL) abort(); - \\ __v8qu unsigned_vector = (__v8qu) big_int; - \\ for (int i = 0; i < 8; i++) { - \\ if (unsigned_vector[i] != (uint8_t)signed_vector[i] && unsigned_vector[i] != (uint8_t)signed_vector[7 - i]) abort(); - \\ } - \\ return 0; - \\} - , ""); - - cases.add("break from switch statement. Issue #8387", - \\#include - \\int switcher(int x) { - \\ switch (x) { - \\ case 0: // no braces - \\ x += 1; - \\ break; - \\ case 1: // conditional break - \\ if (x == 1) { - \\ x += 1; - \\ break; - \\ } - \\ x += 100; - \\ case 2: { // braces with fallthrough - \\ x += 1; - \\ } - \\ case 3: // fallthrough to return statement - \\ x += 1; - \\ case 42: { // random out of order case - \\ x += 1; - \\ return x; - \\ } - \\ case 4: { // break within braces - \\ x += 1; - \\ break; - \\ } - \\ case 5: - \\ x += 1; // fallthrough to default - \\ default: - \\ x += 1; - \\ } - \\ return x; - \\} - \\int main(void) { - \\ int expected[] = {1, 2, 5, 5, 5, 7, 7}; - \\ for (int i = 0; i < sizeof(expected) / sizeof(int); i++) { - \\ int res = switcher(i); - \\ if (res != expected[i]) abort(); - \\ } - \\ if (switcher(42) != 43) abort(); - \\ return 0; - \\} - , ""); - - cases.add("Cast to enum from larger integral type. Issue #6011", - \\#include - \\#include - \\enum Foo { A, B, C }; - \\static inline enum Foo do_stuff(void) { - \\ int64_t i = 1; - \\ return (enum Foo)i; - \\} - \\int main(void) { - \\ if (do_stuff() != B) abort(); - \\ return 0; - \\} - , ""); - - cases.add("Render array LHS as grouped node if necessary", - \\#include - \\int main(void) { - \\ int arr[] = {40, 41, 42, 43}; - \\ if ((arr + 1)[1] != 42) abort(); - \\ return 0; - \\} - , ""); - - cases.add("typedef with multiple names", - \\#include - \\typedef struct { - \\ char field; - \\} a_t, b_t; - \\ - \\int main(void) { - \\ a_t a = { .field = 42 }; - \\ b_t b = a; - \\ if (b.field != 42) abort(); - \\ return 0; - \\} - , ""); - - cases.add("__cleanup__ attribute", - \\#include - \\static int cleanup_count = 0; - \\void clean_up(int *final_value) { - \\ if (*final_value != cleanup_count++) abort(); - \\} - \\void doit(void) { - \\ int a __attribute__ ((__cleanup__(clean_up))) __attribute__ ((unused)) = 2; - \\ int b __attribute__ ((__cleanup__(clean_up))) __attribute__ ((unused)) = 1; - \\ int c __attribute__ ((__cleanup__(clean_up))) __attribute__ ((unused)) = 0; - \\} - \\int main(void) { - \\ doit(); - \\ if (cleanup_count != 3) abort(); - \\ return 0; - \\} - , ""); - - cases.add("enum used as boolean expression", - \\#include - \\enum FOO {BAR, BAZ}; - \\int main(void) { - \\ enum FOO x = BAR; - \\ if (x) abort(); - \\ if (!BAZ) abort(); - \\ return 0; - \\} - , ""); - - cases.add("Flexible arrays", - \\#include - \\#include - \\typedef struct { char foo; int bar; } ITEM; - \\typedef struct { size_t count; ITEM items[]; } ITEM_LIST; - \\typedef struct { unsigned char count; int items[]; } INT_LIST; - \\#define SIZE 10 - \\int main(void) { - \\ ITEM_LIST *list = malloc(sizeof(ITEM_LIST) + SIZE * sizeof(ITEM)); - \\ for (int i = 0; i < SIZE; i++) list->items[i] = (ITEM) {.foo = i, .bar = i + 1}; - \\ const ITEM_LIST *const c_list = list; - \\ for (int i = 0; i < SIZE; i++) if (c_list->items[i].foo != i || c_list->items[i].bar != i + 1) abort(); - \\ INT_LIST *int_list = malloc(sizeof(INT_LIST) + SIZE * sizeof(int)); - \\ for (int i = 0; i < SIZE; i++) int_list->items[i] = i; - \\ const INT_LIST *const c_int_list = int_list; - \\ const int *const ints = int_list->items; - \\ for (int i = 0; i < SIZE; i++) if (ints[i] != i) abort(); - \\ return 0; - \\} - , ""); - - cases.add("Flexible array with typedefed flexible item, issue #16838", - \\#include - \\#include - \\typedef int MARKER[0]; - \\typedef struct { int x; MARKER y; } Flexible; - \\#define SIZE 10 - \\int main(void) { - \\ Flexible *flex = malloc(sizeof(Flexible) + SIZE * sizeof(int)); - \\ for (int i = 0; i < SIZE; i++) { - \\ flex->y[i] = i; - \\ } - \\ for (int i = 0; i < SIZE; i++) { - \\ assert(flex->y[i] == i); - \\ } - \\ return 0; - \\} - , ""); - - cases.add("enum with value that fits in c_uint but not c_int, issue #8003", - \\#include - \\enum my_enum { - \\ FORCE_UINT = 0xffffffff - \\}; - \\int main(void) { - \\ if(FORCE_UINT != 0xffffffff) abort(); - \\} - , ""); - - cases.add("block-scope static variable shadows function parameter. Issue #8208", - \\#include - \\int func1(int foo) { return foo + 1; } - \\int func2(void) { - \\ static int foo = 5; - \\ return foo++; - \\} - \\int main(void) { - \\ if (func1(42) != 43) abort(); - \\ if (func2() != 5) abort(); - \\ if (func2() != 6) abort(); - \\ return 0; - \\} - , ""); - - cases.add("nested same-name static locals", - \\#include - \\int func(int val) { - \\ static int foo; - \\ if (foo != val) abort(); - \\ { - \\ foo += 1; - \\ static int foo = 2; - \\ if (foo != val + 2) abort(); - \\ foo += 1; - \\ } - \\ return foo; - \\} - \\int main(void) { - \\ int foo = 1; - \\ if (func(0) != 1) abort(); - \\ if (func(1) != 2) abort(); - \\ if (func(2) != 3) abort(); - \\ if (foo != 1) abort(); - \\ return 0; - \\} - , ""); - - cases.add("Enum constants are assigned correct type. Issue #9153", - \\enum A { A0, A1=0xFFFFFFFF }; - \\enum B { B0=-1, B1=0xFFFFFFFF }; - \\enum C { C0=-1, C1=0 }; - \\enum D { D0, D1=0xFFFFFFFFFFL }; - \\enum E { E0=-1, E1=0xFFFFFFFFFFL }; - \\int main(void) { - \\ signed char a0 = A0, a1 = A1; - \\ signed char b0 = B0, b1 = B1; - \\ signed char c0 = C0, c1 = C1; - \\ signed char d0 = D0, d1 = D1; - \\ signed char e0 = E0, e1 = E1; - \\ return 0; - \\} - , ""); - - cases.add("Enum constant matches enum name; multiple enumerations with same value", - \\#include - \\enum FOO { - \\ FOO = 1, - \\ BAR = 2, - \\ BAZ = 1, - \\}; - \\int main(void) { - \\ enum FOO x = BAZ; - \\ if (x != 1) abort(); - \\ if (x != BAZ) abort(); - \\ if (x != FOO) abort(); - \\} - , ""); - - cases.add("Scoped enums", - \\#include - \\int main(void) { - \\ enum Foo { A, B, C }; - \\ enum Foo a = B; - \\ if (a != B) abort(); - \\ if (a != 1) abort(); - \\ { - \\ enum Foo { A = 5, B = 6, C = 7 }; - \\ enum Foo a = B; - \\ if (a != B) abort(); - \\ if (a != 6) abort(); - \\ } - \\ if (a != B) abort(); - \\ if (a != 1) abort(); - \\} - , ""); - - cases.add("Underscore identifiers", - \\#include - \\int _ = 10; - \\typedef struct { int _; } S; - \\int main(void) { - \\ if (_ != 10) abort(); - \\ S foo = { ._ = _ }; - \\ if (foo._ != _) abort(); - \\ return 0; - \\} - , ""); - - cases.add("__builtin_choose_expr (unchosen expression is not evaluated)", - \\#include - \\int main(void) { - \\ int x = 0.0; - \\ int y = 0.0; - \\ int res; - \\ res = __builtin_choose_expr(1, 1, x / y); - \\ if (res != 1) abort(); - \\ res = __builtin_choose_expr(0, x / y, 2); - \\ if (res != 2) abort(); - \\ return 0; - \\} - , ""); - - // TODO: add isnan check for long double once bitfield support is added - // (needed for x86_64-windows-gnu) - // TODO: add isinf check for long double once std.math.isInf supports c_longdouble - cases.add("NAN and INFINITY", - \\#include - \\#include - \\#include - \\union uf { uint32_t u; float f; }; - \\#define CHECK_NAN(STR, VAL) { \ - \\ union uf unpack = {.f = __builtin_nanf(STR)}; \ - \\ if (!isnan(unpack.f)) abort(); \ - \\ if (unpack.u != VAL) abort(); \ - \\} - \\int main(void) { - \\ float f_nan = NAN; - \\ if (!isnan(f_nan)) abort(); - \\ double d_nan = NAN; - \\ if (!isnan(d_nan)) abort(); - \\ CHECK_NAN("0", 0x7FC00000); - \\ CHECK_NAN("", 0x7FC00000); - \\ CHECK_NAN("1", 0x7FC00001); - \\ CHECK_NAN("0x7FC00000", 0x7FC00000); - \\ CHECK_NAN("0x7FC0000F", 0x7FC0000F); - \\ CHECK_NAN("0x7FC000F0", 0x7FC000F0); - \\ CHECK_NAN("0x7FC00F00", 0x7FC00F00); - \\ CHECK_NAN("0x7FC0F000", 0x7FC0F000); - \\ CHECK_NAN("0x7FCF0000", 0x7FCF0000); - \\ CHECK_NAN("0xFFFFFFFF", 0x7FFFFFFF); - \\ float f_inf = INFINITY; - \\ if (!isinf(f_inf)) abort(); - \\ double d_inf = INFINITY; - \\ if (!isinf(d_inf)) abort(); - \\ return 0; - \\} - , ""); - - cases.add("signed array subscript. Issue #8556", - \\#include - \\#include - \\#define TEST_NEGATIVE(type) { type x = -1; if (ptr[x] != 42) abort(); } - \\#define TEST_UNSIGNED(type) { type x = 2; if (arr[x] != 42) abort(); } - \\int main(void) { - \\ int arr[] = {40, 41, 42, 43}; - \\ int *ptr = arr + 3; - \\ if (ptr[-1] != 42) abort(); - \\ TEST_NEGATIVE(int); - \\ TEST_NEGATIVE(long); - \\ TEST_NEGATIVE(long long); - \\ TEST_NEGATIVE(int64_t); - \\ TEST_NEGATIVE(__int128); - \\ TEST_UNSIGNED(unsigned); - \\ TEST_UNSIGNED(unsigned long); - \\ TEST_UNSIGNED(unsigned long long); - \\ TEST_UNSIGNED(uint64_t); - \\ TEST_UNSIGNED(size_t); - \\ TEST_UNSIGNED(unsigned __int128); - \\ return 0; - \\} - , ""); - - cases.add("Ensure side-effects only evaluated once for signed array indices", - \\#include - \\int main(void) { - \\ int foo[] = {1, 2, 3, 4}; - \\ int *p = foo; - \\ int idx = 1; - \\ if ((++p)[--idx] != 2) abort(); - \\ if (p != foo + 1) abort(); - \\ if (idx != 0) abort(); - \\ if ((p++)[idx++] != 2) abort(); - \\ if (p != foo + 2) abort(); - \\ if (idx != 1) abort(); - \\ return 0; - \\} - , ""); - - cases.add("Allow non-const char* string literals. Issue #9126", - \\#include - \\int func(char *x) { return x[0]; } - \\struct S { char *member; }; - \\struct S global_struct = { .member = "global" }; - \\char *g = "global"; - \\int main(void) { - \\ if (g[0] != 'g') abort(); - \\ if (global_struct.member[0] != 'g') abort(); - \\ char *string = "hello"; - \\ if (string[0] != 'h') abort(); - \\ struct S s = {.member = "hello"}; - \\ if (s.member[0] != 'h') abort(); - \\ if (func("foo") != 'f') abort(); - \\ return 0; - \\} - , ""); - - cases.add("Ensure while loop under an if doesn't steal the else. Issue #9953", - \\#include - \\void doWork(int id) { } - \\int reallyDelete(int id) { printf("deleted %d\n", id); return 1; } - \\int process(int id, int n, int delete) { - \\ if(!delete) - \\ while(n-- > 0) doWork(id); - \\ else - \\ return reallyDelete(id); - \\ return 0; - \\} - \\int main(void) { - \\ process(99, 3, 0); - \\ return 0; - \\} - , ""); - - cases.add("Remainder operator with negative integers. Issue #10176", - \\#include - \\int main(void) { - \\ int denominator = -2; - \\ int numerator = 5; - \\ if (numerator % denominator != 1) abort(); - \\ numerator = -5; denominator = 2; - \\ if (numerator % denominator != -1) abort(); - \\ return 0; - \\} - , ""); - - cases.add("Boolean expression coerced to int. Issue #10175", - \\#include - \\int sign(int v) { - \\ return -(v < 0); - \\} - \\int main(void) { - \\ if (sign(-5) != -1) abort(); - \\ if (sign(5) != 0) abort(); - \\ if (sign(0) != 0) abort(); - \\ return 0; - \\} - , ""); - - cases.add("Typedef'ed void used as return type. Issue #10356", - \\typedef void V; - \\V foo(V *f) {} - \\int main(void) { - \\ int x = 0; - \\ foo(&x); - \\ return 0; - \\} - , ""); - - cases.add("Zero-initialization of global union. Issue #10797", - \\#include - \\union U { int x; double y; }; - \\union U u; - \\int main(void) { - \\ if (u.x != 0) abort(); - \\ return 0; - \\} - , ""); - - cases.add("Cast-to-union. Issue #10955", - \\#include - \\struct S { int x; }; - \\union U { - \\ long l; - \\ double d; - \\ struct S s; - \\}; - \\union U bar(union U u) { return u; } - \\int main(void) { - \\ union U u = (union U) 42L; - \\ if (u.l != 42L) abort(); - \\ u = (union U) 2.0; - \\ if (u.d != 2.0) abort(); - \\ u = bar((union U)4.0); - \\ if (u.d != 4.0) abort(); - \\ u = (union U)(struct S){ .x = 5 }; - \\ if (u.s.x != 5) abort(); - \\ return 0; - \\} - , ""); - - cases.add("Nested comma operator in macro. Issue #11040", - \\#include - \\#define FOO (1, (2, 3)) - \\int main(void) { - \\ int x = FOO; - \\ if (x != 3) abort(); - \\ return 0; - \\} - , ""); - - // The C standard does not require function pointers to be convertible to any integer type. - // However, POSIX requires that function pointers have the same representation as `void *` - // so that dlsym() can work - cases.add("Function to integral", - \\#include - \\int main(void) { - \\#if defined(__UINTPTR_MAX__) && __has_include() - \\ uintptr_t x = (uintptr_t)main; - \\#endif - \\ return 0; - \\} - , ""); - - cases.add("Closure over local in typeof", - \\#include - \\int main(void) { - \\ int x = 123; - \\ union { typeof(x) val; } u = { x }; - \\ if (u.val != 123) abort(); - \\ return 0; - \\} - , ""); - - cases.add("struct without global declaration does not conflict with local variable name", - \\#include - \\static void foo(struct foobar *unused) {} - \\int main(void) { - \\ int struct_foobar = 123; - \\ if (struct_foobar != 123) abort(); - \\ int foobar = 456; - \\ if (foobar != 456) abort(); - \\ return 0; - \\} - , ""); - - cases.add("struct without global declaration does not conflict with global variable name", - \\#include - \\static void foo(struct foobar *unused) {} - \\static int struct_foobar = 123; - \\static int foobar = 456; - \\int main(void) { - \\ if (struct_foobar != 123) abort(); - \\ if (foobar != 456) abort(); - \\ return 0; - \\} - , ""); -} diff --git a/test/src/Cases.zig b/test/src/Cases.zig index 18bca9841ed7..7298c8858d1d 100644 --- a/test/src/Cases.zig +++ b/test/src/Cases.zig @@ -9,7 +9,6 @@ const ArrayList = std.ArrayList; gpa: Allocator, arena: Allocator, cases: std.array_list.Managed(Case), -translate: std.array_list.Managed(Translate), pub const IncrementalCase = struct { base_path: []const u8, @@ -126,25 +125,6 @@ pub const Case = struct { } }; -pub const Translate = struct { - /// The name of the test case. This is shown if a test fails, and - /// otherwise ignored. - name: []const u8, - - input: [:0]const u8, - target: std.Build.ResolvedTarget, - link_libc: bool, - c_frontend: CFrontend, - kind: union(enum) { - /// Translate the input, run it and check that it - /// outputs the expected text. - run: []const u8, - /// Translate the input and check that it contains - /// the expected lines of code. - translate: []const []const u8, - }, -}; - pub fn addExe( ctx: *Cases, name: []const u8, @@ -393,7 +373,6 @@ fn addFromDirInner( const backends = try manifest.getConfigForKeyAlloc(ctx.arena, "backend", Backend); const targets = try manifest.getConfigForKeyAlloc(ctx.arena, "target", std.Target.Query); - const c_frontends = try manifest.getConfigForKeyAlloc(ctx.arena, "c_frontend", CFrontend); const is_test = try manifest.getConfigForKeyAssertSingle("is_test", bool); const link_libc = try manifest.getConfigForKeyAssertSingle("link_libc", bool); const output_mode = try manifest.getConfigForKeyAssertSingle("output_mode", std.builtin.OutputMode); @@ -403,39 +382,6 @@ fn addFromDirInner( const emit_bin = try manifest.getConfigForKeyAssertSingle("emit_bin", bool); const imports = try manifest.getConfigForKeyAlloc(ctx.arena, "imports", []const u8); - if (manifest.type == .translate_c) { - for (c_frontends) |c_frontend| { - for (targets) |target_query| { - const output = try manifest.trailingLinesSplit(ctx.arena); - try ctx.translate.append(.{ - .name = try caseNameFromPath(ctx.arena, filename), - .c_frontend = c_frontend, - .target = b.resolveTargetQuery(target_query), - .link_libc = link_libc, - .input = src, - .kind = .{ .translate = output }, - }); - } - } - continue; - } - if (manifest.type == .run_translated_c) { - for (c_frontends) |c_frontend| { - for (targets) |target_query| { - const output = try manifest.trailingSplit(ctx.arena); - try ctx.translate.append(.{ - .name = try caseNameFromPath(ctx.arena, filename), - .c_frontend = c_frontend, - .target = b.resolveTargetQuery(target_query), - .link_libc = link_libc, - .input = src, - .kind = .{ .run = output }, - }); - } - } - continue; - } - var cases = std.array_list.Managed(usize).init(ctx.arena); // Cross-product to get all possible test combinations @@ -503,101 +449,11 @@ fn addFromDirInner( pub fn init(gpa: Allocator, arena: Allocator) Cases { return .{ .gpa = gpa, - .cases = std.array_list.Managed(Case).init(gpa), - .translate = std.array_list.Managed(Translate).init(gpa), + .cases = .init(gpa), .arena = arena, }; } -pub const TranslateCOptions = struct { - skip_translate_c: bool = false, - skip_run_translated_c: bool = false, -}; -pub fn lowerToTranslateCSteps( - self: *Cases, - b: *std.Build, - parent_step: *std.Build.Step, - test_filters: []const []const u8, - test_target_filters: []const []const u8, - target: std.Build.ResolvedTarget, - translate_c_options: TranslateCOptions, -) void { - const tests = @import("../tests.zig"); - const test_translate_c_step = b.step("test-translate-c", "Run the C translation tests"); - if (!translate_c_options.skip_translate_c) { - tests.addTranslateCTests(b, test_translate_c_step, test_filters, test_target_filters); - parent_step.dependOn(test_translate_c_step); - } - - const test_run_translated_c_step = b.step("test-run-translated-c", "Run the Run-Translated-C tests"); - if (!translate_c_options.skip_run_translated_c) { - tests.addRunTranslatedCTests(b, test_run_translated_c_step, test_filters, target); - parent_step.dependOn(test_run_translated_c_step); - } - - for (self.translate.items) |case| switch (case.kind) { - .run => |output| { - if (translate_c_options.skip_run_translated_c) continue; - const annotated_case_name = b.fmt("run-translated-c {s}", .{case.name}); - for (test_filters) |test_filter| { - if (std.mem.indexOf(u8, annotated_case_name, test_filter)) |_| break; - } else if (test_filters.len > 0) continue; - if (!std.process.can_spawn) { - std.debug.print("Unable to spawn child processes on {s}, skipping test.\n", .{@tagName(builtin.os.tag)}); - continue; // Pass test. - } - - const write_src = b.addWriteFiles(); - const file_source = write_src.add("tmp.c", case.input); - - const translate_c = b.addTranslateC(.{ - .root_source_file = file_source, - .optimize = .Debug, - .target = case.target, - .link_libc = case.link_libc, - .use_clang = case.c_frontend == .clang, - }); - translate_c.step.name = b.fmt("{s} translate-c", .{annotated_case_name}); - - const run_exe = b.addExecutable(.{ - .name = "translated_c", - .root_module = translate_c.createModule(), - }); - run_exe.step.name = b.fmt("{s} build-exe", .{annotated_case_name}); - run_exe.root_module.link_libc = true; - const run = b.addRunArtifact(run_exe); - run.step.name = b.fmt("{s} run", .{annotated_case_name}); - run.expectStdOutEqual(output); - run.skip_foreign_checks = true; - - test_run_translated_c_step.dependOn(&run.step); - }, - .translate => |output| { - if (translate_c_options.skip_translate_c) continue; - const annotated_case_name = b.fmt("zig translate-c {s}", .{case.name}); - for (test_filters) |test_filter| { - if (std.mem.indexOf(u8, annotated_case_name, test_filter)) |_| break; - } else if (test_filters.len > 0) continue; - - const write_src = b.addWriteFiles(); - const file_source = write_src.add("tmp.c", case.input); - - const translate_c = b.addTranslateC(.{ - .root_source_file = file_source, - .optimize = .Debug, - .target = case.target, - .link_libc = case.link_libc, - .use_clang = case.c_frontend == .clang, - }); - translate_c.step.name = b.fmt("{s} translate-c", .{annotated_case_name}); - - const check_file = translate_c.addCheckFile(output); - check_file.step.name = b.fmt("{s} CheckFile", .{annotated_case_name}); - test_translate_c_step.dependOn(&check_file.step); - }, - }; -} - pub const CaseTestOptions = struct { test_filters: []const []const u8, test_target_filters: []const []const u8, diff --git a/test/tests.zig b/test/tests.zig index 1e5db67f07ca..8888ba325a3b 100644 --- a/test/tests.zig +++ b/test/tests.zig @@ -9,13 +9,9 @@ const Step = std.Build.Step; const compare_output = @import("compare_output.zig"); const stack_traces = @import("stack_traces.zig"); const assemble_and_link = @import("assemble_and_link.zig"); -const translate_c = @import("translate_c.zig"); -const run_translated_c = @import("run_translated_c.zig"); const llvm_ir = @import("llvm_ir.zig"); // Implementations -pub const TranslateCContext = @import("src/TranslateC.zig"); -pub const RunTranslatedCContext = @import("src/RunTranslatedC.zig"); pub const CompareOutputContext = @import("src/CompareOutput.zig"); pub const StackTracesContext = @import("src/StackTrace.zig"); pub const DebuggerContext = @import("src/Debugger.zig"); @@ -2193,42 +2189,6 @@ pub fn addAssembleAndLinkTests(b: *std.Build, test_filters: []const []const u8, return cases.step; } -pub fn addTranslateCTests( - b: *std.Build, - parent_step: *std.Build.Step, - test_filters: []const []const u8, - test_target_filters: []const []const u8, -) void { - const cases = b.allocator.create(TranslateCContext) catch @panic("OOM"); - cases.* = TranslateCContext{ - .b = b, - .step = parent_step, - .test_index = 0, - .test_filters = test_filters, - .test_target_filters = test_target_filters, - }; - - translate_c.addCases(cases); -} - -pub fn addRunTranslatedCTests( - b: *std.Build, - parent_step: *std.Build.Step, - test_filters: []const []const u8, - target: std.Build.ResolvedTarget, -) void { - const cases = b.allocator.create(RunTranslatedCContext) catch @panic("OOM"); - cases.* = .{ - .b = b, - .step = parent_step, - .test_index = 0, - .test_filters = test_filters, - .target = target, - }; - - run_translated_c.addCases(cases); -} - const ModuleTestOptions = struct { test_filters: []const []const u8, test_target_filters: []const []const u8, @@ -2592,9 +2552,7 @@ pub fn addCAbiTests(b: *std.Build, options: CAbiTestOptions) *Step { pub fn addCases( b: *std.Build, parent_step: *Step, - target: std.Build.ResolvedTarget, case_test_options: @import("src/Cases.zig").CaseTestOptions, - translate_c_options: @import("src/Cases.zig").TranslateCOptions, build_options: @import("cases.zig").BuildOptions, ) !void { const arena = b.allocator; @@ -2608,15 +2566,6 @@ pub fn addCases( cases.addFromDir(dir, b); try @import("cases.zig").addCases(&cases, build_options, b); - cases.lowerToTranslateCSteps( - b, - parent_step, - case_test_options.test_filters, - case_test_options.test_target_filters, - target, - translate_c_options, - ); - cases.lowerToBuildSteps( b, parent_step, diff --git a/test/translate_c.zig b/test/translate_c.zig deleted file mode 100644 index 6d1a8916f287..000000000000 --- a/test/translate_c.zig +++ /dev/null @@ -1,3923 +0,0 @@ -const std = @import("std"); -const builtin = @import("builtin"); -const tests = @import("tests.zig"); - -// ******************************************************** -// * * -// * DO NOT ADD NEW CASES HERE * -// * instead add a file to test/cases/translate_c * -// * * -// ******************************************************** - -pub fn addCases(cases: *tests.TranslateCContext) void { - const default_enum_type = if (builtin.abi == .msvc) "c_int" else "c_uint"; - - cases.add("do while with breaks", - \\void foo(int a) { - \\ do { - \\ if (a) break; - \\ } while (4); - \\ do { - \\ if (a) break; - \\ } while (0); - \\ do { - \\ if (a) break; - \\ } while (a); - \\ do { - \\ break; - \\ } while (3); - \\ do { - \\ break; - \\ } while (0); - \\ do { - \\ break; - \\ } while (a); - \\} - , &[_][]const u8{ - \\pub export fn foo(arg_a: c_int) void { - \\ var a = arg_a; - \\ _ = &a; - \\ while (true) { - \\ if (a != 0) break; - \\ } - \\ while (true) { - \\ if (a != 0) break; - \\ if (!false) break; - \\ } - \\ while (true) { - \\ if (a != 0) break; - \\ if (!(a != 0)) break; - \\ } - \\ while (true) { - \\ break; - \\ } - \\ while (true) { - \\ break; - \\ } - \\ while (true) { - \\ break; - \\ } - \\} - }); - - cases.add("variables check for opaque demotion", - \\struct A { - \\ _Atomic int a; - \\} a; - \\int main(void) { - \\ struct A a; - \\} - , &[_][]const u8{ - \\pub const struct_A = opaque {}; - \\pub const a = @compileError("non-extern variable has opaque type"); - , - \\pub extern fn main() c_int; - }); - - cases.add("unnamed child types of typedef receive typedef's name", - \\typedef enum { - \\ FooA, - \\ FooB, - \\} Foo; - \\typedef struct { - \\ int a, b; - \\} Bar; - , &[_][]const u8{ - \\pub const FooA: c_int = 0; - \\pub const FooB: c_int = 1; - \\pub const Foo = - ++ " " ++ default_enum_type ++ - \\; - \\pub const Bar = extern struct { - \\ a: c_int = @import("std").mem.zeroes(c_int), - \\ b: c_int = @import("std").mem.zeroes(c_int), - \\}; - }); - - cases.add("if as while stmt has semicolon", - \\void foo() { - \\ while (1) if (1) { - \\ int a = 1; - \\ } else { - \\ int b = 2; - \\ } - \\ if (1) if (1) {} - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ while (true) if (true) { - \\ var a: c_int = 1; - \\ _ = &a; - \\ } else { - \\ var b: c_int = 2; - \\ _ = &b; - \\ }; - \\ if (true) if (true) {}; - \\} - }); - - cases.add("conditional operator cast to void", - \\int bar(); - \\void foo() { - \\ int a; - \\ a ? a = 2 : bar(); - \\} - , &[_][]const u8{ - \\pub extern fn bar(...) c_int; - \\pub export fn foo() void { - \\ var a: c_int = undefined; - \\ _ = &a; - \\ if (a != 0) a = 2 else _ = bar(); - \\} - }); - - cases.add("scoped typedef", - \\void foo() { - \\ typedef union { - \\ int A; - \\ int B; - \\ int C; - \\ } Foo; - \\ Foo a = {0}; - \\ { - \\ typedef union { - \\ int A; - \\ int B; - \\ int C; - \\ } Foo; - \\ Foo a = {0}; - \\ } - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ const union_unnamed_1 = extern union { - \\ A: c_int, - \\ B: c_int, - \\ C: c_int, - \\ }; - \\ _ = &union_unnamed_1; - \\ const Foo = union_unnamed_1; - \\ _ = &Foo; - \\ var a: Foo = Foo{ - \\ .A = @as(c_int, 0), - \\ }; - \\ _ = &a; - \\ { - \\ const union_unnamed_2 = extern union { - \\ A: c_int, - \\ B: c_int, - \\ C: c_int, - \\ }; - \\ _ = &union_unnamed_2; - \\ const Foo_1 = union_unnamed_2; - \\ _ = &Foo_1; - \\ var a_2: Foo_1 = Foo_1{ - \\ .A = @as(c_int, 0), - \\ }; - \\ _ = &a_2; - \\ } - \\} - }); - - cases.add("use cast param as macro fn return type", - \\#include - \\#define SYS_BASE_CACHED 0 - \\#define MEM_PHYSICAL_TO_K0(x) (void*)((uint32_t)(x) + SYS_BASE_CACHED) - , &[_][]const u8{ - \\pub inline fn MEM_PHYSICAL_TO_K0(x: anytype) ?*anyopaque { - \\ _ = &x; - \\ return @import("std").zig.c_translation.cast(?*anyopaque, @import("std").zig.c_translation.cast(u32, x) + SYS_BASE_CACHED); - \\} - }); - - cases.add("variadic function demoted to extern", - \\int foo(int bar, ...) { - \\ return 1; - \\} - , &[_][]const u8{ - \\warning: TODO unable to translate variadic function, demoted to extern - \\pub extern fn foo(bar: c_int, ...) c_int; - }); - - cases.add("pointer to opaque demoted struct", - \\typedef struct { - \\ _Atomic int foo; - \\} Foo; - \\ - \\typedef struct { - \\ Foo *bar; - \\} Bar; - , &[_][]const u8{ - \\source.h:1:9: warning: struct demoted to opaque type - unable to translate type of field foo - \\pub const Foo = opaque {}; - \\pub const Bar = extern struct { - \\ bar: ?*Foo = @import("std").mem.zeroes(?*Foo), - \\}; - }); - - cases.add("macro expressions respect C operator precedence", - \\int *foo = 0; - \\#define FOO *((foo) + 2) - \\#define VALUE (1 + 2 * 3 + 4 * 5 + 6 << 7 | 8 == 9) - \\#define _AL_READ3BYTES(p) ((*(unsigned char *)(p)) \ - \\ | (*((unsigned char *)(p) + 1) << 8) \ - \\ | (*((unsigned char *)(p) + 2) << 16)) - , &[_][]const u8{ - \\pub inline fn FOO() @TypeOf((foo + @as(c_int, 2)).*) { - \\ return (foo + @as(c_int, 2)).*; - \\} - , - \\pub const VALUE = ((((@as(c_int, 1) + (@as(c_int, 2) * @as(c_int, 3))) + (@as(c_int, 4) * @as(c_int, 5))) + @as(c_int, 6)) << @as(c_int, 7)) | @intFromBool(@as(c_int, 8) == @as(c_int, 9)); - , - \\pub inline fn _AL_READ3BYTES(p: anytype) @TypeOf((@import("std").zig.c_translation.cast([*c]u8, p).* | ((@import("std").zig.c_translation.cast([*c]u8, p) + @as(c_int, 1)).* << @as(c_int, 8))) | ((@import("std").zig.c_translation.cast([*c]u8, p) + @as(c_int, 2)).* << @as(c_int, 16))) { - \\ _ = &p; - \\ return (@import("std").zig.c_translation.cast([*c]u8, p).* | ((@import("std").zig.c_translation.cast([*c]u8, p) + @as(c_int, 1)).* << @as(c_int, 8))) | ((@import("std").zig.c_translation.cast([*c]u8, p) + @as(c_int, 2)).* << @as(c_int, 16)); - \\} - }); - - cases.add("static variable in block scope", - \\float bar; - \\int foo() { - \\ _Thread_local static int bar = 2; - \\} - , &[_][]const u8{ - \\pub export var bar: f32 = @import("std").mem.zeroes(f32); - \\pub export fn foo() c_int { - \\ const bar_1 = struct { - \\ threadlocal var static: c_int = 2; - \\ }; - \\ _ = &bar_1; - \\ return 0; - \\} - }); - - cases.add("missing return stmt", - \\int foo() {} - \\int bar() { - \\ int a = 2; - \\} - \\int baz() { - \\ return 0; - \\} - , &[_][]const u8{ - \\pub export fn foo() c_int { - \\ return 0; - \\} - \\pub export fn bar() c_int { - \\ var a: c_int = 2; - \\ _ = &a; - \\ return 0; - \\} - \\pub export fn baz() c_int { - \\ return 0; - \\} - }); - - cases.add("alignof", - \\void main() { - \\ int a = _Alignof(int); - \\} - , &[_][]const u8{ - \\pub export fn main() void { - \\ var a: c_int = @as(c_int, @bitCast(@as(c_uint, @truncate(@alignOf(c_int))))); - \\ _ = &a; - \\} - }); - - cases.add("initializer list macro", - \\typedef struct Color { - \\ unsigned char r; - \\ unsigned char g; - \\ unsigned char b; - \\ unsigned char a; - \\} Color; - \\#define CLITERAL(type) (type) - \\#define LIGHTGRAY CLITERAL(Color){ 200, 200, 200, 255 } // Light Gray - \\typedef struct boom_t - \\{ - \\ int i1; - \\} boom_t; - \\#define FOO ((boom_t){1}) - \\typedef struct { float x; } MyCStruct; - \\#define A(_x) (MyCStruct) { .x = (_x) } - \\#define B A(0.f) - , &[_][]const u8{ - \\pub const struct_Color = extern struct { - \\ r: u8 = @import("std").mem.zeroes(u8), - \\ g: u8 = @import("std").mem.zeroes(u8), - \\ b: u8 = @import("std").mem.zeroes(u8), - \\ a: u8 = @import("std").mem.zeroes(u8), - \\}; - \\pub const Color = struct_Color; - , - \\pub inline fn CLITERAL(@"type": anytype) @TypeOf(@"type") { - \\ _ = &@"type"; - \\ return @"type"; - \\} - , - \\pub const LIGHTGRAY = @import("std").mem.zeroInit(CLITERAL(Color), .{ @as(c_int, 200), @as(c_int, 200), @as(c_int, 200), @as(c_int, 255) }); - , - \\pub const struct_boom_t = extern struct { - \\ i1: c_int = @import("std").mem.zeroes(c_int), - \\}; - \\pub const boom_t = struct_boom_t; - , - \\pub const FOO = @import("std").mem.zeroInit(boom_t, .{@as(c_int, 1)}); - , - \\pub const MyCStruct = extern struct { - \\ x: f32 = @import("std").mem.zeroes(f32), - \\}; - , - \\pub inline fn A(_x: anytype) MyCStruct { - \\ _ = &_x; - \\ return @import("std").mem.zeroInit(MyCStruct, .{ - \\ .x = _x, - \\ }); - \\} - , - \\pub const B = A(@as(f32, 0)); - }); - - cases.add("complex switch", - \\int main() { - \\ int i = 2; - \\ switch (i) { - \\ case 0: { - \\ case 2:{ - \\ i += 2;} - \\ i += 1; - \\ } - \\ } - \\} - , &[_][]const u8{ // TODO properly translate this - \\source.h:5:13: warning: TODO complex switch - , - \\source.h:1:5: warning: unable to translate function, demoted to extern - \\pub extern fn main() c_int; - }); - - cases.add("correct semicolon after infixop", - \\#define _IO_ERR_SEEN 0 - \\#define __ferror_unlocked_body(_fp) (((_fp)->_flags & _IO_ERR_SEEN) != 0) - , &[_][]const u8{ - \\pub inline fn __ferror_unlocked_body(_fp: anytype) @TypeOf((_fp.*._flags & _IO_ERR_SEEN) != @as(c_int, 0)) { - \\ _ = &_fp; - \\ return (_fp.*._flags & _IO_ERR_SEEN) != @as(c_int, 0); - \\} - }); - - cases.add("c booleans are just ints", - \\#define FOO(x) ((x >= 0) + (x >= 0)) - \\#define BAR 1 && 2 > 4 - , &[_][]const u8{ - \\pub inline fn FOO(x: anytype) @TypeOf(@intFromBool(x >= @as(c_int, 0)) + @intFromBool(x >= @as(c_int, 0))) { - \\ _ = &x; - \\ return @intFromBool(x >= @as(c_int, 0)) + @intFromBool(x >= @as(c_int, 0)); - \\} - , - \\pub const BAR = (@as(c_int, 1) != 0) and (@as(c_int, 2) > @as(c_int, 4)); - }); - - cases.add("struct with flexible array", - \\struct foo { int x; int y[]; }; - \\struct bar { int x; int y[0]; }; - , &[_][]const u8{ - \\pub const struct_foo = extern struct { - \\ x: c_int align(4) = @import("std").mem.zeroes(c_int), - \\ pub fn y(self: anytype) @import("std").zig.c_translation.FlexibleArrayType(@TypeOf(self), c_int) { - \\ const Intermediate = @import("std").zig.c_translation.FlexibleArrayType(@TypeOf(self), u8); - \\ const ReturnType = @import("std").zig.c_translation.FlexibleArrayType(@TypeOf(self), c_int); - \\ return @as(ReturnType, @ptrCast(@alignCast(@as(Intermediate, @ptrCast(self)) + 4))); - \\ } - \\}; - \\pub const struct_bar = extern struct { - \\ x: c_int align(4) = @import("std").mem.zeroes(c_int), - \\ pub fn y(self: anytype) @import("std").zig.c_translation.FlexibleArrayType(@TypeOf(self), c_int) { - \\ const Intermediate = @import("std").zig.c_translation.FlexibleArrayType(@TypeOf(self), u8); - \\ const ReturnType = @import("std").zig.c_translation.FlexibleArrayType(@TypeOf(self), c_int); - \\ return @as(ReturnType, @ptrCast(@alignCast(@as(Intermediate, @ptrCast(self)) + 4))); - \\ } - \\}; - }); - - cases.add("nested loops without blocks", - \\void foo() { - \\ while (0) while (0) {} - \\ for (;;) while (0); - \\ for (;;) do {} while (0); - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ while (false) while (false) {}; - \\ while (true) while (false) {}; - \\ while (true) while (true) { - \\ if (!false) break; - \\ }; - \\} - }); - - cases.add("macro comma operator", - \\#define foo (foo, bar) - \\int baz(int x, int y) { return 0; } - \\#define bar(x) (&x, +3, 4 == 4, 5 * 6, baz(1, 2), 2 % 2, baz(1,2)) - , &[_][]const u8{ - \\pub const foo = blk_1: { - \\ _ = &foo; - \\ break :blk_1 bar; - \\}; - , - \\pub inline fn bar(x: anytype) @TypeOf(baz(@as(c_int, 1), @as(c_int, 2))) { - \\ _ = &x; - \\ return blk_1: { - \\ _ = &x; - \\ _ = @as(c_int, 3); - \\ _ = @as(c_int, 4) == @as(c_int, 4); - \\ _ = @as(c_int, 5) * @as(c_int, 6); - \\ _ = baz(@as(c_int, 1), @as(c_int, 2)); - \\ _ = @import("std").zig.c_translation.MacroArithmetic.rem(@as(c_int, 2), @as(c_int, 2)); - \\ break :blk_1 baz(@as(c_int, 1), @as(c_int, 2)); - \\ }; - \\} - }); - - cases.add("macro keyword define", - \\#define foo 1 - \\#define inline 2 - , &[_][]const u8{ - \\pub const foo = @as(c_int, 1); - , - \\pub const @"inline" = @as(c_int, 2); - }); - - cases.add("macro line continuation", - \\int BAR = 0; - \\#define FOO -\ - \\BAR - , &[_][]const u8{ - \\pub inline fn FOO() @TypeOf(-BAR) { - \\ return -BAR; - \\} - }); - - cases.add("struct with atomic field", - \\struct arcan_shmif_cont { - \\ struct arcan_shmif_page* addr; - \\}; - \\struct arcan_shmif_page { - \\ volatile _Atomic int abufused[12]; - \\}; - , &[_][]const u8{ - \\source.h:4:8: warning: struct demoted to opaque type - unable to translate type of field abufused - \\pub const struct_arcan_shmif_page = opaque {}; - \\pub const struct_arcan_shmif_cont = extern struct { - \\ addr: ?*struct_arcan_shmif_page = @import("std").mem.zeroes(?*struct_arcan_shmif_page), - \\}; - }); - - cases.add("function prototype translated as optional", - \\typedef void (*fnptr_ty)(void); - \\typedef __attribute__((cdecl)) void (*fnptr_attr_ty)(void); - \\struct foo { - \\ __attribute__((cdecl)) void (*foo)(void); - \\ void (*bar)(void); - \\ fnptr_ty baz; - \\ fnptr_attr_ty qux; - \\}; - , &[_][]const u8{ - \\pub const fnptr_ty = ?*const fn () callconv(.c) void; - \\pub const fnptr_attr_ty = ?*const fn () callconv(.c) void; - \\pub const struct_foo = extern struct { - \\ foo: ?*const fn () callconv(.c) void = @import("std").mem.zeroes(?*const fn () callconv(.c) void), - \\ bar: ?*const fn () callconv(.c) void = @import("std").mem.zeroes(?*const fn () callconv(.c) void), - \\ baz: fnptr_ty = @import("std").mem.zeroes(fnptr_ty), - \\ qux: fnptr_attr_ty = @import("std").mem.zeroes(fnptr_attr_ty), - \\}; - }); - - cases.add("array initializer w/ typedef", - \\typedef unsigned char uuid_t[16]; - \\static const uuid_t UUID_NULL __attribute__ ((unused)) = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - , &[_][]const u8{ - \\pub const uuid_t = [16]u8; - \\pub const UUID_NULL: uuid_t = [16]u8{ - \\ 0, - \\ 0, - \\ 0, - \\ 0, - \\ 0, - \\ 0, - \\ 0, - \\ 0, - \\ 0, - \\ 0, - \\ 0, - \\ 0, - \\ 0, - \\ 0, - \\ 0, - \\ 0, - \\}; - }); - - cases.add("#define hex literal with capital X", - \\#define VAL 0XF00D - , &[_][]const u8{ - \\pub const VAL = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0xF00D, .hex); - }); - - cases.add("anonymous struct & unions", - \\typedef struct { - \\ union { - \\ char x; - \\ struct { int y; }; - \\ }; - \\} outer; - \\void foo(outer *x) { x->y = x->x; } - , &[_][]const u8{ - \\const struct_unnamed_2 = extern struct { - \\ y: c_int = @import("std").mem.zeroes(c_int), - \\}; - \\const union_unnamed_1 = extern union { - \\ x: u8, - \\ unnamed_0: struct_unnamed_2, - \\}; - \\pub const outer = extern struct { - \\ unnamed_0: union_unnamed_1 = @import("std").mem.zeroes(union_unnamed_1), - \\}; - \\pub export fn foo(arg_x: [*c]outer) void { - \\ var x = arg_x; - \\ _ = &x; - \\ x.*.unnamed_0.unnamed_0.y = @as(c_int, @bitCast(@as(c_uint, x.*.unnamed_0.x))); - \\} - }); - - cases.add("struct initializer - simple", - \\typedef struct { int x; } foo; - \\struct {double x,y,z;} s0 = {1.2, 1.3}; - \\struct {int sec,min,hour,day,mon,year;} s1 = {.day=31,12,2014,.sec=30,15,17}; - \\struct {int x,y;} s2 = {.y = 2, .x=1}; - \\foo s3 = { 123 }; - , &[_][]const u8{ - \\pub const foo = extern struct { - \\ x: c_int = @import("std").mem.zeroes(c_int), - \\}; - \\const struct_unnamed_1 = extern struct { - \\ x: f64 = @import("std").mem.zeroes(f64), - \\ y: f64 = @import("std").mem.zeroes(f64), - \\ z: f64 = @import("std").mem.zeroes(f64), - \\}; - \\pub export var s0: struct_unnamed_1 = struct_unnamed_1{ - \\ .x = 1.2, - \\ .y = 1.3, - \\ .z = 0, - \\}; - \\const struct_unnamed_2 = extern struct { - \\ sec: c_int = @import("std").mem.zeroes(c_int), - \\ min: c_int = @import("std").mem.zeroes(c_int), - \\ hour: c_int = @import("std").mem.zeroes(c_int), - \\ day: c_int = @import("std").mem.zeroes(c_int), - \\ mon: c_int = @import("std").mem.zeroes(c_int), - \\ year: c_int = @import("std").mem.zeroes(c_int), - \\}; - \\pub export var s1: struct_unnamed_2 = struct_unnamed_2{ - \\ .sec = @as(c_int, 30), - \\ .min = @as(c_int, 15), - \\ .hour = @as(c_int, 17), - \\ .day = @as(c_int, 31), - \\ .mon = @as(c_int, 12), - \\ .year = @as(c_int, 2014), - \\}; - \\const struct_unnamed_3 = extern struct { - \\ x: c_int = @import("std").mem.zeroes(c_int), - \\ y: c_int = @import("std").mem.zeroes(c_int), - \\}; - \\pub export var s2: struct_unnamed_3 = struct_unnamed_3{ - \\ .x = @as(c_int, 1), - \\ .y = @as(c_int, 2), - \\}; - \\pub export var s3: foo = foo{ - \\ .x = @as(c_int, 123), - \\}; - }); - - cases.add("simple ptrCast for casts between opaque types", - \\struct opaque; - \\struct opaque_2; - \\void function(struct opaque *opaque) { - \\ struct opaque_2 *cast = (struct opaque_2 *)opaque; - \\} - , &[_][]const u8{ - \\pub const struct_opaque = opaque {}; - \\pub const struct_opaque_2 = opaque {}; - \\pub export fn function(arg_opaque_1: ?*struct_opaque) void { - \\ var opaque_1 = arg_opaque_1; - \\ _ = &opaque_1; - \\ var cast: ?*struct_opaque_2 = @as(?*struct_opaque_2, @ptrCast(opaque_1)); - \\ _ = &cast; - \\} - }); - - cases.add("struct initializer - packed", - \\struct {int x,y,z;} __attribute__((packed)) s0 = {1, 2}; - , &[_][]const u8{ - \\const struct_unnamed_1 = extern struct { - \\ x: c_int align(1) = @import("std").mem.zeroes(c_int), - \\ y: c_int align(1) = @import("std").mem.zeroes(c_int), - \\ z: c_int align(1) = @import("std").mem.zeroes(c_int), - \\}; - \\pub export var s0: struct_unnamed_1 = struct_unnamed_1{ - \\ .x = @as(c_int, 1), - \\ .y = @as(c_int, 2), - \\ .z = 0, - \\}; - }); - - cases.add("linksection() attribute", - \\// Use the "segment,section" format to make this test pass when - \\// targeting the mach-o binary format - \\__attribute__ ((__section__("NEAR,.data"))) - \\extern char my_array[16]; - \\__attribute__ ((__section__("NEAR,.data"))) - \\void my_fn(void) { } - , &[_][]const u8{ - \\pub extern var my_array: [16]u8 linksection("NEAR,.data"); - \\pub export fn my_fn() linksection("NEAR,.data") void {} - }); - - cases.add("simple var decls", - \\void foo(void) { - \\ int a; - \\ char b = 123; - \\ const int c; - \\ const unsigned d = 440; - \\ int e = 10; - \\ unsigned int f = 10u; - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ var a: c_int = undefined; - \\ _ = &a; - \\ var b: u8 = 123; - \\ _ = &b; - \\ const c: c_int = undefined; - \\ _ = &c; - \\ const d: c_uint = @as(c_uint, @bitCast(@as(c_int, 440))); - \\ _ = &d; - \\ var e: c_int = 10; - \\ _ = &e; - \\ var f: c_uint = 10; - \\ _ = &f; - \\} - }); - - cases.add("ignore result, explicit function arguments", - \\void foo(void) { - \\ int a; - \\ 1; - \\ "hey"; - \\ 1 + 1; - \\ 1 - 1; - \\ a = 1; - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ var a: c_int = undefined; - \\ _ = &a; - \\ _ = @as(c_int, 1); - \\ _ = "hey"; - \\ _ = @as(c_int, 1) + @as(c_int, 1); - \\ _ = @as(c_int, 1) - @as(c_int, 1); - \\ a = 1; - \\} - }); - - cases.add("function with no prototype", - \\int foo() { - \\ return 5; - \\} - , &[_][]const u8{ - \\pub export fn foo() c_int { - \\ return 5; - \\} - }); - - cases.add("variables", - \\extern int extern_var; - \\static const int int_var = 13; - \\int foo; - , &[_][]const u8{ - \\pub extern var extern_var: c_int; - \\pub const int_var: c_int = 13; - \\pub export var foo: c_int = @import("std").mem.zeroes(c_int); - }); - - cases.add("const ptr initializer", - \\static const char *v0 = "0.0.0"; - , &[_][]const u8{ - \\pub var v0: [*c]const u8 = "0.0.0"; - }); - - cases.add("static incomplete array inside function", - \\void foo(void) { - \\ static const char v2[] = "2.2.2"; - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ const v2 = struct { - \\ const static: [5:0]u8 = "2.2.2".*; - \\ }; - \\ _ = &v2; - \\} - }); - - cases.add("simple function definition", - \\void foo(void) {} - \\static void bar(void) {} - , &[_][]const u8{ - \\pub export fn foo() void {} - \\pub fn bar() callconv(.c) void {} - }); - - cases.add("typedef void", - \\typedef void Foo; - \\Foo fun(Foo *a); - , &[_][]const u8{ - \\pub const Foo = anyopaque; - , - \\pub extern fn fun(a: ?*Foo) void; - }); - - cases.add("duplicate typedef", - \\typedef long foo; - \\typedef int bar; - \\typedef long foo; - \\typedef int baz; - , &[_][]const u8{ - \\pub const foo = c_long; - \\pub const bar = c_int; - \\pub const baz = c_int; - }); - - cases.add("casting pointers to ints and ints to pointers", - \\void foo(void); - \\void bar(void) { - \\ void *func_ptr = foo; - \\ void (*typed_func_ptr)(void) = (void (*)(void)) (unsigned long) func_ptr; - \\} - , &[_][]const u8{ - \\pub extern fn foo() void; - \\pub export fn bar() void { - \\ var func_ptr: ?*anyopaque = @as(?*anyopaque, @ptrCast(&foo)); - \\ _ = &func_ptr; - \\ var typed_func_ptr: ?*const fn () callconv(.c) void = @as(?*const fn () callconv(.c) void, @ptrFromInt(@as(c_ulong, @intCast(@intFromPtr(func_ptr))))); - \\ _ = &typed_func_ptr; - \\} - }); - - cases.add("always_inline attribute", - \\__attribute__((always_inline)) int foo() { - \\ return 5; - \\} - , &[_][]const u8{ - \\pub inline fn foo() c_int { - \\ return 5; - \\} - }); - - cases.add("add, sub, mul, div, rem", - \\int s() { - \\ int a, b, c; - \\ c = a + b; - \\ c = a - b; - \\ c = a * b; - \\ c = a / b; - \\ c = a % b; - \\} - \\unsigned u() { - \\ unsigned a, b, c; - \\ c = a + b; - \\ c = a - b; - \\ c = a * b; - \\ c = a / b; - \\ c = a % b; - \\} - , &[_][]const u8{ - \\pub export fn s() c_int { - \\ var a: c_int = undefined; - \\ _ = &a; - \\ var b: c_int = undefined; - \\ _ = &b; - \\ var c: c_int = undefined; - \\ _ = &c; - \\ c = a + b; - \\ c = a - b; - \\ c = a * b; - \\ c = @divTrunc(a, b); - \\ c = @import("std").zig.c_translation.signedRemainder(a, b); - \\ return 0; - \\} - \\pub export fn u() c_uint { - \\ var a: c_uint = undefined; - \\ _ = &a; - \\ var b: c_uint = undefined; - \\ _ = &b; - \\ var c: c_uint = undefined; - \\ _ = &c; - \\ c = a +% b; - \\ c = a -% b; - \\ c = a *% b; - \\ c = a / b; - \\ c = a % b; - \\ return 0; - \\} - }); - - cases.add("typedef of function in struct field", - \\typedef void lws_callback_function(void); - \\struct Foo { - \\ void (*func)(void); - \\ lws_callback_function *callback_http; - \\}; - , &[_][]const u8{ - \\pub const lws_callback_function = fn () callconv(.c) void; - \\pub const struct_Foo = extern struct { - \\ func: ?*const fn () callconv(.c) void = @import("std").mem.zeroes(?*const fn () callconv(.c) void), - \\ callback_http: ?*const lws_callback_function = @import("std").mem.zeroes(?*const lws_callback_function), - \\}; - }); - - cases.add("macro with left shift", - \\#define REDISMODULE_READ (1<<0) - , &[_][]const u8{ - \\pub const REDISMODULE_READ = @as(c_int, 1) << @as(c_int, 0); - }); - - cases.add("macro with right shift", - \\#define FLASH_SIZE 0x200000UL /* 2 MB */ - \\#define FLASH_BANK_SIZE (FLASH_SIZE >> 1) /* 1 MB */ - , &[_][]const u8{ - \\pub const FLASH_SIZE = @as(c_ulong, 0x200000); - , - \\pub const FLASH_BANK_SIZE = FLASH_SIZE >> @as(c_int, 1); - }); - - cases.add("self referential struct with function pointer", - \\struct Foo { - \\ void (*derp)(struct Foo *foo); - \\}; - , &[_][]const u8{ - \\pub const struct_Foo = extern struct { - \\ derp: ?*const fn ([*c]struct_Foo) callconv(.c) void = @import("std").mem.zeroes(?*const fn ([*c]struct_Foo) callconv(.c) void), - \\}; - , - \\pub const Foo = struct_Foo; - }); - - cases.add("#define an unsigned integer literal", - \\#define CHANNEL_COUNT 24 - , &[_][]const u8{ - \\pub const CHANNEL_COUNT = @as(c_int, 24); - }); - - cases.add("#define referencing another #define", - \\#define THING2 THING1 - \\#define THING1 1234 - , &[_][]const u8{ - \\pub const THING1 = @as(c_int, 1234); - , - \\pub const THING2 = THING1; - }); - - cases.add("#define string", - \\#define foo "a string" - , &[_][]const u8{ - \\pub const foo = "a string"; - }); - - cases.add("macro with parens around negative number", - \\#define LUA_GLOBALSINDEX (-10002) - , &[_][]const u8{ - \\pub const LUA_GLOBALSINDEX = -@as(c_int, 10002); - }); - - cases.add( - "u integer suffix after 0 (zero) in macro definition", - "#define ZERO 0U", - &[_][]const u8{ - "pub const ZERO = @as(c_uint, 0);", - }, - ); - - cases.add( - "l integer suffix after 0 (zero) in macro definition", - "#define ZERO 0L", - &[_][]const u8{ - "pub const ZERO = @as(c_long, 0);", - }, - ); - - cases.add( - "ul integer suffix after 0 (zero) in macro definition", - "#define ZERO 0UL", - &[_][]const u8{ - "pub const ZERO = @as(c_ulong, 0);", - }, - ); - - cases.add( - "lu integer suffix after 0 (zero) in macro definition", - "#define ZERO 0LU", - &[_][]const u8{ - "pub const ZERO = @as(c_ulong, 0);", - }, - ); - - cases.add( - "ll integer suffix after 0 (zero) in macro definition", - "#define ZERO 0LL", - &[_][]const u8{ - "pub const ZERO = @as(c_longlong, 0);", - }, - ); - - cases.add( - "ull integer suffix after 0 (zero) in macro definition", - "#define ZERO 0ULL", - &[_][]const u8{ - "pub const ZERO = @as(c_ulonglong, 0);", - }, - ); - - cases.add( - "llu integer suffix after 0 (zero) in macro definition", - "#define ZERO 0LLU", - &[_][]const u8{ - "pub const ZERO = @as(c_ulonglong, 0);", - }, - ); - - cases.add( - "bitwise not on u-suffixed 0 (zero) in macro definition", - "#define NOT_ZERO (~0U)", - &[_][]const u8{ - "pub const NOT_ZERO = ~@as(c_uint, 0);", - }, - ); - - cases.add("float suffixes", - \\#define foo 3.14f - \\#define bar 16.e-2l - \\#define FOO 0.12345 - \\#define BAR .12345 - \\#define baz 1e1 - \\#define BAZ 42e-3f - \\#define foobar -73.L - \\extern const float my_float = 1.0f; - \\extern const double my_double = 1.0; - \\extern const long double my_longdouble = 1.0l; - \\extern const long double my_extended_precision_longdouble = 1.0000000000000003l; - , &([_][]const u8{ - "pub const foo = @as(f32, 3.14);", - "pub const bar = @as(c_longdouble, 16.e-2);", - "pub const FOO = @as(f64, 0.12345);", - "pub const BAR = @as(f64, 0.12345);", - "pub const baz = @as(f64, 1e1);", - "pub const BAZ = @as(f32, 42e-3);", - "pub const foobar = -@as(c_longdouble, 73);", - "pub export const my_float: f32 = 1.0;", - "pub export const my_double: f64 = 1.0;", - "pub export const my_longdouble: c_longdouble = 1.0;", - switch (@bitSizeOf(c_longdouble)) { - // TODO implement decimal format for f128 - // (so that f80/f128 values not exactly representable as f64 can be emitted in decimal form) - 80 => "pub export const my_extended_precision_longdouble: c_longdouble = 0x1.000000000000159ep0;", - 128 => "pub export const my_extended_precision_longdouble: c_longdouble = 0x1.000000000000159e05f1e2674d21p0;", - else => "pub export const my_extended_precision_longdouble: c_longdouble = 1.0000000000000002;", - }, - })); - - cases.add("macro defines hexadecimal float", - \\#define FOO 0xf7p38 - \\#define BAR -0X8F.BP5F - \\#define FOOBAR 0X0P+0 - \\#define BAZ -0x.0a5dp+12 - \\#define FOOBAZ 0xfE.P-1l - , &[_][]const u8{ - "pub const FOO = @as(f64, 0xf7p38);", - "pub const BAR = -@as(f32, 0x8F.BP5);", - "pub const FOOBAR = @as(f64, 0x0P+0);", - "pub const BAZ = -@as(f64, 0x0.0a5dp+12);", - "pub const FOOBAZ = @as(c_longdouble, 0xfE.P-1);", - }); - - cases.add("comments", - \\#define foo 1 //foo - \\#define bar /* bar */ 2 - , &[_][]const u8{ - "pub const foo = @as(c_int, 1);", - "pub const bar = @as(c_int, 2);", - }); - - cases.add("string prefix", - \\#define foo L"hello" - , &[_][]const u8{ - "pub const foo = \"hello\";", - }); - - cases.add("null statements", - \\void foo(void) { - \\ ;;;;; - \\} - , &[_][]const u8{ - \\pub export fn foo() void {} - }); - - if (builtin.os.tag != .windows) { - // Windows treats this as an enum with type c_int - cases.add("big negative enum init values when C ABI supports long long enums", - \\enum EnumWithInits { - \\ VAL01 = 0, - \\ VAL02 = 1, - \\ VAL03 = 2, - \\ VAL04 = 3, - \\ VAL05 = -1, - \\ VAL06 = -2, - \\ VAL07 = -3, - \\ VAL08 = -4, - \\ VAL09 = VAL02 + VAL08, - \\ VAL10 = -1000012000, - \\ VAL11 = -1000161000, - \\ VAL12 = -1000174001, - \\ VAL13 = VAL09, - \\ VAL14 = VAL10, - \\ VAL15 = VAL11, - \\ VAL16 = VAL13, - \\ VAL17 = (VAL16 - VAL10 + 1), - \\ VAL18 = 0x1000000000000000L, - \\ VAL19 = VAL18 + VAL18 + VAL18 - 1, - \\ VAL20 = VAL19 + VAL19, - \\ VAL21 = VAL20 + 0xFFFFFFFFFFFFFFFF, - \\ VAL22 = 0xFFFFFFFFFFFFFFFF + 1, - \\ VAL23 = 0xFFFFFFFFFFFFFFFF, - \\}; - , &[_][]const u8{ - \\pub const VAL01: c_longlong = 0; - \\pub const VAL02: c_longlong = 1; - \\pub const VAL03: c_longlong = 2; - \\pub const VAL04: c_longlong = 3; - \\pub const VAL05: c_longlong = -1; - \\pub const VAL06: c_longlong = -2; - \\pub const VAL07: c_longlong = -3; - \\pub const VAL08: c_longlong = -4; - \\pub const VAL09: c_longlong = -3; - \\pub const VAL10: c_longlong = -1000012000; - \\pub const VAL11: c_longlong = -1000161000; - \\pub const VAL12: c_longlong = -1000174001; - \\pub const VAL13: c_longlong = -3; - \\pub const VAL14: c_longlong = -1000012000; - \\pub const VAL15: c_longlong = -1000161000; - \\pub const VAL16: c_longlong = -3; - \\pub const VAL17: c_longlong = 1000011998; - \\pub const VAL18: c_longlong = 1152921504606846976; - \\pub const VAL19: c_longlong = 3458764513820540927; - \\pub const VAL20: c_longlong = 6917529027641081854; - \\pub const VAL21: c_longlong = 6917529027641081853; - \\pub const VAL22: c_longlong = 0; - \\pub const VAL23: c_longlong = -1; - \\pub const enum_EnumWithInits = c_longlong; - }); - } - - cases.add("predefined expressions", - \\void foo(void) { - \\ __func__; - \\ __FUNCTION__; - \\ __PRETTY_FUNCTION__; - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ _ = "foo"; - \\ _ = "foo"; - \\ _ = "void foo(void)"; - \\} - }); - - cases.add("constant size array", - \\void func(int array[20]); - , &[_][]const u8{ - \\pub extern fn func(array: [*c]c_int) void; - }); - - cases.add("__cdecl doesn't mess up function pointers", - \\void foo(void (__cdecl *fn_ptr)(void)); - , &[_][]const u8{ - \\pub extern fn foo(fn_ptr: ?*const fn () callconv(.c) void) void; - }); - - cases.add("void cast", - \\void foo() { - \\ int a; - \\ (void) a; - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ var a: c_int = undefined; - \\ _ = &a; - \\ _ = &a; - \\} - }); - - cases.add("implicit cast to void *", - \\void *foo() { - \\ unsigned short *x; - \\ return x; - \\} - , &[_][]const u8{ - \\pub export fn foo() ?*anyopaque { - \\ var x: [*c]c_ushort = undefined; - \\ _ = &x; - \\ return @as(?*anyopaque, @ptrCast(x)); - \\} - }); - - cases.add("null pointer implicit cast", - \\int* foo(void) { - \\ return 0; - \\} - , &[_][]const u8{ - \\pub export fn foo() [*c]c_int { - \\ return null; - \\} - }); - - cases.add("string literal", - \\const char *foo(void) { - \\ return "bar"; - \\} - , &[_][]const u8{ - \\pub export fn foo() [*c]const u8 { - \\ return "bar"; - \\} - }); - - cases.add("return void", - \\void foo(void) { - \\ return; - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ return; - \\} - }); - - cases.add("for loop", - \\void foo(void) { - \\ for (int i = 0; i; i++) { } - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ { - \\ var i: c_int = 0; - \\ _ = &i; - \\ while (i != 0) : (i += 1) {} - \\ } - \\} - }); - - cases.add("empty for loop", - \\void foo(void) { - \\ for (;;) { } - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ while (true) {} - \\} - }); - - cases.add("for loop with simple init expression", - \\void foo(void) { - \\ int i; - \\ for (i = 3; i; i--) { } - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ var i: c_int = undefined; - \\ _ = &i; - \\ { - \\ i = 3; - \\ while (i != 0) : (i -= 1) {} - \\ } - \\} - }); - - cases.add("break statement", - \\void foo(void) { - \\ for (;;) { - \\ break; - \\ } - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ while (true) { - \\ break; - \\ } - \\} - }); - - cases.add("continue statement", - \\void foo(void) { - \\ for (;;) { - \\ continue; - \\ } - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ while (true) { - \\ continue; - \\ } - \\} - }); - - cases.add("pointer casting", - \\float *ptrcast() { - \\ int *a; - \\ return (float *)a; - \\} - , &[_][]const u8{ - \\pub export fn ptrcast() [*c]f32 { - \\ var a: [*c]c_int = undefined; - \\ _ = &a; - \\ return @as([*c]f32, @ptrCast(@alignCast(a))); - \\} - }); - - cases.add("casting pointer to pointer", - \\float **ptrptrcast() { - \\ int **a; - \\ return (float **)a; - \\} - , &[_][]const u8{ - \\pub export fn ptrptrcast() [*c][*c]f32 { - \\ var a: [*c][*c]c_int = undefined; - \\ _ = &a; - \\ return @as([*c][*c]f32, @ptrCast(@alignCast(a))); - \\} - }); - - cases.add("pointer conversion with different alignment", - \\void test_ptr_cast() { - \\ void *p; - \\ { - \\ char *to_char = (char *)p; - \\ short *to_short = (short *)p; - \\ int *to_int = (int *)p; - \\ long long *to_longlong = (long long *)p; - \\ } - \\ { - \\ char *to_char = p; - \\ short *to_short = p; - \\ int *to_int = p; - \\ long long *to_longlong = p; - \\ } - \\} - , &[_][]const u8{ - \\pub export fn test_ptr_cast() void { - \\ var p: ?*anyopaque = undefined; - \\ _ = &p; - \\ { - \\ var to_char: [*c]u8 = @as([*c]u8, @ptrCast(@alignCast(p))); - \\ _ = &to_char; - \\ var to_short: [*c]c_short = @as([*c]c_short, @ptrCast(@alignCast(p))); - \\ _ = &to_short; - \\ var to_int: [*c]c_int = @as([*c]c_int, @ptrCast(@alignCast(p))); - \\ _ = &to_int; - \\ var to_longlong: [*c]c_longlong = @as([*c]c_longlong, @ptrCast(@alignCast(p))); - \\ _ = &to_longlong; - \\ } - \\ { - \\ var to_char: [*c]u8 = @as([*c]u8, @ptrCast(@alignCast(p))); - \\ _ = &to_char; - \\ var to_short: [*c]c_short = @as([*c]c_short, @ptrCast(@alignCast(p))); - \\ _ = &to_short; - \\ var to_int: [*c]c_int = @as([*c]c_int, @ptrCast(@alignCast(p))); - \\ _ = &to_int; - \\ var to_longlong: [*c]c_longlong = @as([*c]c_longlong, @ptrCast(@alignCast(p))); - \\ _ = &to_longlong; - \\ } - \\} - }); - - cases.add("while on non-bool", - \\int while_none_bool() { - \\ int a; - \\ float b; - \\ void *c; - \\ while (a) return 0; - \\ while (b) return 1; - \\ while (c) return 2; - \\ return 3; - \\} - , &[_][]const u8{ - \\pub export fn while_none_bool() c_int { - \\ var a: c_int = undefined; - \\ _ = &a; - \\ var b: f32 = undefined; - \\ _ = &b; - \\ var c: ?*anyopaque = undefined; - \\ _ = &c; - \\ while (a != 0) return 0; - \\ while (b != 0) return 1; - \\ while (c != null) return 2; - \\ return 3; - \\} - }); - - cases.add("for on non-bool", - \\int for_none_bool() { - \\ int a; - \\ float b; - \\ void *c; - \\ for (;a;) return 0; - \\ for (;b;) return 1; - \\ for (;c;) return 2; - \\ return 3; - \\} - , &[_][]const u8{ - \\pub export fn for_none_bool() c_int { - \\ var a: c_int = undefined; - \\ _ = &a; - \\ var b: f32 = undefined; - \\ _ = &b; - \\ var c: ?*anyopaque = undefined; - \\ _ = &c; - \\ while (a != 0) return 0; - \\ while (b != 0) return 1; - \\ while (c != null) return 2; - \\ return 3; - \\} - }); - - cases.add("bitshift", - \\int foo(void) { - \\ return (1 << 2) >> 1; - \\} - , &[_][]const u8{ - \\pub export fn foo() c_int { - \\ return (@as(c_int, 1) << @intCast(2)) >> @intCast(1); - \\} - }); - - cases.add("sizeof", - \\#include - \\size_t size_of(void) { - \\ return sizeof(int); - \\} - , &[_][]const u8{ - \\pub export fn size_of() usize { - \\ return @sizeOf(c_int); - \\} - }); - - cases.add("normal deref", - \\void foo() { - \\ int *x; - \\ *x = 1; - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ var x: [*c]c_int = undefined; - \\ _ = &x; - \\ x.* = 1; - \\} - }); - - cases.add("address of operator", - \\int foo(void) { - \\ int x = 1234; - \\ int *ptr = &x; - \\ return *ptr; - \\} - , &[_][]const u8{ - \\pub export fn foo() c_int { - \\ var x: c_int = 1234; - \\ _ = &x; - \\ var ptr: [*c]c_int = &x; - \\ _ = &ptr; - \\ return ptr.*; - \\} - }); - - cases.add("bin not", - \\int foo() { - \\ int x; - \\ return ~x; - \\} - , &[_][]const u8{ - \\pub export fn foo() c_int { - \\ var x: c_int = undefined; - \\ _ = &x; - \\ return ~x; - \\} - }); - - cases.add("bool not", - \\int foo() { - \\ int a; - \\ float b; - \\ void *c; - \\ return !(a == 0); - \\ return !a; - \\ return !b; - \\ return !c; - \\} - , &[_][]const u8{ - \\pub export fn foo() c_int { - \\ var a: c_int = undefined; - \\ _ = &a; - \\ var b: f32 = undefined; - \\ _ = &b; - \\ var c: ?*anyopaque = undefined; - \\ _ = &c; - \\ return @intFromBool(!(a == @as(c_int, 0))); - \\ return @intFromBool(!(a != 0)); - \\ return @intFromBool(!(b != 0)); - \\ return @intFromBool(!(c != null)); - \\} - }); - - cases.add("__extension__ cast", - \\int foo(void) { - \\ return __extension__ 1; - \\} - , &[_][]const u8{ - \\pub export fn foo() c_int { - \\ return 1; - \\} - }); - - if (builtin.os.tag != .windows) { - // sysv_abi not currently supported on windows - cases.add("Macro qualified functions", - \\void __attribute__((sysv_abi)) foo(void); - , &[_][]const u8{ - \\pub extern fn foo() void; - }); - } - - cases.add("Forward-declared enum", - \\extern enum enum_ty my_enum; - \\enum enum_ty { FOO }; - , &[_][]const u8{ - \\pub const FOO: c_int = 0; - \\pub const enum_enum_ty = c_int; - \\pub extern var my_enum: enum_enum_ty; - }); - - cases.add("Parameterless function pointers", - \\typedef void (*fn0)(); - \\typedef void (*fn1)(char); - , &[_][]const u8{ - \\pub const fn0 = ?*const fn (...) callconv(.c) void; - \\pub const fn1 = ?*const fn (u8) callconv(.c) void; - }); - - cases.addWithTarget("Calling convention", .{ - .cpu_arch = .x86, - .os_tag = .linux, - .abi = .none, - }, - \\void __attribute__((fastcall)) foo1(float *a); - \\void __attribute__((stdcall)) foo2(float *a); - \\void __attribute__((vectorcall)) foo3(float *a); - \\void __attribute__((cdecl)) foo4(float *a); - \\void __attribute__((thiscall)) foo5(float *a); - , &[_][]const u8{ - \\pub extern fn foo1(a: [*c]f32) callconv(.{ .x86_fastcall = .{} }) void; - \\pub extern fn foo2(a: [*c]f32) callconv(.{ .x86_stdcall = .{} }) void; - \\pub extern fn foo3(a: [*c]f32) callconv(.{ .x86_vectorcall = .{} }) void; - \\pub extern fn foo4(a: [*c]f32) void; - \\pub extern fn foo5(a: [*c]f32) callconv(.{ .x86_thiscall = .{} }) void; - }); - - cases.addWithTarget("Calling convention", std.Target.Query.parse(.{ - .arch_os_abi = "arm-linux-none", - .cpu_features = "generic+v8_5a", - }) catch unreachable, - \\void __attribute__((pcs("aapcs"))) foo1(float *a); - \\void __attribute__((pcs("aapcs-vfp"))) foo2(float *a); - , &[_][]const u8{ - \\pub extern fn foo1(a: [*c]f32) callconv(.{ .arm_aapcs = .{} }) void; - \\pub extern fn foo2(a: [*c]f32) callconv(.{ .arm_aapcs_vfp = .{} }) void; - }); - - cases.addWithTarget("Calling convention", std.Target.Query.parse(.{ - .arch_os_abi = "aarch64-linux-none", - .cpu_features = "generic+v8_5a", - }) catch unreachable, - \\void __attribute__((aarch64_vector_pcs)) foo1(float *a); - , &[_][]const u8{ - \\pub extern fn foo1(a: [*c]f32) callconv(.{ .aarch64_vfabi = .{} }) void; - }); - - cases.add("Parameterless function prototypes", - \\void a() {} - \\void b(void) {} - \\void c(); - \\void d(void); - \\static void e() {} - \\static void f(void) {} - \\static void g(); - \\static void h(void); - , &[_][]const u8{ - \\pub export fn a() void {} - \\pub export fn b() void {} - \\pub extern fn c(...) void; - \\pub extern fn d() void; - \\pub fn e() callconv(.c) void {} - \\pub fn f() callconv(.c) void {} - \\pub extern fn g() void; - \\pub extern fn h() void; - }); - - cases.add("variable declarations", - \\extern char arr0[] = "hello"; - \\static char arr1[] = "hello"; - \\char arr2[] = "hello"; - , &[_][]const u8{ - \\pub export var arr0: [5:0]u8 = "hello".*; - \\pub var arr1: [5:0]u8 = "hello".*; - \\pub export var arr2: [5:0]u8 = "hello".*; - }); - - cases.add("array initializer expr", - \\static void foo(void){ - \\ char arr[10] ={1}; - \\ char *arr1[10] ={0}; - \\} - , &[_][]const u8{ - \\pub fn foo() callconv(.c) void { - \\ var arr: [10]u8 = [1]u8{ - \\ 1, - \\ } ++ [1]u8{0} ** 9; - \\ _ = &arr; - \\ var arr1: [10][*c]u8 = [1][*c]u8{ - \\ null, - \\ } ++ [1][*c]u8{null} ** 9; - \\ _ = &arr1; - \\} - }); - - cases.add("enums", - \\typedef enum { - \\ a, - \\ b, - \\ c, - \\} d; - \\enum { - \\ e, - \\ f = 4, - \\ g, - \\} h = e; - \\struct Baz { - \\ enum { - \\ i, - \\ j, - \\ k, - \\ } l; - \\ d m; - \\}; - \\enum i { - \\ n, - \\ o, - \\ p, - \\}; - , &[_][]const u8{ - \\pub const a: c_int = 0; - \\pub const b: c_int = 1; - \\pub const c: c_int = 2; - \\pub const d = - ++ " " ++ default_enum_type ++ - \\; - \\pub const e: c_int = 0; - \\pub const f: c_int = 4; - \\pub const g: c_int = 5; - \\const enum_unnamed_1 = - ++ " " ++ default_enum_type ++ - \\; - \\pub export var h: enum_unnamed_1 = @as(c_uint, @bitCast(e)); - \\pub const i: c_int = 0; - \\pub const j: c_int = 1; - \\pub const k: c_int = 2; - \\const enum_unnamed_2 = - ++ " " ++ default_enum_type ++ - \\; - \\pub const struct_Baz = extern struct { - \\ l: enum_unnamed_2 = @import("std").mem.zeroes(enum_unnamed_2), - \\ m: d = @import("std").mem.zeroes(d), - \\}; - \\pub const n: c_int = 0; - \\pub const o: c_int = 1; - \\pub const p: c_int = 2; - \\pub const enum_i = - ++ " " ++ default_enum_type ++ - \\; - , - "pub const Baz = struct_Baz;", - }); - - cases.add("#define a char literal", - \\#define A_CHAR 'a' - , &[_][]const u8{ - \\pub const A_CHAR = 'a'; - }); - - cases.add("comment after integer literal", - \\#define SDL_INIT_VIDEO 0x00000020 /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */ - , &[_][]const u8{ - \\pub const SDL_INIT_VIDEO = @as(c_int, 0x00000020); - }); - - cases.add("u integer suffix after hex literal", - \\#define SDL_INIT_VIDEO 0x00000020u /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */ - , &[_][]const u8{ - \\pub const SDL_INIT_VIDEO = @as(c_uint, 0x00000020); - }); - - cases.add("l integer suffix after hex literal", - \\#define SDL_INIT_VIDEO 0x00000020l /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */ - , &[_][]const u8{ - \\pub const SDL_INIT_VIDEO = @as(c_long, 0x00000020); - }); - - cases.add("ul integer suffix after hex literal", - \\#define SDL_INIT_VIDEO 0x00000020ul /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */ - , &[_][]const u8{ - \\pub const SDL_INIT_VIDEO = @as(c_ulong, 0x00000020); - }); - - cases.add("lu integer suffix after hex literal", - \\#define SDL_INIT_VIDEO 0x00000020lu /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */ - , &[_][]const u8{ - \\pub const SDL_INIT_VIDEO = @as(c_ulong, 0x00000020); - }); - - cases.add("ll integer suffix after hex literal", - \\#define SDL_INIT_VIDEO 0x00000020ll /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */ - , &[_][]const u8{ - \\pub const SDL_INIT_VIDEO = @as(c_longlong, 0x00000020); - }); - - cases.add("ull integer suffix after hex literal", - \\#define SDL_INIT_VIDEO 0x00000020ull /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */ - , &[_][]const u8{ - \\pub const SDL_INIT_VIDEO = @as(c_ulonglong, 0x00000020); - }); - - cases.add("llu integer suffix after hex literal", - \\#define SDL_INIT_VIDEO 0x00000020llu /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */ - , &[_][]const u8{ - \\pub const SDL_INIT_VIDEO = @as(c_ulonglong, 0x00000020); - }); - - cases.add("generate inline func for #define global extern fn", - \\extern void (*fn_ptr)(void); - \\#define foo fn_ptr - \\ - \\extern char (*fn_ptr2)(int, float); - \\#define bar fn_ptr2 - , &[_][]const u8{ - \\pub extern var fn_ptr: ?*const fn () callconv(.c) void; - , - \\pub inline fn foo() void { - \\ return fn_ptr.?(); - \\} - , - \\pub extern var fn_ptr2: ?*const fn (c_int, f32) callconv(.c) u8; - , - \\pub inline fn bar(arg_1: c_int, arg_2: f32) u8 { - \\ return fn_ptr2.?(arg_1, arg_2); - \\} - }); - - cases.add("macros with field targets", - \\typedef unsigned int GLbitfield; - \\typedef void (*PFNGLCLEARPROC) (GLbitfield mask); - \\typedef void(*OpenGLProc)(void); - \\union OpenGLProcs { - \\ OpenGLProc ptr[1]; - \\ struct { - \\ PFNGLCLEARPROC Clear; - \\ } gl; - \\}; - \\extern union OpenGLProcs glProcs; - \\#define glClearUnion glProcs.gl.Clear - \\#define glClearPFN PFNGLCLEARPROC - , &[_][]const u8{ - \\pub const GLbitfield = c_uint; - \\pub const PFNGLCLEARPROC = ?*const fn (GLbitfield) callconv(.c) void; - \\pub const OpenGLProc = ?*const fn () callconv(.c) void; - \\const struct_unnamed_1 = extern struct { - \\ Clear: PFNGLCLEARPROC = @import("std").mem.zeroes(PFNGLCLEARPROC), - \\}; - \\pub const union_OpenGLProcs = extern union { - \\ ptr: [1]OpenGLProc, - \\ gl: struct_unnamed_1, - \\}; - \\pub extern var glProcs: union_OpenGLProcs; - , - \\pub const glClearPFN = PFNGLCLEARPROC; - , - \\pub inline fn glClearUnion(arg_2: GLbitfield) void { - \\ return glProcs.gl.Clear.?(arg_2); - \\} - , - \\pub const OpenGLProcs = union_OpenGLProcs; - }); - - cases.add("macro pointer cast", - \\#define NRF_GPIO_BASE 0 - \\typedef struct { int dummy; } NRF_GPIO_Type; - \\#define NRF_GPIO ((NRF_GPIO_Type *) NRF_GPIO_BASE) - , &[_][]const u8{ - \\pub const NRF_GPIO = @import("std").zig.c_translation.cast([*c]NRF_GPIO_Type, NRF_GPIO_BASE); - }); - - cases.add("basic macro function", - \\extern int c; - \\#define BASIC(c) (c*2) - \\#define FOO(L,b) (L + b) - \\#define BAR() (c*c) - , &[_][]const u8{ - \\pub extern var c: c_int; - , - \\pub inline fn BASIC(c_1: anytype) @TypeOf(c_1 * @as(c_int, 2)) { - \\ _ = &c_1; - \\ return c_1 * @as(c_int, 2); - \\} - , - \\pub inline fn FOO(L: anytype, b: anytype) @TypeOf(L + b) { - \\ _ = &L; - \\ _ = &b; - \\ return L + b; - \\} - , - \\pub inline fn BAR() @TypeOf(c * c) { - \\ return c * c; - \\} - }); - - cases.add("macro defines string literal with hex", - \\#define FOO "aoeu\xab derp" - \\#define FOO2 "aoeu\x0007a derp" - \\#define FOO_CHAR '\xfF' - , &[_][]const u8{ - \\pub const FOO = "aoeu\xab derp"; - , - \\pub const FOO2 = "aoeu\x7a derp"; - , - \\pub const FOO_CHAR = '\xff'; - }); - - cases.add("macro add", - \\#define D3_AHB1PERIPH_BASE 0 - \\#define PERIPH_BASE (0x40000000UL) /*!< Base address of : AHB/APB Peripherals */ - \\#define D3_APB1PERIPH_BASE (PERIPH_BASE + 0x18000000UL) - \\#define RCC_BASE (D3_AHB1PERIPH_BASE + 0x4400UL) - , &[_][]const u8{ - \\pub const PERIPH_BASE = @as(c_ulong, 0x40000000); - , - \\pub const D3_APB1PERIPH_BASE = PERIPH_BASE + @as(c_ulong, 0x18000000); - , - \\pub const RCC_BASE = D3_AHB1PERIPH_BASE + @as(c_ulong, 0x4400); - }); - - cases.add("variable aliasing", - \\static long a = 2; - \\static long b = 2; - \\static int c = 4; - \\void foo(char c) { - \\ int a; - \\ char b = 123; - \\ b = (char) a; - \\ { - \\ int d = 5; - \\ } - \\ unsigned d = 440; - \\} - , &[_][]const u8{ - \\pub var a: c_long = 2; - \\pub var b: c_long = 2; - \\pub var c: c_int = 4; - \\pub export fn foo(arg_c_1: u8) void { - \\ var c_1 = arg_c_1; - \\ _ = &c_1; - \\ var a_2: c_int = undefined; - \\ _ = &a_2; - \\ var b_3: u8 = 123; - \\ _ = &b_3; - \\ b_3 = @as(u8, @bitCast(@as(i8, @truncate(a_2)))); - \\ { - \\ var d: c_int = 5; - \\ _ = &d; - \\ } - \\ var d: c_uint = @as(c_uint, @bitCast(@as(c_int, 440))); - \\ _ = &d; - \\} - }); - - cases.add("comma operator", - \\int foo() { - \\ 2, 4; - \\ return 2, 4, 6; - \\} - , &[_][]const u8{ - \\pub export fn foo() c_int { - \\ _ = blk: { - \\ _ = @as(c_int, 2); - \\ break :blk @as(c_int, 4); - \\ }; - \\ return blk: { - \\ _ = blk_1: { - \\ _ = @as(c_int, 2); - \\ break :blk_1 @as(c_int, 4); - \\ }; - \\ break :blk @as(c_int, 6); - \\ }; - \\} - }); - - cases.add("worst-case assign", - \\void foo() { - \\ int a; - \\ int b; - \\ a = b = 2; - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ var a: c_int = undefined; - \\ _ = &a; - \\ var b: c_int = undefined; - \\ _ = &b; - \\ a = blk: { - \\ const tmp = @as(c_int, 2); - \\ b = tmp; - \\ break :blk tmp; - \\ }; - \\} - }); - - cases.add("while loops", - \\int foo() { - \\ int a = 5; - \\ while (2) - \\ a = 2; - \\ while (4) { - \\ int a = 4; - \\ a = 9; - \\ return 6, a; - \\ } - \\ do { - \\ int a = 2; - \\ a = 12; - \\ } while (4); - \\ do - \\ a = 7; - \\ while (4); - \\} - , &[_][]const u8{ - \\pub export fn foo() c_int { - \\ var a: c_int = 5; - \\ _ = &a; - \\ while (true) { - \\ a = 2; - \\ } - \\ while (true) { - \\ var a_1: c_int = 4; - \\ _ = &a_1; - \\ a_1 = 9; - \\ return blk: { - \\ _ = @as(c_int, 6); - \\ break :blk a_1; - \\ }; - \\ } - \\ while (true) { - \\ var a_1: c_int = 2; - \\ _ = &a_1; - \\ a_1 = 12; - \\ } - \\ while (true) { - \\ a = 7; - \\ } - \\ return 0; - \\} - }); - - cases.add("for loops", - \\void foo() { - \\ for (int i = 2, b = 4; i + 2; i = 2) { - \\ int a = 2; - \\ a = 6, 5, 7; - \\ } - \\ char i = 2; - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ { - \\ var i: c_int = 2; - \\ _ = &i; - \\ var b: c_int = 4; - \\ _ = &b; - \\ while ((i + @as(c_int, 2)) != 0) : (i = 2) { - \\ var a: c_int = 2; - \\ _ = &a; - \\ _ = blk: { - \\ _ = blk_1: { - \\ a = 6; - \\ break :blk_1 @as(c_int, 5); - \\ }; - \\ break :blk @as(c_int, 7); - \\ }; - \\ } - \\ } - \\ var i: u8 = 2; - \\ _ = &i; - \\} - }); - - cases.add("shadowing primitive types", - \\unsigned anyerror = 2; - \\#define noreturn _Noreturn - \\typedef enum { - \\ f32, - \\ u32, - \\} BadEnum; - , &[_][]const u8{ - \\pub export var @"anyerror": c_uint = 2; - , - \\pub const @"noreturn" = @compileError("unable to translate C expr: unexpected token '_Noreturn'"); - , - \\pub const @"f32": c_int = 0; - \\pub const @"u32": c_int = 1; - \\pub const BadEnum = c_uint; - }); - - cases.add("floats", - \\float a = 3.1415; - \\double b = 3.1415; - \\int c = 3.1415; - \\double d = 3; - , &[_][]const u8{ - \\pub export var a: f32 = @as(f32, @floatCast(3.1415)); - \\pub export var b: f64 = 3.1415; - \\pub export var c: c_int = @as(c_int, @intFromFloat(3.1415)); - \\pub export var d: f64 = 3; - }); - - cases.add("conditional operator", - \\int bar(void) { - \\ if (2 ? 5 : 5 ? 4 : 6) 2; - \\ return 2 ? 5 : 5 ? 4 : 6; - \\} - , &[_][]const u8{ - \\pub export fn bar() c_int { - \\ if ((if (true) @as(c_int, 5) else if (true) @as(c_int, 4) else @as(c_int, 6)) != 0) { - \\ _ = @as(c_int, 2); - \\ } - \\ return if (true) @as(c_int, 5) else if (true) @as(c_int, 4) else @as(c_int, 6); - \\} - }); - - cases.add("switch on int", - \\void switch_fn(int i) { - \\ int res = 0; - \\ switch (i) { - \\ case 0: - \\ res = 1; - \\ case 1 ... 3: - \\ res = 2; - \\ default: - \\ res = 3 * i; - \\ break; - \\ break; - \\ case 7: { - \\ res = 7; - \\ break; - \\ } - \\ case 4: - \\ case 5: - \\ res = 69; - \\ { - \\ res = 5; - \\ return; - \\ } - \\ case 6: - \\ switch (res) { - \\ case 9: break; - \\ } - \\ res = 1; - \\ return; - \\ } - \\} - , &[_][]const u8{ - \\pub export fn switch_fn(arg_i: c_int) void { - \\ var i = arg_i; - \\ _ = &i; - \\ var res: c_int = 0; - \\ _ = &res; - \\ while (true) { - \\ switch (i) { - \\ @as(c_int, 0) => { - \\ res = 1; - \\ res = 2; - \\ res = @as(c_int, 3) * i; - \\ break; - \\ }, - \\ @as(c_int, 1)...@as(c_int, 3) => { - \\ res = 2; - \\ res = @as(c_int, 3) * i; - \\ break; - \\ }, - \\ else => { - \\ res = @as(c_int, 3) * i; - \\ break; - \\ }, - \\ @as(c_int, 7) => { - \\ { - \\ res = 7; - \\ break; - \\ } - \\ }, - \\ @as(c_int, 4), @as(c_int, 5) => { - \\ res = 69; - \\ { - \\ res = 5; - \\ return; - \\ } - \\ }, - \\ @as(c_int, 6) => { - \\ while (true) { - \\ switch (res) { - \\ @as(c_int, 9) => break, - \\ else => {}, - \\ } - \\ break; - \\ } - \\ res = 1; - \\ return; - \\ }, - \\ } - \\ break; - \\ } - \\} - }); - cases.add("undefined array global", - \\int array[100] = {}; - , &[_][]const u8{ - \\pub export var array: [100]c_int = [1]c_int{0} ** 100; - }); - - cases.add("restrict -> noalias", - \\void foo(void *restrict bar, void *restrict); - , &[_][]const u8{ - \\pub extern fn foo(noalias bar: ?*anyopaque, noalias ?*anyopaque) void; - }); - - cases.add("assign", - \\void max(int a) { - \\ int tmp; - \\ tmp = a; - \\ a = tmp; - \\} - , &[_][]const u8{ - \\pub export fn max(arg_a: c_int) void { - \\ var a = arg_a; - \\ _ = &a; - \\ var tmp: c_int = undefined; - \\ _ = &tmp; - \\ tmp = a; - \\ a = tmp; - \\} - }); - - cases.add("chaining assign", - \\void max(int a) { - \\ int b, c; - \\ c = b = a; - \\} - , &[_][]const u8{ - \\pub export fn max(arg_a: c_int) void { - \\ var a = arg_a; - \\ _ = &a; - \\ var b: c_int = undefined; - \\ _ = &b; - \\ var c: c_int = undefined; - \\ _ = &c; - \\ c = blk: { - \\ const tmp = a; - \\ b = tmp; - \\ break :blk tmp; - \\ }; - \\} - }); - - cases.add("anonymous enum", - \\enum { - \\ One, - \\ Two, - \\}; - , &[_][]const u8{ - \\pub const One: c_int = 0; - \\pub const Two: c_int = 1; - \\const enum_unnamed_1 = - ++ " " ++ default_enum_type ++ - \\; - }); - - cases.add("c style cast", - \\int int_from_float(float a) { - \\ return (int)a; - \\} - , &[_][]const u8{ - \\pub export fn int_from_float(arg_a: f32) c_int { - \\ var a = arg_a; - \\ _ = &a; - \\ return @as(c_int, @intFromFloat(a)); - \\} - }); - - cases.add("escape sequences", - \\const char *escapes() { - \\char a = '\'', - \\ b = '\\', - \\ c = '\a', - \\ d = '\b', - \\ e = '\f', - \\ f = '\n', - \\ g = '\r', - \\ h = '\t', - \\ i = '\v', - \\ j = '\0', - \\ k = '\"'; - \\ return "\'\\\a\b\f\n\r\t\v\0\""; - \\} - \\ - , &[_][]const u8{ - \\pub export fn escapes() [*c]const u8 { - \\ var a: u8 = '\''; - \\ _ = &a; - \\ var b: u8 = '\\'; - \\ _ = &b; - \\ var c: u8 = '\x07'; - \\ _ = &c; - \\ var d: u8 = '\x08'; - \\ _ = &d; - \\ var e: u8 = '\x0c'; - \\ _ = &e; - \\ var f: u8 = '\n'; - \\ _ = &f; - \\ var g: u8 = '\r'; - \\ _ = &g; - \\ var h: u8 = '\t'; - \\ _ = &h; - \\ var i: u8 = '\x0b'; - \\ _ = &i; - \\ var j: u8 = '\x00'; - \\ _ = &j; - \\ var k: u8 = '"'; - \\ _ = &k; - \\ return "'\\\x07\x08\x0c\n\r\t\x0b\x00\""; - \\} - }); - - cases.add("do loop", - \\void foo(void) { - \\ int a = 2; - \\ do { - \\ a = a - 1; - \\ } while (a); - \\ - \\ int b = 2; - \\ do - \\ b = b -1; - \\ while (b); - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ var a: c_int = 2; - \\ _ = &a; - \\ while (true) { - \\ a = a - @as(c_int, 1); - \\ if (!(a != 0)) break; - \\ } - \\ var b: c_int = 2; - \\ _ = &b; - \\ while (true) { - \\ b = b - @as(c_int, 1); - \\ if (!(b != 0)) break; - \\ } - \\} - }); - - cases.add("logical and, logical or, on non-bool values, extra parens", - \\enum Foo { - \\ FooA, - \\ FooB, - \\ FooC, - \\}; - \\typedef int SomeTypedef; - \\int and_or_non_bool(int a, float b, void *c) { - \\ enum Foo d = FooA; - \\ int e = (a && b); - \\ int f = (b && c); - \\ int g = (a && c); - \\ int h = (a || b); - \\ int i = (b || c); - \\ int j = (a || c); - \\ int k = (a || (int)d); - \\ int l = ((int)d && b); - \\ int m = (c || (unsigned int)d); - \\ SomeTypedef td = 44; - \\ int o = (td || b); - \\ int p = (c && td); - \\ return ((((((((((e + f) + g) + h) + i) + j) + k) + l) + m) + o) + p); - \\} - , &[_][]const u8{ - \\pub const FooA: c_int = 0; - \\pub const FooB: c_int = 1; - \\pub const FooC: c_int = 2; - \\pub const enum_Foo = - ++ " " ++ default_enum_type ++ - \\; - \\pub const SomeTypedef = c_int; - \\pub export fn and_or_non_bool(arg_a: c_int, arg_b: f32, arg_c: ?*anyopaque) c_int { - \\ var a = arg_a; - \\ _ = &a; - \\ var b = arg_b; - \\ _ = &b; - \\ var c = arg_c; - \\ _ = &c; - \\ var d: enum_Foo = @as(c_uint, @bitCast(FooA)); - \\ _ = &d; - \\ var e: c_int = @intFromBool((a != 0) and (b != 0)); - \\ _ = &e; - \\ var f: c_int = @intFromBool((b != 0) and (c != null)); - \\ _ = &f; - \\ var g: c_int = @intFromBool((a != 0) and (c != null)); - \\ _ = &g; - \\ var h: c_int = @intFromBool((a != 0) or (b != 0)); - \\ _ = &h; - \\ var i: c_int = @intFromBool((b != 0) or (c != null)); - \\ _ = &i; - \\ var j: c_int = @intFromBool((a != 0) or (c != null)); - \\ _ = &j; - \\ var k: c_int = @intFromBool((a != 0) or (@as(c_int, @bitCast(d)) != 0)); - \\ _ = &k; - \\ var l: c_int = @intFromBool((@as(c_int, @bitCast(d)) != 0) and (b != 0)); - \\ _ = &l; - \\ var m: c_int = @intFromBool((c != null) or (d != 0)); - \\ _ = &m; - \\ var td: SomeTypedef = 44; - \\ _ = &td; - \\ var o: c_int = @intFromBool((td != 0) or (b != 0)); - \\ _ = &o; - \\ var p: c_int = @intFromBool((c != null) and (td != 0)); - \\ _ = &p; - \\ return (((((((((e + f) + g) + h) + i) + j) + k) + l) + m) + o) + p; - \\} - , - \\pub const Foo = enum_Foo; - }); - - cases.add("bitwise binary operators, simpler parens", - \\int max(int a, int b) { - \\ return (a & b) ^ (a | b); - \\} - , &[_][]const u8{ - \\pub export fn max(arg_a: c_int, arg_b: c_int) c_int { - \\ var a = arg_a; - \\ _ = &a; - \\ var b = arg_b; - \\ _ = &b; - \\ return (a & b) ^ (a | b); - \\} - }); - - cases.add("comparison operators (no if)", // TODO Come up with less contrived tests? Make sure to cover all these comparisons. - \\int test_comparisons(int a, int b) { - \\ int c = (a < b); - \\ int d = (a > b); - \\ int e = (a <= b); - \\ int f = (a >= b); - \\ int g = (c < d); - \\ int h = (e < f); - \\ int i = (g < h); - \\ return i; - \\} - , &[_][]const u8{ - \\pub export fn test_comparisons(arg_a: c_int, arg_b: c_int) c_int { - \\ var a = arg_a; - \\ _ = &a; - \\ var b = arg_b; - \\ _ = &b; - \\ var c: c_int = @intFromBool(a < b); - \\ _ = &c; - \\ var d: c_int = @intFromBool(a > b); - \\ _ = &d; - \\ var e: c_int = @intFromBool(a <= b); - \\ _ = &e; - \\ var f: c_int = @intFromBool(a >= b); - \\ _ = &f; - \\ var g: c_int = @intFromBool(c < d); - \\ _ = &g; - \\ var h: c_int = @intFromBool(e < f); - \\ _ = &h; - \\ var i: c_int = @intFromBool(g < h); - \\ _ = &i; - \\ return i; - \\} - }); - - cases.add("==, !=", - \\int max(int a, int b) { - \\ if (a == b) - \\ return a; - \\ if (a != b) - \\ return b; - \\ return a; - \\} - , &[_][]const u8{ - \\pub export fn max(arg_a: c_int, arg_b: c_int) c_int { - \\ var a = arg_a; - \\ _ = &a; - \\ var b = arg_b; - \\ _ = &b; - \\ if (a == b) return a; - \\ if (a != b) return b; - \\ return a; - \\} - }); - - cases.add("typedeffed bool expression", - \\typedef char* yes; - \\void foo(void) { - \\ yes a; - \\ if (a) 2; - \\} - , &[_][]const u8{ - \\pub const yes = [*c]u8; - \\pub export fn foo() void { - \\ var a: yes = undefined; - \\ _ = &a; - \\ if (a != null) { - \\ _ = @as(c_int, 2); - \\ } - \\} - }); - - cases.add("statement expression", - \\int foo(void) { - \\ return ({ - \\ int a = 1; - \\ a; - \\ a; - \\ }); - \\} - , &[_][]const u8{ - \\pub export fn foo() c_int { - \\ return blk: { - \\ var a: c_int = 1; - \\ _ = &a; - \\ _ = &a; - \\ break :blk a; - \\ }; - \\} - }); - - cases.add("field access expression", - \\#define ARROW a->b - \\#define DOT a.b - \\extern struct Foo { - \\ int b; - \\}a; - \\float b = 2.0f; - \\void foo(void) { - \\ struct Foo *c; - \\ a.b; - \\ c->b; - \\} - , &[_][]const u8{ - \\pub const struct_Foo = extern struct { - \\ b: c_int = @import("std").mem.zeroes(c_int), - \\}; - \\pub extern var a: struct_Foo; - \\pub export var b: f32 = 2.0; - \\pub export fn foo() void { - \\ var c: [*c]struct_Foo = undefined; - \\ _ = &c; - \\ _ = a.b; - \\ _ = c.*.b; - \\} - , - \\pub inline fn ARROW() @TypeOf(a.*.b) { - \\ return a.*.b; - \\} - , - \\pub inline fn DOT() @TypeOf(a.b) { - \\ return a.b; - \\} - }); - - cases.add("array access", - \\#define ACCESS array[2] - \\int array[100] = {}; - \\int foo(int index) { - \\ return array[index]; - \\} - , &[_][]const u8{ - \\pub export var array: [100]c_int = [1]c_int{0} ** 100; - \\pub export fn foo(arg_index: c_int) c_int { - \\ var index = arg_index; - \\ _ = &index; - \\ return array[@as(c_uint, @intCast(index))]; - \\} - , - \\pub inline fn ACCESS() @TypeOf(array[@as(usize, @intCast(@as(c_int, 2)))]) { - \\ return array[@as(usize, @intCast(@as(c_int, 2)))]; - \\} - }); - - cases.add("cast signed array index to unsigned", - \\void foo() { - \\ int a[10], i = 0; - \\ a[i] = 0; - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ var a: [10]c_int = undefined; - \\ _ = &a; - \\ var i: c_int = 0; - \\ _ = &i; - \\ a[@as(c_uint, @intCast(i))] = 0; - \\} - }); - - cases.add("long long array index cast to usize", - \\void foo() { - \\ long long a[10], i = 0; - \\ a[i] = 0; - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ var a: [10]c_longlong = undefined; - \\ _ = &a; - \\ var i: c_longlong = 0; - \\ _ = &i; - \\ a[@as(usize, @intCast(i))] = 0; - \\} - }); - - cases.add("unsigned array index skips cast", - \\void foo() { - \\ unsigned int a[10], i = 0; - \\ a[i] = 0; - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ var a: [10]c_uint = undefined; - \\ _ = &a; - \\ var i: c_uint = 0; - \\ _ = &i; - \\ a[i] = 0; - \\} - }); - - cases.add("macro call", - \\#define CALL(arg) bar(arg) - \\int bar(int x) { return x; } - , &[_][]const u8{ - \\pub inline fn CALL(arg: anytype) @TypeOf(bar(arg)) { - \\ _ = &arg; - \\ return bar(arg); - \\} - }); - - cases.add("macro call with no args", - \\#define CALL(arg) bar() - \\int bar(void) { return 0; } - , &[_][]const u8{ - \\pub inline fn CALL(arg: anytype) @TypeOf(bar()) { - \\ _ = &arg; - \\ return bar(); - \\} - }); - - cases.add("logical and, logical or", - \\int max(int a, int b) { - \\ if (a < b || a == b) - \\ return b; - \\ if (a >= b && a == b) - \\ return a; - \\ return a; - \\} - , &[_][]const u8{ - \\pub export fn max(arg_a: c_int, arg_b: c_int) c_int { - \\ var a = arg_a; - \\ _ = &a; - \\ var b = arg_b; - \\ _ = &b; - \\ if ((a < b) or (a == b)) return b; - \\ if ((a >= b) and (a == b)) return a; - \\ return a; - \\} - }); - - cases.add("simple if statement", - \\int max(int a, int b) { - \\ if (a < b) - \\ return b; - \\ - \\ if (a < b) - \\ return b; - \\ else - \\ return a; - \\ - \\ if (a < b) ; else ; - \\} - , &[_][]const u8{ - \\pub export fn max(arg_a: c_int, arg_b: c_int) c_int { - \\ var a = arg_a; - \\ _ = &a; - \\ var b = arg_b; - \\ _ = &b; - \\ if (a < b) return b; - \\ if (a < b) return b else return a; - \\ if (a < b) {} else {} - \\ return 0; - \\} - }); - - cases.add("if statements", - \\void foo() { - \\ if (2) { - \\ int a = 2; - \\ } - \\ if (2, 5) { - \\ int a = 2; - \\ } - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ if (true) { - \\ var a: c_int = 2; - \\ _ = &a; - \\ } - \\ if ((blk: { - \\ _ = @as(c_int, 2); - \\ break :blk @as(c_int, 5); - \\ }) != 0) { - \\ var a: c_int = 2; - \\ _ = &a; - \\ } - \\} - }); - - cases.add("if on non-bool", - \\enum SomeEnum { A, B, C }; - \\int if_none_bool(int a, float b, void *c, enum SomeEnum d) { - \\ if (a) return 0; - \\ if (b) return 1; - \\ if (c) return 2; - \\ if (d) return 3; - \\ return 4; - \\} - , &[_][]const u8{ - \\pub const A: c_int = 0; - \\pub const B: c_int = 1; - \\pub const C: c_int = 2; - \\pub const enum_SomeEnum = - ++ " " ++ default_enum_type ++ - \\; - \\pub export fn if_none_bool(arg_a: c_int, arg_b: f32, arg_c: ?*anyopaque, arg_d: enum_SomeEnum) c_int { - \\ var a = arg_a; - \\ _ = &a; - \\ var b = arg_b; - \\ _ = &b; - \\ var c = arg_c; - \\ _ = &c; - \\ var d = arg_d; - \\ _ = &d; - \\ if (a != 0) return 0; - \\ if (b != 0) return 1; - \\ if (c != null) return 2; - \\ if (d != 0) return 3; - \\ return 4; - \\} - }); - - cases.add("simple data types", - \\#include - \\int foo(char a, unsigned char b, signed char c); - \\int foo(char a, unsigned char b, signed char c); // test a duplicate prototype - \\void bar(uint8_t a, uint16_t b, uint32_t c, uint64_t d); - \\void baz(int8_t a, int16_t b, int32_t c, int64_t d); - , &[_][]const u8{ - \\pub extern fn foo(a: u8, b: u8, c: i8) c_int; - \\pub extern fn bar(a: u8, b: u16, c: u32, d: u64) void; - \\pub extern fn baz(a: i8, b: i16, c: i32, d: i64) void; - }); - - cases.add("simple function", - \\int abs(int a) { - \\ return a < 0 ? -a : a; - \\} - , &[_][]const u8{ - \\pub export fn abs(arg_a: c_int) c_int { - \\ var a = arg_a; - \\ _ = &a; - \\ return if (a < @as(c_int, 0)) -a else a; - \\} - }); - - cases.add("post increment", - \\unsigned foo1(unsigned a) { - \\ a++; - \\ return a; - \\} - \\int foo2(int a) { - \\ a++; - \\ return a; - \\} - \\int *foo3(int *a) { - \\ a++; - \\ return a; - \\} - , &[_][]const u8{ - \\pub export fn foo1(arg_a: c_uint) c_uint { - \\ var a = arg_a; - \\ _ = &a; - \\ a +%= 1; - \\ return a; - \\} - \\pub export fn foo2(arg_a: c_int) c_int { - \\ var a = arg_a; - \\ _ = &a; - \\ a += 1; - \\ return a; - \\} - \\pub export fn foo3(arg_a: [*c]c_int) [*c]c_int { - \\ var a = arg_a; - \\ _ = &a; - \\ a += 1; - \\ return a; - \\} - }); - - cases.add("deref function pointer", - \\void foo(void) {} - \\int baz(void) { return 0; } - \\void bar(void) { - \\ void(*f)(void) = foo; - \\ int(*b)(void) = baz; - \\ f(); - \\ (*(f))(); - \\ foo(); - \\ b(); - \\ (*(b))(); - \\ baz(); - \\} - , &[_][]const u8{ - \\pub export fn foo() void {} - \\pub export fn baz() c_int { - \\ return 0; - \\} - \\pub export fn bar() void { - \\ var f: ?*const fn () callconv(.c) void = &foo; - \\ _ = &f; - \\ var b: ?*const fn () callconv(.c) c_int = &baz; - \\ _ = &b; - \\ f.?(); - \\ f.?(); - \\ foo(); - \\ _ = b.?(); - \\ _ = b.?(); - \\ _ = baz(); - \\} - }); - - cases.add("pre increment/decrement", - \\void foo(void) { - \\ int i = 0; - \\ unsigned u = 0; - \\ ++i; - \\ --i; - \\ ++u; - \\ --u; - \\ i = ++i; - \\ i = --i; - \\ u = ++u; - \\ u = --u; - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ var i: c_int = 0; - \\ _ = &i; - \\ var u: c_uint = 0; - \\ _ = &u; - \\ i += 1; - \\ i -= 1; - \\ u +%= 1; - \\ u -%= 1; - \\ i = blk: { - \\ const ref = &i; - \\ ref.* += 1; - \\ break :blk ref.*; - \\ }; - \\ i = blk: { - \\ const ref = &i; - \\ ref.* -= 1; - \\ break :blk ref.*; - \\ }; - \\ u = blk: { - \\ const ref = &u; - \\ ref.* +%= 1; - \\ break :blk ref.*; - \\ }; - \\ u = blk: { - \\ const ref = &u; - \\ ref.* -%= 1; - \\ break :blk ref.*; - \\ }; - \\} - }); - - cases.add("shift right assign", - \\int log2(unsigned a) { - \\ int i = 0; - \\ while (a > 0) { - \\ a >>= 1; - \\ } - \\ return i; - \\} - , &[_][]const u8{ - \\pub export fn log2(arg_a: c_uint) c_int { - \\ var a = arg_a; - \\ _ = &a; - \\ var i: c_int = 0; - \\ _ = &i; - \\ while (a > @as(c_uint, @bitCast(@as(c_int, 0)))) { - \\ a >>= @intCast(@as(c_int, 1)); - \\ } - \\ return i; - \\} - }); - - cases.add("shift right assign with a fixed size type", - \\#include - \\int log2(uint32_t a) { - \\ int i = 0; - \\ while (a > 0) { - \\ a >>= 1; - \\ } - \\ return i; - \\} - , &[_][]const u8{ - \\pub export fn log2(arg_a: u32) c_int { - \\ var a = arg_a; - \\ _ = &a; - \\ var i: c_int = 0; - \\ _ = &i; - \\ while (a > @as(u32, @bitCast(@as(c_int, 0)))) { - \\ a >>= @intCast(@as(c_int, 1)); - \\ } - \\ return i; - \\} - }); - - cases.add("compound assignment operators", - \\void foo(void) { - \\ int a = 0; - \\ unsigned b = 0; - \\ a += (a += 1); - \\ a -= (a -= 1); - \\ a *= (a *= 1); - \\ a &= (a &= 1); - \\ a |= (a |= 1); - \\ a ^= (a ^= 1); - \\ a >>= (a >>= 1); - \\ a <<= (a <<= 1); - \\ a /= (a /= 1); - \\ a %= (a %= 1); - \\ b /= (b /= 1); - \\ b %= (b %= 1); - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ var a: c_int = 0; - \\ _ = &a; - \\ var b: c_uint = 0; - \\ _ = &b; - \\ a += blk: { - \\ const ref = &a; - \\ ref.* += @as(c_int, 1); - \\ break :blk ref.*; - \\ }; - \\ a -= blk: { - \\ const ref = &a; - \\ ref.* -= @as(c_int, 1); - \\ break :blk ref.*; - \\ }; - \\ a *= blk: { - \\ const ref = &a; - \\ ref.* *= @as(c_int, 1); - \\ break :blk ref.*; - \\ }; - \\ a &= blk: { - \\ const ref = &a; - \\ ref.* &= @as(c_int, 1); - \\ break :blk ref.*; - \\ }; - \\ a |= blk: { - \\ const ref = &a; - \\ ref.* |= @as(c_int, 1); - \\ break :blk ref.*; - \\ }; - \\ a ^= blk: { - \\ const ref = &a; - \\ ref.* ^= @as(c_int, 1); - \\ break :blk ref.*; - \\ }; - \\ a >>= @intCast(blk: { - \\ const ref = &a; - \\ ref.* >>= @intCast(@as(c_int, 1)); - \\ break :blk ref.*; - \\ }); - \\ a <<= @intCast(blk: { - \\ const ref = &a; - \\ ref.* <<= @intCast(@as(c_int, 1)); - \\ break :blk ref.*; - \\ }); - \\ a = @divTrunc(a, blk: { - \\ const ref = &a; - \\ ref.* = @divTrunc(ref.*, @as(c_int, 1)); - \\ break :blk ref.*; - \\ }); - \\ a = @import("std").zig.c_translation.signedRemainder(a, blk: { - \\ const ref = &a; - \\ ref.* = @import("std").zig.c_translation.signedRemainder(ref.*, @as(c_int, 1)); - \\ break :blk ref.*; - \\ }); - \\ b /= blk: { - \\ const ref = &b; - \\ ref.* /= @as(c_uint, @bitCast(@as(c_int, 1))); - \\ break :blk ref.*; - \\ }; - \\ b %= blk: { - \\ const ref = &b; - \\ ref.* %= @as(c_uint, @bitCast(@as(c_int, 1))); - \\ break :blk ref.*; - \\ }; - \\} - }); - - cases.add("compound assignment operators unsigned", - \\void foo(void) { - \\ unsigned a = 0; - \\ a += (a += 1); - \\ a -= (a -= 1); - \\ a *= (a *= 1); - \\ a &= (a &= 1); - \\ a |= (a |= 1); - \\ a ^= (a ^= 1); - \\ a >>= (a >>= 1); - \\ a <<= (a <<= 1); - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ var a: c_uint = 0; - \\ _ = &a; - \\ a +%= blk: { - \\ const ref = &a; - \\ ref.* +%= @as(c_uint, @bitCast(@as(c_int, 1))); - \\ break :blk ref.*; - \\ }; - \\ a -%= blk: { - \\ const ref = &a; - \\ ref.* -%= @as(c_uint, @bitCast(@as(c_int, 1))); - \\ break :blk ref.*; - \\ }; - \\ a *%= blk: { - \\ const ref = &a; - \\ ref.* *%= @as(c_uint, @bitCast(@as(c_int, 1))); - \\ break :blk ref.*; - \\ }; - \\ a &= blk: { - \\ const ref = &a; - \\ ref.* &= @as(c_uint, @bitCast(@as(c_int, 1))); - \\ break :blk ref.*; - \\ }; - \\ a |= blk: { - \\ const ref = &a; - \\ ref.* |= @as(c_uint, @bitCast(@as(c_int, 1))); - \\ break :blk ref.*; - \\ }; - \\ a ^= blk: { - \\ const ref = &a; - \\ ref.* ^= @as(c_uint, @bitCast(@as(c_int, 1))); - \\ break :blk ref.*; - \\ }; - \\ a >>= @intCast(blk: { - \\ const ref = &a; - \\ ref.* >>= @intCast(@as(c_int, 1)); - \\ break :blk ref.*; - \\ }); - \\ a <<= @intCast(blk: { - \\ const ref = &a; - \\ ref.* <<= @intCast(@as(c_int, 1)); - \\ break :blk ref.*; - \\ }); - \\} - }); - - cases.add("post increment/decrement", - \\void foo(void) { - \\ int i = 0; - \\ unsigned u = 0; - \\ i++; - \\ i--; - \\ u++; - \\ u--; - \\ i = i++; - \\ i = i--; - \\ u = u++; - \\ u = u--; - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ var i: c_int = 0; - \\ _ = &i; - \\ var u: c_uint = 0; - \\ _ = &u; - \\ i += 1; - \\ i -= 1; - \\ u +%= 1; - \\ u -%= 1; - \\ i = blk: { - \\ const ref = &i; - \\ const tmp = ref.*; - \\ ref.* += 1; - \\ break :blk tmp; - \\ }; - \\ i = blk: { - \\ const ref = &i; - \\ const tmp = ref.*; - \\ ref.* -= 1; - \\ break :blk tmp; - \\ }; - \\ u = blk: { - \\ const ref = &u; - \\ const tmp = ref.*; - \\ ref.* +%= 1; - \\ break :blk tmp; - \\ }; - \\ u = blk: { - \\ const ref = &u; - \\ const tmp = ref.*; - \\ ref.* -%= 1; - \\ break :blk tmp; - \\ }; - \\} - }); - - cases.add("implicit casts", - \\#include - \\ - \\void fn_int(int x); - \\void fn_f32(float x); - \\void fn_f64(double x); - \\void fn_char(char x); - \\void fn_bool(bool x); - \\void fn_ptr(void *x); - \\ - \\void call() { - \\ fn_int(3.0f); - \\ fn_int(3.0); - \\ fn_int('ABCD'); - \\ fn_f32(3); - \\ fn_f64(3); - \\ fn_char('3'); - \\ fn_char('\x1'); - \\ fn_char(0); - \\ fn_f32(3.0f); - \\ fn_f64(3.0); - \\ fn_bool(123); - \\ fn_bool(0); - \\ fn_bool(&fn_int); - \\ fn_int((int)&fn_int); - \\ fn_ptr((void *)42); - \\} - , &[_][]const u8{ - \\pub extern fn fn_int(x: c_int) void; - \\pub extern fn fn_f32(x: f32) void; - \\pub extern fn fn_f64(x: f64) void; - \\pub extern fn fn_char(x: u8) void; - \\pub extern fn fn_bool(x: bool) void; - \\pub extern fn fn_ptr(x: ?*anyopaque) void; - \\pub export fn call() void { - \\ fn_int(@as(c_int, @intFromFloat(3.0))); - \\ fn_int(@as(c_int, @intFromFloat(3.0))); - \\ fn_int(@as(c_int, 1094861636)); - \\ fn_f32(@as(f32, @floatFromInt(@as(c_int, 3)))); - \\ fn_f64(@as(f64, @floatFromInt(@as(c_int, 3)))); - \\ fn_char(@as(u8, @bitCast(@as(i8, @truncate(@as(c_int, '3')))))); - \\ fn_char(@as(u8, @bitCast(@as(i8, @truncate(@as(c_int, '\x01')))))); - \\ fn_char(@as(u8, @bitCast(@as(i8, @truncate(@as(c_int, 0)))))); - \\ fn_f32(3.0); - \\ fn_f64(3.0); - \\ fn_bool(@as(c_int, 123) != 0); - \\ fn_bool(@as(c_int, 0) != 0); - \\ fn_bool(@intFromPtr(&fn_int) != 0); - \\ fn_int(@as(c_int, @intCast(@intFromPtr(&fn_int)))); - \\ fn_ptr(@as(?*anyopaque, @ptrFromInt(@as(c_int, 42)))); - \\} - }); - - cases.add("function call", - \\static void bar(void) { } - \\void foo(int *(baz)(void)) { - \\ bar(); - \\ baz(); - \\} - , &[_][]const u8{ - \\pub fn bar() callconv(.c) void {} - \\pub export fn foo(arg_baz: ?*const fn () callconv(.c) [*c]c_int) void { - \\ var baz = arg_baz; - \\ _ = &baz; - \\ bar(); - \\ _ = baz.?(); - \\} - }); - - cases.add("macro defines string literal with octal", - \\#define FOO "aoeu\023 derp" - \\#define FOO2 "aoeu\0234 derp" - \\#define FOO_CHAR '\077' - , &[_][]const u8{ - \\pub const FOO = "aoeu\x13 derp"; - , - \\pub const FOO2 = "aoeu\x134 derp"; - , - \\pub const FOO_CHAR = '\x3f'; - }); - - cases.add("macro cast", - \\#include - \\int baz(void *arg) { return 0; } - \\#define FOO(bar) baz((void *)(baz)) - \\#define BAR (void*) a - \\#define BAZ (uint32_t)(2) - \\#define a 2 - , &[_][]const u8{ - \\pub inline fn FOO(bar: anytype) @TypeOf(baz(@import("std").zig.c_translation.cast(?*anyopaque, baz))) { - \\ _ = &bar; - \\ return baz(@import("std").zig.c_translation.cast(?*anyopaque, baz)); - \\} - , - \\pub const BAR = @import("std").zig.c_translation.cast(?*anyopaque, a); - , - \\pub const BAZ = @import("std").zig.c_translation.cast(u32, @as(c_int, 2)); - }); - - cases.add("macro with cast to unsigned short, long, and long long", - \\#define CURLAUTH_BASIC_BUT_USHORT ((unsigned short) 1) - \\#define CURLAUTH_BASIC ((unsigned long) 1) - \\#define CURLAUTH_BASIC_BUT_ULONGLONG ((unsigned long long) 1) - , &[_][]const u8{ - \\pub const CURLAUTH_BASIC_BUT_USHORT = @import("std").zig.c_translation.cast(c_ushort, @as(c_int, 1)); - \\pub const CURLAUTH_BASIC = @import("std").zig.c_translation.cast(c_ulong, @as(c_int, 1)); - \\pub const CURLAUTH_BASIC_BUT_ULONGLONG = @import("std").zig.c_translation.cast(c_ulonglong, @as(c_int, 1)); - }); - - cases.add("macro conditional operator", - \\ int a, b, c; - \\#define FOO a ? b : c - , &[_][]const u8{ - \\pub inline fn FOO() @TypeOf(if (a) b else c) { - \\ return if (a) b else c; - \\} - }); - - cases.add("do while as expr", - \\static void foo(void) { - \\ if (1) - \\ do {} while (0); - \\} - , &[_][]const u8{ - \\pub fn foo() callconv(.c) void { - \\ if (true) while (true) { - \\ if (!false) break; - \\ }; - \\} - }); - - cases.add("macro comparisons", - \\#define MIN(a, b) ((b) < (a) ? (b) : (a)) - \\#define MAX(a, b) ((b) > (a) ? (b) : (a)) - , &[_][]const u8{ - \\pub inline fn MIN(a: anytype, b: anytype) @TypeOf(if (b < a) b else a) { - \\ _ = &a; - \\ _ = &b; - \\ return if (b < a) b else a; - \\} - , - \\pub inline fn MAX(a: anytype, b: anytype) @TypeOf(if (b > a) b else a) { - \\ _ = &a; - \\ _ = &b; - \\ return if (b > a) b else a; - \\} - }); - - cases.add("nested assignment", - \\int foo(int *p, int x) { - \\ return *p++ = x; - \\} - , &[_][]const u8{ - \\pub export fn foo(arg_p: [*c]c_int, arg_x: c_int) c_int { - \\ var p = arg_p; - \\ _ = &p; - \\ var x = arg_x; - \\ _ = &x; - \\ return blk: { - \\ const tmp = x; - \\ (blk_1: { - \\ const ref = &p; - \\ const tmp_2 = ref.*; - \\ ref.* += 1; - \\ break :blk_1 tmp_2; - \\ }).* = tmp; - \\ break :blk tmp; - \\ }; - \\} - }); - - cases.add("widening and truncating integer casting to different signedness", - \\unsigned long foo(void) { - \\ return -1; - \\} - \\unsigned short bar(long x) { - \\ return x; - \\} - , &[_][]const u8{ - \\pub export fn foo() c_ulong { - \\ return @as(c_ulong, @bitCast(@as(c_long, -@as(c_int, 1)))); - \\} - \\pub export fn bar(arg_x: c_long) c_ushort { - \\ var x = arg_x; - \\ _ = &x; - \\ return @as(c_ushort, @bitCast(@as(c_short, @truncate(x)))); - \\} - }); - - cases.add("arg name aliasing decl which comes after", - \\void foo(int bar) { - \\ bar = 2; - \\} - \\int bar = 4; - , &[_][]const u8{ - \\pub export fn foo(arg_bar_1: c_int) void { - \\ var bar_1 = arg_bar_1; - \\ _ = &bar_1; - \\ bar_1 = 2; - \\} - \\pub export var bar: c_int = 4; - }); - - cases.add("arg name aliasing macro which comes after", - \\void foo(int bar) { - \\ bar = 2; - \\} - \\#define bar 4 - , &[_][]const u8{ - \\pub export fn foo(arg_bar_1: c_int) void { - \\ var bar_1 = arg_bar_1; - \\ _ = &bar_1; - \\ bar_1 = 2; - \\} - , - \\pub const bar = @as(c_int, 4); - }); - - cases.add("don't export inline functions", - \\inline void a(void) {} - \\static void b(void) {} - \\void c(void) {} - \\static void foo() {} - , &[_][]const u8{ - \\pub fn a() callconv(.c) void {} - \\pub fn b() callconv(.c) void {} - \\pub export fn c() void {} - \\pub fn foo() callconv(.c) void {} - }); - - cases.add("casting away const and volatile", - \\void foo(int *a) {} - \\void bar(const int *a) { - \\ foo((int *)a); - \\} - \\void baz(volatile int *a) { - \\ foo((int *)a); - \\} - , &[_][]const u8{ - \\pub export fn foo(arg_a: [*c]c_int) void { - \\ var a = arg_a; - \\ _ = &a; - \\} - \\pub export fn bar(arg_a: [*c]const c_int) void { - \\ var a = arg_a; - \\ _ = &a; - \\ foo(@as([*c]c_int, @ptrCast(@constCast(@volatileCast(a))))); - \\} - \\pub export fn baz(arg_a: [*c]volatile c_int) void { - \\ var a = arg_a; - \\ _ = &a; - \\ foo(@as([*c]c_int, @ptrCast(@constCast(@volatileCast(a))))); - \\} - }); - - cases.add("handling of _Bool type", - \\_Bool foo(_Bool x) { - \\ _Bool a = x != 1; - \\ _Bool b = a != 0; - \\ _Bool c = foo; - \\ return foo(c != b); - \\} - , &[_][]const u8{ - \\pub export fn foo(arg_x: bool) bool { - \\ var x = arg_x; - \\ _ = &x; - \\ var a: bool = @as(c_int, @intFromBool(x)) != @as(c_int, 1); - \\ _ = &a; - \\ var b: bool = @as(c_int, @intFromBool(a)) != @as(c_int, 0); - \\ _ = &b; - \\ var c: bool = @intFromPtr(&foo) != 0; - \\ _ = &c; - \\ return foo(@as(c_int, @intFromBool(c)) != @as(c_int, @intFromBool(b))); - \\} - }); - - cases.add("Don't make const parameters mutable", - \\int max(const int x, int y) { - \\ return (x > y) ? x : y; - \\} - , &[_][]const u8{ - \\pub export fn max(x: c_int, arg_y: c_int) c_int { - \\ _ = &x; - \\ var y = arg_y; - \\ _ = &y; - \\ return if (x > y) x else y; - \\} - }); - - cases.add("string concatenation in macros", - \\#define FOO "hello" - \\#define BAR FOO " world" - \\#define BAZ "oh, " FOO - , &[_][]const u8{ - \\pub const FOO = "hello"; - , - \\pub const BAR = FOO ++ " world"; - , - \\pub const BAZ = "oh, " ++ FOO; - }); - - cases.add("string concatenation in macros: two defines", - \\#define FOO "hello" - \\#define BAZ " world" - \\#define BAR FOO BAZ - , &[_][]const u8{ - \\pub const FOO = "hello"; - , - \\pub const BAZ = " world"; - , - \\pub const BAR = FOO ++ BAZ; - }); - - cases.add("string concatenation in macros: two strings", - \\#define FOO "a" "b" - \\#define BAR FOO "c" - , &[_][]const u8{ - \\pub const FOO = "a" ++ "b"; - , - \\pub const BAR = FOO ++ "c"; - }); - - cases.add("string concatenation in macros: three strings", - \\#define FOO "a" "b" "c" - , &[_][]const u8{ - \\pub const FOO = "a" ++ "b" ++ "c"; - }); - - cases.add("multibyte character literals", - \\#define FOO 'abcd' - , &[_][]const u8{ - \\pub const FOO = 0x61626364; - }); - - cases.add("Make sure casts are grouped", - \\typedef struct - \\{ - \\ int i; - \\} - \\*_XPrivDisplay; - \\typedef struct _XDisplay Display; - \\#define DefaultScreen(dpy) (((_XPrivDisplay)(dpy))->default_screen) - \\ - , &[_][]const u8{ - \\pub inline fn DefaultScreen(dpy: anytype) @TypeOf(@import("std").zig.c_translation.cast(_XPrivDisplay, dpy).*.default_screen) { - \\ _ = &dpy; - \\ return @import("std").zig.c_translation.cast(_XPrivDisplay, dpy).*.default_screen; - \\} - }); - - cases.add("macro integer literal casts", - \\#define NULL ((void*)0) - \\#define FOO ((int)0x8000) - , &[_][]const u8{ - \\pub const NULL = @import("std").zig.c_translation.cast(?*anyopaque, @as(c_int, 0)); - , - \\pub const FOO = @import("std").zig.c_translation.cast(c_int, @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8000, .hex)); - }); - - if (builtin.abi == .msvc) { - cases.add("nameless struct fields", - \\typedef struct NAMED - \\{ - \\ long name; - \\} NAMED; - \\ - \\typedef struct ONENAMEWITHSTRUCT - \\{ - \\ NAMED; - \\ long b; - \\} ONENAMEWITHSTRUCT; - , &[_][]const u8{ - \\pub const struct_NAMED = extern struct { - \\ name: c_long = @import("std").mem.zeroes(c_long), - \\}; - \\pub const NAMED = struct_NAMED; - \\pub const struct_ONENAMEWITHSTRUCT = extern struct { - \\ unnamed_0: struct_NAMED = = @import("std").mem.zeroes(struct_NAMED), - \\ b: c_long = @import("std").mem.zeroes(c_long), - \\}; - }); - } else { - cases.add("nameless struct fields", - \\typedef struct NAMED - \\{ - \\ long name; - \\} NAMED; - \\ - \\typedef struct ONENAMEWITHSTRUCT - \\{ - \\ NAMED; - \\ long b; - \\} ONENAMEWITHSTRUCT; - , &[_][]const u8{ - \\pub const struct_NAMED = extern struct { - \\ name: c_long = @import("std").mem.zeroes(c_long), - \\}; - \\pub const NAMED = struct_NAMED; - \\pub const struct_ONENAMEWITHSTRUCT = extern struct { - \\ b: c_long = @import("std").mem.zeroes(c_long), - \\}; - }); - } - - cases.add("integer literal promotion", - \\#define GUARANTEED_TO_FIT_1 1024 - \\#define GUARANTEED_TO_FIT_2 10241024L - \\#define GUARANTEED_TO_FIT_3 20482048LU - \\#define MAY_NEED_PROMOTION_1 10241024 - \\#define MAY_NEED_PROMOTION_2 307230723072L - \\#define MAY_NEED_PROMOTION_3 819281928192LU - \\#define MAY_NEED_PROMOTION_HEX 0x80000000 - \\#define MAY_NEED_PROMOTION_OCT 020000000000 - , &[_][]const u8{ - \\pub const GUARANTEED_TO_FIT_1 = @as(c_int, 1024); - \\pub const GUARANTEED_TO_FIT_2 = @as(c_long, 10241024); - \\pub const GUARANTEED_TO_FIT_3 = @as(c_ulong, 20482048); - \\pub const MAY_NEED_PROMOTION_1 = @import("std").zig.c_translation.promoteIntLiteral(c_int, 10241024, .decimal); - \\pub const MAY_NEED_PROMOTION_2 = @import("std").zig.c_translation.promoteIntLiteral(c_long, 307230723072, .decimal); - \\pub const MAY_NEED_PROMOTION_3 = @import("std").zig.c_translation.promoteIntLiteral(c_ulong, 819281928192, .decimal); - \\pub const MAY_NEED_PROMOTION_HEX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x80000000, .hex); - \\pub const MAY_NEED_PROMOTION_OCT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0o20000000000, .octal); - }); - - cases.add("demote un-implemented builtins", - \\#define FOO(X) __builtin_alloca_with_align((X), 8) - , &[_][]const u8{ - \\pub const FOO = @compileError("unable to translate macro: undefined identifier `__builtin_alloca_with_align`"); - }); - - cases.add("null sentinel arrays when initialized from string literal. Issue #8256", - \\#include - \\char zero[0] = "abc"; - \\uint32_t zero_w[0] = U"💯💯💯"; - \\char empty_incomplete[] = ""; - \\uint32_t empty_incomplete_w[] = U""; - \\char empty_constant[100] = ""; - \\uint32_t empty_constant_w[100] = U""; - \\char incomplete[] = "abc"; - \\uint32_t incomplete_w[] = U"💯💯💯"; - \\char truncated[1] = "abc"; - \\uint32_t truncated_w[1] = U"💯💯💯"; - \\char extend[5] = "a"; - \\uint32_t extend_w[5] = U"💯"; - \\char no_null[3] = "abc"; - \\uint32_t no_null_w[3] = U"💯💯💯"; - , &[_][]const u8{ - \\pub export var zero: [0]u8 = [0]u8{}; - \\pub export var zero_w: [0]u32 = [0]u32{}; - \\pub export var empty_incomplete: [1]u8 = [1]u8{0} ** 1; - \\pub export var empty_incomplete_w: [1]u32 = [1]u32{0} ** 1; - \\pub export var empty_constant: [100]u8 = [1]u8{0} ** 100; - \\pub export var empty_constant_w: [100]u32 = [1]u32{0} ** 100; - \\pub export var incomplete: [3:0]u8 = "abc".*; - \\pub export var incomplete_w: [3:0]u32 = [3:0]u32{ - \\ '\u{1f4af}', - \\ '\u{1f4af}', - \\ '\u{1f4af}', - \\}; - \\pub export var truncated: [1]u8 = "abc"[0..1].*; - \\pub export var truncated_w: [1]u32 = [1]u32{ - \\ '\u{1f4af}', - \\}; - \\pub export var extend: [5]u8 = "a"[0..1].* ++ [1]u8{0} ** 4; - \\pub export var extend_w: [5]u32 = [1]u32{ - \\ '\u{1f4af}', - \\} ++ [1]u32{0} ** 4; - \\pub export var no_null: [3]u8 = "abc".*; - \\pub export var no_null_w: [3]u32 = [3]u32{ - \\ '\u{1f4af}', - \\ '\u{1f4af}', - \\ '\u{1f4af}', - \\}; - }); - - cases.add("global assembly", - \\__asm__(".globl func\n\t" - \\ ".type func, @function\n\t" - \\ "func:\n\t" - \\ ".cfi_startproc\n\t" - \\ "movl $42, %eax\n\t" - \\ "ret\n\t" - \\ ".cfi_endproc"); - , &[_][]const u8{ - \\comptime { - \\ asm (".globl func\n\t.type func, @function\n\tfunc:\n\t.cfi_startproc\n\tmovl $42, %eax\n\tret\n\t.cfi_endproc"); - \\} - }); - - cases.add("Demote function that initializes opaque struct", - \\struct my_struct { - \\ unsigned a: 15; - \\ unsigned: 2; - \\ unsigned b: 15; - \\}; - \\void initialize(void) { - \\ struct my_struct S = {.a = 1, .b = 2}; - \\} - , &[_][]const u8{ - \\warning: local variable has opaque type - , - \\warning: unable to translate function, demoted to extern - \\pub extern fn initialize() void; - }); - - cases.add("Demote function that dereferences opaque type", - \\struct my_struct { - \\ unsigned a: 1; - \\}; - \\void deref(struct my_struct *s) { - \\ *s; - \\} - , &[_][]const u8{ - \\warning: cannot dereference opaque type - , - \\warning: unable to translate function, demoted to extern - \\pub extern fn deref(arg_s: ?*struct_my_struct) void; - }); - - cases.add("Demote function that dereference types that contain opaque type", - \\struct inner { - \\ _Atomic int a; - \\}; - \\struct outer { - \\ int thing; - \\ struct inner sub_struct; - \\}; - \\void deref(struct outer *s) { - \\ *s; - \\} - , &[_][]const u8{ - \\pub const struct_inner = opaque {}; - , - \\pub const struct_outer = extern struct { - \\ thing: c_int = @import("std").mem.zeroes(c_int), - \\ sub_struct: struct_inner = @import("std").mem.zeroes(struct_inner), - \\}; - , - \\warning: unable to translate function, demoted to extern - , - \\pub extern fn deref(arg_s: ?*struct_outer) void; - }); - - cases.add("Function prototype declared within function", - \\int foo(void) { - \\ extern int bar(int, int); - \\ return bar(1, 2); - \\} - , &[_][]const u8{ - \\pub export fn foo() c_int { - \\ const ExternLocal_bar = struct { - \\ pub extern fn bar(c_int, c_int) c_int; - \\ }; - \\ _ = &ExternLocal_bar; - \\ return ExternLocal_bar.bar(@as(c_int, 1), @as(c_int, 2)); - \\} - }); - - cases.add("static local variable zero-initialized if no initializer", - \\struct FOO {int x; int y;}; - \\int bar(void) { - \\ static struct FOO foo; - \\ return foo.x; - \\} - , &[_][]const u8{ - \\pub const struct_FOO = extern struct { - \\ x: c_int = @import("std").mem.zeroes(c_int), - \\ y: c_int = @import("std").mem.zeroes(c_int), - \\}; - \\pub export fn bar() c_int { - \\ const foo = struct { - \\ var static: struct_FOO = @import("std").mem.zeroes(struct_FOO); - \\ }; - \\ _ = &foo; - \\ return foo.static.x; - \\} - }); - - cases.add("macro with nontrivial cast", - \\#define MAP_FAILED ((void *) -1) - \\typedef long long LONG_PTR; - \\#define INVALID_HANDLE_VALUE ((void *)(LONG_PTR)-1) - , &[_][]const u8{ - \\pub const MAP_FAILED = @import("std").zig.c_translation.cast(?*anyopaque, -@as(c_int, 1)); - \\pub const INVALID_HANDLE_VALUE = @import("std").zig.c_translation.cast(?*anyopaque, @import("std").zig.c_translation.cast(LONG_PTR, -@as(c_int, 1))); - }); - - cases.add("discard unused local variables and function parameters", - \\#define FOO(A, B) (A) - \\int bar(int x, int y) { - \\ return x; - \\} - , &[_][]const u8{ - \\pub export fn bar(arg_x: c_int, arg_y: c_int) c_int { - \\ var x = arg_x; - \\ _ = &x; - \\ var y = arg_y; - \\ _ = &y; - \\ return x; - \\} - , - \\pub inline fn FOO(A: anytype, B: anytype) @TypeOf(A) { - \\ _ = &A; - \\ _ = &B; - \\ return A; - \\} - }); - - cases.add("Use @ syntax for bare underscore identifier in macro or public symbol", - \\#define FOO _ - \\int _ = 42; - , &[_][]const u8{ - \\pub inline fn FOO() @TypeOf(@"_") { - \\ return @"_"; - \\} - , - \\pub export var @"_": c_int = 42; - }); - - cases.add("Macro matching", - \\#define FOO(X) (X ## U) - , &[_][]const u8{ - \\pub const FOO = @import("std").zig.c_translation.Macros.U_SUFFIX; - }); - - cases.add("Simple array access of pointer with non-negative integer constant", - \\void foo(int *p) { - \\ p[0]; - \\ p[1]; - \\} - , &[_][]const u8{ - \\_ = p[@as(c_uint, @intCast(@as(c_int, 0)))]; - , - \\_ = p[@as(c_uint, @intCast(@as(c_int, 1)))]; - }); - - cases.add("Undefined macro identifier", - \\#define FOO BAR - , &[_][]const u8{ - \\pub const FOO = @compileError("unable to translate macro: undefined identifier `BAR`"); - }); - - cases.add("Macro redefines builtin", - \\#define FOO __builtin_popcount - , &[_][]const u8{ - \\pub const FOO = __builtin_popcount; - }); - - cases.add("Only consider public decls in `isBuiltinDefined`", - \\#define FOO std - , &[_][]const u8{ - \\pub const FOO = @compileError("unable to translate macro: undefined identifier `std`"); - }); - - cases.add("Macro without a value", - \\#define FOO - , &[_][]const u8{ - \\pub const FOO = ""; - }); - - cases.add("leading zeroes", - \\#define O_RDONLY 00 - \\#define HELLO 000 - \\#define ZERO 0 - \\#define WORLD 00000123 - , &[_][]const u8{ - \\pub const O_RDONLY = @as(c_int, 0o0); - \\pub const HELLO = @as(c_int, 0o00); - \\pub const ZERO = @as(c_int, 0); - \\pub const WORLD = @as(c_int, 0o0000123); - }); - - cases.add("Assign expression from bool to int", - \\void foo(void) { - \\ int a; - \\ if (a = 1 > 0) {} - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ var a: c_int = undefined; - \\ _ = &a; - \\ if ((blk: { - \\ const tmp = @intFromBool(@as(c_int, 1) > @as(c_int, 0)); - \\ a = tmp; - \\ break :blk tmp; - \\ }) != 0) {} - \\} - }); - - if (builtin.os.tag == .windows) { - cases.add("Pointer subtraction with typedef", - \\typedef char* S; - \\void foo() { - \\ S a, b; - \\ long long c = a - b; - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ var a: S = undefined; - \\ _ = &a; - \\ var b: S = undefined; - \\ _ = &b; - \\ var c: c_longlong = @divExact(@as(c_longlong, @bitCast(@intFromPtr(a) -% @intFromPtr(b))), @sizeOf(u8)); - \\ _ = &c; - \\} - }); - } else { - cases.add("Pointer subtraction with typedef", - \\typedef char* S; - \\void foo() { - \\ S a, b; - \\ long c = a - b; - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ var a: S = undefined; - \\ _ = &a; - \\ var b: S = undefined; - \\ _ = &b; - \\ var c: c_long = @divExact(@as(c_long, @bitCast(@intFromPtr(a) -% @intFromPtr(b))), @sizeOf(u8)); - \\ _ = &c; - \\} - }); - } - - cases.add("extern array of unknown length", - \\extern int foo[]; - , &[_][]const u8{ - \\const foo: [*c]c_int = @extern([*c]c_int, .{ - \\ .name = "foo", - \\}); - }); - - cases.add("string array initializer", - \\static const char foo[] = {"bar"}; - , &[_][]const u8{ - \\pub const foo: [3:0]u8 = "bar"; - }); - - cases.add("worst-case assign from mangle prefix", - \\void foo() { - \\ int n, tmp = 1; - \\ if (n = tmp) {} - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ var n: c_int = undefined; - \\ _ = &n; - \\ var tmp: c_int = 1; - \\ _ = &tmp; - \\ if ((blk: { - \\ const tmp_1 = tmp; - \\ n = tmp_1; - \\ break :blk tmp_1; - \\ }) != 0) {} - \\} - }); - - cases.add("worst-case assign to mangle prefix", - \\void foo() { - \\ int tmp, n = 1; - \\ if (tmp = n) {} - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ var tmp: c_int = undefined; - \\ _ = &tmp; - \\ var n: c_int = 1; - \\ _ = &n; - \\ if ((blk: { - \\ const tmp_1 = n; - \\ tmp = tmp_1; - \\ break :blk tmp_1; - \\ }) != 0) {} - \\} - }); - - cases.add("worst-case precrement mangle prefix", - \\void foo() { - \\ int n, ref = 1; - \\ if (n = ++ref) {} - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ var n: c_int = undefined; - \\ _ = &n; - \\ var ref: c_int = 1; - \\ _ = &ref; - \\ if ((blk: { - \\ const tmp = blk_1: { - \\ const ref_2 = &ref; - \\ ref_2.* += 1; - \\ break :blk_1 ref_2.*; - \\ }; - \\ n = tmp; - \\ break :blk tmp; - \\ }) != 0) {} - \\} - }); - - cases.add("worst-case postcrement mangle prefix", - \\void foo() { - \\ int n, ref = 1; - \\ if (n = ref++) {} - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ var n: c_int = undefined; - \\ _ = &n; - \\ var ref: c_int = 1; - \\ _ = &ref; - \\ if ((blk: { - \\ const tmp = blk_1: { - \\ const ref_2 = &ref; - \\ const tmp_3 = ref_2.*; - \\ ref_2.* += 1; - \\ break :blk_1 tmp_3; - \\ }; - \\ n = tmp; - \\ break :blk tmp; - \\ }) != 0) {} - \\} - }); - - cases.add("worst-case compound assign from mangle prefix", - \\void foo() { - \\ int n, ref = 1; - \\ if (n += ref) {} - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ var n: c_int = undefined; - \\ _ = &n; - \\ var ref: c_int = 1; - \\ _ = &ref; - \\ if ((blk: { - \\ const ref_1 = &n; - \\ ref_1.* += ref; - \\ break :blk ref_1.*; - \\ }) != 0) {} - \\} - }); - - cases.add("worst-case compound assign to mangle prefix", - \\void foo() { - \\ int ref, n = 1; - \\ if (ref += n) {} - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ var ref: c_int = undefined; - \\ _ = &ref; - \\ var n: c_int = 1; - \\ _ = &n; - \\ if ((blk: { - \\ const ref_1 = &ref; - \\ ref_1.* += n; - \\ break :blk ref_1.*; - \\ }) != 0) {} - \\} - }); - - cases.add("binary conditional operator where condition is the mangle prefix", - \\void foo() { - \\ int f = 1; - \\ int n, cond_temp = 1; - \\ if (n = (cond_temp)?:(f)) {} - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ var f: c_int = 1; - \\ _ = &f; - \\ var n: c_int = undefined; - \\ _ = &n; - \\ var cond_temp: c_int = 1; - \\ _ = &cond_temp; - \\ if ((blk: { - \\ const tmp = blk_1: { - \\ const cond_temp_2 = cond_temp; - \\ break :blk_1 if (cond_temp_2 != 0) cond_temp_2 else f; - \\ }; - \\ n = tmp; - \\ break :blk tmp; - \\ }) != 0) {} - \\} - }); - - cases.add("binary conditional operator where false_expr is the mangle prefix", - \\void foo() { - \\ int cond_temp = 1; - \\ int n, f = 1; - \\ if (n = (f)?:(cond_temp)) {} - \\} - , &[_][]const u8{ - \\pub export fn foo() void { - \\ var cond_temp: c_int = 1; - \\ _ = &cond_temp; - \\ var n: c_int = undefined; - \\ _ = &n; - \\ var f: c_int = 1; - \\ _ = &f; - \\ if ((blk: { - \\ const tmp = blk_1: { - \\ const cond_temp_2 = f; - \\ break :blk_1 if (cond_temp_2 != 0) cond_temp_2 else cond_temp; - \\ }; - \\ n = tmp; - \\ break :blk tmp; - \\ }) != 0) {} - \\} - }); - - cases.add("macro using argument as struct name is not translated", - \\#define FOO(x) struct x - , &[_][]const u8{ - \\pub const FOO = @compileError("unable to translate macro: untranslatable usage of arg `x`"); - }); - - cases.add("unsupport declare statement at the last of a compound statement which belongs to a statement expr", - \\void somefunc(void) { - \\ int y; - \\ (void)({y=1; _Static_assert(1);}); - \\} - , &[_][]const u8{ - \\pub export fn somefunc() void { - \\ var y: c_int = undefined; - \\ _ = &y; - \\ _ = blk: { - \\ y = 1; - \\ }; - \\} - }); -}